From b35a956b927f4e2fe6748258fd632b038a809b92 Mon Sep 17 00:00:00 2001 From: Mohammad Abu-Shelbaia Date: Sun, 15 Oct 2023 17:14:55 +0300 Subject: [PATCH] Initial Version --- README.md | 3 + app.py | 18 + node_modules/.bin/cssesc | 12 + node_modules/.bin/cssesc.cmd | 17 + node_modules/.bin/cssesc.ps1 | 28 + node_modules/.bin/jiti | 12 + node_modules/.bin/jiti.cmd | 17 + node_modules/.bin/jiti.ps1 | 28 + node_modules/.bin/mini-svg-data-uri | 12 + node_modules/.bin/mini-svg-data-uri.cmd | 17 + node_modules/.bin/mini-svg-data-uri.ps1 | 28 + node_modules/.bin/nanoid | 12 + node_modules/.bin/nanoid.cmd | 17 + node_modules/.bin/nanoid.ps1 | 28 + node_modules/.bin/resolve | 12 + node_modules/.bin/resolve.cmd | 17 + node_modules/.bin/resolve.ps1 | 28 + node_modules/.bin/sucrase | 12 + node_modules/.bin/sucrase-node | 12 + node_modules/.bin/sucrase-node.cmd | 17 + node_modules/.bin/sucrase-node.ps1 | 28 + node_modules/.bin/sucrase.cmd | 17 + node_modules/.bin/sucrase.ps1 | 28 + node_modules/.bin/tailwind | 12 + node_modules/.bin/tailwind.cmd | 17 + node_modules/.bin/tailwind.ps1 | 28 + node_modules/.bin/tailwindcss | 12 + node_modules/.bin/tailwindcss.cmd | 17 + node_modules/.bin/tailwindcss.ps1 | 28 + node_modules/.package-lock.json | 979 + node_modules/@alloc/quick-lru/index.d.ts | 128 + node_modules/@alloc/quick-lru/index.js | 263 + node_modules/@alloc/quick-lru/license | 9 + node_modules/@alloc/quick-lru/package.json | 43 + node_modules/@alloc/quick-lru/readme.md | 139 + node_modules/@jridgewell/gen-mapping/LICENSE | 19 + .../@jridgewell/gen-mapping/README.md | 227 + .../gen-mapping/dist/gen-mapping.mjs | 230 + .../gen-mapping/dist/gen-mapping.mjs.map | 1 + .../gen-mapping/dist/gen-mapping.umd.js | 236 + .../gen-mapping/dist/gen-mapping.umd.js.map | 1 + .../gen-mapping/dist/types/gen-mapping.d.ts | 90 + .../dist/types/sourcemap-segment.d.ts | 12 + .../gen-mapping/dist/types/types.d.ts | 35 + .../@jridgewell/gen-mapping/package.json | 77 + node_modules/@jridgewell/resolve-uri/LICENSE | 19 + .../@jridgewell/resolve-uri/README.md | 40 + .../resolve-uri/dist/resolve-uri.mjs | 242 + .../resolve-uri/dist/resolve-uri.mjs.map | 1 + .../resolve-uri/dist/resolve-uri.umd.js | 250 + .../resolve-uri/dist/resolve-uri.umd.js.map | 1 + .../resolve-uri/dist/types/resolve-uri.d.ts | 4 + .../@jridgewell/resolve-uri/package.json | 69 + node_modules/@jridgewell/set-array/LICENSE | 19 + node_modules/@jridgewell/set-array/README.md | 37 + .../@jridgewell/set-array/dist/set-array.mjs | 48 + .../set-array/dist/set-array.mjs.map | 1 + .../set-array/dist/set-array.umd.js | 58 + .../set-array/dist/set-array.umd.js.map | 1 + .../set-array/dist/types/set-array.d.ts | 26 + .../@jridgewell/set-array/package.json | 66 + .../@jridgewell/set-array/src/set-array.ts | 55 + .../@jridgewell/sourcemap-codec/LICENSE | 21 + .../@jridgewell/sourcemap-codec/README.md | 200 + .../sourcemap-codec/dist/sourcemap-codec.mjs | 164 + .../dist/sourcemap-codec.mjs.map | 1 + .../dist/sourcemap-codec.umd.js | 175 + .../dist/sourcemap-codec.umd.js.map | 1 + .../dist/types/sourcemap-codec.d.ts | 6 + .../@jridgewell/sourcemap-codec/package.json | 74 + .../@jridgewell/trace-mapping/LICENSE | 19 + .../@jridgewell/trace-mapping/README.md | 252 + .../trace-mapping/dist/trace-mapping.mjs | 552 + .../trace-mapping/dist/trace-mapping.mjs.map | 1 + .../trace-mapping/dist/trace-mapping.umd.js | 566 + .../dist/trace-mapping.umd.js.map | 1 + .../trace-mapping/dist/types/any-map.d.ts | 8 + .../dist/types/binary-search.d.ts | 32 + .../trace-mapping/dist/types/by-source.d.ts | 7 + .../trace-mapping/dist/types/resolve.d.ts | 1 + .../trace-mapping/dist/types/sort.d.ts | 2 + .../dist/types/sourcemap-segment.d.ts | 16 + .../dist/types/strip-filename.d.ts | 4 + .../dist/types/trace-mapping.d.ts | 74 + .../trace-mapping/dist/types/types.d.ts | 92 + .../@jridgewell/trace-mapping/package.json | 75 + node_modules/@nodelib/fs.scandir/LICENSE | 21 + node_modules/@nodelib/fs.scandir/README.md | 171 + .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 + .../@nodelib/fs.scandir/out/adapters/fs.js | 19 + .../@nodelib/fs.scandir/out/constants.d.ts | 4 + .../@nodelib/fs.scandir/out/constants.js | 17 + .../@nodelib/fs.scandir/out/index.d.ts | 12 + node_modules/@nodelib/fs.scandir/out/index.js | 26 + .../fs.scandir/out/providers/async.d.ts | 7 + .../fs.scandir/out/providers/async.js | 104 + .../fs.scandir/out/providers/common.d.ts | 1 + .../fs.scandir/out/providers/common.js | 13 + .../fs.scandir/out/providers/sync.d.ts | 5 + .../@nodelib/fs.scandir/out/providers/sync.js | 54 + .../@nodelib/fs.scandir/out/settings.d.ts | 20 + .../@nodelib/fs.scandir/out/settings.js | 24 + .../@nodelib/fs.scandir/out/types/index.d.ts | 20 + .../@nodelib/fs.scandir/out/types/index.js | 2 + .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/fs.js | 19 + .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/index.js | 5 + node_modules/@nodelib/fs.scandir/package.json | 44 + node_modules/@nodelib/fs.stat/LICENSE | 21 + node_modules/@nodelib/fs.stat/README.md | 126 + .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 + .../@nodelib/fs.stat/out/adapters/fs.js | 17 + node_modules/@nodelib/fs.stat/out/index.d.ts | 12 + node_modules/@nodelib/fs.stat/out/index.js | 26 + .../@nodelib/fs.stat/out/providers/async.d.ts | 4 + .../@nodelib/fs.stat/out/providers/async.js | 36 + .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 + .../@nodelib/fs.stat/out/providers/sync.js | 23 + .../@nodelib/fs.stat/out/settings.d.ts | 16 + node_modules/@nodelib/fs.stat/out/settings.js | 16 + .../@nodelib/fs.stat/out/types/index.d.ts | 4 + .../@nodelib/fs.stat/out/types/index.js | 2 + node_modules/@nodelib/fs.stat/package.json | 37 + node_modules/@nodelib/fs.walk/LICENSE | 21 + node_modules/@nodelib/fs.walk/README.md | 215 + node_modules/@nodelib/fs.walk/out/index.d.ts | 14 + node_modules/@nodelib/fs.walk/out/index.js | 34 + .../@nodelib/fs.walk/out/providers/async.d.ts | 12 + .../@nodelib/fs.walk/out/providers/async.js | 30 + .../@nodelib/fs.walk/out/providers/index.d.ts | 4 + .../@nodelib/fs.walk/out/providers/index.js | 9 + .../fs.walk/out/providers/stream.d.ts | 12 + .../@nodelib/fs.walk/out/providers/stream.js | 34 + .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 + .../@nodelib/fs.walk/out/providers/sync.js | 14 + .../@nodelib/fs.walk/out/readers/async.d.ts | 30 + .../@nodelib/fs.walk/out/readers/async.js | 97 + .../@nodelib/fs.walk/out/readers/common.d.ts | 7 + .../@nodelib/fs.walk/out/readers/common.js | 31 + .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 + .../@nodelib/fs.walk/out/readers/reader.js | 11 + .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 + .../@nodelib/fs.walk/out/readers/sync.js | 59 + .../@nodelib/fs.walk/out/settings.d.ts | 30 + node_modules/@nodelib/fs.walk/out/settings.js | 26 + .../@nodelib/fs.walk/out/types/index.d.ts | 8 + .../@nodelib/fs.walk/out/types/index.js | 2 + node_modules/@nodelib/fs.walk/package.json | 44 + node_modules/@popperjs/core/LICENSE.md | 20 + node_modules/@popperjs/core/README.md | 376 + node_modules/@popperjs/core/dist/cjs/enums.js | 65 + .../@popperjs/core/dist/cjs/enums.js.flow | 3 + .../@popperjs/core/dist/cjs/enums.js.map | 1 + .../@popperjs/core/dist/cjs/popper-base.js | 939 + .../core/dist/cjs/popper-base.js.flow | 3 + .../core/dist/cjs/popper-base.js.map | 1 + .../@popperjs/core/dist/cjs/popper-lite.js | 1260 + .../core/dist/cjs/popper-lite.js.flow | 3 + .../core/dist/cjs/popper-lite.js.map | 1 + .../@popperjs/core/dist/cjs/popper.js | 1819 + .../@popperjs/core/dist/cjs/popper.js.flow | 3 + .../@popperjs/core/dist/cjs/popper.js.map | 1 + .../@popperjs/core/dist/esm/createPopper.js | 199 + .../core/dist/esm/dom-utils/contains.js | 23 + .../esm/dom-utils/getBoundingClientRect.js | 41 + .../dist/esm/dom-utils/getClippingRect.js | 70 + .../dist/esm/dom-utils/getCompositeRect.js | 58 + .../dist/esm/dom-utils/getComputedStyle.js | 4 + .../dist/esm/dom-utils/getDocumentElement.js | 6 + .../dist/esm/dom-utils/getDocumentRect.js | 29 + .../esm/dom-utils/getHTMLElementScroll.js | 6 + .../core/dist/esm/dom-utils/getLayoutRect.js | 25 + .../core/dist/esm/dom-utils/getNodeName.js | 3 + .../core/dist/esm/dom-utils/getNodeScroll.js | 11 + .../dist/esm/dom-utils/getOffsetParent.js | 69 + .../core/dist/esm/dom-utils/getParentNode.js | 19 + .../dist/esm/dom-utils/getScrollParent.js | 16 + .../dist/esm/dom-utils/getViewportRect.js | 31 + .../core/dist/esm/dom-utils/getWindow.js | 12 + .../dist/esm/dom-utils/getWindowScroll.js | 10 + .../dist/esm/dom-utils/getWindowScrollBarX.js | 13 + .../core/dist/esm/dom-utils/instanceOf.js | 23 + .../dist/esm/dom-utils/isLayoutViewport.js | 4 + .../core/dist/esm/dom-utils/isScrollParent.js | 10 + .../core/dist/esm/dom-utils/isTableElement.js | 4 + .../dist/esm/dom-utils/listScrollParents.js | 26 + node_modules/@popperjs/core/dist/esm/enums.js | 31 + node_modules/@popperjs/core/dist/esm/index.js | 8 + .../core/dist/esm/modifiers/applyStyles.js | 84 + .../core/dist/esm/modifiers/arrow.js | 90 + .../core/dist/esm/modifiers/computeStyles.js | 169 + .../core/dist/esm/modifiers/eventListeners.js | 49 + .../@popperjs/core/dist/esm/modifiers/flip.js | 147 + .../@popperjs/core/dist/esm/modifiers/hide.js | 61 + .../core/dist/esm/modifiers/index.js | 9 + .../core/dist/esm/modifiers/offset.js | 54 + .../core/dist/esm/modifiers/popperOffsets.js | 25 + .../dist/esm/modifiers/preventOverflow.js | 142 + .../@popperjs/core/dist/esm/popper-base.js | 3 + .../@popperjs/core/dist/esm/popper-lite.js | 11 + .../@popperjs/core/dist/esm/popper.js | 20 + node_modules/@popperjs/core/dist/esm/types.js | 0 .../dist/esm/utils/computeAutoPlacement.js | 43 + .../core/dist/esm/utils/computeOffsets.js | 70 + .../@popperjs/core/dist/esm/utils/debounce.js | 15 + .../core/dist/esm/utils/detectOverflow.js | 65 + .../core/dist/esm/utils/expandToHashMap.js | 6 + .../core/dist/esm/utils/getAltAxis.js | 3 + .../core/dist/esm/utils/getAltLen.js | 3 + .../core/dist/esm/utils/getBasePlacement.js | 4 + .../core/dist/esm/utils/getFreshSideObject.js | 8 + .../esm/utils/getMainAxisFromPlacement.js | 3 + .../dist/esm/utils/getOppositePlacement.js | 11 + .../utils/getOppositeVariationPlacement.js | 9 + .../core/dist/esm/utils/getVariation.js | 3 + .../@popperjs/core/dist/esm/utils/math.js | 3 + .../core/dist/esm/utils/mergeByName.js | 14 + .../core/dist/esm/utils/mergePaddingObject.js | 4 + .../core/dist/esm/utils/orderModifiers.js | 44 + .../core/dist/esm/utils/rectToClientRect.js | 8 + .../@popperjs/core/dist/esm/utils/uniqueBy.js | 11 + .../core/dist/esm/utils/userAgent.js | 11 + .../@popperjs/core/dist/esm/utils/within.js | 8 + node_modules/@popperjs/core/dist/umd/enums.js | 71 + .../@popperjs/core/dist/umd/enums.js.map | 1 + .../@popperjs/core/dist/umd/enums.min.js | 6 + .../@popperjs/core/dist/umd/enums.min.js.flow | 3 + .../@popperjs/core/dist/umd/enums.min.js.map | 1 + .../@popperjs/core/dist/umd/popper-base.js | 945 + .../core/dist/umd/popper-base.js.map | 1 + .../core/dist/umd/popper-base.min.js | 6 + .../core/dist/umd/popper-base.min.js.flow | 3 + .../core/dist/umd/popper-base.min.js.map | 1 + .../@popperjs/core/dist/umd/popper-lite.js | 1266 + .../core/dist/umd/popper-lite.js.map | 1 + .../core/dist/umd/popper-lite.min.js | 6 + .../core/dist/umd/popper-lite.min.js.flow | 3 + .../core/dist/umd/popper-lite.min.js.map | 1 + .../@popperjs/core/dist/umd/popper.js | 1825 + .../@popperjs/core/dist/umd/popper.js.map | 1 + .../@popperjs/core/dist/umd/popper.min.js | 6 + .../core/dist/umd/popper.min.js.flow | 3 + .../@popperjs/core/dist/umd/popper.min.js.map | 1 + node_modules/@popperjs/core/index.d.ts | 1 + .../@popperjs/core/lib/createPopper.d.ts | 9 + .../@popperjs/core/lib/createPopper.js | 199 + .../@popperjs/core/lib/createPopper.js.flow | 218 + .../core/lib/dom-utils/contains.d.ts | 1 + .../@popperjs/core/lib/dom-utils/contains.js | 23 + .../core/lib/dom-utils/contains.js.flow | 25 + .../lib/dom-utils/getBoundingClientRect.d.ts | 2 + .../lib/dom-utils/getBoundingClientRect.js | 41 + .../dom-utils/getBoundingClientRect.js.flow | 52 + .../core/lib/dom-utils/getClippingRect.d.ts | 3 + .../core/lib/dom-utils/getClippingRect.js | 70 + .../lib/dom-utils/getClippingRect.js.flow | 106 + .../core/lib/dom-utils/getCompositeRect.d.ts | 2 + .../core/lib/dom-utils/getCompositeRect.js | 58 + .../lib/dom-utils/getCompositeRect.js.flow | 64 + .../core/lib/dom-utils/getComputedStyle.d.ts | 1 + .../core/lib/dom-utils/getComputedStyle.js | 4 + .../lib/dom-utils/getComputedStyle.js.flow | 8 + .../lib/dom-utils/getDocumentElement.d.ts | 2 + .../core/lib/dom-utils/getDocumentElement.js | 6 + .../lib/dom-utils/getDocumentElement.js.flow | 15 + .../core/lib/dom-utils/getDocumentRect.d.ts | 2 + .../core/lib/dom-utils/getDocumentRect.js | 29 + .../lib/dom-utils/getDocumentRect.js.flow | 37 + .../lib/dom-utils/getHTMLElementScroll.d.ts | 4 + .../lib/dom-utils/getHTMLElementScroll.js | 6 + .../dom-utils/getHTMLElementScroll.js.flow | 8 + .../core/lib/dom-utils/getLayoutRect.d.ts | 2 + .../core/lib/dom-utils/getLayoutRect.js | 25 + .../core/lib/dom-utils/getLayoutRect.js.flow | 29 + .../core/lib/dom-utils/getNodeName.d.ts | 2 + .../core/lib/dom-utils/getNodeName.js | 3 + .../core/lib/dom-utils/getNodeName.js.flow | 6 + .../core/lib/dom-utils/getNodeScroll.d.ts | 5 + .../core/lib/dom-utils/getNodeScroll.js | 11 + .../core/lib/dom-utils/getNodeScroll.js.flow | 14 + .../core/lib/dom-utils/getOffsetParent.d.ts | 1 + .../core/lib/dom-utils/getOffsetParent.js | 69 + .../lib/dom-utils/getOffsetParent.js.flow | 93 + .../core/lib/dom-utils/getParentNode.d.ts | 1 + .../core/lib/dom-utils/getParentNode.js | 19 + .../core/lib/dom-utils/getParentNode.js.flow | 21 + .../core/lib/dom-utils/getScrollParent.d.ts | 1 + .../core/lib/dom-utils/getScrollParent.js | 16 + .../lib/dom-utils/getScrollParent.js.flow | 18 + .../core/lib/dom-utils/getViewportRect.d.ts | 7 + .../core/lib/dom-utils/getViewportRect.js | 31 + .../lib/dom-utils/getViewportRect.js.flow | 39 + .../core/lib/dom-utils/getWindow.d.ts | 1 + .../@popperjs/core/lib/dom-utils/getWindow.js | 12 + .../core/lib/dom-utils/getWindow.js.flow | 16 + .../core/lib/dom-utils/getWindowScroll.d.ts | 5 + .../core/lib/dom-utils/getWindowScroll.js | 10 + .../lib/dom-utils/getWindowScroll.js.flow | 14 + .../lib/dom-utils/getWindowScrollBarX.d.ts | 1 + .../core/lib/dom-utils/getWindowScrollBarX.js | 13 + .../lib/dom-utils/getWindowScrollBarX.js.flow | 18 + .../core/lib/dom-utils/instanceOf.d.ts | 4 + .../core/lib/dom-utils/instanceOf.js | 23 + .../core/lib/dom-utils/instanceOf.js.flow | 29 + .../core/lib/dom-utils/isLayoutViewport.d.ts | 1 + .../core/lib/dom-utils/isLayoutViewport.js | 4 + .../lib/dom-utils/isLayoutViewport.js.flow | 6 + .../core/lib/dom-utils/isScrollParent.d.ts | 1 + .../core/lib/dom-utils/isScrollParent.js | 10 + .../core/lib/dom-utils/isScrollParent.js.flow | 8 + .../core/lib/dom-utils/isTableElement.d.ts | 1 + .../core/lib/dom-utils/isTableElement.js | 4 + .../core/lib/dom-utils/isTableElement.js.flow | 6 + .../core/lib/dom-utils/listScrollParents.d.ts | 2 + .../core/lib/dom-utils/listScrollParents.js | 26 + .../lib/dom-utils/listScrollParents.js.flow | 33 + node_modules/@popperjs/core/lib/enums.d.ts | 34 + node_modules/@popperjs/core/lib/enums.js | 31 + node_modules/@popperjs/core/lib/enums.js.flow | 91 + node_modules/@popperjs/core/lib/index.d.ts | 6 + node_modules/@popperjs/core/lib/index.js | 8 + node_modules/@popperjs/core/lib/index.js.flow | 13 + .../core/lib/modifiers/applyStyles.d.ts | 4 + .../core/lib/modifiers/applyStyles.js | 84 + .../core/lib/modifiers/applyStyles.js.flow | 98 + .../@popperjs/core/lib/modifiers/arrow.d.ts | 13 + .../@popperjs/core/lib/modifiers/arrow.js | 90 + .../core/lib/modifiers/arrow.js.flow | 120 + .../core/lib/modifiers/computeStyles.d.ts | 38 + .../core/lib/modifiers/computeStyles.js | 169 + .../core/lib/modifiers/computeStyles.js.flow | 233 + .../core/lib/modifiers/eventListeners.d.ts | 8 + .../core/lib/modifiers/eventListeners.js | 49 + .../core/lib/modifiers/eventListeners.js.flow | 54 + .../@popperjs/core/lib/modifiers/flip.d.ts | 16 + .../@popperjs/core/lib/modifiers/flip.js | 147 + .../@popperjs/core/lib/modifiers/flip.js.flow | 177 + .../@popperjs/core/lib/modifiers/hide.d.ts | 4 + .../@popperjs/core/lib/modifiers/hide.js | 61 + .../@popperjs/core/lib/modifiers/hide.js.flow | 76 + .../@popperjs/core/lib/modifiers/index.d.ts | 9 + .../@popperjs/core/lib/modifiers/index.js | 9 + .../core/lib/modifiers/index.js.flow | 10 + .../@popperjs/core/lib/modifiers/offset.d.ts | 18 + .../@popperjs/core/lib/modifiers/offset.js | 54 + .../core/lib/modifiers/offset.js.flow | 71 + .../core/lib/modifiers/popperOffsets.d.ts | 4 + .../core/lib/modifiers/popperOffsets.js | 25 + .../core/lib/modifiers/popperOffsets.js.flow | 26 + .../core/lib/modifiers/preventOverflow.d.ts | 30 + .../core/lib/modifiers/preventOverflow.js | 142 + .../lib/modifiers/preventOverflow.js.flow | 220 + .../@popperjs/core/lib/popper-base.d.ts | 3 + .../@popperjs/core/lib/popper-base.js | 3 + .../@popperjs/core/lib/popper-base.js.flow | 7 + .../@popperjs/core/lib/popper-lite.d.ts | 5 + .../@popperjs/core/lib/popper-lite.js | 11 + .../@popperjs/core/lib/popper-lite.js.flow | 21 + node_modules/@popperjs/core/lib/popper.d.ts | 7 + node_modules/@popperjs/core/lib/popper.js | 20 + .../@popperjs/core/lib/popper.js.flow | 35 + node_modules/@popperjs/core/lib/types.d.ts | 167 + node_modules/@popperjs/core/lib/types.js | 0 node_modules/@popperjs/core/lib/types.js.flow | 199 + .../core/lib/utils/computeAutoPlacement.d.ts | 12 + .../core/lib/utils/computeAutoPlacement.js | 43 + .../lib/utils/computeAutoPlacement.js.flow | 73 + .../core/lib/utils/computeOffsets.d.ts | 8 + .../core/lib/utils/computeOffsets.js | 70 + .../core/lib/utils/computeOffsets.js.flow | 82 + .../@popperjs/core/lib/utils/debounce.d.ts | 1 + .../@popperjs/core/lib/utils/debounce.js | 15 + .../@popperjs/core/lib/utils/debounce.js.flow | 17 + .../core/lib/utils/detectOverflow.d.ts | 12 + .../core/lib/utils/detectOverflow.js | 65 + .../core/lib/utils/detectOverflow.js.flow | 112 + .../core/lib/utils/expandToHashMap.d.ts | 3 + .../core/lib/utils/expandToHashMap.js | 6 + .../core/lib/utils/expandToHashMap.js.flow | 11 + .../@popperjs/core/lib/utils/getAltAxis.d.ts | 1 + .../@popperjs/core/lib/utils/getAltAxis.js | 3 + .../core/lib/utils/getAltAxis.js.flow | 5 + .../@popperjs/core/lib/utils/getAltLen.d.ts | 1 + .../@popperjs/core/lib/utils/getAltLen.js | 3 + .../core/lib/utils/getAltLen.js.flow | 5 + .../core/lib/utils/getBasePlacement.d.ts | 2 + .../core/lib/utils/getBasePlacement.js | 4 + .../core/lib/utils/getBasePlacement.js.flow | 8 + .../core/lib/utils/getFreshSideObject.d.ts | 2 + .../core/lib/utils/getFreshSideObject.js | 8 + .../core/lib/utils/getFreshSideObject.js.flow | 11 + .../lib/utils/getMainAxisFromPlacement.d.ts | 2 + .../lib/utils/getMainAxisFromPlacement.js | 3 + .../utils/getMainAxisFromPlacement.js.flow | 8 + .../core/lib/utils/getOppositePlacement.d.ts | 2 + .../core/lib/utils/getOppositePlacement.js | 11 + .../lib/utils/getOppositePlacement.js.flow | 11 + .../utils/getOppositeVariationPlacement.d.ts | 2 + .../utils/getOppositeVariationPlacement.js | 9 + .../getOppositeVariationPlacement.js.flow | 10 + .../core/lib/utils/getVariation.d.ts | 2 + .../@popperjs/core/lib/utils/getVariation.js | 3 + .../core/lib/utils/getVariation.js.flow | 6 + .../@popperjs/core/lib/utils/math.d.ts | 3 + node_modules/@popperjs/core/lib/utils/math.js | 3 + .../@popperjs/core/lib/utils/math.js.flow | 4 + .../@popperjs/core/lib/utils/mergeByName.d.ts | 2 + .../@popperjs/core/lib/utils/mergeByName.js | 14 + .../core/lib/utils/mergeByName.js.flow | 22 + .../core/lib/utils/mergePaddingObject.d.ts | 2 + .../core/lib/utils/mergePaddingObject.js | 4 + .../core/lib/utils/mergePaddingObject.js.flow | 12 + .../core/lib/utils/orderModifiers.d.ts | 2 + .../core/lib/utils/orderModifiers.js | 44 + .../core/lib/utils/orderModifiers.js.flow | 59 + .../core/lib/utils/rectToClientRect.d.ts | 2 + .../core/lib/utils/rectToClientRect.js | 8 + .../core/lib/utils/rectToClientRect.js.flow | 12 + .../@popperjs/core/lib/utils/uniqueBy.d.ts | 1 + .../@popperjs/core/lib/utils/uniqueBy.js | 11 + .../@popperjs/core/lib/utils/uniqueBy.js.flow | 14 + .../@popperjs/core/lib/utils/userAgent.d.ts | 1 + .../@popperjs/core/lib/utils/userAgent.js | 11 + .../core/lib/utils/userAgent.js.flow | 20 + .../@popperjs/core/lib/utils/within.d.ts | 2 + .../@popperjs/core/lib/utils/within.js | 8 + .../@popperjs/core/lib/utils/within.js.flow | 11 + node_modules/@popperjs/core/package.json | 119 + node_modules/any-promise/.jshintrc | 4 + node_modules/any-promise/.npmignore | 7 + node_modules/any-promise/LICENSE | 19 + node_modules/any-promise/README.md | 161 + node_modules/any-promise/implementation.d.ts | 3 + node_modules/any-promise/implementation.js | 1 + node_modules/any-promise/index.d.ts | 73 + node_modules/any-promise/index.js | 1 + node_modules/any-promise/loader.js | 78 + node_modules/any-promise/optional.js | 6 + node_modules/any-promise/package.json | 45 + node_modules/any-promise/register-shim.js | 18 + node_modules/any-promise/register.d.ts | 17 + node_modules/any-promise/register.js | 94 + .../any-promise/register/bluebird.d.ts | 1 + node_modules/any-promise/register/bluebird.js | 2 + .../any-promise/register/es6-promise.d.ts | 1 + .../any-promise/register/es6-promise.js | 2 + node_modules/any-promise/register/lie.d.ts | 1 + node_modules/any-promise/register/lie.js | 2 + .../register/native-promise-only.d.ts | 1 + .../register/native-promise-only.js | 2 + node_modules/any-promise/register/pinkie.d.ts | 1 + node_modules/any-promise/register/pinkie.js | 2 + .../any-promise/register/promise.d.ts | 1 + node_modules/any-promise/register/promise.js | 2 + node_modules/any-promise/register/q.d.ts | 1 + node_modules/any-promise/register/q.js | 2 + node_modules/any-promise/register/rsvp.d.ts | 1 + node_modules/any-promise/register/rsvp.js | 2 + node_modules/any-promise/register/vow.d.ts | 1 + node_modules/any-promise/register/vow.js | 2 + node_modules/any-promise/register/when.d.ts | 1 + node_modules/any-promise/register/when.js | 2 + node_modules/anymatch/LICENSE | 15 + node_modules/anymatch/README.md | 87 + node_modules/anymatch/index.d.ts | 20 + node_modules/anymatch/index.js | 104 + node_modules/anymatch/package.json | 48 + node_modules/arg/LICENSE.md | 21 + node_modules/arg/README.md | 317 + node_modules/arg/index.d.ts | 44 + node_modules/arg/index.js | 195 + node_modules/arg/package.json | 28 + .../balanced-match/.github/FUNDING.yml | 2 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 97 + node_modules/balanced-match/index.js | 62 + node_modules/balanced-match/package.json | 48 + .../binary-extensions/binary-extensions.json | 260 + .../binary-extensions.json.d.ts | 3 + node_modules/binary-extensions/index.d.ts | 14 + node_modules/binary-extensions/index.js | 1 + node_modules/binary-extensions/license | 9 + node_modules/binary-extensions/package.json | 38 + node_modules/binary-extensions/readme.md | 41 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + node_modules/brace-expansion/package.json | 47 + node_modules/braces/CHANGELOG.md | 184 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 593 + node_modules/braces/index.js | 170 + node_modules/braces/lib/compile.js | 57 + node_modules/braces/lib/constants.js | 57 + node_modules/braces/lib/expand.js | 113 + node_modules/braces/lib/parse.js | 333 + node_modules/braces/lib/stringify.js | 32 + node_modules/braces/lib/utils.js | 112 + node_modules/braces/package.json | 77 + node_modules/camelcase-css/README.md | 27 + node_modules/camelcase-css/index-es5.js | 24 + node_modules/camelcase-css/index.js | 30 + node_modules/camelcase-css/license | 21 + node_modules/camelcase-css/package.json | 34 + node_modules/chokidar/LICENSE | 21 + node_modules/chokidar/README.md | 308 + node_modules/chokidar/index.js | 973 + node_modules/chokidar/lib/constants.js | 65 + node_modules/chokidar/lib/fsevents-handler.js | 524 + node_modules/chokidar/lib/nodefs-handler.js | 654 + .../node_modules/glob-parent/CHANGELOG.md | 110 + .../chokidar/node_modules/glob-parent/LICENSE | 15 + .../node_modules/glob-parent/README.md | 137 + .../node_modules/glob-parent/index.js | 42 + .../node_modules/glob-parent/package.json | 48 + node_modules/chokidar/package.json | 85 + node_modules/chokidar/types/index.d.ts | 188 + node_modules/commander/CHANGELOG.md | 436 + node_modules/commander/LICENSE | 22 + node_modules/commander/Readme.md | 713 + node_modules/commander/index.js | 1649 + node_modules/commander/package.json | 41 + node_modules/commander/typings/index.d.ts | 311 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 43 + node_modules/concat-map/test/map.js | 39 + node_modules/cssesc/LICENSE-MIT.txt | 20 + node_modules/cssesc/README.md | 201 + node_modules/cssesc/bin/cssesc | 116 + node_modules/cssesc/cssesc.js | 110 + node_modules/cssesc/man/cssesc.1 | 70 + node_modules/cssesc/package.json | 51 + node_modules/didyoumean/LICENSE | 14 + node_modules/didyoumean/README.md | 134 + node_modules/didyoumean/didYouMean-1.2.1.js | 274 + .../didyoumean/didYouMean-1.2.1.min.js | 17 + node_modules/didyoumean/package.json | 27 + node_modules/dlv/README.md | 76 + node_modules/dlv/dist/dlv.es.js | 2 + node_modules/dlv/dist/dlv.es.js.map | 1 + node_modules/dlv/dist/dlv.js | 2 + node_modules/dlv/dist/dlv.js.map | 1 + node_modules/dlv/dist/dlv.umd.js | 2 + node_modules/dlv/dist/dlv.umd.js.map | 1 + node_modules/dlv/index.js | 7 + node_modules/dlv/package.json | 30 + node_modules/fast-glob/LICENSE | 21 + node_modules/fast-glob/README.md | 830 + .../node_modules/glob-parent/CHANGELOG.md | 110 + .../node_modules/glob-parent/LICENSE | 15 + .../node_modules/glob-parent/README.md | 137 + .../node_modules/glob-parent/index.js | 42 + .../node_modules/glob-parent/package.json | 48 + node_modules/fast-glob/out/index.d.ts | 40 + node_modules/fast-glob/out/index.js | 102 + .../fast-glob/out/managers/tasks.d.ts | 22 + node_modules/fast-glob/out/managers/tasks.js | 110 + .../fast-glob/out/providers/async.d.ts | 9 + node_modules/fast-glob/out/providers/async.js | 23 + .../fast-glob/out/providers/filters/deep.d.ts | 16 + .../fast-glob/out/providers/filters/deep.js | 62 + .../out/providers/filters/entry.d.ts | 16 + .../fast-glob/out/providers/filters/entry.js | 63 + .../out/providers/filters/error.d.ts | 8 + .../fast-glob/out/providers/filters/error.js | 15 + .../out/providers/matchers/matcher.d.ts | 33 + .../out/providers/matchers/matcher.js | 45 + .../out/providers/matchers/partial.d.ts | 4 + .../out/providers/matchers/partial.js | 38 + .../fast-glob/out/providers/provider.d.ts | 19 + .../fast-glob/out/providers/provider.js | 48 + .../fast-glob/out/providers/stream.d.ts | 11 + .../fast-glob/out/providers/stream.js | 31 + .../fast-glob/out/providers/sync.d.ts | 9 + node_modules/fast-glob/out/providers/sync.js | 23 + .../out/providers/transformers/entry.d.ts | 8 + .../out/providers/transformers/entry.js | 26 + node_modules/fast-glob/out/readers/async.d.ts | 10 + node_modules/fast-glob/out/readers/async.js | 35 + .../fast-glob/out/readers/reader.d.ts | 15 + node_modules/fast-glob/out/readers/reader.js | 33 + .../fast-glob/out/readers/stream.d.ts | 14 + node_modules/fast-glob/out/readers/stream.js | 55 + node_modules/fast-glob/out/readers/sync.d.ts | 12 + node_modules/fast-glob/out/readers/sync.js | 43 + node_modules/fast-glob/out/settings.d.ts | 164 + node_modules/fast-glob/out/settings.js | 59 + node_modules/fast-glob/out/types/index.d.ts | 31 + node_modules/fast-glob/out/types/index.js | 2 + node_modules/fast-glob/out/utils/array.d.ts | 2 + node_modules/fast-glob/out/utils/array.js | 22 + node_modules/fast-glob/out/utils/errno.d.ts | 2 + node_modules/fast-glob/out/utils/errno.js | 7 + node_modules/fast-glob/out/utils/fs.d.ts | 4 + node_modules/fast-glob/out/utils/fs.js | 19 + node_modules/fast-glob/out/utils/index.d.ts | 8 + node_modules/fast-glob/out/utils/index.js | 17 + node_modules/fast-glob/out/utils/path.d.ts | 13 + node_modules/fast-glob/out/utils/path.js | 68 + node_modules/fast-glob/out/utils/pattern.d.ts | 47 + node_modules/fast-glob/out/utils/pattern.js | 188 + node_modules/fast-glob/out/utils/stream.d.ts | 4 + node_modules/fast-glob/out/utils/stream.js | 17 + node_modules/fast-glob/out/utils/string.d.ts | 2 + node_modules/fast-glob/out/utils/string.js | 11 + node_modules/fast-glob/package.json | 81 + node_modules/fastq/.github/dependabot.yml | 11 + node_modules/fastq/.github/workflows/ci.yml | 50 + node_modules/fastq/LICENSE | 13 + node_modules/fastq/README.md | 309 + node_modules/fastq/bench.js | 66 + node_modules/fastq/example.js | 14 + node_modules/fastq/example.mjs | 11 + node_modules/fastq/index.d.ts | 37 + node_modules/fastq/package.json | 52 + node_modules/fastq/queue.js | 289 + node_modules/fastq/test/example.ts | 81 + node_modules/fastq/test/promise.js | 248 + node_modules/fastq/test/test.js | 566 + node_modules/fastq/test/tsconfig.json | 11 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 237 + node_modules/fill-range/index.js | 249 + node_modules/fill-range/package.json | 69 + node_modules/flowbite/LICENSE.md | 21 + node_modules/flowbite/README.md | 778 + node_modules/flowbite/dist/datepicker.js | 3119 + node_modules/flowbite/dist/datepicker.js.map | 1 + node_modules/flowbite/dist/datepicker.min.js | 2 + .../flowbite/dist/datepicker.turbo.js | 3141 + .../flowbite/dist/datepicker.turbo.js.map | 1 + .../flowbite/dist/datepicker.turbo.min.js | 2 + node_modules/flowbite/dist/flowbite.css | 7979 ++ node_modules/flowbite/dist/flowbite.js | 4434 + node_modules/flowbite/dist/flowbite.js.map | 1 + node_modules/flowbite/dist/flowbite.min.css | 1 + node_modules/flowbite/dist/flowbite.min.js | 2 + .../flowbite/dist/flowbite.min.js.map | 1 + .../flowbite/dist/flowbite.phoenix.js | 4438 + .../flowbite/dist/flowbite.phoenix.js.map | 1 + .../flowbite/dist/flowbite.phoenix.min.js | 2 + .../flowbite/dist/flowbite.phoenix.min.js.map | 1 + node_modules/flowbite/dist/flowbite.turbo.js | 4438 + .../flowbite/dist/flowbite.turbo.js.map | 1 + .../flowbite/dist/flowbite.turbo.min.js | 2 + .../flowbite/dist/flowbite.turbo.min.js.map | 1 + .../lib/cjs/components/accordion/index.d.ts | 15 + .../cjs/components/accordion/index.d.ts.map | 1 + .../lib/cjs/components/accordion/index.js | 151 + .../lib/cjs/components/accordion/index.js.map | 1 + .../cjs/components/accordion/interface.d.ts | 10 + .../components/accordion/interface.d.ts.map | 1 + .../lib/cjs/components/accordion/interface.js | 3 + .../cjs/components/accordion/interface.js.map | 1 + .../lib/cjs/components/accordion/types.d.ts | 17 + .../cjs/components/accordion/types.d.ts.map | 1 + .../lib/cjs/components/accordion/types.js | 3 + .../lib/cjs/components/accordion/types.js.map | 1 + .../lib/cjs/components/carousel/index.d.ts | 54 + .../cjs/components/carousel/index.d.ts.map | 1 + .../lib/cjs/components/carousel/index.js | 246 + .../lib/cjs/components/carousel/index.js.map | 1 + .../cjs/components/carousel/interface.d.ts | 20 + .../components/carousel/interface.d.ts.map | 1 + .../lib/cjs/components/carousel/interface.js | 3 + .../cjs/components/carousel/interface.js.map | 1 + .../lib/cjs/components/carousel/types.d.ts | 27 + .../cjs/components/carousel/types.d.ts.map | 1 + .../lib/cjs/components/carousel/types.js | 3 + .../lib/cjs/components/carousel/types.js.map | 1 + .../lib/cjs/components/collapse/index.d.ts | 16 + .../cjs/components/collapse/index.d.ts.map | 1 + .../lib/cjs/components/collapse/index.js | 98 + .../lib/cjs/components/collapse/index.js.map | 1 + .../cjs/components/collapse/interface.d.ts | 12 + .../components/collapse/interface.d.ts.map | 1 + .../lib/cjs/components/collapse/interface.js | 3 + .../cjs/components/collapse/interface.js.map | 1 + .../lib/cjs/components/collapse/types.d.ts | 7 + .../cjs/components/collapse/types.d.ts.map | 1 + .../lib/cjs/components/collapse/types.js | 3 + .../lib/cjs/components/collapse/types.js.map | 1 + .../lib/cjs/components/dial/index.d.ts | 23 + .../lib/cjs/components/dial/index.d.ts.map | 1 + .../flowbite/lib/cjs/components/dial/index.js | 142 + .../lib/cjs/components/dial/index.js.map | 1 + .../lib/cjs/components/dial/interface.d.ts | 16 + .../cjs/components/dial/interface.d.ts.map | 1 + .../lib/cjs/components/dial/interface.js | 3 + .../lib/cjs/components/dial/interface.js.map | 1 + .../lib/cjs/components/dial/types.d.ts | 13 + .../lib/cjs/components/dial/types.d.ts.map | 1 + .../flowbite/lib/cjs/components/dial/types.js | 3 + .../lib/cjs/components/dial/types.js.map | 1 + .../lib/cjs/components/dismiss/index.d.ts | 13 + .../lib/cjs/components/dismiss/index.d.ts.map | 1 + .../lib/cjs/components/dismiss/index.js | 68 + .../lib/cjs/components/dismiss/index.js.map | 1 + .../lib/cjs/components/dismiss/interface.d.ts | 9 + .../cjs/components/dismiss/interface.d.ts.map | 1 + .../lib/cjs/components/dismiss/interface.js | 3 + .../cjs/components/dismiss/interface.js.map | 1 + .../lib/cjs/components/dismiss/types.d.ts | 8 + .../lib/cjs/components/dismiss/types.d.ts.map | 1 + .../lib/cjs/components/dismiss/types.js | 3 + .../lib/cjs/components/dismiss/types.js.map | 1 + .../lib/cjs/components/drawer/index.d.ts | 21 + .../lib/cjs/components/drawer/index.d.ts.map | 1 + .../lib/cjs/components/drawer/index.js | 314 + .../lib/cjs/components/drawer/index.js.map | 1 + .../lib/cjs/components/drawer/interface.d.ts | 17 + .../cjs/components/drawer/interface.d.ts.map | 1 + .../lib/cjs/components/drawer/interface.js | 3 + .../cjs/components/drawer/interface.js.map | 1 + .../lib/cjs/components/drawer/types.d.ts | 22 + .../lib/cjs/components/drawer/types.d.ts.map | 1 + .../lib/cjs/components/drawer/types.js | 3 + .../lib/cjs/components/drawer/types.js.map | 1 + .../lib/cjs/components/dropdown/index.d.ts | 29 + .../cjs/components/dropdown/index.d.ts.map | 1 + .../lib/cjs/components/dropdown/index.js | 254 + .../lib/cjs/components/dropdown/index.js.map | 1 + .../cjs/components/dropdown/interface.d.ts | 22 + .../components/dropdown/interface.d.ts.map | 1 + .../lib/cjs/components/dropdown/interface.js | 3 + .../cjs/components/dropdown/interface.js.map | 1 + .../lib/cjs/components/dropdown/types.d.ts | 19 + .../cjs/components/dropdown/types.d.ts.map | 1 + .../lib/cjs/components/dropdown/types.js | 3 + .../lib/cjs/components/dropdown/types.js.map | 1 + .../flowbite/lib/cjs/components/index.d.ts | 2 + .../lib/cjs/components/index.d.ts.map | 1 + .../flowbite/lib/cjs/components/index.js | 32 + .../flowbite/lib/cjs/components/index.js.map | 1 + .../lib/cjs/components/modal/index.d.ts | 26 + .../lib/cjs/components/modal/index.d.ts.map | 1 + .../lib/cjs/components/modal/index.js | 274 + .../lib/cjs/components/modal/index.js.map | 1 + .../lib/cjs/components/modal/interface.d.ts | 21 + .../cjs/components/modal/interface.d.ts.map | 1 + .../lib/cjs/components/modal/interface.js | 3 + .../lib/cjs/components/modal/interface.js.map | 1 + .../lib/cjs/components/modal/types.d.ts | 17 + .../lib/cjs/components/modal/types.d.ts.map | 1 + .../lib/cjs/components/modal/types.js | 3 + .../lib/cjs/components/modal/types.js.map | 1 + .../lib/cjs/components/popover/index.d.ts | 32 + .../lib/cjs/components/popover/index.d.ts.map | 1 + .../lib/cjs/components/popover/index.js | 222 + .../lib/cjs/components/popover/index.js.map | 1 + .../lib/cjs/components/popover/interface.d.ts | 22 + .../cjs/components/popover/interface.d.ts.map | 1 + .../lib/cjs/components/popover/interface.js | 3 + .../cjs/components/popover/interface.js.map | 1 + .../lib/cjs/components/popover/types.d.ts | 16 + .../lib/cjs/components/popover/types.d.ts.map | 1 + .../lib/cjs/components/popover/types.js | 3 + .../lib/cjs/components/popover/types.js.map | 1 + .../lib/cjs/components/tabs/index.d.ts | 16 + .../lib/cjs/components/tabs/index.d.ts.map | 1 + .../flowbite/lib/cjs/components/tabs/index.js | 115 + .../lib/cjs/components/tabs/index.js.map | 1 + .../lib/cjs/components/tabs/interface.d.ts | 12 + .../cjs/components/tabs/interface.d.ts.map | 1 + .../lib/cjs/components/tabs/interface.js | 3 + .../lib/cjs/components/tabs/interface.js.map | 1 + .../lib/cjs/components/tabs/types.d.ts | 13 + .../lib/cjs/components/tabs/types.d.ts.map | 1 + .../flowbite/lib/cjs/components/tabs/types.js | 3 + .../lib/cjs/components/tabs/types.js.map | 1 + .../lib/cjs/components/tooltip/index.d.ts | 32 + .../lib/cjs/components/tooltip/index.d.ts.map | 1 + .../lib/cjs/components/tooltip/index.js | 204 + .../lib/cjs/components/tooltip/index.js.map | 1 + .../lib/cjs/components/tooltip/interface.d.ts | 23 + .../cjs/components/tooltip/interface.d.ts.map | 1 + .../lib/cjs/components/tooltip/interface.js | 3 + .../cjs/components/tooltip/interface.js.map | 1 + .../lib/cjs/components/tooltip/types.d.ts | 15 + .../lib/cjs/components/tooltip/types.d.ts.map | 1 + .../lib/cjs/components/tooltip/types.js | 3 + .../lib/cjs/components/tooltip/types.js.map | 1 + .../flowbite/lib/cjs/config/global.d.ts | 39 + .../flowbite/lib/cjs/config/global.d.ts.map | 1 + .../flowbite/lib/cjs/config/global.js | 3 + .../flowbite/lib/cjs/config/global.js.map | 1 + node_modules/flowbite/lib/cjs/dom/events.d.ts | 8 + .../flowbite/lib/cjs/dom/events.d.ts.map | 1 + node_modules/flowbite/lib/cjs/dom/events.js | 20 + .../flowbite/lib/cjs/dom/events.js.map | 1 + node_modules/flowbite/lib/cjs/index.d.ts | 47 + node_modules/flowbite/lib/cjs/index.d.ts.map | 1 + node_modules/flowbite/lib/cjs/index.js | 119 + node_modules/flowbite/lib/cjs/index.js.map | 1 + .../flowbite/lib/cjs/index.phoenix.d.ts | 29 + .../flowbite/lib/cjs/index.phoenix.d.ts.map | 1 + .../flowbite/lib/cjs/index.phoenix.js | 59 + .../flowbite/lib/cjs/index.phoenix.js.map | 1 + .../flowbite/lib/cjs/index.turbo.d.ts | 29 + .../flowbite/lib/cjs/index.turbo.d.ts.map | 1 + node_modules/flowbite/lib/cjs/index.turbo.js | 59 + .../flowbite/lib/cjs/index.turbo.js.map | 1 + node_modules/flowbite/lib/cjs/index.umd.d.ts | 30 + .../flowbite/lib/cjs/index.umd.d.ts.map | 1 + node_modules/flowbite/lib/cjs/index.umd.js | 46 + .../flowbite/lib/cjs/index.umd.js.map | 1 + .../lib/esm/components/accordion/index.d.ts | 15 + .../esm/components/accordion/index.d.ts.map | 1 + .../lib/esm/components/accordion/index.js | 147 + .../lib/esm/components/accordion/index.js.map | 1 + .../esm/components/accordion/interface.d.ts | 10 + .../components/accordion/interface.d.ts.map | 1 + .../lib/esm/components/accordion/interface.js | 2 + .../esm/components/accordion/interface.js.map | 1 + .../lib/esm/components/accordion/types.d.ts | 17 + .../esm/components/accordion/types.d.ts.map | 1 + .../lib/esm/components/accordion/types.js | 2 + .../lib/esm/components/accordion/types.js.map | 1 + .../lib/esm/components/carousel/index.d.ts | 54 + .../esm/components/carousel/index.d.ts.map | 1 + .../lib/esm/components/carousel/index.js | 242 + .../lib/esm/components/carousel/index.js.map | 1 + .../esm/components/carousel/interface.d.ts | 20 + .../components/carousel/interface.d.ts.map | 1 + .../lib/esm/components/carousel/interface.js | 2 + .../esm/components/carousel/interface.js.map | 1 + .../lib/esm/components/carousel/types.d.ts | 27 + .../esm/components/carousel/types.d.ts.map | 1 + .../lib/esm/components/carousel/types.js | 2 + .../lib/esm/components/carousel/types.js.map | 1 + .../lib/esm/components/collapse/index.d.ts | 16 + .../esm/components/collapse/index.d.ts.map | 1 + .../lib/esm/components/collapse/index.js | 94 + .../lib/esm/components/collapse/index.js.map | 1 + .../esm/components/collapse/interface.d.ts | 12 + .../components/collapse/interface.d.ts.map | 1 + .../lib/esm/components/collapse/interface.js | 2 + .../esm/components/collapse/interface.js.map | 1 + .../lib/esm/components/collapse/types.d.ts | 7 + .../esm/components/collapse/types.d.ts.map | 1 + .../lib/esm/components/collapse/types.js | 2 + .../lib/esm/components/collapse/types.js.map | 1 + .../lib/esm/components/dial/index.d.ts | 23 + .../lib/esm/components/dial/index.d.ts.map | 1 + .../flowbite/lib/esm/components/dial/index.js | 138 + .../lib/esm/components/dial/index.js.map | 1 + .../lib/esm/components/dial/interface.d.ts | 16 + .../esm/components/dial/interface.d.ts.map | 1 + .../lib/esm/components/dial/interface.js | 2 + .../lib/esm/components/dial/interface.js.map | 1 + .../lib/esm/components/dial/types.d.ts | 13 + .../lib/esm/components/dial/types.d.ts.map | 1 + .../flowbite/lib/esm/components/dial/types.js | 2 + .../lib/esm/components/dial/types.js.map | 1 + .../lib/esm/components/dismiss/index.d.ts | 13 + .../lib/esm/components/dismiss/index.d.ts.map | 1 + .../lib/esm/components/dismiss/index.js | 64 + .../lib/esm/components/dismiss/index.js.map | 1 + .../lib/esm/components/dismiss/interface.d.ts | 9 + .../esm/components/dismiss/interface.d.ts.map | 1 + .../lib/esm/components/dismiss/interface.js | 2 + .../esm/components/dismiss/interface.js.map | 1 + .../lib/esm/components/dismiss/types.d.ts | 8 + .../lib/esm/components/dismiss/types.d.ts.map | 1 + .../lib/esm/components/dismiss/types.js | 2 + .../lib/esm/components/dismiss/types.js.map | 1 + .../lib/esm/components/drawer/index.d.ts | 21 + .../lib/esm/components/drawer/index.d.ts.map | 1 + .../lib/esm/components/drawer/index.js | 310 + .../lib/esm/components/drawer/index.js.map | 1 + .../lib/esm/components/drawer/interface.d.ts | 17 + .../esm/components/drawer/interface.d.ts.map | 1 + .../lib/esm/components/drawer/interface.js | 2 + .../esm/components/drawer/interface.js.map | 1 + .../lib/esm/components/drawer/types.d.ts | 22 + .../lib/esm/components/drawer/types.d.ts.map | 1 + .../lib/esm/components/drawer/types.js | 2 + .../lib/esm/components/drawer/types.js.map | 1 + .../lib/esm/components/dropdown/index.d.ts | 29 + .../esm/components/dropdown/index.d.ts.map | 1 + .../lib/esm/components/dropdown/index.js | 250 + .../lib/esm/components/dropdown/index.js.map | 1 + .../esm/components/dropdown/interface.d.ts | 22 + .../components/dropdown/interface.d.ts.map | 1 + .../lib/esm/components/dropdown/interface.js | 2 + .../esm/components/dropdown/interface.js.map | 1 + .../lib/esm/components/dropdown/types.d.ts | 19 + .../esm/components/dropdown/types.d.ts.map | 1 + .../lib/esm/components/dropdown/types.js | 2 + .../lib/esm/components/dropdown/types.js.map | 1 + .../flowbite/lib/esm/components/index.d.ts | 2 + .../lib/esm/components/index.d.ts.map | 1 + .../flowbite/lib/esm/components/index.js | 28 + .../flowbite/lib/esm/components/index.js.map | 1 + .../lib/esm/components/modal/index.d.ts | 26 + .../lib/esm/components/modal/index.d.ts.map | 1 + .../lib/esm/components/modal/index.js | 270 + .../lib/esm/components/modal/index.js.map | 1 + .../lib/esm/components/modal/interface.d.ts | 21 + .../esm/components/modal/interface.d.ts.map | 1 + .../lib/esm/components/modal/interface.js | 2 + .../lib/esm/components/modal/interface.js.map | 1 + .../lib/esm/components/modal/types.d.ts | 17 + .../lib/esm/components/modal/types.d.ts.map | 1 + .../lib/esm/components/modal/types.js | 2 + .../lib/esm/components/modal/types.js.map | 1 + .../lib/esm/components/popover/index.d.ts | 32 + .../lib/esm/components/popover/index.d.ts.map | 1 + .../lib/esm/components/popover/index.js | 218 + .../lib/esm/components/popover/index.js.map | 1 + .../lib/esm/components/popover/interface.d.ts | 22 + .../esm/components/popover/interface.d.ts.map | 1 + .../lib/esm/components/popover/interface.js | 2 + .../esm/components/popover/interface.js.map | 1 + .../lib/esm/components/popover/types.d.ts | 16 + .../lib/esm/components/popover/types.d.ts.map | 1 + .../lib/esm/components/popover/types.js | 2 + .../lib/esm/components/popover/types.js.map | 1 + .../lib/esm/components/tabs/index.d.ts | 16 + .../lib/esm/components/tabs/index.d.ts.map | 1 + .../flowbite/lib/esm/components/tabs/index.js | 111 + .../lib/esm/components/tabs/index.js.map | 1 + .../lib/esm/components/tabs/interface.d.ts | 12 + .../esm/components/tabs/interface.d.ts.map | 1 + .../lib/esm/components/tabs/interface.js | 2 + .../lib/esm/components/tabs/interface.js.map | 1 + .../lib/esm/components/tabs/types.d.ts | 13 + .../lib/esm/components/tabs/types.d.ts.map | 1 + .../flowbite/lib/esm/components/tabs/types.js | 2 + .../lib/esm/components/tabs/types.js.map | 1 + .../lib/esm/components/tooltip/index.d.ts | 32 + .../lib/esm/components/tooltip/index.d.ts.map | 1 + .../lib/esm/components/tooltip/index.js | 200 + .../lib/esm/components/tooltip/index.js.map | 1 + .../lib/esm/components/tooltip/interface.d.ts | 23 + .../esm/components/tooltip/interface.d.ts.map | 1 + .../lib/esm/components/tooltip/interface.js | 2 + .../esm/components/tooltip/interface.js.map | 1 + .../lib/esm/components/tooltip/types.d.ts | 15 + .../lib/esm/components/tooltip/types.d.ts.map | 1 + .../lib/esm/components/tooltip/types.js | 2 + .../lib/esm/components/tooltip/types.js.map | 1 + .../flowbite/lib/esm/config/global.d.ts | 39 + .../flowbite/lib/esm/config/global.d.ts.map | 1 + .../flowbite/lib/esm/config/global.js | 2 + .../flowbite/lib/esm/config/global.js.map | 1 + node_modules/flowbite/lib/esm/dom/events.d.ts | 8 + .../flowbite/lib/esm/dom/events.d.ts.map | 1 + node_modules/flowbite/lib/esm/dom/events.js | 18 + .../flowbite/lib/esm/dom/events.js.map | 1 + node_modules/flowbite/lib/esm/index.d.ts | 47 + node_modules/flowbite/lib/esm/index.d.ts.map | 1 + node_modules/flowbite/lib/esm/index.js | 79 + node_modules/flowbite/lib/esm/index.js.map | 1 + .../flowbite/lib/esm/index.phoenix.d.ts | 29 + .../flowbite/lib/esm/index.phoenix.d.ts.map | 1 + .../flowbite/lib/esm/index.phoenix.js | 57 + .../flowbite/lib/esm/index.phoenix.js.map | 1 + .../flowbite/lib/esm/index.turbo.d.ts | 29 + .../flowbite/lib/esm/index.turbo.d.ts.map | 1 + node_modules/flowbite/lib/esm/index.turbo.js | 57 + .../flowbite/lib/esm/index.turbo.js.map | 1 + node_modules/flowbite/lib/esm/index.umd.d.ts | 30 + .../flowbite/lib/esm/index.umd.d.ts.map | 1 + node_modules/flowbite/lib/esm/index.umd.js | 44 + .../flowbite/lib/esm/index.umd.js.map | 1 + node_modules/flowbite/package.json | 121 + node_modules/flowbite/plugin-windicss.js | 588 + node_modules/flowbite/plugin.d.ts | 2 + node_modules/flowbite/plugin.js | 970 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 26 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 134 + node_modules/glob-parent/index.js | 75 + node_modules/glob-parent/package.json | 54 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 375 + node_modules/glob/changelog.md | 67 + node_modules/glob/common.js | 240 + node_modules/glob/glob.js | 790 + node_modules/glob/package.json | 46 + node_modules/glob/sync.js | 486 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 45 + node_modules/has/src/index.js | 8 + node_modules/has/test/index.js | 16 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 29 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 29 + node_modules/is-binary-path/index.d.ts | 17 + node_modules/is-binary-path/index.js | 7 + node_modules/is-binary-path/license | 9 + node_modules/is-binary-path/package.json | 40 + node_modules/is-binary-path/readme.md | 34 + node_modules/is-core-module/.eslintrc | 18 + node_modules/is-core-module/.nycrc | 9 + node_modules/is-core-module/CHANGELOG.md | 173 + node_modules/is-core-module/LICENSE | 20 + node_modules/is-core-module/README.md | 40 + node_modules/is-core-module/core.json | 158 + node_modules/is-core-module/index.js | 69 + node_modules/is-core-module/package.json | 73 + node_modules/is-core-module/test/index.js | 133 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 107 + node_modules/is-extglob/index.js | 20 + node_modules/is-extglob/package.json | 69 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 206 + node_modules/is-glob/index.js | 150 + node_modules/is-glob/package.json | 81 + node_modules/is-number/LICENSE | 21 + node_modules/is-number/README.md | 187 + node_modules/is-number/index.js | 18 + node_modules/is-number/package.json | 82 + node_modules/jiti/LICENSE | 21 + node_modules/jiti/README.md | 161 + node_modules/jiti/bin/jiti.js | 16 + node_modules/jiti/dist/babel.d.ts | 2 + node_modules/jiti/dist/babel.js | 1885 + node_modules/jiti/dist/jiti.d.ts | 19 + node_modules/jiti/dist/jiti.js | 1 + .../babel-plugin-transform-import-meta.d.ts | 4 + .../jiti/dist/plugins/import-meta-env.d.ts | 5 + node_modules/jiti/dist/types.d.ts | 31 + node_modules/jiti/dist/utils.d.ts | 8 + node_modules/jiti/lib/index.js | 15 + node_modules/jiti/package.json | 81 + node_modules/jiti/register.js | 3 + node_modules/lilconfig/LICENSE | 21 + node_modules/lilconfig/dist/index.d.ts | 38 + node_modules/lilconfig/dist/index.js | 251 + node_modules/lilconfig/package.json | 48 + node_modules/lilconfig/readme.md | 118 + node_modules/lines-and-columns/LICENSE | 21 + node_modules/lines-and-columns/README.md | 33 + .../lines-and-columns/build/index.d.ts | 13 + node_modules/lines-and-columns/build/index.js | 62 + node_modules/lines-and-columns/package.json | 49 + node_modules/merge2/LICENSE | 21 + node_modules/merge2/README.md | 144 + node_modules/merge2/index.js | 144 + node_modules/merge2/package.json | 43 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 1011 + node_modules/micromatch/index.js | 467 + node_modules/micromatch/package.json | 119 + node_modules/mini-svg-data-uri/LICENSE | 21 + node_modules/mini-svg-data-uri/README.md | 109 + node_modules/mini-svg-data-uri/cli.js | 41 + node_modules/mini-svg-data-uri/index.d.ts | 7 + node_modules/mini-svg-data-uri/index.js | 55 + .../mini-svg-data-uri/index.test-d.ts | 5 + node_modules/mini-svg-data-uri/package.json | 26 + .../shorter-css-color-names.js | 56 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 230 + node_modules/minimatch/minimatch.js | 947 + node_modules/minimatch/package.json | 33 + node_modules/mz/HISTORY.md | 66 + node_modules/mz/LICENSE | 22 + node_modules/mz/README.md | 106 + node_modules/mz/child_process.js | 8 + node_modules/mz/crypto.js | 9 + node_modules/mz/dns.js | 16 + node_modules/mz/fs.js | 62 + node_modules/mz/index.js | 8 + node_modules/mz/package.json | 44 + node_modules/mz/readline.js | 64 + node_modules/mz/zlib.js | 13 + node_modules/nanoid/LICENSE | 20 + node_modules/nanoid/README.md | 39 + node_modules/nanoid/async/index.browser.cjs | 34 + node_modules/nanoid/async/index.browser.js | 34 + node_modules/nanoid/async/index.cjs | 35 + node_modules/nanoid/async/index.d.ts | 56 + node_modules/nanoid/async/index.js | 35 + node_modules/nanoid/async/index.native.js | 26 + node_modules/nanoid/async/package.json | 12 + node_modules/nanoid/bin/nanoid.cjs | 55 + node_modules/nanoid/index.browser.cjs | 34 + node_modules/nanoid/index.browser.js | 34 + node_modules/nanoid/index.cjs | 45 + node_modules/nanoid/index.d.ts | 91 + node_modules/nanoid/index.js | 45 + node_modules/nanoid/nanoid.js | 1 + node_modules/nanoid/non-secure/index.cjs | 21 + node_modules/nanoid/non-secure/index.d.ts | 33 + node_modules/nanoid/non-secure/index.js | 21 + node_modules/nanoid/non-secure/package.json | 6 + node_modules/nanoid/package.json | 66 + node_modules/nanoid/url-alphabet/index.cjs | 3 + node_modules/nanoid/url-alphabet/index.js | 3 + node_modules/nanoid/url-alphabet/package.json | 6 + node_modules/normalize-path/LICENSE | 21 + node_modules/normalize-path/README.md | 127 + node_modules/normalize-path/index.js | 35 + node_modules/normalize-path/package.json | 77 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 42 + node_modules/object-assign/readme.md | 61 + node_modules/object-hash/LICENSE | 22 + node_modules/object-hash/dist/object_hash.js | 1 + node_modules/object-hash/index.js | 453 + node_modules/object-hash/package.json | 53 + node_modules/object-hash/readme.markdown | 198 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 33 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 43 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 75 + node_modules/path-parse/package.json | 33 + node_modules/picocolors/LICENSE | 15 + node_modules/picocolors/README.md | 21 + node_modules/picocolors/package.json | 25 + node_modules/picocolors/picocolors.browser.js | 4 + node_modules/picocolors/picocolors.d.ts | 5 + node_modules/picocolors/picocolors.js | 58 + node_modules/picocolors/types.ts | 30 + node_modules/picomatch/CHANGELOG.md | 136 + node_modules/picomatch/LICENSE | 21 + node_modules/picomatch/README.md | 708 + node_modules/picomatch/index.js | 3 + node_modules/picomatch/lib/constants.js | 179 + node_modules/picomatch/lib/parse.js | 1091 + node_modules/picomatch/lib/picomatch.js | 342 + node_modules/picomatch/lib/scan.js | 391 + node_modules/picomatch/lib/utils.js | 64 + node_modules/picomatch/package.json | 81 + node_modules/pify/index.js | 68 + node_modules/pify/license | 21 + node_modules/pify/package.json | 48 + node_modules/pify/readme.md | 119 + node_modules/pirates/LICENSE | 21 + node_modules/pirates/README.md | 69 + node_modules/pirates/index.d.ts | 82 + node_modules/pirates/lib/index.js | 139 + node_modules/pirates/package.json | 74 + node_modules/postcss-import/LICENSE | 20 + node_modules/postcss-import/README.md | 244 + node_modules/postcss-import/index.js | 420 + .../postcss-import/lib/assign-layer-names.js | 17 + node_modules/postcss-import/lib/data-url.js | 17 + node_modules/postcss-import/lib/join-layer.js | 9 + node_modules/postcss-import/lib/join-media.js | 28 + .../postcss-import/lib/load-content.js | 12 + .../postcss-import/lib/parse-statements.js | 172 + .../postcss-import/lib/process-content.js | 59 + node_modules/postcss-import/lib/resolve-id.js | 42 + node_modules/postcss-import/package.json | 65 + node_modules/postcss-js/LICENSE | 20 + node_modules/postcss-js/README.md | 22 + node_modules/postcss-js/async.js | 15 + node_modules/postcss-js/index.js | 11 + node_modules/postcss-js/index.mjs | 8 + node_modules/postcss-js/objectifier.js | 85 + node_modules/postcss-js/package.json | 42 + node_modules/postcss-js/parser.js | 104 + node_modules/postcss-js/process-result.js | 11 + node_modules/postcss-js/sync.js | 12 + node_modules/postcss-load-config/LICENSE | 20 + node_modules/postcss-load-config/README.md | 491 + node_modules/postcss-load-config/package.json | 48 + .../postcss-load-config/src/index.d.ts | 65 + node_modules/postcss-load-config/src/index.js | 179 + .../postcss-load-config/src/options.js | 47 + .../postcss-load-config/src/plugins.js | 85 + node_modules/postcss-load-config/src/req.js | 10 + node_modules/postcss-nested/LICENSE | 20 + node_modules/postcss-nested/README.md | 86 + node_modules/postcss-nested/index.d.ts | 41 + node_modules/postcss-nested/index.js | 361 + node_modules/postcss-nested/package.json | 28 + node_modules/postcss-selector-parser/API.md | 872 + .../postcss-selector-parser/CHANGELOG.md | 525 + .../postcss-selector-parser/LICENSE-MIT | 22 + .../postcss-selector-parser/README.md | 49 + .../postcss-selector-parser/dist/index.js | 17 + .../postcss-selector-parser/dist/parser.js | 1012 + .../postcss-selector-parser/dist/processor.js | 170 + .../dist/selectors/attribute.js | 448 + .../dist/selectors/className.js | 50 + .../dist/selectors/combinator.js | 21 + .../dist/selectors/comment.js | 21 + .../dist/selectors/constructors.js | 65 + .../dist/selectors/container.js | 308 + .../dist/selectors/guards.js | 58 + .../dist/selectors/id.js | 25 + .../dist/selectors/index.js | 21 + .../dist/selectors/namespace.js | 80 + .../dist/selectors/nesting.js | 22 + .../dist/selectors/node.js | 192 + .../dist/selectors/pseudo.js | 26 + .../dist/selectors/root.js | 44 + .../dist/selectors/selector.js | 21 + .../dist/selectors/string.js | 21 + .../dist/selectors/tag.js | 21 + .../dist/selectors/types.js | 28 + .../dist/selectors/universal.js | 22 + .../dist/sortAscending.js | 11 + .../dist/tokenTypes.js | 70 + .../postcss-selector-parser/dist/tokenize.js | 239 + .../dist/util/ensureObject.js | 17 + .../dist/util/getProp.js | 18 + .../dist/util/index.js | 13 + .../dist/util/stripComments.js | 21 + .../dist/util/unesc.js | 76 + .../postcss-selector-parser/package.json | 79 + .../postcss-selector-parser.d.ts | 555 + node_modules/postcss-value-parser/LICENSE | 22 + node_modules/postcss-value-parser/README.md | 263 + .../postcss-value-parser/lib/index.d.ts | 177 + .../postcss-value-parser/lib/index.js | 28 + .../postcss-value-parser/lib/parse.js | 321 + .../postcss-value-parser/lib/stringify.js | 48 + node_modules/postcss-value-parser/lib/unit.js | 120 + node_modules/postcss-value-parser/lib/walk.js | 22 + .../postcss-value-parser/package.json | 58 + node_modules/postcss/LICENSE | 20 + node_modules/postcss/README.md | 28 + node_modules/postcss/lib/at-rule.d.ts | 115 + node_modules/postcss/lib/at-rule.js | 25 + node_modules/postcss/lib/comment.d.ts | 67 + node_modules/postcss/lib/comment.js | 13 + node_modules/postcss/lib/container.d.ts | 452 + node_modules/postcss/lib/container.js | 439 + .../postcss/lib/css-syntax-error.d.ts | 248 + node_modules/postcss/lib/css-syntax-error.js | 100 + node_modules/postcss/lib/declaration.d.ts | 148 + node_modules/postcss/lib/declaration.js | 24 + node_modules/postcss/lib/document.d.ts | 68 + node_modules/postcss/lib/document.js | 33 + node_modules/postcss/lib/fromJSON.d.ts | 9 + node_modules/postcss/lib/fromJSON.js | 54 + node_modules/postcss/lib/input.d.ts | 194 + node_modules/postcss/lib/input.js | 248 + node_modules/postcss/lib/lazy-result.d.ts | 190 + node_modules/postcss/lib/lazy-result.js | 550 + node_modules/postcss/lib/list.d.ts | 57 + node_modules/postcss/lib/list.js | 58 + node_modules/postcss/lib/map-generator.js | 359 + node_modules/postcss/lib/no-work-result.d.ts | 46 + node_modules/postcss/lib/no-work-result.js | 135 + node_modules/postcss/lib/node.d.ts | 536 + node_modules/postcss/lib/node.js | 381 + node_modules/postcss/lib/parse.d.ts | 9 + node_modules/postcss/lib/parse.js | 42 + node_modules/postcss/lib/parser.js | 610 + node_modules/postcss/lib/postcss.d.mts | 72 + node_modules/postcss/lib/postcss.d.ts | 441 + node_modules/postcss/lib/postcss.js | 101 + node_modules/postcss/lib/postcss.mjs | 30 + node_modules/postcss/lib/previous-map.d.ts | 81 + node_modules/postcss/lib/previous-map.js | 142 + node_modules/postcss/lib/processor.d.ts | 115 + node_modules/postcss/lib/processor.js | 67 + node_modules/postcss/lib/result.d.ts | 206 + node_modules/postcss/lib/result.js | 42 + node_modules/postcss/lib/root.d.ts | 86 + node_modules/postcss/lib/root.js | 61 + node_modules/postcss/lib/rule.d.ts | 113 + node_modules/postcss/lib/rule.js | 27 + node_modules/postcss/lib/stringifier.d.ts | 46 + node_modules/postcss/lib/stringifier.js | 353 + node_modules/postcss/lib/stringify.d.ts | 9 + node_modules/postcss/lib/stringify.js | 11 + node_modules/postcss/lib/symbols.js | 5 + .../postcss/lib/terminal-highlight.js | 70 + node_modules/postcss/lib/tokenize.js | 266 + node_modules/postcss/lib/warn-once.js | 13 + node_modules/postcss/lib/warning.d.ts | 147 + node_modules/postcss/lib/warning.js | 37 + node_modules/postcss/package.json | 88 + node_modules/queue-microtask/LICENSE | 20 + node_modules/queue-microtask/README.md | 90 + node_modules/queue-microtask/index.d.ts | 2 + node_modules/queue-microtask/index.js | 9 + node_modules/queue-microtask/package.json | 55 + node_modules/read-cache/LICENSE | 20 + node_modules/read-cache/README.md | 46 + node_modules/read-cache/index.js | 78 + node_modules/read-cache/package.json | 34 + node_modules/readdirp/LICENSE | 21 + node_modules/readdirp/README.md | 122 + node_modules/readdirp/index.d.ts | 43 + node_modules/readdirp/index.js | 287 + node_modules/readdirp/package.json | 122 + node_modules/resolve/.editorconfig | 37 + node_modules/resolve/.eslintrc | 65 + node_modules/resolve/.github/FUNDING.yml | 12 + node_modules/resolve/LICENSE | 21 + node_modules/resolve/SECURITY.md | 3 + node_modules/resolve/async.js | 3 + node_modules/resolve/bin/resolve | 50 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 6 + node_modules/resolve/lib/async.js | 329 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/core.js | 12 + node_modules/resolve/lib/core.json | 158 + node_modules/resolve/lib/homedir.js | 24 + node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + node_modules/resolve/lib/normalize-options.js | 10 + node_modules/resolve/lib/sync.js | 208 + node_modules/resolve/package.json | 72 + node_modules/resolve/readme.markdown | 301 + node_modules/resolve/sync.js | 3 + node_modules/resolve/test/core.js | 88 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 2 + node_modules/resolve/test/dotdot/index.js | 1 + node_modules/resolve/test/faulty_basedir.js | 29 + node_modules/resolve/test/filter.js | 34 + node_modules/resolve/test/filter_sync.js | 33 + node_modules/resolve/test/home_paths.js | 127 + node_modules/resolve/test/home_paths_sync.js | 114 + node_modules/resolve/test/mock.js | 315 + node_modules/resolve/test/mock_sync.js | 214 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + node_modules/resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + node_modules/resolve/test/resolver.js | 597 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 + node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 730 + node_modules/resolve/test/shadowed_core.js | 54 + .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 176 + node_modules/reusify/.coveralls.yml | 1 + node_modules/reusify/.travis.yml | 28 + node_modules/reusify/LICENSE | 22 + node_modules/reusify/README.md | 145 + .../benchmarks/createNoCodeFunction.js | 30 + node_modules/reusify/benchmarks/fib.js | 13 + .../reusify/benchmarks/reuseNoCodeFunction.js | 38 + node_modules/reusify/package.json | 45 + node_modules/reusify/reusify.js | 33 + node_modules/reusify/test.js | 66 + node_modules/run-parallel/LICENSE | 20 + node_modules/run-parallel/README.md | 85 + node_modules/run-parallel/index.js | 51 + node_modules/run-parallel/package.json | 58 + node_modules/source-map-js/CHANGELOG.md | 320 + node_modules/source-map-js/LICENSE | 28 + node_modules/source-map-js/README.md | 758 + node_modules/source-map-js/lib/array-set.js | 121 + node_modules/source-map-js/lib/base64-vlq.js | 140 + node_modules/source-map-js/lib/base64.js | 67 + .../source-map-js/lib/binary-search.js | 111 + .../source-map-js/lib/mapping-list.js | 79 + node_modules/source-map-js/lib/quick-sort.js | 132 + .../source-map-js/lib/source-map-consumer.js | 1184 + .../source-map-js/lib/source-map-generator.js | 425 + node_modules/source-map-js/lib/source-node.js | 413 + node_modules/source-map-js/lib/util.js | 594 + node_modules/source-map-js/package.json | 71 + node_modules/source-map-js/source-map.d.ts | 115 + node_modules/source-map-js/source-map.js | 8 + node_modules/sucrase/LICENSE | 21 + node_modules/sucrase/README.md | 295 + node_modules/sucrase/bin/sucrase | 3 + node_modules/sucrase/bin/sucrase-node | 18 + .../sucrase/dist/CJSImportProcessor.js | 456 + node_modules/sucrase/dist/HelperManager.js | 176 + node_modules/sucrase/dist/NameManager.js | 27 + .../sucrase/dist/Options-gen-types.js | 42 + node_modules/sucrase/dist/Options.js | 101 + node_modules/sucrase/dist/TokenProcessor.js | 357 + node_modules/sucrase/dist/cli.js | 320 + node_modules/sucrase/dist/computeSourceMap.js | 89 + .../sucrase/dist/esm/CJSImportProcessor.js | 456 + .../sucrase/dist/esm/HelperManager.js | 176 + node_modules/sucrase/dist/esm/NameManager.js | 27 + .../sucrase/dist/esm/Options-gen-types.js | 42 + node_modules/sucrase/dist/esm/Options.js | 101 + .../sucrase/dist/esm/TokenProcessor.js | 357 + node_modules/sucrase/dist/esm/cli.js | 320 + .../sucrase/dist/esm/computeSourceMap.js | 89 + .../dist/esm/identifyShadowedGlobals.js | 98 + node_modules/sucrase/dist/esm/index.js | 133 + node_modules/sucrase/dist/esm/parser/index.js | 31 + .../sucrase/dist/esm/parser/plugins/flow.js | 1105 + .../dist/esm/parser/plugins/jsx/index.js | 367 + .../dist/esm/parser/plugins/jsx/xhtml.js | 256 + .../sucrase/dist/esm/parser/plugins/types.js | 37 + .../dist/esm/parser/plugins/typescript.js | 1632 + .../dist/esm/parser/tokenizer/index.js | 1004 + .../dist/esm/parser/tokenizer/keywords.js | 43 + .../dist/esm/parser/tokenizer/readWord.js | 64 + .../dist/esm/parser/tokenizer/readWordTree.js | 671 + .../dist/esm/parser/tokenizer/state.js | 106 + .../dist/esm/parser/tokenizer/types.js | 361 + .../sucrase/dist/esm/parser/traverser/base.js | 60 + .../dist/esm/parser/traverser/expression.js | 1022 + .../dist/esm/parser/traverser/index.js | 18 + .../sucrase/dist/esm/parser/traverser/lval.js | 159 + .../dist/esm/parser/traverser/statement.js | 1332 + .../sucrase/dist/esm/parser/traverser/util.js | 104 + .../sucrase/dist/esm/parser/util/charcodes.js | 115 + .../dist/esm/parser/util/identifier.js | 34 + .../dist/esm/parser/util/whitespace.js | 33 + node_modules/sucrase/dist/esm/register.js | 88 + .../esm/transformers/CJSImportTransformer.js | 916 + .../esm/transformers/ESMImportTransformer.js | 415 + .../dist/esm/transformers/FlowTransformer.js | 182 + .../dist/esm/transformers/JSXTransformer.js | 733 + .../esm/transformers/JestHoistTransformer.js | 111 + .../NumericSeparatorTransformer.js | 20 + .../OptionalCatchBindingTransformer.js | 19 + .../OptionalChainingNullishTransformer.js | 155 + .../ReactDisplayNameTransformer.js | 160 + .../transformers/ReactHotLoaderTransformer.js | 69 + .../dist/esm/transformers/RootTransformer.js | 462 + .../dist/esm/transformers/Transformer.js | 16 + .../esm/transformers/TypeScriptTransformer.js | 279 + .../dist/esm/util/elideImportEquals.js | 29 + .../sucrase/dist/esm/util/formatTokens.js | 74 + .../sucrase/dist/esm/util/getClassInfo.js | 352 + .../dist/esm/util/getDeclarationInfo.js | 40 + .../dist/esm/util/getIdentifierNames.js | 15 + .../esm/util/getImportExportSpecifierInfo.js | 92 + .../sucrase/dist/esm/util/getJSXPragmaInfo.js | 22 + .../dist/esm/util/getNonTypeIdentifiers.js | 43 + .../dist/esm/util/getTSImportedNames.js | 84 + .../sucrase/dist/esm/util/isAsyncOperation.js | 38 + .../sucrase/dist/esm/util/isExportFrom.js | 18 + .../sucrase/dist/esm/util/isIdentifier.js | 81 + .../esm/util/removeMaybeImportAttributes.js | 22 + .../dist/esm/util/shouldElideDefaultExport.js | 38 + .../sucrase/dist/identifyShadowedGlobals.js | 98 + node_modules/sucrase/dist/index.js | 133 + node_modules/sucrase/dist/parser/index.js | 31 + .../sucrase/dist/parser/plugins/flow.js | 1105 + .../sucrase/dist/parser/plugins/jsx/index.js | 367 + .../sucrase/dist/parser/plugins/jsx/xhtml.js | 256 + .../sucrase/dist/parser/plugins/types.js | 37 + .../sucrase/dist/parser/plugins/typescript.js | 1632 + .../sucrase/dist/parser/tokenizer/index.js | 1004 + .../sucrase/dist/parser/tokenizer/keywords.js | 43 + .../sucrase/dist/parser/tokenizer/readWord.js | 64 + .../dist/parser/tokenizer/readWordTree.js | 671 + .../sucrase/dist/parser/tokenizer/state.js | 106 + .../sucrase/dist/parser/tokenizer/types.js | 361 + .../sucrase/dist/parser/traverser/base.js | 60 + .../dist/parser/traverser/expression.js | 1022 + .../sucrase/dist/parser/traverser/index.js | 18 + .../sucrase/dist/parser/traverser/lval.js | 159 + .../dist/parser/traverser/statement.js | 1332 + .../sucrase/dist/parser/traverser/util.js | 104 + .../sucrase/dist/parser/util/charcodes.js | 115 + .../sucrase/dist/parser/util/identifier.js | 34 + .../sucrase/dist/parser/util/whitespace.js | 33 + node_modules/sucrase/dist/register.js | 88 + .../dist/transformers/CJSImportTransformer.js | 916 + .../dist/transformers/ESMImportTransformer.js | 415 + .../dist/transformers/FlowTransformer.js | 182 + .../dist/transformers/JSXTransformer.js | 733 + .../dist/transformers/JestHoistTransformer.js | 111 + .../NumericSeparatorTransformer.js | 20 + .../OptionalCatchBindingTransformer.js | 19 + .../OptionalChainingNullishTransformer.js | 155 + .../ReactDisplayNameTransformer.js | 160 + .../transformers/ReactHotLoaderTransformer.js | 69 + .../dist/transformers/RootTransformer.js | 462 + .../sucrase/dist/transformers/Transformer.js | 16 + .../transformers/TypeScriptTransformer.js | 279 + .../dist/types/CJSImportProcessor.d.ts | 67 + .../sucrase/dist/types/HelperManager.d.ts | 15 + .../sucrase/dist/types/NameManager.d.ts | 7 + .../sucrase/dist/types/Options-gen-types.d.ts | 9 + node_modules/sucrase/dist/types/Options.d.ts | 90 + .../sucrase/dist/types/TokenProcessor.d.ts | 87 + node_modules/sucrase/dist/types/cli.d.ts | 1 + .../sucrase/dist/types/computeSourceMap.d.ts | 17 + .../dist/types/identifyShadowedGlobals.d.ts | 12 + node_modules/sucrase/dist/types/index.d.ts | 26 + .../sucrase/dist/types/parser/index.d.ts | 8 + .../dist/types/parser/plugins/flow.d.ts | 27 + .../dist/types/parser/plugins/jsx/index.d.ts | 2 + .../dist/types/parser/plugins/jsx/xhtml.d.ts | 2 + .../dist/types/parser/plugins/types.d.ts | 5 + .../dist/types/parser/plugins/typescript.d.ts | 49 + .../dist/types/parser/tokenizer/index.d.ts | 93 + .../dist/types/parser/tokenizer/keywords.d.ts | 43 + .../dist/types/parser/tokenizer/readWord.d.ts | 7 + .../types/parser/tokenizer/readWordTree.d.ts | 1 + .../dist/types/parser/tokenizer/state.d.ts | 50 + .../dist/types/parser/tokenizer/types.d.ts | 126 + .../dist/types/parser/traverser/base.d.ts | 16 + .../types/parser/traverser/expression.d.ts | 34 + .../dist/types/parser/traverser/index.d.ts | 2 + .../dist/types/parser/traverser/lval.d.ts | 9 + .../types/parser/traverser/statement.d.ts | 20 + .../dist/types/parser/traverser/util.d.ts | 17 + .../dist/types/parser/util/charcodes.d.ts | 107 + .../dist/types/parser/util/identifier.d.ts | 2 + .../dist/types/parser/util/whitespace.d.ts | 3 + node_modules/sucrase/dist/types/register.d.ts | 14 + .../transformers/CJSImportTransformer.d.ts | 149 + .../transformers/ESMImportTransformer.d.ts | 52 + .../types/transformers/FlowTransformer.d.ts | 79 + .../types/transformers/JSXTransformer.d.ts | 144 + .../transformers/JestHoistTransformer.d.ts | 32 + .../NumericSeparatorTransformer.d.ts | 7 + .../OptionalCatchBindingTransformer.d.ts | 9 + .../OptionalChainingNullishTransformer.d.ts | 36 + .../ReactDisplayNameTransformer.d.ts | 29 + .../ReactHotLoaderTransformer.d.ts | 12 + .../types/transformers/RootTransformer.d.ts | 52 + .../dist/types/transformers/Transformer.d.ts | 6 + .../transformers/TypeScriptTransformer.d.ts | 104 + .../dist/types/util/elideImportEquals.d.ts | 2 + .../sucrase/dist/types/util/formatTokens.d.ts | 2 + .../sucrase/dist/types/util/getClassInfo.d.ts | 34 + .../dist/types/util/getDeclarationInfo.d.ts | 18 + .../dist/types/util/getIdentifierNames.d.ts | 5 + .../util/getImportExportSpecifierInfo.d.ts | 36 + .../dist/types/util/getJSXPragmaInfo.d.ts | 8 + .../types/util/getNonTypeIdentifiers.d.ts | 3 + .../dist/types/util/getTSImportedNames.d.ts | 9 + .../dist/types/util/isAsyncOperation.d.ts | 11 + .../sucrase/dist/types/util/isExportFrom.d.ts | 6 + .../sucrase/dist/types/util/isIdentifier.d.ts | 8 + .../util/removeMaybeImportAttributes.d.ts | 6 + .../types/util/shouldElideDefaultExport.d.ts | 6 + .../sucrase/dist/util/elideImportEquals.js | 29 + .../sucrase/dist/util/formatTokens.js | 74 + .../sucrase/dist/util/getClassInfo.js | 352 + .../sucrase/dist/util/getDeclarationInfo.js | 40 + .../sucrase/dist/util/getIdentifierNames.js | 15 + .../dist/util/getImportExportSpecifierInfo.js | 92 + .../sucrase/dist/util/getJSXPragmaInfo.js | 22 + .../dist/util/getNonTypeIdentifiers.js | 43 + .../sucrase/dist/util/getTSImportedNames.js | 84 + .../sucrase/dist/util/isAsyncOperation.js | 38 + .../sucrase/dist/util/isExportFrom.js | 18 + .../sucrase/dist/util/isIdentifier.js | 81 + .../dist/util/removeMaybeImportAttributes.js | 22 + .../dist/util/shouldElideDefaultExport.js | 38 + node_modules/sucrase/package.json | 89 + node_modules/sucrase/register/index.js | 1 + node_modules/sucrase/register/js.js | 1 + node_modules/sucrase/register/jsx.js | 1 + .../register/ts-legacy-module-interop.js | 1 + node_modules/sucrase/register/ts.js | 1 + .../register/tsx-legacy-module-interop.js | 1 + node_modules/sucrase/register/tsx.js | 1 + node_modules/sucrase/ts-node-plugin/index.js | 83 + .../supports-preserve-symlinks-flag/.eslintrc | 14 + .../.github/FUNDING.yml | 12 + .../supports-preserve-symlinks-flag/.nycrc | 9 + .../CHANGELOG.md | 22 + .../supports-preserve-symlinks-flag/LICENSE | 21 + .../supports-preserve-symlinks-flag/README.md | 42 + .../browser.js | 3 + .../supports-preserve-symlinks-flag/index.js | 9 + .../package.json | 70 + .../test/index.js | 29 + node_modules/tailwindcss/CHANGELOG.md | 2474 + node_modules/tailwindcss/LICENSE | 21 + node_modules/tailwindcss/README.md | 41 + node_modules/tailwindcss/base.css | 1 + node_modules/tailwindcss/colors.d.ts | 3 + node_modules/tailwindcss/colors.js | 2 + node_modules/tailwindcss/components.css | 1 + node_modules/tailwindcss/defaultConfig.d.ts | 3 + node_modules/tailwindcss/defaultConfig.js | 2 + node_modules/tailwindcss/defaultTheme.d.ts | 4 + node_modules/tailwindcss/defaultTheme.js | 2 + .../tailwindcss/lib/cli-peer-dependencies.js | 36 + node_modules/tailwindcss/lib/cli.js | 7 + .../tailwindcss/lib/cli/build/deps.js | 62 + .../tailwindcss/lib/cli/build/index.js | 54 + .../tailwindcss/lib/cli/build/plugin.js | 378 + .../tailwindcss/lib/cli/build/utils.js | 88 + .../tailwindcss/lib/cli/build/watching.js | 182 + .../tailwindcss/lib/cli/help/index.js | 73 + node_modules/tailwindcss/lib/cli/index.js | 230 + .../tailwindcss/lib/cli/init/index.js | 63 + .../tailwindcss/lib/corePluginList.js | 187 + node_modules/tailwindcss/lib/corePlugins.js | 4177 + node_modules/tailwindcss/lib/css/LICENSE | 25 + .../tailwindcss/lib/css/preflight.css | 378 + node_modules/tailwindcss/lib/featureFlags.js | 83 + node_modules/tailwindcss/lib/index.js | 2 + .../tailwindcss/lib/lib/cacheInvalidation.js | 92 + .../lib/lib/collapseAdjacentRules.js | 61 + .../lib/lib/collapseDuplicateDeclarations.js | 85 + node_modules/tailwindcss/lib/lib/content.js | 181 + .../tailwindcss/lib/lib/defaultExtractor.js | 243 + .../tailwindcss/lib/lib/detectNesting.js | 45 + .../lib/lib/evaluateTailwindFunctions.js | 238 + .../tailwindcss/lib/lib/expandApplyAtRules.js | 534 + .../lib/lib/expandTailwindAtRules.js | 274 + .../tailwindcss/lib/lib/findAtConfigPath.js | 46 + .../tailwindcss/lib/lib/generateRules.js | 890 + .../lib/lib/getModuleDependencies.js | 99 + .../tailwindcss/lib/lib/load-config.js | 42 + .../lib/lib/normalizeTailwindDirectives.js | 89 + node_modules/tailwindcss/lib/lib/offsets.js | 306 + .../lib/lib/partitionApplyAtRules.js | 58 + node_modules/tailwindcss/lib/lib/regex.js | 74 + .../tailwindcss/lib/lib/remap-bitfield.js | 89 + .../lib/lib/resolveDefaultsAtRules.js | 165 + .../tailwindcss/lib/lib/setupContextUtils.js | 1273 + .../lib/lib/setupTrackingContext.js | 166 + .../tailwindcss/lib/lib/sharedState.js | 87 + .../lib/lib/substituteScreenAtRules.js | 31 + node_modules/tailwindcss/lib/oxide/cli.js | 5 + .../tailwindcss/lib/oxide/cli/build/deps.js | 89 + .../tailwindcss/lib/oxide/cli/build/index.js | 53 + .../tailwindcss/lib/oxide/cli/build/plugin.js | 375 + .../tailwindcss/lib/oxide/cli/build/utils.js | 87 + .../lib/oxide/cli/build/watching.js | 179 + .../tailwindcss/lib/oxide/cli/help/index.js | 72 + .../tailwindcss/lib/oxide/cli/index.js | 214 + .../tailwindcss/lib/oxide/cli/init/index.js | 52 + .../tailwindcss/lib/oxide/postcss-plugin.js | 2 + node_modules/tailwindcss/lib/plugin.js | 98 + .../lib/postcss-plugins/nesting/README.md | 42 + .../lib/postcss-plugins/nesting/index.js | 21 + .../lib/postcss-plugins/nesting/plugin.js | 89 + .../lib/processTailwindFeatures.js | 64 + node_modules/tailwindcss/lib/public/colors.js | 355 + .../tailwindcss/lib/public/create-plugin.js | 17 + .../tailwindcss/lib/public/default-config.js | 18 + .../tailwindcss/lib/public/default-theme.js | 18 + .../tailwindcss/lib/public/load-config.js | 12 + .../tailwindcss/lib/public/resolve-config.js | 24 + .../lib/util/applyImportantSelector.js | 36 + node_modules/tailwindcss/lib/util/bigSign.js | 13 + .../tailwindcss/lib/util/buildMediaQuery.js | 27 + .../tailwindcss/lib/util/cloneDeep.js | 22 + .../tailwindcss/lib/util/cloneNodes.js | 34 + node_modules/tailwindcss/lib/util/color.js | 116 + .../tailwindcss/lib/util/colorNames.js | 752 + .../tailwindcss/lib/util/configurePlugins.js | 23 + .../tailwindcss/lib/util/createPlugin.js | 32 + .../lib/util/createUtilityPlugin.js | 53 + .../tailwindcss/lib/util/dataTypes.js | 304 + node_modules/tailwindcss/lib/util/defaults.js | 27 + .../tailwindcss/lib/util/escapeClassName.js | 24 + .../tailwindcss/lib/util/escapeCommas.js | 13 + .../lib/util/flattenColorPalette.js | 18 + .../lib/util/formatVariantSelector.js | 263 + .../tailwindcss/lib/util/getAllConfigs.js | 50 + .../tailwindcss/lib/util/hashConfig.js | 21 + .../tailwindcss/lib/util/isKeyframeRule.js | 13 + .../tailwindcss/lib/util/isPlainObject.js | 17 + .../util/isSyntacticallyValidPropertyValue.js | 74 + node_modules/tailwindcss/lib/util/log.js | 61 + .../tailwindcss/lib/util/nameClass.js | 49 + .../tailwindcss/lib/util/negateValue.js | 36 + .../tailwindcss/lib/util/normalizeConfig.js | 282 + .../tailwindcss/lib/util/normalizeScreens.js | 178 + .../lib/util/parseAnimationValue.js | 93 + .../lib/util/parseBoxShadowValue.js | 88 + .../tailwindcss/lib/util/parseDependency.js | 47 + .../tailwindcss/lib/util/parseGlob.js | 36 + .../tailwindcss/lib/util/parseObjectStyles.js | 36 + .../tailwindcss/lib/util/pluginUtils.js | 276 + .../tailwindcss/lib/util/prefixSelector.js | 39 + .../tailwindcss/lib/util/pseudoElements.js | 209 + .../lib/util/removeAlphaVariables.js | 31 + .../tailwindcss/lib/util/resolveConfig.js | 256 + .../tailwindcss/lib/util/resolveConfigPath.js | 70 + .../tailwindcss/lib/util/responsive.js | 24 + .../lib/util/splitAtTopLevelOnly.js | 51 + node_modules/tailwindcss/lib/util/tap.js | 14 + .../tailwindcss/lib/util/toColorValue.js | 13 + node_modules/tailwindcss/lib/util/toPath.js | 32 + .../lib/util/transformThemeValue.js | 73 + .../tailwindcss/lib/util/validateConfig.js | 37 + .../lib/util/validateFormalSyntax.js | 26 + .../tailwindcss/lib/util/withAlphaVariable.js | 79 + .../tailwindcss/lib/value-parser/LICENSE | 22 + .../tailwindcss/lib/value-parser/README.md | 3 + .../tailwindcss/lib/value-parser/index.d.js | 2 + .../tailwindcss/lib/value-parser/index.js | 22 + .../tailwindcss/lib/value-parser/parse.js | 259 + .../tailwindcss/lib/value-parser/stringify.js | 38 + .../tailwindcss/lib/value-parser/unit.js | 86 + .../tailwindcss/lib/value-parser/walk.js | 16 + node_modules/tailwindcss/loadConfig.d.ts | 4 + node_modules/tailwindcss/loadConfig.js | 2 + node_modules/tailwindcss/nesting/index.js | 2 + node_modules/tailwindcss/package.json | 121 + node_modules/tailwindcss/peers/index.js | 96540 ++++++++++++++++ node_modules/tailwindcss/plugin.d.ts | 11 + node_modules/tailwindcss/plugin.js | 2 + node_modules/tailwindcss/prettier.config.js | 19 + node_modules/tailwindcss/resolveConfig.d.ts | 12 + node_modules/tailwindcss/resolveConfig.js | 2 + node_modules/tailwindcss/screens.css | 1 + .../tailwindcss/scripts/create-plugin-list.js | 10 + .../tailwindcss/scripts/generate-types.js | 105 + .../tailwindcss/scripts/release-channel.js | 18 + .../tailwindcss/scripts/release-notes.js | 21 + .../tailwindcss/scripts/swap-engines.js | 40 + .../tailwindcss/scripts/type-utils.js | 27 + .../tailwindcss/src/cli-peer-dependencies.js | 15 + node_modules/tailwindcss/src/cli.js | 7 + .../tailwindcss/src/cli/build/deps.js | 56 + .../tailwindcss/src/cli/build/index.js | 49 + .../tailwindcss/src/cli/build/plugin.js | 444 + .../tailwindcss/src/cli/build/utils.js | 76 + .../tailwindcss/src/cli/build/watching.js | 229 + .../tailwindcss/src/cli/help/index.js | 70 + node_modules/tailwindcss/src/cli/index.js | 216 + .../tailwindcss/src/cli/init/index.js | 79 + .../tailwindcss/src/corePluginList.js | 1 + node_modules/tailwindcss/src/corePlugins.js | 2855 + node_modules/tailwindcss/src/css/LICENSE | 25 + .../tailwindcss/src/css/preflight.css | 378 + node_modules/tailwindcss/src/featureFlags.js | 70 + node_modules/tailwindcss/src/index.js | 1 + .../tailwindcss/src/lib/cacheInvalidation.js | 52 + .../src/lib/collapseAdjacentRules.js | 58 + .../src/lib/collapseDuplicateDeclarations.js | 93 + node_modules/tailwindcss/src/lib/content.js | 208 + .../tailwindcss/src/lib/defaultExtractor.js | 217 + .../tailwindcss/src/lib/detectNesting.js | 47 + .../src/lib/evaluateTailwindFunctions.js | 272 + .../tailwindcss/src/lib/expandApplyAtRules.js | 613 + .../src/lib/expandTailwindAtRules.js | 285 + .../tailwindcss/src/lib/findAtConfigPath.js | 48 + .../tailwindcss/src/lib/generateRules.js | 934 + .../src/lib/getModuleDependencies.js | 79 + .../tailwindcss/src/lib/load-config.ts | 31 + .../src/lib/normalizeTailwindDirectives.js | 84 + node_modules/tailwindcss/src/lib/offsets.js | 373 + .../src/lib/partitionApplyAtRules.js | 52 + node_modules/tailwindcss/src/lib/regex.js | 74 + .../tailwindcss/src/lib/remap-bitfield.js | 82 + .../src/lib/resolveDefaultsAtRules.js | 163 + .../tailwindcss/src/lib/setupContextUtils.js | 1340 + .../src/lib/setupTrackingContext.js | 169 + .../tailwindcss/src/lib/sharedState.js | 61 + .../src/lib/substituteScreenAtRules.js | 19 + node_modules/tailwindcss/src/oxide/cli.ts | 1 + .../tailwindcss/src/oxide/cli/build/deps.ts | 91 + .../tailwindcss/src/oxide/cli/build/index.ts | 47 + .../tailwindcss/src/oxide/cli/build/plugin.ts | 442 + .../tailwindcss/src/oxide/cli/build/utils.ts | 74 + .../src/oxide/cli/build/watching.ts | 225 + .../tailwindcss/src/oxide/cli/help/index.ts | 69 + .../tailwindcss/src/oxide/cli/index.ts | 204 + .../tailwindcss/src/oxide/cli/init/index.ts | 59 + .../tailwindcss/src/oxide/postcss-plugin.ts | 1 + node_modules/tailwindcss/src/plugin.js | 107 + .../src/postcss-plugins/nesting/README.md | 42 + .../src/postcss-plugins/nesting/index.js | 13 + .../src/postcss-plugins/nesting/plugin.js | 80 + .../src/processTailwindFeatures.js | 59 + node_modules/tailwindcss/src/public/colors.js | 322 + .../tailwindcss/src/public/create-plugin.js | 2 + .../tailwindcss/src/public/default-config.js | 4 + .../tailwindcss/src/public/default-theme.js | 4 + .../tailwindcss/src/public/load-config.js | 2 + .../tailwindcss/src/public/resolve-config.js | 7 + .../src/util/applyImportantSelector.js | 27 + node_modules/tailwindcss/src/util/bigSign.js | 3 + .../tailwindcss/src/util/buildMediaQuery.js | 22 + .../tailwindcss/src/util/cloneDeep.js | 11 + .../tailwindcss/src/util/cloneNodes.js | 28 + node_modules/tailwindcss/src/util/color.js | 88 + .../tailwindcss/src/util/colorNames.js | 150 + .../tailwindcss/src/util/configurePlugins.js | 23 + .../tailwindcss/src/util/createPlugin.js | 27 + .../src/util/createUtilityPlugin.js | 37 + .../tailwindcss/src/util/dataTypes.js | 292 + node_modules/tailwindcss/src/util/defaults.js | 17 + .../tailwindcss/src/util/escapeClassName.js | 8 + .../tailwindcss/src/util/escapeCommas.js | 3 + .../src/util/flattenColorPalette.js | 13 + .../src/util/formatVariantSelector.js | 316 + .../tailwindcss/src/util/getAllConfigs.js | 38 + .../tailwindcss/src/util/hashConfig.js | 5 + .../tailwindcss/src/util/isKeyframeRule.js | 3 + .../tailwindcss/src/util/isPlainObject.js | 8 + .../util/isSyntacticallyValidPropertyValue.js | 61 + node_modules/tailwindcss/src/util/log.js | 29 + .../tailwindcss/src/util/nameClass.js | 30 + .../tailwindcss/src/util/negateValue.js | 24 + .../tailwindcss/src/util/normalizeConfig.js | 301 + .../tailwindcss/src/util/normalizeScreens.js | 140 + .../src/util/parseAnimationValue.js | 68 + .../src/util/parseBoxShadowValue.js | 72 + .../tailwindcss/src/util/parseDependency.js | 44 + .../tailwindcss/src/util/parseGlob.js | 24 + .../tailwindcss/src/util/parseObjectStyles.js | 19 + .../tailwindcss/src/util/pluginUtils.js | 291 + .../tailwindcss/src/util/prefixSelector.js | 33 + .../tailwindcss/src/util/pseudoElements.js | 167 + .../src/util/removeAlphaVariables.js | 24 + .../tailwindcss/src/util/resolveConfig.js | 277 + .../tailwindcss/src/util/resolveConfigPath.js | 66 + .../tailwindcss/src/util/responsive.js | 10 + .../src/util/splitAtTopLevelOnly.js | 52 + node_modules/tailwindcss/src/util/tap.js | 4 + .../tailwindcss/src/util/toColorValue.js | 3 + node_modules/tailwindcss/src/util/toPath.js | 26 + .../src/util/transformThemeValue.js | 62 + .../tailwindcss/src/util/validateConfig.js | 26 + .../src/util/validateFormalSyntax.js | 34 + .../tailwindcss/src/util/withAlphaVariable.js | 49 + .../tailwindcss/src/value-parser/LICENSE | 22 + .../tailwindcss/src/value-parser/README.md | 3 + .../tailwindcss/src/value-parser/index.d.ts | 177 + .../tailwindcss/src/value-parser/index.js | 28 + .../tailwindcss/src/value-parser/parse.js | 303 + .../tailwindcss/src/value-parser/stringify.js | 41 + .../tailwindcss/src/value-parser/unit.js | 118 + .../tailwindcss/src/value-parser/walk.js | 18 + node_modules/tailwindcss/stubs/.npmignore | 1 + .../tailwindcss/stubs/.prettierrc.json | 6 + node_modules/tailwindcss/stubs/config.full.js | 991 + .../tailwindcss/stubs/config.simple.js | 7 + .../tailwindcss/stubs/postcss.config.cjs | 6 + .../tailwindcss/stubs/postcss.config.js | 6 + .../tailwindcss/stubs/tailwind.config.cjs | 2 + .../tailwindcss/stubs/tailwind.config.js | 2 + .../tailwindcss/stubs/tailwind.config.ts | 3 + node_modules/tailwindcss/tailwind.css | 5 + node_modules/tailwindcss/types/config.d.ts | 368 + .../tailwindcss/types/generated/.gitkeep | 0 .../tailwindcss/types/generated/colors.d.ts | 298 + .../types/generated/corePluginList.d.ts | 1 + .../types/generated/default-theme.d.ts | 372 + node_modules/tailwindcss/types/index.d.ts | 7 + node_modules/tailwindcss/utilities.css | 1 + node_modules/tailwindcss/variants.css | 1 + node_modules/thenify-all/History.md | 11 + node_modules/thenify-all/LICENSE | 22 + node_modules/thenify-all/README.md | 66 + node_modules/thenify-all/index.js | 73 + node_modules/thenify-all/package.json | 34 + node_modules/thenify/History.md | 11 + node_modules/thenify/LICENSE | 22 + node_modules/thenify/README.md | 120 + node_modules/thenify/index.js | 77 + node_modules/thenify/package.json | 31 + node_modules/to-regex-range/LICENSE | 21 + node_modules/to-regex-range/README.md | 305 + node_modules/to-regex-range/index.js | 288 + node_modules/to-regex-range/package.json | 88 + node_modules/ts-interface-checker/LICENSE | 201 + node_modules/ts-interface-checker/README.md | 185 + .../ts-interface-checker/dist/index.d.ts | 124 + .../ts-interface-checker/dist/index.js | 224 + .../ts-interface-checker/dist/types.d.ts | 181 + .../ts-interface-checker/dist/types.js | 566 + .../ts-interface-checker/dist/util.d.ts | 55 + .../ts-interface-checker/dist/util.js | 130 + .../ts-interface-checker/package.json | 60 + node_modules/util-deprecate/History.md | 16 + node_modules/util-deprecate/LICENSE | 24 + node_modules/util-deprecate/README.md | 53 + node_modules/util-deprecate/browser.js | 67 + node_modules/util-deprecate/node.js | 6 + node_modules/util-deprecate/package.json | 27 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 29 + node_modules/wrappy/wrappy.js | 33 + node_modules/yaml/LICENSE | 13 + node_modules/yaml/README.md | 147 + .../dist/compose/compose-collection.js | 76 + .../yaml/browser/dist/compose/compose-doc.js | 41 + .../yaml/browser/dist/compose/compose-node.js | 92 + .../browser/dist/compose/compose-scalar.js | 80 + .../yaml/browser/dist/compose/composer.js | 217 + .../browser/dist/compose/resolve-block-map.js | 111 + .../dist/compose/resolve-block-scalar.js | 194 + .../browser/dist/compose/resolve-block-seq.js | 46 + .../yaml/browser/dist/compose/resolve-end.js | 37 + .../dist/compose/resolve-flow-collection.js | 199 + .../dist/compose/resolve-flow-scalar.js | 223 + .../browser/dist/compose/resolve-props.js | 134 + .../dist/compose/util-contains-newline.js | 34 + .../compose/util-empty-scalar-position.js | 27 + .../dist/compose/util-flow-indent-check.js | 15 + .../browser/dist/compose/util-map-includes.js | 17 + .../yaml/browser/dist/doc/Document.js | 334 + node_modules/yaml/browser/dist/doc/anchors.js | 72 + .../yaml/browser/dist/doc/applyReviver.js | 54 + .../yaml/browser/dist/doc/createNode.js | 89 + .../yaml/browser/dist/doc/directives.js | 176 + node_modules/yaml/browser/dist/errors.js | 57 + node_modules/yaml/browser/dist/index.js | 17 + node_modules/yaml/browser/dist/log.js | 16 + .../dist/node_modules/tslib/tslib.es6.js | 21 + node_modules/yaml/browser/dist/nodes/Alias.js | 101 + .../yaml/browser/dist/nodes/Collection.js | 148 + node_modules/yaml/browser/dist/nodes/Node.js | 38 + node_modules/yaml/browser/dist/nodes/Pair.js | 36 + .../yaml/browser/dist/nodes/Scalar.js | 24 + .../yaml/browser/dist/nodes/YAMLMap.js | 144 + .../yaml/browser/dist/nodes/YAMLSeq.js | 113 + .../yaml/browser/dist/nodes/addPairToJSMap.js | 104 + .../yaml/browser/dist/nodes/identity.js | 36 + node_modules/yaml/browser/dist/nodes/toJS.js | 37 + .../yaml/browser/dist/parse/cst-scalar.js | 214 + .../yaml/browser/dist/parse/cst-stringify.js | 61 + .../yaml/browser/dist/parse/cst-visit.js | 97 + node_modules/yaml/browser/dist/parse/cst.js | 98 + node_modules/yaml/browser/dist/parse/lexer.js | 701 + .../yaml/browser/dist/parse/line-counter.js | 39 + .../yaml/browser/dist/parse/parser.js | 950 + node_modules/yaml/browser/dist/public-api.js | 99 + .../yaml/browser/dist/schema/Schema.js | 38 + .../yaml/browser/dist/schema/common/map.js | 17 + .../yaml/browser/dist/schema/common/null.js | 15 + .../yaml/browser/dist/schema/common/seq.js | 17 + .../yaml/browser/dist/schema/common/string.js | 14 + .../yaml/browser/dist/schema/core/bool.js | 19 + .../yaml/browser/dist/schema/core/float.js | 43 + .../yaml/browser/dist/schema/core/int.js | 38 + .../yaml/browser/dist/schema/core/schema.js | 23 + .../yaml/browser/dist/schema/json/schema.js | 62 + node_modules/yaml/browser/dist/schema/tags.js | 83 + .../browser/dist/schema/yaml-1.1/binary.js | 66 + .../yaml/browser/dist/schema/yaml-1.1/bool.js | 26 + .../browser/dist/schema/yaml-1.1/float.js | 46 + .../yaml/browser/dist/schema/yaml-1.1/int.js | 71 + .../yaml/browser/dist/schema/yaml-1.1/omap.js | 74 + .../browser/dist/schema/yaml-1.1/pairs.js | 78 + .../browser/dist/schema/yaml-1.1/schema.js | 37 + .../yaml/browser/dist/schema/yaml-1.1/set.js | 93 + .../browser/dist/schema/yaml-1.1/timestamp.js | 101 + .../browser/dist/stringify/foldFlowLines.js | 135 + .../yaml/browser/dist/stringify/stringify.js | 124 + .../dist/stringify/stringifyCollection.js | 151 + .../dist/stringify/stringifyComment.js | 20 + .../dist/stringify/stringifyDocument.js | 85 + .../browser/dist/stringify/stringifyNumber.js | 24 + .../browser/dist/stringify/stringifyPair.js | 150 + .../browser/dist/stringify/stringifyString.js | 328 + node_modules/yaml/browser/dist/util.js | 11 + node_modules/yaml/browser/dist/visit.js | 233 + node_modules/yaml/browser/index.js | 5 + node_modules/yaml/browser/package.json | 3 + .../yaml/dist/compose/compose-collection.d.ts | 5 + .../yaml/dist/compose/compose-collection.js | 78 + .../yaml/dist/compose/compose-doc.d.ts | 7 + node_modules/yaml/dist/compose/compose-doc.js | 43 + .../yaml/dist/compose/compose-node.d.ts | 27 + .../yaml/dist/compose/compose-node.js | 95 + .../yaml/dist/compose/compose-scalar.d.ts | 5 + .../yaml/dist/compose/compose-scalar.js | 82 + node_modules/yaml/dist/compose/composer.d.ts | 62 + node_modules/yaml/dist/compose/composer.js | 221 + .../yaml/dist/compose/resolve-block-map.d.ts | 7 + .../yaml/dist/compose/resolve-block-map.js | 113 + .../dist/compose/resolve-block-scalar.d.ts | 10 + .../yaml/dist/compose/resolve-block-scalar.js | 196 + .../yaml/dist/compose/resolve-block-seq.d.ts | 6 + .../yaml/dist/compose/resolve-block-seq.js | 48 + .../yaml/dist/compose/resolve-end.d.ts | 6 + node_modules/yaml/dist/compose/resolve-end.js | 39 + .../dist/compose/resolve-flow-collection.d.ts | 7 + .../dist/compose/resolve-flow-collection.js | 201 + .../dist/compose/resolve-flow-scalar.d.ts | 10 + .../yaml/dist/compose/resolve-flow-scalar.js | 225 + .../yaml/dist/compose/resolve-props.d.ts | 22 + .../yaml/dist/compose/resolve-props.js | 136 + .../dist/compose/util-contains-newline.d.ts | 2 + .../dist/compose/util-contains-newline.js | 36 + .../compose/util-empty-scalar-position.d.ts | 2 + .../compose/util-empty-scalar-position.js | 29 + .../dist/compose/util-flow-indent-check.d.ts | 3 + .../dist/compose/util-flow-indent-check.js | 17 + .../yaml/dist/compose/util-map-includes.d.ts | 4 + .../yaml/dist/compose/util-map-includes.js | 19 + node_modules/yaml/dist/doc/Document.d.ts | 141 + node_modules/yaml/dist/doc/Document.js | 336 + node_modules/yaml/dist/doc/anchors.d.ts | 24 + node_modules/yaml/dist/doc/anchors.js | 77 + node_modules/yaml/dist/doc/applyReviver.d.ts | 9 + node_modules/yaml/dist/doc/applyReviver.js | 56 + node_modules/yaml/dist/doc/createNode.d.ts | 17 + node_modules/yaml/dist/doc/createNode.js | 91 + node_modules/yaml/dist/doc/directives.d.ts | 49 + node_modules/yaml/dist/doc/directives.js | 178 + node_modules/yaml/dist/errors.d.ts | 21 + node_modules/yaml/dist/errors.js | 62 + node_modules/yaml/dist/index.d.ts | 22 + node_modules/yaml/dist/index.js | 50 + node_modules/yaml/dist/log.d.ts | 3 + node_modules/yaml/dist/log.js | 19 + node_modules/yaml/dist/nodes/Alias.d.ts | 28 + node_modules/yaml/dist/nodes/Alias.js | 103 + node_modules/yaml/dist/nodes/Collection.d.ts | 74 + node_modules/yaml/dist/nodes/Collection.js | 152 + node_modules/yaml/dist/nodes/Node.d.ts | 46 + node_modules/yaml/dist/nodes/Node.js | 40 + node_modules/yaml/dist/nodes/Pair.d.ts | 21 + node_modules/yaml/dist/nodes/Pair.js | 39 + node_modules/yaml/dist/nodes/Scalar.d.ts | 42 + node_modules/yaml/dist/nodes/Scalar.js | 27 + node_modules/yaml/dist/nodes/YAMLMap.d.ts | 53 + node_modules/yaml/dist/nodes/YAMLMap.js | 147 + node_modules/yaml/dist/nodes/YAMLSeq.d.ts | 60 + node_modules/yaml/dist/nodes/YAMLSeq.js | 115 + .../yaml/dist/nodes/addPairToJSMap.d.ts | 4 + .../yaml/dist/nodes/addPairToJSMap.js | 106 + node_modules/yaml/dist/nodes/identity.d.ts | 23 + node_modules/yaml/dist/nodes/identity.js | 53 + node_modules/yaml/dist/nodes/toJS.d.ts | 27 + node_modules/yaml/dist/nodes/toJS.js | 39 + node_modules/yaml/dist/options.d.ts | 338 + node_modules/yaml/dist/parse/cst-scalar.d.ts | 64 + node_modules/yaml/dist/parse/cst-scalar.js | 218 + .../yaml/dist/parse/cst-stringify.d.ts | 8 + node_modules/yaml/dist/parse/cst-stringify.js | 63 + node_modules/yaml/dist/parse/cst-visit.d.ts | 39 + node_modules/yaml/dist/parse/cst-visit.js | 99 + node_modules/yaml/dist/parse/cst.d.ts | 106 + node_modules/yaml/dist/parse/cst.js | 112 + node_modules/yaml/dist/parse/lexer.d.ts | 87 + node_modules/yaml/dist/parse/lexer.js | 703 + .../yaml/dist/parse/line-counter.d.ts | 22 + node_modules/yaml/dist/parse/line-counter.js | 41 + node_modules/yaml/dist/parse/parser.d.ts | 84 + node_modules/yaml/dist/parse/parser.js | 954 + node_modules/yaml/dist/public-api.d.ts | 43 + node_modules/yaml/dist/public-api.js | 104 + node_modules/yaml/dist/schema/Schema.d.ts | 18 + node_modules/yaml/dist/schema/Schema.js | 40 + node_modules/yaml/dist/schema/common/map.d.ts | 2 + node_modules/yaml/dist/schema/common/map.js | 19 + .../yaml/dist/schema/common/null.d.ts | 4 + node_modules/yaml/dist/schema/common/null.js | 17 + node_modules/yaml/dist/schema/common/seq.d.ts | 2 + node_modules/yaml/dist/schema/common/seq.js | 19 + .../yaml/dist/schema/common/string.d.ts | 2 + .../yaml/dist/schema/common/string.js | 16 + node_modules/yaml/dist/schema/core/bool.d.ts | 4 + node_modules/yaml/dist/schema/core/bool.js | 21 + node_modules/yaml/dist/schema/core/float.d.ts | 4 + node_modules/yaml/dist/schema/core/float.js | 47 + node_modules/yaml/dist/schema/core/int.d.ts | 4 + node_modules/yaml/dist/schema/core/int.js | 42 + .../yaml/dist/schema/core/schema.d.ts | 1 + node_modules/yaml/dist/schema/core/schema.js | 25 + .../yaml/dist/schema/json-schema.d.ts | 69 + .../yaml/dist/schema/json/schema.d.ts | 2 + node_modules/yaml/dist/schema/json/schema.js | 64 + node_modules/yaml/dist/schema/tags.d.ts | 40 + node_modules/yaml/dist/schema/tags.js | 86 + node_modules/yaml/dist/schema/types.d.ts | 90 + .../yaml/dist/schema/yaml-1.1/binary.d.ts | 2 + .../yaml/dist/schema/yaml-1.1/binary.js | 68 + .../yaml/dist/schema/yaml-1.1/bool.d.ts | 7 + .../yaml/dist/schema/yaml-1.1/bool.js | 29 + .../yaml/dist/schema/yaml-1.1/float.d.ts | 4 + .../yaml/dist/schema/yaml-1.1/float.js | 50 + .../yaml/dist/schema/yaml-1.1/int.d.ts | 5 + node_modules/yaml/dist/schema/yaml-1.1/int.js | 76 + .../yaml/dist/schema/yaml-1.1/omap.d.ts | 28 + .../yaml/dist/schema/yaml-1.1/omap.js | 77 + .../yaml/dist/schema/yaml-1.1/pairs.d.ts | 10 + .../yaml/dist/schema/yaml-1.1/pairs.js | 82 + .../yaml/dist/schema/yaml-1.1/schema.d.ts | 1 + .../yaml/dist/schema/yaml-1.1/schema.js | 39 + .../yaml/dist/schema/yaml-1.1/set.d.ts | 28 + node_modules/yaml/dist/schema/yaml-1.1/set.js | 96 + .../yaml/dist/schema/yaml-1.1/timestamp.d.ts | 6 + .../yaml/dist/schema/yaml-1.1/timestamp.js | 105 + .../yaml/dist/stringify/foldFlowLines.d.ts | 34 + .../yaml/dist/stringify/foldFlowLines.js | 140 + .../yaml/dist/stringify/stringify.d.ts | 21 + node_modules/yaml/dist/stringify/stringify.js | 127 + .../dist/stringify/stringifyCollection.d.ts | 17 + .../dist/stringify/stringifyCollection.js | 153 + .../yaml/dist/stringify/stringifyComment.d.ts | 10 + .../yaml/dist/stringify/stringifyComment.js | 24 + .../dist/stringify/stringifyDocument.d.ts | 4 + .../yaml/dist/stringify/stringifyDocument.js | 87 + .../yaml/dist/stringify/stringifyNumber.d.ts | 2 + .../yaml/dist/stringify/stringifyNumber.js | 26 + .../yaml/dist/stringify/stringifyPair.d.ts | 3 + .../yaml/dist/stringify/stringifyPair.js | 152 + .../yaml/dist/stringify/stringifyString.d.ts | 9 + .../yaml/dist/stringify/stringifyString.js | 330 + node_modules/yaml/dist/test-events.d.ts | 4 + node_modules/yaml/dist/test-events.js | 134 + node_modules/yaml/dist/util.d.ts | 12 + node_modules/yaml/dist/util.js | 28 + node_modules/yaml/dist/visit.d.ts | 102 + node_modules/yaml/dist/visit.js | 236 + node_modules/yaml/package.json | 95 + node_modules/yaml/util.js | 2 + package-lock.json | 1001 + package.json | 8 + static/css/main.css | 70 + static/css/output.css | 1554 + static/img/images.jpg | Bin 0 -> 4388 bytes static/img/lichess-svgrepo-com.svg | 2 + static/img/linkedin.svg | 10 + static/src/input.css | 3 + tailwind.config.js | 14 + templates/index.html | 162 + 2182 files changed, 315168 insertions(+) create mode 100644 README.md create mode 100644 app.py create mode 100644 node_modules/.bin/cssesc create mode 100644 node_modules/.bin/cssesc.cmd create mode 100644 node_modules/.bin/cssesc.ps1 create mode 100644 node_modules/.bin/jiti create mode 100644 node_modules/.bin/jiti.cmd create mode 100644 node_modules/.bin/jiti.ps1 create mode 100644 node_modules/.bin/mini-svg-data-uri create mode 100644 node_modules/.bin/mini-svg-data-uri.cmd create mode 100644 node_modules/.bin/mini-svg-data-uri.ps1 create mode 100644 node_modules/.bin/nanoid create mode 100644 node_modules/.bin/nanoid.cmd create mode 100644 node_modules/.bin/nanoid.ps1 create mode 100644 node_modules/.bin/resolve create mode 100644 node_modules/.bin/resolve.cmd create mode 100644 node_modules/.bin/resolve.ps1 create mode 100644 node_modules/.bin/sucrase create mode 100644 node_modules/.bin/sucrase-node create mode 100644 node_modules/.bin/sucrase-node.cmd create mode 100644 node_modules/.bin/sucrase-node.ps1 create mode 100644 node_modules/.bin/sucrase.cmd create mode 100644 node_modules/.bin/sucrase.ps1 create mode 100644 node_modules/.bin/tailwind create mode 100644 node_modules/.bin/tailwind.cmd create mode 100644 node_modules/.bin/tailwind.ps1 create mode 100644 node_modules/.bin/tailwindcss create mode 100644 node_modules/.bin/tailwindcss.cmd create mode 100644 node_modules/.bin/tailwindcss.ps1 create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@alloc/quick-lru/index.d.ts create mode 100644 node_modules/@alloc/quick-lru/index.js create mode 100644 node_modules/@alloc/quick-lru/license create mode 100644 node_modules/@alloc/quick-lru/package.json create mode 100644 node_modules/@alloc/quick-lru/readme.md create mode 100644 node_modules/@jridgewell/gen-mapping/LICENSE create mode 100644 node_modules/@jridgewell/gen-mapping/README.md create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/package.json create mode 100644 node_modules/@jridgewell/resolve-uri/LICENSE create mode 100644 node_modules/@jridgewell/resolve-uri/README.md create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map create mode 100644 node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts create mode 100644 node_modules/@jridgewell/resolve-uri/package.json create mode 100644 node_modules/@jridgewell/set-array/LICENSE create mode 100644 node_modules/@jridgewell/set-array/README.md create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs.map create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js.map create mode 100644 node_modules/@jridgewell/set-array/dist/types/set-array.d.ts create mode 100644 node_modules/@jridgewell/set-array/package.json create mode 100644 node_modules/@jridgewell/set-array/src/set-array.ts create mode 100644 node_modules/@jridgewell/sourcemap-codec/LICENSE create mode 100644 node_modules/@jridgewell/sourcemap-codec/README.md create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts create mode 100644 node_modules/@jridgewell/sourcemap-codec/package.json create mode 100644 node_modules/@jridgewell/trace-mapping/LICENSE create mode 100644 node_modules/@jridgewell/trace-mapping/README.md create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/package.json create mode 100644 node_modules/@nodelib/fs.scandir/LICENSE create mode 100644 node_modules/@nodelib/fs.scandir/README.md create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js create mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.js create mode 100644 node_modules/@nodelib/fs.scandir/package.json create mode 100644 node_modules/@nodelib/fs.stat/LICENSE create mode 100644 node_modules/@nodelib/fs.stat/README.md create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/index.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/settings.js create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.js create mode 100644 node_modules/@nodelib/fs.stat/package.json create mode 100644 node_modules/@nodelib/fs.walk/LICENSE create mode 100644 node_modules/@nodelib/fs.walk/README.md create mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/settings.js create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.js create mode 100644 node_modules/@nodelib/fs.walk/package.json create mode 100644 node_modules/@popperjs/core/LICENSE.md create mode 100644 node_modules/@popperjs/core/README.md create mode 100644 node_modules/@popperjs/core/dist/cjs/enums.js create mode 100644 node_modules/@popperjs/core/dist/cjs/enums.js.flow create mode 100644 node_modules/@popperjs/core/dist/cjs/enums.js.map create mode 100644 node_modules/@popperjs/core/dist/cjs/popper-base.js create mode 100644 node_modules/@popperjs/core/dist/cjs/popper-base.js.flow create mode 100644 node_modules/@popperjs/core/dist/cjs/popper-base.js.map create mode 100644 node_modules/@popperjs/core/dist/cjs/popper-lite.js create mode 100644 node_modules/@popperjs/core/dist/cjs/popper-lite.js.flow create mode 100644 node_modules/@popperjs/core/dist/cjs/popper-lite.js.map create mode 100644 node_modules/@popperjs/core/dist/cjs/popper.js create mode 100644 node_modules/@popperjs/core/dist/cjs/popper.js.flow create mode 100644 node_modules/@popperjs/core/dist/cjs/popper.js.map create mode 100644 node_modules/@popperjs/core/dist/esm/createPopper.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/contains.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getBoundingClientRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getClippingRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getCompositeRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getComputedStyle.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getDocumentElement.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getDocumentRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getHTMLElementScroll.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getLayoutRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getNodeName.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getNodeScroll.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getOffsetParent.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getParentNode.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getScrollParent.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getViewportRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getWindow.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getWindowScroll.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/getWindowScrollBarX.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/instanceOf.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/isLayoutViewport.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/isScrollParent.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/isTableElement.js create mode 100644 node_modules/@popperjs/core/dist/esm/dom-utils/listScrollParents.js create mode 100644 node_modules/@popperjs/core/dist/esm/enums.js create mode 100644 node_modules/@popperjs/core/dist/esm/index.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/applyStyles.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/arrow.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/computeStyles.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/eventListeners.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/flip.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/hide.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/index.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/offset.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/popperOffsets.js create mode 100644 node_modules/@popperjs/core/dist/esm/modifiers/preventOverflow.js create mode 100644 node_modules/@popperjs/core/dist/esm/popper-base.js create mode 100644 node_modules/@popperjs/core/dist/esm/popper-lite.js create mode 100644 node_modules/@popperjs/core/dist/esm/popper.js create mode 100644 node_modules/@popperjs/core/dist/esm/types.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/computeAutoPlacement.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/computeOffsets.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/debounce.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/detectOverflow.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/expandToHashMap.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getAltAxis.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getAltLen.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getBasePlacement.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getFreshSideObject.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getMainAxisFromPlacement.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getOppositePlacement.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getOppositeVariationPlacement.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/getVariation.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/math.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/mergeByName.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/mergePaddingObject.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/orderModifiers.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/rectToClientRect.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/uniqueBy.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/userAgent.js create mode 100644 node_modules/@popperjs/core/dist/esm/utils/within.js create mode 100644 node_modules/@popperjs/core/dist/umd/enums.js create mode 100644 node_modules/@popperjs/core/dist/umd/enums.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/enums.min.js create mode 100644 node_modules/@popperjs/core/dist/umd/enums.min.js.flow create mode 100644 node_modules/@popperjs/core/dist/umd/enums.min.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/popper-base.js create mode 100644 node_modules/@popperjs/core/dist/umd/popper-base.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/popper-base.min.js create mode 100644 node_modules/@popperjs/core/dist/umd/popper-base.min.js.flow create mode 100644 node_modules/@popperjs/core/dist/umd/popper-base.min.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/popper-lite.js create mode 100644 node_modules/@popperjs/core/dist/umd/popper-lite.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/popper-lite.min.js create mode 100644 node_modules/@popperjs/core/dist/umd/popper-lite.min.js.flow create mode 100644 node_modules/@popperjs/core/dist/umd/popper-lite.min.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/popper.js create mode 100644 node_modules/@popperjs/core/dist/umd/popper.js.map create mode 100644 node_modules/@popperjs/core/dist/umd/popper.min.js create mode 100644 node_modules/@popperjs/core/dist/umd/popper.min.js.flow create mode 100644 node_modules/@popperjs/core/dist/umd/popper.min.js.map create mode 100644 node_modules/@popperjs/core/index.d.ts create mode 100644 node_modules/@popperjs/core/lib/createPopper.d.ts create mode 100644 node_modules/@popperjs/core/lib/createPopper.js create mode 100644 node_modules/@popperjs/core/lib/createPopper.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/contains.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/contains.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/contains.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getClippingRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getNodeName.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getNodeName.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getNodeName.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getParentNode.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getParentNode.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getParentNode.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getScrollParent.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getViewportRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindow.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindow.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindow.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/instanceOf.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/instanceOf.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/instanceOf.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isScrollParent.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isTableElement.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isTableElement.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/isTableElement.js.flow create mode 100644 node_modules/@popperjs/core/lib/dom-utils/listScrollParents.d.ts create mode 100644 node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js create mode 100644 node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js.flow create mode 100644 node_modules/@popperjs/core/lib/enums.d.ts create mode 100644 node_modules/@popperjs/core/lib/enums.js create mode 100644 node_modules/@popperjs/core/lib/enums.js.flow create mode 100644 node_modules/@popperjs/core/lib/index.d.ts create mode 100644 node_modules/@popperjs/core/lib/index.js create mode 100644 node_modules/@popperjs/core/lib/index.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/applyStyles.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/applyStyles.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/applyStyles.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/arrow.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/arrow.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/arrow.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/computeStyles.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/computeStyles.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/computeStyles.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/eventListeners.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/eventListeners.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/eventListeners.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/flip.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/flip.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/flip.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/hide.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/hide.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/hide.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/index.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/index.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/index.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/offset.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/offset.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/offset.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/popperOffsets.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/popperOffsets.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/popperOffsets.js.flow create mode 100644 node_modules/@popperjs/core/lib/modifiers/preventOverflow.d.ts create mode 100644 node_modules/@popperjs/core/lib/modifiers/preventOverflow.js create mode 100644 node_modules/@popperjs/core/lib/modifiers/preventOverflow.js.flow create mode 100644 node_modules/@popperjs/core/lib/popper-base.d.ts create mode 100644 node_modules/@popperjs/core/lib/popper-base.js create mode 100644 node_modules/@popperjs/core/lib/popper-base.js.flow create mode 100644 node_modules/@popperjs/core/lib/popper-lite.d.ts create mode 100644 node_modules/@popperjs/core/lib/popper-lite.js create mode 100644 node_modules/@popperjs/core/lib/popper-lite.js.flow create mode 100644 node_modules/@popperjs/core/lib/popper.d.ts create mode 100644 node_modules/@popperjs/core/lib/popper.js create mode 100644 node_modules/@popperjs/core/lib/popper.js.flow create mode 100644 node_modules/@popperjs/core/lib/types.d.ts create mode 100644 node_modules/@popperjs/core/lib/types.js create mode 100644 node_modules/@popperjs/core/lib/types.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/computeAutoPlacement.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js create mode 100644 node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/computeOffsets.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/computeOffsets.js create mode 100644 node_modules/@popperjs/core/lib/utils/computeOffsets.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/debounce.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/debounce.js create mode 100644 node_modules/@popperjs/core/lib/utils/debounce.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/detectOverflow.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/detectOverflow.js create mode 100644 node_modules/@popperjs/core/lib/utils/detectOverflow.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/expandToHashMap.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/expandToHashMap.js create mode 100644 node_modules/@popperjs/core/lib/utils/expandToHashMap.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getAltAxis.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getAltAxis.js create mode 100644 node_modules/@popperjs/core/lib/utils/getAltAxis.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getAltLen.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getAltLen.js create mode 100644 node_modules/@popperjs/core/lib/utils/getAltLen.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getBasePlacement.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getBasePlacement.js create mode 100644 node_modules/@popperjs/core/lib/utils/getBasePlacement.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getFreshSideObject.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getFreshSideObject.js create mode 100644 node_modules/@popperjs/core/lib/utils/getFreshSideObject.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js create mode 100644 node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getOppositePlacement.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getOppositePlacement.js create mode 100644 node_modules/@popperjs/core/lib/utils/getOppositePlacement.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js create mode 100644 node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/getVariation.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/getVariation.js create mode 100644 node_modules/@popperjs/core/lib/utils/getVariation.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/math.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/math.js create mode 100644 node_modules/@popperjs/core/lib/utils/math.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/mergeByName.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/mergeByName.js create mode 100644 node_modules/@popperjs/core/lib/utils/mergeByName.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/mergePaddingObject.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/mergePaddingObject.js create mode 100644 node_modules/@popperjs/core/lib/utils/mergePaddingObject.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/orderModifiers.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/orderModifiers.js create mode 100644 node_modules/@popperjs/core/lib/utils/orderModifiers.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/rectToClientRect.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/rectToClientRect.js create mode 100644 node_modules/@popperjs/core/lib/utils/rectToClientRect.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/uniqueBy.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/uniqueBy.js create mode 100644 node_modules/@popperjs/core/lib/utils/uniqueBy.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/userAgent.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/userAgent.js create mode 100644 node_modules/@popperjs/core/lib/utils/userAgent.js.flow create mode 100644 node_modules/@popperjs/core/lib/utils/within.d.ts create mode 100644 node_modules/@popperjs/core/lib/utils/within.js create mode 100644 node_modules/@popperjs/core/lib/utils/within.js.flow create mode 100644 node_modules/@popperjs/core/package.json create mode 100644 node_modules/any-promise/.jshintrc create mode 100644 node_modules/any-promise/.npmignore create mode 100644 node_modules/any-promise/LICENSE create mode 100644 node_modules/any-promise/README.md create mode 100644 node_modules/any-promise/implementation.d.ts create mode 100644 node_modules/any-promise/implementation.js create mode 100644 node_modules/any-promise/index.d.ts create mode 100644 node_modules/any-promise/index.js create mode 100644 node_modules/any-promise/loader.js create mode 100644 node_modules/any-promise/optional.js create mode 100644 node_modules/any-promise/package.json create mode 100644 node_modules/any-promise/register-shim.js create mode 100644 node_modules/any-promise/register.d.ts create mode 100644 node_modules/any-promise/register.js create mode 100644 node_modules/any-promise/register/bluebird.d.ts create mode 100644 node_modules/any-promise/register/bluebird.js create mode 100644 node_modules/any-promise/register/es6-promise.d.ts create mode 100644 node_modules/any-promise/register/es6-promise.js create mode 100644 node_modules/any-promise/register/lie.d.ts create mode 100644 node_modules/any-promise/register/lie.js create mode 100644 node_modules/any-promise/register/native-promise-only.d.ts create mode 100644 node_modules/any-promise/register/native-promise-only.js create mode 100644 node_modules/any-promise/register/pinkie.d.ts create mode 100644 node_modules/any-promise/register/pinkie.js create mode 100644 node_modules/any-promise/register/promise.d.ts create mode 100644 node_modules/any-promise/register/promise.js create mode 100644 node_modules/any-promise/register/q.d.ts create mode 100644 node_modules/any-promise/register/q.js create mode 100644 node_modules/any-promise/register/rsvp.d.ts create mode 100644 node_modules/any-promise/register/rsvp.js create mode 100644 node_modules/any-promise/register/vow.d.ts create mode 100644 node_modules/any-promise/register/vow.js create mode 100644 node_modules/any-promise/register/when.d.ts create mode 100644 node_modules/any-promise/register/when.js create mode 100644 node_modules/anymatch/LICENSE create mode 100644 node_modules/anymatch/README.md create mode 100644 node_modules/anymatch/index.d.ts create mode 100644 node_modules/anymatch/index.js create mode 100644 node_modules/anymatch/package.json create mode 100644 node_modules/arg/LICENSE.md create mode 100644 node_modules/arg/README.md create mode 100644 node_modules/arg/index.d.ts create mode 100644 node_modules/arg/index.js create mode 100644 node_modules/arg/package.json create mode 100644 node_modules/balanced-match/.github/FUNDING.yml create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/binary-extensions/binary-extensions.json create mode 100644 node_modules/binary-extensions/binary-extensions.json.d.ts create mode 100644 node_modules/binary-extensions/index.d.ts create mode 100644 node_modules/binary-extensions/index.js create mode 100644 node_modules/binary-extensions/license create mode 100644 node_modules/binary-extensions/package.json create mode 100644 node_modules/binary-extensions/readme.md create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/CHANGELOG.md create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/lib/compile.js create mode 100644 node_modules/braces/lib/constants.js create mode 100644 node_modules/braces/lib/expand.js create mode 100644 node_modules/braces/lib/parse.js create mode 100644 node_modules/braces/lib/stringify.js create mode 100644 node_modules/braces/lib/utils.js create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/camelcase-css/README.md create mode 100644 node_modules/camelcase-css/index-es5.js create mode 100644 node_modules/camelcase-css/index.js create mode 100644 node_modules/camelcase-css/license create mode 100644 node_modules/camelcase-css/package.json create mode 100644 node_modules/chokidar/LICENSE create mode 100644 node_modules/chokidar/README.md create mode 100644 node_modules/chokidar/index.js create mode 100644 node_modules/chokidar/lib/constants.js create mode 100644 node_modules/chokidar/lib/fsevents-handler.js create mode 100644 node_modules/chokidar/lib/nodefs-handler.js create mode 100644 node_modules/chokidar/node_modules/glob-parent/CHANGELOG.md create mode 100644 node_modules/chokidar/node_modules/glob-parent/LICENSE create mode 100644 node_modules/chokidar/node_modules/glob-parent/README.md create mode 100644 node_modules/chokidar/node_modules/glob-parent/index.js create mode 100644 node_modules/chokidar/node_modules/glob-parent/package.json create mode 100644 node_modules/chokidar/package.json create mode 100644 node_modules/chokidar/types/index.d.ts create mode 100644 node_modules/commander/CHANGELOG.md create mode 100644 node_modules/commander/LICENSE create mode 100644 node_modules/commander/Readme.md create mode 100644 node_modules/commander/index.js create mode 100644 node_modules/commander/package.json create mode 100644 node_modules/commander/typings/index.d.ts create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/cssesc/LICENSE-MIT.txt create mode 100644 node_modules/cssesc/README.md create mode 100644 node_modules/cssesc/bin/cssesc create mode 100644 node_modules/cssesc/cssesc.js create mode 100644 node_modules/cssesc/man/cssesc.1 create mode 100644 node_modules/cssesc/package.json create mode 100644 node_modules/didyoumean/LICENSE create mode 100644 node_modules/didyoumean/README.md create mode 100644 node_modules/didyoumean/didYouMean-1.2.1.js create mode 100644 node_modules/didyoumean/didYouMean-1.2.1.min.js create mode 100644 node_modules/didyoumean/package.json create mode 100644 node_modules/dlv/README.md create mode 100644 node_modules/dlv/dist/dlv.es.js create mode 100644 node_modules/dlv/dist/dlv.es.js.map create mode 100644 node_modules/dlv/dist/dlv.js create mode 100644 node_modules/dlv/dist/dlv.js.map create mode 100644 node_modules/dlv/dist/dlv.umd.js create mode 100644 node_modules/dlv/dist/dlv.umd.js.map create mode 100644 node_modules/dlv/index.js create mode 100644 node_modules/dlv/package.json create mode 100644 node_modules/fast-glob/LICENSE create mode 100644 node_modules/fast-glob/README.md create mode 100644 node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md create mode 100644 node_modules/fast-glob/node_modules/glob-parent/LICENSE create mode 100644 node_modules/fast-glob/node_modules/glob-parent/README.md create mode 100644 node_modules/fast-glob/node_modules/glob-parent/index.js create mode 100644 node_modules/fast-glob/node_modules/glob-parent/package.json create mode 100644 node_modules/fast-glob/out/index.d.ts create mode 100644 node_modules/fast-glob/out/index.js create mode 100644 node_modules/fast-glob/out/managers/tasks.d.ts create mode 100644 node_modules/fast-glob/out/managers/tasks.js create mode 100644 node_modules/fast-glob/out/providers/async.d.ts create mode 100644 node_modules/fast-glob/out/providers/async.js create mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/deep.js create mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/entry.js create mode 100644 node_modules/fast-glob/out/providers/filters/error.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/error.js create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.js create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.js create mode 100644 node_modules/fast-glob/out/providers/provider.d.ts create mode 100644 node_modules/fast-glob/out/providers/provider.js create mode 100644 node_modules/fast-glob/out/providers/stream.d.ts create mode 100644 node_modules/fast-glob/out/providers/stream.js create mode 100644 node_modules/fast-glob/out/providers/sync.d.ts create mode 100644 node_modules/fast-glob/out/providers/sync.js create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.js create mode 100644 node_modules/fast-glob/out/readers/async.d.ts create mode 100644 node_modules/fast-glob/out/readers/async.js create mode 100644 node_modules/fast-glob/out/readers/reader.d.ts create mode 100644 node_modules/fast-glob/out/readers/reader.js create mode 100644 node_modules/fast-glob/out/readers/stream.d.ts create mode 100644 node_modules/fast-glob/out/readers/stream.js create mode 100644 node_modules/fast-glob/out/readers/sync.d.ts create mode 100644 node_modules/fast-glob/out/readers/sync.js create mode 100644 node_modules/fast-glob/out/settings.d.ts create mode 100644 node_modules/fast-glob/out/settings.js create mode 100644 node_modules/fast-glob/out/types/index.d.ts create mode 100644 node_modules/fast-glob/out/types/index.js create mode 100644 node_modules/fast-glob/out/utils/array.d.ts create mode 100644 node_modules/fast-glob/out/utils/array.js create mode 100644 node_modules/fast-glob/out/utils/errno.d.ts create mode 100644 node_modules/fast-glob/out/utils/errno.js create mode 100644 node_modules/fast-glob/out/utils/fs.d.ts create mode 100644 node_modules/fast-glob/out/utils/fs.js create mode 100644 node_modules/fast-glob/out/utils/index.d.ts create mode 100644 node_modules/fast-glob/out/utils/index.js create mode 100644 node_modules/fast-glob/out/utils/path.d.ts create mode 100644 node_modules/fast-glob/out/utils/path.js create mode 100644 node_modules/fast-glob/out/utils/pattern.d.ts create mode 100644 node_modules/fast-glob/out/utils/pattern.js create mode 100644 node_modules/fast-glob/out/utils/stream.d.ts create mode 100644 node_modules/fast-glob/out/utils/stream.js create mode 100644 node_modules/fast-glob/out/utils/string.d.ts create mode 100644 node_modules/fast-glob/out/utils/string.js create mode 100644 node_modules/fast-glob/package.json create mode 100644 node_modules/fastq/.github/dependabot.yml create mode 100644 node_modules/fastq/.github/workflows/ci.yml create mode 100644 node_modules/fastq/LICENSE create mode 100644 node_modules/fastq/README.md create mode 100644 node_modules/fastq/bench.js create mode 100644 node_modules/fastq/example.js create mode 100644 node_modules/fastq/example.mjs create mode 100644 node_modules/fastq/index.d.ts create mode 100644 node_modules/fastq/package.json create mode 100644 node_modules/fastq/queue.js create mode 100644 node_modules/fastq/test/example.ts create mode 100644 node_modules/fastq/test/promise.js create mode 100644 node_modules/fastq/test/test.js create mode 100644 node_modules/fastq/test/tsconfig.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/flowbite/LICENSE.md create mode 100644 node_modules/flowbite/README.md create mode 100644 node_modules/flowbite/dist/datepicker.js create mode 100644 node_modules/flowbite/dist/datepicker.js.map create mode 100644 node_modules/flowbite/dist/datepicker.min.js create mode 100644 node_modules/flowbite/dist/datepicker.turbo.js create mode 100644 node_modules/flowbite/dist/datepicker.turbo.js.map create mode 100644 node_modules/flowbite/dist/datepicker.turbo.min.js create mode 100644 node_modules/flowbite/dist/flowbite.css create mode 100644 node_modules/flowbite/dist/flowbite.js create mode 100644 node_modules/flowbite/dist/flowbite.js.map create mode 100644 node_modules/flowbite/dist/flowbite.min.css create mode 100644 node_modules/flowbite/dist/flowbite.min.js create mode 100644 node_modules/flowbite/dist/flowbite.min.js.map create mode 100644 node_modules/flowbite/dist/flowbite.phoenix.js create mode 100644 node_modules/flowbite/dist/flowbite.phoenix.js.map create mode 100644 node_modules/flowbite/dist/flowbite.phoenix.min.js create mode 100644 node_modules/flowbite/dist/flowbite.phoenix.min.js.map create mode 100644 node_modules/flowbite/dist/flowbite.turbo.js create mode 100644 node_modules/flowbite/dist/flowbite.turbo.js.map create mode 100644 node_modules/flowbite/dist/flowbite.turbo.min.js create mode 100644 node_modules/flowbite/dist/flowbite.turbo.min.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/accordion/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/carousel/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/collapse/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dial/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dial/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dial/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/dial/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dial/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dial/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dial/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/dial/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dial/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dial/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dial/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/dial/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/dismiss/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/drawer/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/dropdown/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/modal/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/modal/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/modal/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/modal/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/modal/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/modal/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/modal/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/modal/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/modal/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/modal/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/modal/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/modal/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/popover/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/popover/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/popover/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/popover/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/popover/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/popover/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/popover/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/popover/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/popover/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/popover/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/popover/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/popover/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/tabs/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/index.js create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/interface.js create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/interface.js.map create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/types.js create mode 100644 node_modules/flowbite/lib/cjs/components/tooltip/types.js.map create mode 100644 node_modules/flowbite/lib/cjs/config/global.d.ts create mode 100644 node_modules/flowbite/lib/cjs/config/global.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/config/global.js create mode 100644 node_modules/flowbite/lib/cjs/config/global.js.map create mode 100644 node_modules/flowbite/lib/cjs/dom/events.d.ts create mode 100644 node_modules/flowbite/lib/cjs/dom/events.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/dom/events.js create mode 100644 node_modules/flowbite/lib/cjs/dom/events.js.map create mode 100644 node_modules/flowbite/lib/cjs/index.d.ts create mode 100644 node_modules/flowbite/lib/cjs/index.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/index.js create mode 100644 node_modules/flowbite/lib/cjs/index.js.map create mode 100644 node_modules/flowbite/lib/cjs/index.phoenix.d.ts create mode 100644 node_modules/flowbite/lib/cjs/index.phoenix.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/index.phoenix.js create mode 100644 node_modules/flowbite/lib/cjs/index.phoenix.js.map create mode 100644 node_modules/flowbite/lib/cjs/index.turbo.d.ts create mode 100644 node_modules/flowbite/lib/cjs/index.turbo.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/index.turbo.js create mode 100644 node_modules/flowbite/lib/cjs/index.turbo.js.map create mode 100644 node_modules/flowbite/lib/cjs/index.umd.d.ts create mode 100644 node_modules/flowbite/lib/cjs/index.umd.d.ts.map create mode 100644 node_modules/flowbite/lib/cjs/index.umd.js create mode 100644 node_modules/flowbite/lib/cjs/index.umd.js.map create mode 100644 node_modules/flowbite/lib/esm/components/accordion/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/accordion/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/accordion/index.js create mode 100644 node_modules/flowbite/lib/esm/components/accordion/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/accordion/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/accordion/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/accordion/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/accordion/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/accordion/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/accordion/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/accordion/types.js create mode 100644 node_modules/flowbite/lib/esm/components/accordion/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/carousel/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/carousel/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/carousel/index.js create mode 100644 node_modules/flowbite/lib/esm/components/carousel/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/carousel/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/carousel/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/carousel/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/carousel/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/carousel/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/carousel/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/carousel/types.js create mode 100644 node_modules/flowbite/lib/esm/components/carousel/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/collapse/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/collapse/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/collapse/index.js create mode 100644 node_modules/flowbite/lib/esm/components/collapse/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/collapse/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/collapse/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/collapse/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/collapse/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/collapse/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/collapse/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/collapse/types.js create mode 100644 node_modules/flowbite/lib/esm/components/collapse/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dial/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dial/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dial/index.js create mode 100644 node_modules/flowbite/lib/esm/components/dial/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dial/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dial/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dial/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/dial/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dial/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dial/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dial/types.js create mode 100644 node_modules/flowbite/lib/esm/components/dial/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/index.js create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/types.js create mode 100644 node_modules/flowbite/lib/esm/components/dismiss/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/drawer/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/drawer/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/drawer/index.js create mode 100644 node_modules/flowbite/lib/esm/components/drawer/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/drawer/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/drawer/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/drawer/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/drawer/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/drawer/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/drawer/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/drawer/types.js create mode 100644 node_modules/flowbite/lib/esm/components/drawer/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/index.js create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/types.js create mode 100644 node_modules/flowbite/lib/esm/components/dropdown/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/index.js create mode 100644 node_modules/flowbite/lib/esm/components/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/modal/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/modal/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/modal/index.js create mode 100644 node_modules/flowbite/lib/esm/components/modal/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/modal/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/modal/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/modal/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/modal/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/modal/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/modal/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/modal/types.js create mode 100644 node_modules/flowbite/lib/esm/components/modal/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/popover/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/popover/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/popover/index.js create mode 100644 node_modules/flowbite/lib/esm/components/popover/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/popover/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/popover/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/popover/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/popover/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/popover/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/popover/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/popover/types.js create mode 100644 node_modules/flowbite/lib/esm/components/popover/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/tabs/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/tabs/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/tabs/index.js create mode 100644 node_modules/flowbite/lib/esm/components/tabs/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/tabs/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/tabs/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/tabs/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/tabs/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/tabs/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/tabs/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/tabs/types.js create mode 100644 node_modules/flowbite/lib/esm/components/tabs/types.js.map create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/index.js create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/index.js.map create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/interface.js create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/interface.js.map create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/types.d.ts create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/types.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/types.js create mode 100644 node_modules/flowbite/lib/esm/components/tooltip/types.js.map create mode 100644 node_modules/flowbite/lib/esm/config/global.d.ts create mode 100644 node_modules/flowbite/lib/esm/config/global.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/config/global.js create mode 100644 node_modules/flowbite/lib/esm/config/global.js.map create mode 100644 node_modules/flowbite/lib/esm/dom/events.d.ts create mode 100644 node_modules/flowbite/lib/esm/dom/events.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/dom/events.js create mode 100644 node_modules/flowbite/lib/esm/dom/events.js.map create mode 100644 node_modules/flowbite/lib/esm/index.d.ts create mode 100644 node_modules/flowbite/lib/esm/index.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/index.js create mode 100644 node_modules/flowbite/lib/esm/index.js.map create mode 100644 node_modules/flowbite/lib/esm/index.phoenix.d.ts create mode 100644 node_modules/flowbite/lib/esm/index.phoenix.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/index.phoenix.js create mode 100644 node_modules/flowbite/lib/esm/index.phoenix.js.map create mode 100644 node_modules/flowbite/lib/esm/index.turbo.d.ts create mode 100644 node_modules/flowbite/lib/esm/index.turbo.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/index.turbo.js create mode 100644 node_modules/flowbite/lib/esm/index.turbo.js.map create mode 100644 node_modules/flowbite/lib/esm/index.umd.d.ts create mode 100644 node_modules/flowbite/lib/esm/index.umd.d.ts.map create mode 100644 node_modules/flowbite/lib/esm/index.umd.js create mode 100644 node_modules/flowbite/lib/esm/index.umd.js.map create mode 100644 node_modules/flowbite/package.json create mode 100644 node_modules/flowbite/plugin-windicss.js create mode 100644 node_modules/flowbite/plugin.d.ts create mode 100644 node_modules/flowbite/plugin.js create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/package.json create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/changelog.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/is-binary-path/index.d.ts create mode 100644 node_modules/is-binary-path/index.js create mode 100644 node_modules/is-binary-path/license create mode 100644 node_modules/is-binary-path/package.json create mode 100644 node_modules/is-binary-path/readme.md create mode 100644 node_modules/is-core-module/.eslintrc create mode 100644 node_modules/is-core-module/.nycrc create mode 100644 node_modules/is-core-module/CHANGELOG.md create mode 100644 node_modules/is-core-module/LICENSE create mode 100644 node_modules/is-core-module/README.md create mode 100644 node_modules/is-core-module/core.json create mode 100644 node_modules/is-core-module/index.js create mode 100644 node_modules/is-core-module/package.json create mode 100644 node_modules/is-core-module/test/index.js create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/jiti/LICENSE create mode 100644 node_modules/jiti/README.md create mode 100644 node_modules/jiti/bin/jiti.js create mode 100644 node_modules/jiti/dist/babel.d.ts create mode 100644 node_modules/jiti/dist/babel.js create mode 100644 node_modules/jiti/dist/jiti.d.ts create mode 100644 node_modules/jiti/dist/jiti.js create mode 100644 node_modules/jiti/dist/plugins/babel-plugin-transform-import-meta.d.ts create mode 100644 node_modules/jiti/dist/plugins/import-meta-env.d.ts create mode 100644 node_modules/jiti/dist/types.d.ts create mode 100644 node_modules/jiti/dist/utils.d.ts create mode 100644 node_modules/jiti/lib/index.js create mode 100644 node_modules/jiti/package.json create mode 100644 node_modules/jiti/register.js create mode 100644 node_modules/lilconfig/LICENSE create mode 100644 node_modules/lilconfig/dist/index.d.ts create mode 100644 node_modules/lilconfig/dist/index.js create mode 100644 node_modules/lilconfig/package.json create mode 100644 node_modules/lilconfig/readme.md create mode 100644 node_modules/lines-and-columns/LICENSE create mode 100644 node_modules/lines-and-columns/README.md create mode 100644 node_modules/lines-and-columns/build/index.d.ts create mode 100644 node_modules/lines-and-columns/build/index.js create mode 100644 node_modules/lines-and-columns/package.json create mode 100644 node_modules/merge2/LICENSE create mode 100644 node_modules/merge2/README.md create mode 100644 node_modules/merge2/index.js create mode 100644 node_modules/merge2/package.json create mode 100644 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100644 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/mini-svg-data-uri/LICENSE create mode 100644 node_modules/mini-svg-data-uri/README.md create mode 100644 node_modules/mini-svg-data-uri/cli.js create mode 100644 node_modules/mini-svg-data-uri/index.d.ts create mode 100644 node_modules/mini-svg-data-uri/index.js create mode 100644 node_modules/mini-svg-data-uri/index.test-d.ts create mode 100644 node_modules/mini-svg-data-uri/package.json create mode 100644 node_modules/mini-svg-data-uri/shorter-css-color-names.js create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/mz/HISTORY.md create mode 100644 node_modules/mz/LICENSE create mode 100644 node_modules/mz/README.md create mode 100644 node_modules/mz/child_process.js create mode 100644 node_modules/mz/crypto.js create mode 100644 node_modules/mz/dns.js create mode 100644 node_modules/mz/fs.js create mode 100644 node_modules/mz/index.js create mode 100644 node_modules/mz/package.json create mode 100644 node_modules/mz/readline.js create mode 100644 node_modules/mz/zlib.js create mode 100644 node_modules/nanoid/LICENSE create mode 100644 node_modules/nanoid/README.md create mode 100644 node_modules/nanoid/async/index.browser.cjs create mode 100644 node_modules/nanoid/async/index.browser.js create mode 100644 node_modules/nanoid/async/index.cjs create mode 100644 node_modules/nanoid/async/index.d.ts create mode 100644 node_modules/nanoid/async/index.js create mode 100644 node_modules/nanoid/async/index.native.js create mode 100644 node_modules/nanoid/async/package.json create mode 100644 node_modules/nanoid/bin/nanoid.cjs create mode 100644 node_modules/nanoid/index.browser.cjs create mode 100644 node_modules/nanoid/index.browser.js create mode 100644 node_modules/nanoid/index.cjs create mode 100644 node_modules/nanoid/index.d.ts create mode 100644 node_modules/nanoid/index.js create mode 100644 node_modules/nanoid/nanoid.js create mode 100644 node_modules/nanoid/non-secure/index.cjs create mode 100644 node_modules/nanoid/non-secure/index.d.ts create mode 100644 node_modules/nanoid/non-secure/index.js create mode 100644 node_modules/nanoid/non-secure/package.json create mode 100644 node_modules/nanoid/package.json create mode 100644 node_modules/nanoid/url-alphabet/index.cjs create mode 100644 node_modules/nanoid/url-alphabet/index.js create mode 100644 node_modules/nanoid/url-alphabet/package.json create mode 100644 node_modules/normalize-path/LICENSE create mode 100644 node_modules/normalize-path/README.md create mode 100644 node_modules/normalize-path/index.js create mode 100644 node_modules/normalize-path/package.json create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/object-hash/LICENSE create mode 100644 node_modules/object-hash/dist/object_hash.js create mode 100644 node_modules/object-hash/index.js create mode 100644 node_modules/object-hash/package.json create mode 100644 node_modules/object-hash/readme.markdown create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/picocolors/LICENSE create mode 100644 node_modules/picocolors/README.md create mode 100644 node_modules/picocolors/package.json create mode 100644 node_modules/picocolors/picocolors.browser.js create mode 100644 node_modules/picocolors/picocolors.d.ts create mode 100644 node_modules/picocolors/picocolors.js create mode 100644 node_modules/picocolors/types.ts create mode 100644 node_modules/picomatch/CHANGELOG.md create mode 100644 node_modules/picomatch/LICENSE create mode 100644 node_modules/picomatch/README.md create mode 100644 node_modules/picomatch/index.js create mode 100644 node_modules/picomatch/lib/constants.js create mode 100644 node_modules/picomatch/lib/parse.js create mode 100644 node_modules/picomatch/lib/picomatch.js create mode 100644 node_modules/picomatch/lib/scan.js create mode 100644 node_modules/picomatch/lib/utils.js create mode 100644 node_modules/picomatch/package.json create mode 100644 node_modules/pify/index.js create mode 100644 node_modules/pify/license create mode 100644 node_modules/pify/package.json create mode 100644 node_modules/pify/readme.md create mode 100644 node_modules/pirates/LICENSE create mode 100644 node_modules/pirates/README.md create mode 100644 node_modules/pirates/index.d.ts create mode 100644 node_modules/pirates/lib/index.js create mode 100644 node_modules/pirates/package.json create mode 100644 node_modules/postcss-import/LICENSE create mode 100644 node_modules/postcss-import/README.md create mode 100644 node_modules/postcss-import/index.js create mode 100644 node_modules/postcss-import/lib/assign-layer-names.js create mode 100644 node_modules/postcss-import/lib/data-url.js create mode 100644 node_modules/postcss-import/lib/join-layer.js create mode 100644 node_modules/postcss-import/lib/join-media.js create mode 100644 node_modules/postcss-import/lib/load-content.js create mode 100644 node_modules/postcss-import/lib/parse-statements.js create mode 100644 node_modules/postcss-import/lib/process-content.js create mode 100644 node_modules/postcss-import/lib/resolve-id.js create mode 100644 node_modules/postcss-import/package.json create mode 100644 node_modules/postcss-js/LICENSE create mode 100644 node_modules/postcss-js/README.md create mode 100644 node_modules/postcss-js/async.js create mode 100644 node_modules/postcss-js/index.js create mode 100644 node_modules/postcss-js/index.mjs create mode 100644 node_modules/postcss-js/objectifier.js create mode 100644 node_modules/postcss-js/package.json create mode 100644 node_modules/postcss-js/parser.js create mode 100644 node_modules/postcss-js/process-result.js create mode 100644 node_modules/postcss-js/sync.js create mode 100644 node_modules/postcss-load-config/LICENSE create mode 100644 node_modules/postcss-load-config/README.md create mode 100644 node_modules/postcss-load-config/package.json create mode 100644 node_modules/postcss-load-config/src/index.d.ts create mode 100644 node_modules/postcss-load-config/src/index.js create mode 100644 node_modules/postcss-load-config/src/options.js create mode 100644 node_modules/postcss-load-config/src/plugins.js create mode 100644 node_modules/postcss-load-config/src/req.js create mode 100644 node_modules/postcss-nested/LICENSE create mode 100644 node_modules/postcss-nested/README.md create mode 100644 node_modules/postcss-nested/index.d.ts create mode 100644 node_modules/postcss-nested/index.js create mode 100644 node_modules/postcss-nested/package.json create mode 100644 node_modules/postcss-selector-parser/API.md create mode 100644 node_modules/postcss-selector-parser/CHANGELOG.md create mode 100644 node_modules/postcss-selector-parser/LICENSE-MIT create mode 100644 node_modules/postcss-selector-parser/README.md create mode 100644 node_modules/postcss-selector-parser/dist/index.js create mode 100644 node_modules/postcss-selector-parser/dist/parser.js create mode 100644 node_modules/postcss-selector-parser/dist/processor.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/attribute.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/className.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/combinator.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/comment.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/constructors.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/container.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/guards.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/id.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/index.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/namespace.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/nesting.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/node.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/pseudo.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/root.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/selector.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/string.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/tag.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/types.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/universal.js create mode 100644 node_modules/postcss-selector-parser/dist/sortAscending.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenTypes.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenize.js create mode 100644 node_modules/postcss-selector-parser/dist/util/ensureObject.js create mode 100644 node_modules/postcss-selector-parser/dist/util/getProp.js create mode 100644 node_modules/postcss-selector-parser/dist/util/index.js create mode 100644 node_modules/postcss-selector-parser/dist/util/stripComments.js create mode 100644 node_modules/postcss-selector-parser/dist/util/unesc.js create mode 100644 node_modules/postcss-selector-parser/package.json create mode 100644 node_modules/postcss-selector-parser/postcss-selector-parser.d.ts create mode 100644 node_modules/postcss-value-parser/LICENSE create mode 100644 node_modules/postcss-value-parser/README.md create mode 100644 node_modules/postcss-value-parser/lib/index.d.ts create mode 100644 node_modules/postcss-value-parser/lib/index.js create mode 100644 node_modules/postcss-value-parser/lib/parse.js create mode 100644 node_modules/postcss-value-parser/lib/stringify.js create mode 100644 node_modules/postcss-value-parser/lib/unit.js create mode 100644 node_modules/postcss-value-parser/lib/walk.js create mode 100644 node_modules/postcss-value-parser/package.json create mode 100644 node_modules/postcss/LICENSE create mode 100644 node_modules/postcss/README.md create mode 100644 node_modules/postcss/lib/at-rule.d.ts create mode 100644 node_modules/postcss/lib/at-rule.js create mode 100644 node_modules/postcss/lib/comment.d.ts create mode 100644 node_modules/postcss/lib/comment.js create mode 100644 node_modules/postcss/lib/container.d.ts create mode 100644 node_modules/postcss/lib/container.js create mode 100644 node_modules/postcss/lib/css-syntax-error.d.ts create mode 100644 node_modules/postcss/lib/css-syntax-error.js create mode 100644 node_modules/postcss/lib/declaration.d.ts create mode 100644 node_modules/postcss/lib/declaration.js create mode 100644 node_modules/postcss/lib/document.d.ts create mode 100644 node_modules/postcss/lib/document.js create mode 100644 node_modules/postcss/lib/fromJSON.d.ts create mode 100644 node_modules/postcss/lib/fromJSON.js create mode 100644 node_modules/postcss/lib/input.d.ts create mode 100644 node_modules/postcss/lib/input.js create mode 100644 node_modules/postcss/lib/lazy-result.d.ts create mode 100644 node_modules/postcss/lib/lazy-result.js create mode 100644 node_modules/postcss/lib/list.d.ts create mode 100644 node_modules/postcss/lib/list.js create mode 100644 node_modules/postcss/lib/map-generator.js create mode 100644 node_modules/postcss/lib/no-work-result.d.ts create mode 100644 node_modules/postcss/lib/no-work-result.js create mode 100644 node_modules/postcss/lib/node.d.ts create mode 100644 node_modules/postcss/lib/node.js create mode 100644 node_modules/postcss/lib/parse.d.ts create mode 100644 node_modules/postcss/lib/parse.js create mode 100644 node_modules/postcss/lib/parser.js create mode 100644 node_modules/postcss/lib/postcss.d.mts create mode 100644 node_modules/postcss/lib/postcss.d.ts create mode 100644 node_modules/postcss/lib/postcss.js create mode 100644 node_modules/postcss/lib/postcss.mjs create mode 100644 node_modules/postcss/lib/previous-map.d.ts create mode 100644 node_modules/postcss/lib/previous-map.js create mode 100644 node_modules/postcss/lib/processor.d.ts create mode 100644 node_modules/postcss/lib/processor.js create mode 100644 node_modules/postcss/lib/result.d.ts create mode 100644 node_modules/postcss/lib/result.js create mode 100644 node_modules/postcss/lib/root.d.ts create mode 100644 node_modules/postcss/lib/root.js create mode 100644 node_modules/postcss/lib/rule.d.ts create mode 100644 node_modules/postcss/lib/rule.js create mode 100644 node_modules/postcss/lib/stringifier.d.ts create mode 100644 node_modules/postcss/lib/stringifier.js create mode 100644 node_modules/postcss/lib/stringify.d.ts create mode 100644 node_modules/postcss/lib/stringify.js create mode 100644 node_modules/postcss/lib/symbols.js create mode 100644 node_modules/postcss/lib/terminal-highlight.js create mode 100644 node_modules/postcss/lib/tokenize.js create mode 100644 node_modules/postcss/lib/warn-once.js create mode 100644 node_modules/postcss/lib/warning.d.ts create mode 100644 node_modules/postcss/lib/warning.js create mode 100644 node_modules/postcss/package.json create mode 100644 node_modules/queue-microtask/LICENSE create mode 100644 node_modules/queue-microtask/README.md create mode 100644 node_modules/queue-microtask/index.d.ts create mode 100644 node_modules/queue-microtask/index.js create mode 100644 node_modules/queue-microtask/package.json create mode 100644 node_modules/read-cache/LICENSE create mode 100644 node_modules/read-cache/README.md create mode 100644 node_modules/read-cache/index.js create mode 100644 node_modules/read-cache/package.json create mode 100644 node_modules/readdirp/LICENSE create mode 100644 node_modules/readdirp/README.md create mode 100644 node_modules/readdirp/index.d.ts create mode 100644 node_modules/readdirp/index.js create mode 100644 node_modules/readdirp/package.json create mode 100644 node_modules/resolve/.editorconfig create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.github/FUNDING.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/SECURITY.md create mode 100644 node_modules/resolve/async.js create mode 100644 node_modules/resolve/bin/resolve create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/core.js create mode 100644 node_modules/resolve/lib/core.json create mode 100644 node_modules/resolve/lib/homedir.js create mode 100644 node_modules/resolve/lib/is-core.js create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/sync.js create mode 100644 node_modules/resolve/test/core.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/home_paths.js create mode 100644 node_modules/resolve/test/home_paths_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/false_main/index.js create mode 100644 node_modules/resolve/test/resolver/false_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/reusify/.coveralls.yml create mode 100644 node_modules/reusify/.travis.yml create mode 100644 node_modules/reusify/LICENSE create mode 100644 node_modules/reusify/README.md create mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js create mode 100644 node_modules/reusify/benchmarks/fib.js create mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js create mode 100644 node_modules/reusify/package.json create mode 100644 node_modules/reusify/reusify.js create mode 100644 node_modules/reusify/test.js create mode 100644 node_modules/run-parallel/LICENSE create mode 100644 node_modules/run-parallel/README.md create mode 100644 node_modules/run-parallel/index.js create mode 100644 node_modules/run-parallel/package.json create mode 100644 node_modules/source-map-js/CHANGELOG.md create mode 100644 node_modules/source-map-js/LICENSE create mode 100644 node_modules/source-map-js/README.md create mode 100644 node_modules/source-map-js/lib/array-set.js create mode 100644 node_modules/source-map-js/lib/base64-vlq.js create mode 100644 node_modules/source-map-js/lib/base64.js create mode 100644 node_modules/source-map-js/lib/binary-search.js create mode 100644 node_modules/source-map-js/lib/mapping-list.js create mode 100644 node_modules/source-map-js/lib/quick-sort.js create mode 100644 node_modules/source-map-js/lib/source-map-consumer.js create mode 100644 node_modules/source-map-js/lib/source-map-generator.js create mode 100644 node_modules/source-map-js/lib/source-node.js create mode 100644 node_modules/source-map-js/lib/util.js create mode 100644 node_modules/source-map-js/package.json create mode 100644 node_modules/source-map-js/source-map.d.ts create mode 100644 node_modules/source-map-js/source-map.js create mode 100644 node_modules/sucrase/LICENSE create mode 100644 node_modules/sucrase/README.md create mode 100644 node_modules/sucrase/bin/sucrase create mode 100644 node_modules/sucrase/bin/sucrase-node create mode 100644 node_modules/sucrase/dist/CJSImportProcessor.js create mode 100644 node_modules/sucrase/dist/HelperManager.js create mode 100644 node_modules/sucrase/dist/NameManager.js create mode 100644 node_modules/sucrase/dist/Options-gen-types.js create mode 100644 node_modules/sucrase/dist/Options.js create mode 100644 node_modules/sucrase/dist/TokenProcessor.js create mode 100644 node_modules/sucrase/dist/cli.js create mode 100644 node_modules/sucrase/dist/computeSourceMap.js create mode 100644 node_modules/sucrase/dist/esm/CJSImportProcessor.js create mode 100644 node_modules/sucrase/dist/esm/HelperManager.js create mode 100644 node_modules/sucrase/dist/esm/NameManager.js create mode 100644 node_modules/sucrase/dist/esm/Options-gen-types.js create mode 100644 node_modules/sucrase/dist/esm/Options.js create mode 100644 node_modules/sucrase/dist/esm/TokenProcessor.js create mode 100644 node_modules/sucrase/dist/esm/cli.js create mode 100644 node_modules/sucrase/dist/esm/computeSourceMap.js create mode 100644 node_modules/sucrase/dist/esm/identifyShadowedGlobals.js create mode 100644 node_modules/sucrase/dist/esm/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/flow.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/types.js create mode 100644 node_modules/sucrase/dist/esm/parser/plugins/typescript.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/state.js create mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/types.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/base.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/expression.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/index.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/lval.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/statement.js create mode 100644 node_modules/sucrase/dist/esm/parser/traverser/util.js create mode 100644 node_modules/sucrase/dist/esm/parser/util/charcodes.js create mode 100644 node_modules/sucrase/dist/esm/parser/util/identifier.js create mode 100644 node_modules/sucrase/dist/esm/parser/util/whitespace.js create mode 100644 node_modules/sucrase/dist/esm/register.js create mode 100644 node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/FlowTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/JSXTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/RootTransformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/Transformer.js create mode 100644 node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js create mode 100644 node_modules/sucrase/dist/esm/util/elideImportEquals.js create mode 100644 node_modules/sucrase/dist/esm/util/formatTokens.js create mode 100644 node_modules/sucrase/dist/esm/util/getClassInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getDeclarationInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getIdentifierNames.js create mode 100644 node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js create mode 100644 node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js create mode 100644 node_modules/sucrase/dist/esm/util/getTSImportedNames.js create mode 100644 node_modules/sucrase/dist/esm/util/isAsyncOperation.js create mode 100644 node_modules/sucrase/dist/esm/util/isExportFrom.js create mode 100644 node_modules/sucrase/dist/esm/util/isIdentifier.js create mode 100644 node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js create mode 100644 node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js create mode 100644 node_modules/sucrase/dist/identifyShadowedGlobals.js create mode 100644 node_modules/sucrase/dist/index.js create mode 100644 node_modules/sucrase/dist/parser/index.js create mode 100644 node_modules/sucrase/dist/parser/plugins/flow.js create mode 100644 node_modules/sucrase/dist/parser/plugins/jsx/index.js create mode 100644 node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js create mode 100644 node_modules/sucrase/dist/parser/plugins/types.js create mode 100644 node_modules/sucrase/dist/parser/plugins/typescript.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/index.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/keywords.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/readWord.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/readWordTree.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/state.js create mode 100644 node_modules/sucrase/dist/parser/tokenizer/types.js create mode 100644 node_modules/sucrase/dist/parser/traverser/base.js create mode 100644 node_modules/sucrase/dist/parser/traverser/expression.js create mode 100644 node_modules/sucrase/dist/parser/traverser/index.js create mode 100644 node_modules/sucrase/dist/parser/traverser/lval.js create mode 100644 node_modules/sucrase/dist/parser/traverser/statement.js create mode 100644 node_modules/sucrase/dist/parser/traverser/util.js create mode 100644 node_modules/sucrase/dist/parser/util/charcodes.js create mode 100644 node_modules/sucrase/dist/parser/util/identifier.js create mode 100644 node_modules/sucrase/dist/parser/util/whitespace.js create mode 100644 node_modules/sucrase/dist/register.js create mode 100644 node_modules/sucrase/dist/transformers/CJSImportTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/ESMImportTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/FlowTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/JSXTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/JestHoistTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/RootTransformer.js create mode 100644 node_modules/sucrase/dist/transformers/Transformer.js create mode 100644 node_modules/sucrase/dist/transformers/TypeScriptTransformer.js create mode 100644 node_modules/sucrase/dist/types/CJSImportProcessor.d.ts create mode 100644 node_modules/sucrase/dist/types/HelperManager.d.ts create mode 100644 node_modules/sucrase/dist/types/NameManager.d.ts create mode 100644 node_modules/sucrase/dist/types/Options-gen-types.d.ts create mode 100644 node_modules/sucrase/dist/types/Options.d.ts create mode 100644 node_modules/sucrase/dist/types/TokenProcessor.d.ts create mode 100644 node_modules/sucrase/dist/types/cli.d.ts create mode 100644 node_modules/sucrase/dist/types/computeSourceMap.d.ts create mode 100644 node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts create mode 100644 node_modules/sucrase/dist/types/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/flow.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/types.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/base.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/expression.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/index.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/lval.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/statement.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/traverser/util.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/util/charcodes.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/util/identifier.d.ts create mode 100644 node_modules/sucrase/dist/types/parser/util/whitespace.d.ts create mode 100644 node_modules/sucrase/dist/types/register.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/Transformer.d.ts create mode 100644 node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts create mode 100644 node_modules/sucrase/dist/types/util/elideImportEquals.d.ts create mode 100644 node_modules/sucrase/dist/types/util/formatTokens.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getClassInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts create mode 100644 node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts create mode 100644 node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts create mode 100644 node_modules/sucrase/dist/types/util/isExportFrom.d.ts create mode 100644 node_modules/sucrase/dist/types/util/isIdentifier.d.ts create mode 100644 node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts create mode 100644 node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts create mode 100644 node_modules/sucrase/dist/util/elideImportEquals.js create mode 100644 node_modules/sucrase/dist/util/formatTokens.js create mode 100644 node_modules/sucrase/dist/util/getClassInfo.js create mode 100644 node_modules/sucrase/dist/util/getDeclarationInfo.js create mode 100644 node_modules/sucrase/dist/util/getIdentifierNames.js create mode 100644 node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js create mode 100644 node_modules/sucrase/dist/util/getJSXPragmaInfo.js create mode 100644 node_modules/sucrase/dist/util/getNonTypeIdentifiers.js create mode 100644 node_modules/sucrase/dist/util/getTSImportedNames.js create mode 100644 node_modules/sucrase/dist/util/isAsyncOperation.js create mode 100644 node_modules/sucrase/dist/util/isExportFrom.js create mode 100644 node_modules/sucrase/dist/util/isIdentifier.js create mode 100644 node_modules/sucrase/dist/util/removeMaybeImportAttributes.js create mode 100644 node_modules/sucrase/dist/util/shouldElideDefaultExport.js create mode 100644 node_modules/sucrase/package.json create mode 100644 node_modules/sucrase/register/index.js create mode 100644 node_modules/sucrase/register/js.js create mode 100644 node_modules/sucrase/register/jsx.js create mode 100644 node_modules/sucrase/register/ts-legacy-module-interop.js create mode 100644 node_modules/sucrase/register/ts.js create mode 100644 node_modules/sucrase/register/tsx-legacy-module-interop.js create mode 100644 node_modules/sucrase/register/tsx.js create mode 100644 node_modules/sucrase/ts-node-plugin/index.js create mode 100644 node_modules/supports-preserve-symlinks-flag/.eslintrc create mode 100644 node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml create mode 100644 node_modules/supports-preserve-symlinks-flag/.nycrc create mode 100644 node_modules/supports-preserve-symlinks-flag/CHANGELOG.md create mode 100644 node_modules/supports-preserve-symlinks-flag/LICENSE create mode 100644 node_modules/supports-preserve-symlinks-flag/README.md create mode 100644 node_modules/supports-preserve-symlinks-flag/browser.js create mode 100644 node_modules/supports-preserve-symlinks-flag/index.js create mode 100644 node_modules/supports-preserve-symlinks-flag/package.json create mode 100644 node_modules/supports-preserve-symlinks-flag/test/index.js create mode 100644 node_modules/tailwindcss/CHANGELOG.md create mode 100644 node_modules/tailwindcss/LICENSE create mode 100644 node_modules/tailwindcss/README.md create mode 100644 node_modules/tailwindcss/base.css create mode 100644 node_modules/tailwindcss/colors.d.ts create mode 100644 node_modules/tailwindcss/colors.js create mode 100644 node_modules/tailwindcss/components.css create mode 100644 node_modules/tailwindcss/defaultConfig.d.ts create mode 100644 node_modules/tailwindcss/defaultConfig.js create mode 100644 node_modules/tailwindcss/defaultTheme.d.ts create mode 100644 node_modules/tailwindcss/defaultTheme.js create mode 100644 node_modules/tailwindcss/lib/cli-peer-dependencies.js create mode 100644 node_modules/tailwindcss/lib/cli.js create mode 100644 node_modules/tailwindcss/lib/cli/build/deps.js create mode 100644 node_modules/tailwindcss/lib/cli/build/index.js create mode 100644 node_modules/tailwindcss/lib/cli/build/plugin.js create mode 100644 node_modules/tailwindcss/lib/cli/build/utils.js create mode 100644 node_modules/tailwindcss/lib/cli/build/watching.js create mode 100644 node_modules/tailwindcss/lib/cli/help/index.js create mode 100644 node_modules/tailwindcss/lib/cli/index.js create mode 100644 node_modules/tailwindcss/lib/cli/init/index.js create mode 100644 node_modules/tailwindcss/lib/corePluginList.js create mode 100644 node_modules/tailwindcss/lib/corePlugins.js create mode 100644 node_modules/tailwindcss/lib/css/LICENSE create mode 100644 node_modules/tailwindcss/lib/css/preflight.css create mode 100644 node_modules/tailwindcss/lib/featureFlags.js create mode 100644 node_modules/tailwindcss/lib/index.js create mode 100644 node_modules/tailwindcss/lib/lib/cacheInvalidation.js create mode 100644 node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js create mode 100644 node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js create mode 100644 node_modules/tailwindcss/lib/lib/content.js create mode 100644 node_modules/tailwindcss/lib/lib/defaultExtractor.js create mode 100644 node_modules/tailwindcss/lib/lib/detectNesting.js create mode 100644 node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js create mode 100644 node_modules/tailwindcss/lib/lib/expandApplyAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/findAtConfigPath.js create mode 100644 node_modules/tailwindcss/lib/lib/generateRules.js create mode 100644 node_modules/tailwindcss/lib/lib/getModuleDependencies.js create mode 100644 node_modules/tailwindcss/lib/lib/load-config.js create mode 100644 node_modules/tailwindcss/lib/lib/normalizeTailwindDirectives.js create mode 100644 node_modules/tailwindcss/lib/lib/offsets.js create mode 100644 node_modules/tailwindcss/lib/lib/partitionApplyAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/regex.js create mode 100644 node_modules/tailwindcss/lib/lib/remap-bitfield.js create mode 100644 node_modules/tailwindcss/lib/lib/resolveDefaultsAtRules.js create mode 100644 node_modules/tailwindcss/lib/lib/setupContextUtils.js create mode 100644 node_modules/tailwindcss/lib/lib/setupTrackingContext.js create mode 100644 node_modules/tailwindcss/lib/lib/sharedState.js create mode 100644 node_modules/tailwindcss/lib/lib/substituteScreenAtRules.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/build/deps.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/build/index.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/build/plugin.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/build/utils.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/build/watching.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/help/index.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/index.js create mode 100644 node_modules/tailwindcss/lib/oxide/cli/init/index.js create mode 100644 node_modules/tailwindcss/lib/oxide/postcss-plugin.js create mode 100644 node_modules/tailwindcss/lib/plugin.js create mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/README.md create mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/index.js create mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/plugin.js create mode 100644 node_modules/tailwindcss/lib/processTailwindFeatures.js create mode 100644 node_modules/tailwindcss/lib/public/colors.js create mode 100644 node_modules/tailwindcss/lib/public/create-plugin.js create mode 100644 node_modules/tailwindcss/lib/public/default-config.js create mode 100644 node_modules/tailwindcss/lib/public/default-theme.js create mode 100644 node_modules/tailwindcss/lib/public/load-config.js create mode 100644 node_modules/tailwindcss/lib/public/resolve-config.js create mode 100644 node_modules/tailwindcss/lib/util/applyImportantSelector.js create mode 100644 node_modules/tailwindcss/lib/util/bigSign.js create mode 100644 node_modules/tailwindcss/lib/util/buildMediaQuery.js create mode 100644 node_modules/tailwindcss/lib/util/cloneDeep.js create mode 100644 node_modules/tailwindcss/lib/util/cloneNodes.js create mode 100644 node_modules/tailwindcss/lib/util/color.js create mode 100644 node_modules/tailwindcss/lib/util/colorNames.js create mode 100644 node_modules/tailwindcss/lib/util/configurePlugins.js create mode 100644 node_modules/tailwindcss/lib/util/createPlugin.js create mode 100644 node_modules/tailwindcss/lib/util/createUtilityPlugin.js create mode 100644 node_modules/tailwindcss/lib/util/dataTypes.js create mode 100644 node_modules/tailwindcss/lib/util/defaults.js create mode 100644 node_modules/tailwindcss/lib/util/escapeClassName.js create mode 100644 node_modules/tailwindcss/lib/util/escapeCommas.js create mode 100644 node_modules/tailwindcss/lib/util/flattenColorPalette.js create mode 100644 node_modules/tailwindcss/lib/util/formatVariantSelector.js create mode 100644 node_modules/tailwindcss/lib/util/getAllConfigs.js create mode 100644 node_modules/tailwindcss/lib/util/hashConfig.js create mode 100644 node_modules/tailwindcss/lib/util/isKeyframeRule.js create mode 100644 node_modules/tailwindcss/lib/util/isPlainObject.js create mode 100644 node_modules/tailwindcss/lib/util/isSyntacticallyValidPropertyValue.js create mode 100644 node_modules/tailwindcss/lib/util/log.js create mode 100644 node_modules/tailwindcss/lib/util/nameClass.js create mode 100644 node_modules/tailwindcss/lib/util/negateValue.js create mode 100644 node_modules/tailwindcss/lib/util/normalizeConfig.js create mode 100644 node_modules/tailwindcss/lib/util/normalizeScreens.js create mode 100644 node_modules/tailwindcss/lib/util/parseAnimationValue.js create mode 100644 node_modules/tailwindcss/lib/util/parseBoxShadowValue.js create mode 100644 node_modules/tailwindcss/lib/util/parseDependency.js create mode 100644 node_modules/tailwindcss/lib/util/parseGlob.js create mode 100644 node_modules/tailwindcss/lib/util/parseObjectStyles.js create mode 100644 node_modules/tailwindcss/lib/util/pluginUtils.js create mode 100644 node_modules/tailwindcss/lib/util/prefixSelector.js create mode 100644 node_modules/tailwindcss/lib/util/pseudoElements.js create mode 100644 node_modules/tailwindcss/lib/util/removeAlphaVariables.js create mode 100644 node_modules/tailwindcss/lib/util/resolveConfig.js create mode 100644 node_modules/tailwindcss/lib/util/resolveConfigPath.js create mode 100644 node_modules/tailwindcss/lib/util/responsive.js create mode 100644 node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js create mode 100644 node_modules/tailwindcss/lib/util/tap.js create mode 100644 node_modules/tailwindcss/lib/util/toColorValue.js create mode 100644 node_modules/tailwindcss/lib/util/toPath.js create mode 100644 node_modules/tailwindcss/lib/util/transformThemeValue.js create mode 100644 node_modules/tailwindcss/lib/util/validateConfig.js create mode 100644 node_modules/tailwindcss/lib/util/validateFormalSyntax.js create mode 100644 node_modules/tailwindcss/lib/util/withAlphaVariable.js create mode 100644 node_modules/tailwindcss/lib/value-parser/LICENSE create mode 100644 node_modules/tailwindcss/lib/value-parser/README.md create mode 100644 node_modules/tailwindcss/lib/value-parser/index.d.js create mode 100644 node_modules/tailwindcss/lib/value-parser/index.js create mode 100644 node_modules/tailwindcss/lib/value-parser/parse.js create mode 100644 node_modules/tailwindcss/lib/value-parser/stringify.js create mode 100644 node_modules/tailwindcss/lib/value-parser/unit.js create mode 100644 node_modules/tailwindcss/lib/value-parser/walk.js create mode 100644 node_modules/tailwindcss/loadConfig.d.ts create mode 100644 node_modules/tailwindcss/loadConfig.js create mode 100644 node_modules/tailwindcss/nesting/index.js create mode 100644 node_modules/tailwindcss/package.json create mode 100644 node_modules/tailwindcss/peers/index.js create mode 100644 node_modules/tailwindcss/plugin.d.ts create mode 100644 node_modules/tailwindcss/plugin.js create mode 100644 node_modules/tailwindcss/prettier.config.js create mode 100644 node_modules/tailwindcss/resolveConfig.d.ts create mode 100644 node_modules/tailwindcss/resolveConfig.js create mode 100644 node_modules/tailwindcss/screens.css create mode 100644 node_modules/tailwindcss/scripts/create-plugin-list.js create mode 100644 node_modules/tailwindcss/scripts/generate-types.js create mode 100644 node_modules/tailwindcss/scripts/release-channel.js create mode 100644 node_modules/tailwindcss/scripts/release-notes.js create mode 100644 node_modules/tailwindcss/scripts/swap-engines.js create mode 100644 node_modules/tailwindcss/scripts/type-utils.js create mode 100644 node_modules/tailwindcss/src/cli-peer-dependencies.js create mode 100644 node_modules/tailwindcss/src/cli.js create mode 100644 node_modules/tailwindcss/src/cli/build/deps.js create mode 100644 node_modules/tailwindcss/src/cli/build/index.js create mode 100644 node_modules/tailwindcss/src/cli/build/plugin.js create mode 100644 node_modules/tailwindcss/src/cli/build/utils.js create mode 100644 node_modules/tailwindcss/src/cli/build/watching.js create mode 100644 node_modules/tailwindcss/src/cli/help/index.js create mode 100644 node_modules/tailwindcss/src/cli/index.js create mode 100644 node_modules/tailwindcss/src/cli/init/index.js create mode 100644 node_modules/tailwindcss/src/corePluginList.js create mode 100644 node_modules/tailwindcss/src/corePlugins.js create mode 100644 node_modules/tailwindcss/src/css/LICENSE create mode 100644 node_modules/tailwindcss/src/css/preflight.css create mode 100644 node_modules/tailwindcss/src/featureFlags.js create mode 100644 node_modules/tailwindcss/src/index.js create mode 100644 node_modules/tailwindcss/src/lib/cacheInvalidation.js create mode 100644 node_modules/tailwindcss/src/lib/collapseAdjacentRules.js create mode 100644 node_modules/tailwindcss/src/lib/collapseDuplicateDeclarations.js create mode 100644 node_modules/tailwindcss/src/lib/content.js create mode 100644 node_modules/tailwindcss/src/lib/defaultExtractor.js create mode 100644 node_modules/tailwindcss/src/lib/detectNesting.js create mode 100644 node_modules/tailwindcss/src/lib/evaluateTailwindFunctions.js create mode 100644 node_modules/tailwindcss/src/lib/expandApplyAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/expandTailwindAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/findAtConfigPath.js create mode 100644 node_modules/tailwindcss/src/lib/generateRules.js create mode 100644 node_modules/tailwindcss/src/lib/getModuleDependencies.js create mode 100644 node_modules/tailwindcss/src/lib/load-config.ts create mode 100644 node_modules/tailwindcss/src/lib/normalizeTailwindDirectives.js create mode 100644 node_modules/tailwindcss/src/lib/offsets.js create mode 100644 node_modules/tailwindcss/src/lib/partitionApplyAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/regex.js create mode 100644 node_modules/tailwindcss/src/lib/remap-bitfield.js create mode 100644 node_modules/tailwindcss/src/lib/resolveDefaultsAtRules.js create mode 100644 node_modules/tailwindcss/src/lib/setupContextUtils.js create mode 100644 node_modules/tailwindcss/src/lib/setupTrackingContext.js create mode 100644 node_modules/tailwindcss/src/lib/sharedState.js create mode 100644 node_modules/tailwindcss/src/lib/substituteScreenAtRules.js create mode 100644 node_modules/tailwindcss/src/oxide/cli.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/build/deps.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/build/index.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/build/plugin.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/build/utils.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/build/watching.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/help/index.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/index.ts create mode 100644 node_modules/tailwindcss/src/oxide/cli/init/index.ts create mode 100644 node_modules/tailwindcss/src/oxide/postcss-plugin.ts create mode 100644 node_modules/tailwindcss/src/plugin.js create mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/README.md create mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/index.js create mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/plugin.js create mode 100644 node_modules/tailwindcss/src/processTailwindFeatures.js create mode 100644 node_modules/tailwindcss/src/public/colors.js create mode 100644 node_modules/tailwindcss/src/public/create-plugin.js create mode 100644 node_modules/tailwindcss/src/public/default-config.js create mode 100644 node_modules/tailwindcss/src/public/default-theme.js create mode 100644 node_modules/tailwindcss/src/public/load-config.js create mode 100644 node_modules/tailwindcss/src/public/resolve-config.js create mode 100644 node_modules/tailwindcss/src/util/applyImportantSelector.js create mode 100644 node_modules/tailwindcss/src/util/bigSign.js create mode 100644 node_modules/tailwindcss/src/util/buildMediaQuery.js create mode 100644 node_modules/tailwindcss/src/util/cloneDeep.js create mode 100644 node_modules/tailwindcss/src/util/cloneNodes.js create mode 100644 node_modules/tailwindcss/src/util/color.js create mode 100644 node_modules/tailwindcss/src/util/colorNames.js create mode 100644 node_modules/tailwindcss/src/util/configurePlugins.js create mode 100644 node_modules/tailwindcss/src/util/createPlugin.js create mode 100644 node_modules/tailwindcss/src/util/createUtilityPlugin.js create mode 100644 node_modules/tailwindcss/src/util/dataTypes.js create mode 100644 node_modules/tailwindcss/src/util/defaults.js create mode 100644 node_modules/tailwindcss/src/util/escapeClassName.js create mode 100644 node_modules/tailwindcss/src/util/escapeCommas.js create mode 100644 node_modules/tailwindcss/src/util/flattenColorPalette.js create mode 100644 node_modules/tailwindcss/src/util/formatVariantSelector.js create mode 100644 node_modules/tailwindcss/src/util/getAllConfigs.js create mode 100644 node_modules/tailwindcss/src/util/hashConfig.js create mode 100644 node_modules/tailwindcss/src/util/isKeyframeRule.js create mode 100644 node_modules/tailwindcss/src/util/isPlainObject.js create mode 100644 node_modules/tailwindcss/src/util/isSyntacticallyValidPropertyValue.js create mode 100644 node_modules/tailwindcss/src/util/log.js create mode 100644 node_modules/tailwindcss/src/util/nameClass.js create mode 100644 node_modules/tailwindcss/src/util/negateValue.js create mode 100644 node_modules/tailwindcss/src/util/normalizeConfig.js create mode 100644 node_modules/tailwindcss/src/util/normalizeScreens.js create mode 100644 node_modules/tailwindcss/src/util/parseAnimationValue.js create mode 100644 node_modules/tailwindcss/src/util/parseBoxShadowValue.js create mode 100644 node_modules/tailwindcss/src/util/parseDependency.js create mode 100644 node_modules/tailwindcss/src/util/parseGlob.js create mode 100644 node_modules/tailwindcss/src/util/parseObjectStyles.js create mode 100644 node_modules/tailwindcss/src/util/pluginUtils.js create mode 100644 node_modules/tailwindcss/src/util/prefixSelector.js create mode 100644 node_modules/tailwindcss/src/util/pseudoElements.js create mode 100644 node_modules/tailwindcss/src/util/removeAlphaVariables.js create mode 100644 node_modules/tailwindcss/src/util/resolveConfig.js create mode 100644 node_modules/tailwindcss/src/util/resolveConfigPath.js create mode 100644 node_modules/tailwindcss/src/util/responsive.js create mode 100644 node_modules/tailwindcss/src/util/splitAtTopLevelOnly.js create mode 100644 node_modules/tailwindcss/src/util/tap.js create mode 100644 node_modules/tailwindcss/src/util/toColorValue.js create mode 100644 node_modules/tailwindcss/src/util/toPath.js create mode 100644 node_modules/tailwindcss/src/util/transformThemeValue.js create mode 100644 node_modules/tailwindcss/src/util/validateConfig.js create mode 100644 node_modules/tailwindcss/src/util/validateFormalSyntax.js create mode 100644 node_modules/tailwindcss/src/util/withAlphaVariable.js create mode 100644 node_modules/tailwindcss/src/value-parser/LICENSE create mode 100644 node_modules/tailwindcss/src/value-parser/README.md create mode 100644 node_modules/tailwindcss/src/value-parser/index.d.ts create mode 100644 node_modules/tailwindcss/src/value-parser/index.js create mode 100644 node_modules/tailwindcss/src/value-parser/parse.js create mode 100644 node_modules/tailwindcss/src/value-parser/stringify.js create mode 100644 node_modules/tailwindcss/src/value-parser/unit.js create mode 100644 node_modules/tailwindcss/src/value-parser/walk.js create mode 100644 node_modules/tailwindcss/stubs/.npmignore create mode 100644 node_modules/tailwindcss/stubs/.prettierrc.json create mode 100644 node_modules/tailwindcss/stubs/config.full.js create mode 100644 node_modules/tailwindcss/stubs/config.simple.js create mode 100644 node_modules/tailwindcss/stubs/postcss.config.cjs create mode 100644 node_modules/tailwindcss/stubs/postcss.config.js create mode 100644 node_modules/tailwindcss/stubs/tailwind.config.cjs create mode 100644 node_modules/tailwindcss/stubs/tailwind.config.js create mode 100644 node_modules/tailwindcss/stubs/tailwind.config.ts create mode 100644 node_modules/tailwindcss/tailwind.css create mode 100644 node_modules/tailwindcss/types/config.d.ts create mode 100644 node_modules/tailwindcss/types/generated/.gitkeep create mode 100644 node_modules/tailwindcss/types/generated/colors.d.ts create mode 100644 node_modules/tailwindcss/types/generated/corePluginList.d.ts create mode 100644 node_modules/tailwindcss/types/generated/default-theme.d.ts create mode 100644 node_modules/tailwindcss/types/index.d.ts create mode 100644 node_modules/tailwindcss/utilities.css create mode 100644 node_modules/tailwindcss/variants.css create mode 100644 node_modules/thenify-all/History.md create mode 100644 node_modules/thenify-all/LICENSE create mode 100644 node_modules/thenify-all/README.md create mode 100644 node_modules/thenify-all/index.js create mode 100644 node_modules/thenify-all/package.json create mode 100644 node_modules/thenify/History.md create mode 100644 node_modules/thenify/LICENSE create mode 100644 node_modules/thenify/README.md create mode 100644 node_modules/thenify/index.js create mode 100644 node_modules/thenify/package.json create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/ts-interface-checker/LICENSE create mode 100644 node_modules/ts-interface-checker/README.md create mode 100644 node_modules/ts-interface-checker/dist/index.d.ts create mode 100644 node_modules/ts-interface-checker/dist/index.js create mode 100644 node_modules/ts-interface-checker/dist/types.d.ts create mode 100644 node_modules/ts-interface-checker/dist/types.js create mode 100644 node_modules/ts-interface-checker/dist/util.d.ts create mode 100644 node_modules/ts-interface-checker/dist/util.js create mode 100644 node_modules/ts-interface-checker/package.json create mode 100644 node_modules/util-deprecate/History.md create mode 100644 node_modules/util-deprecate/LICENSE create mode 100644 node_modules/util-deprecate/README.md create mode 100644 node_modules/util-deprecate/browser.js create mode 100644 node_modules/util-deprecate/node.js create mode 100644 node_modules/util-deprecate/package.json create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/yaml/LICENSE create mode 100644 node_modules/yaml/README.md create mode 100644 node_modules/yaml/browser/dist/compose/compose-collection.js create mode 100644 node_modules/yaml/browser/dist/compose/compose-doc.js create mode 100644 node_modules/yaml/browser/dist/compose/compose-node.js create mode 100644 node_modules/yaml/browser/dist/compose/compose-scalar.js create mode 100644 node_modules/yaml/browser/dist/compose/composer.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-block-map.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-block-scalar.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-block-seq.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-end.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-flow-collection.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js create mode 100644 node_modules/yaml/browser/dist/compose/resolve-props.js create mode 100644 node_modules/yaml/browser/dist/compose/util-contains-newline.js create mode 100644 node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js create mode 100644 node_modules/yaml/browser/dist/compose/util-flow-indent-check.js create mode 100644 node_modules/yaml/browser/dist/compose/util-map-includes.js create mode 100644 node_modules/yaml/browser/dist/doc/Document.js create mode 100644 node_modules/yaml/browser/dist/doc/anchors.js create mode 100644 node_modules/yaml/browser/dist/doc/applyReviver.js create mode 100644 node_modules/yaml/browser/dist/doc/createNode.js create mode 100644 node_modules/yaml/browser/dist/doc/directives.js create mode 100644 node_modules/yaml/browser/dist/errors.js create mode 100644 node_modules/yaml/browser/dist/index.js create mode 100644 node_modules/yaml/browser/dist/log.js create mode 100644 node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js create mode 100644 node_modules/yaml/browser/dist/nodes/Alias.js create mode 100644 node_modules/yaml/browser/dist/nodes/Collection.js create mode 100644 node_modules/yaml/browser/dist/nodes/Node.js create mode 100644 node_modules/yaml/browser/dist/nodes/Pair.js create mode 100644 node_modules/yaml/browser/dist/nodes/Scalar.js create mode 100644 node_modules/yaml/browser/dist/nodes/YAMLMap.js create mode 100644 node_modules/yaml/browser/dist/nodes/YAMLSeq.js create mode 100644 node_modules/yaml/browser/dist/nodes/addPairToJSMap.js create mode 100644 node_modules/yaml/browser/dist/nodes/identity.js create mode 100644 node_modules/yaml/browser/dist/nodes/toJS.js create mode 100644 node_modules/yaml/browser/dist/parse/cst-scalar.js create mode 100644 node_modules/yaml/browser/dist/parse/cst-stringify.js create mode 100644 node_modules/yaml/browser/dist/parse/cst-visit.js create mode 100644 node_modules/yaml/browser/dist/parse/cst.js create mode 100644 node_modules/yaml/browser/dist/parse/lexer.js create mode 100644 node_modules/yaml/browser/dist/parse/line-counter.js create mode 100644 node_modules/yaml/browser/dist/parse/parser.js create mode 100644 node_modules/yaml/browser/dist/public-api.js create mode 100644 node_modules/yaml/browser/dist/schema/Schema.js create mode 100644 node_modules/yaml/browser/dist/schema/common/map.js create mode 100644 node_modules/yaml/browser/dist/schema/common/null.js create mode 100644 node_modules/yaml/browser/dist/schema/common/seq.js create mode 100644 node_modules/yaml/browser/dist/schema/common/string.js create mode 100644 node_modules/yaml/browser/dist/schema/core/bool.js create mode 100644 node_modules/yaml/browser/dist/schema/core/float.js create mode 100644 node_modules/yaml/browser/dist/schema/core/int.js create mode 100644 node_modules/yaml/browser/dist/schema/core/schema.js create mode 100644 node_modules/yaml/browser/dist/schema/json/schema.js create mode 100644 node_modules/yaml/browser/dist/schema/tags.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/float.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/int.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/set.js create mode 100644 node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js create mode 100644 node_modules/yaml/browser/dist/stringify/foldFlowLines.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringify.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyCollection.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyComment.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyDocument.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyNumber.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyPair.js create mode 100644 node_modules/yaml/browser/dist/stringify/stringifyString.js create mode 100644 node_modules/yaml/browser/dist/util.js create mode 100644 node_modules/yaml/browser/dist/visit.js create mode 100644 node_modules/yaml/browser/index.js create mode 100644 node_modules/yaml/browser/package.json create mode 100644 node_modules/yaml/dist/compose/compose-collection.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-collection.js create mode 100644 node_modules/yaml/dist/compose/compose-doc.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-doc.js create mode 100644 node_modules/yaml/dist/compose/compose-node.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-node.js create mode 100644 node_modules/yaml/dist/compose/compose-scalar.d.ts create mode 100644 node_modules/yaml/dist/compose/compose-scalar.js create mode 100644 node_modules/yaml/dist/compose/composer.d.ts create mode 100644 node_modules/yaml/dist/compose/composer.js create mode 100644 node_modules/yaml/dist/compose/resolve-block-map.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-block-map.js create mode 100644 node_modules/yaml/dist/compose/resolve-block-scalar.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-block-scalar.js create mode 100644 node_modules/yaml/dist/compose/resolve-block-seq.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-block-seq.js create mode 100644 node_modules/yaml/dist/compose/resolve-end.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-end.js create mode 100644 node_modules/yaml/dist/compose/resolve-flow-collection.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-flow-collection.js create mode 100644 node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-flow-scalar.js create mode 100644 node_modules/yaml/dist/compose/resolve-props.d.ts create mode 100644 node_modules/yaml/dist/compose/resolve-props.js create mode 100644 node_modules/yaml/dist/compose/util-contains-newline.d.ts create mode 100644 node_modules/yaml/dist/compose/util-contains-newline.js create mode 100644 node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts create mode 100644 node_modules/yaml/dist/compose/util-empty-scalar-position.js create mode 100644 node_modules/yaml/dist/compose/util-flow-indent-check.d.ts create mode 100644 node_modules/yaml/dist/compose/util-flow-indent-check.js create mode 100644 node_modules/yaml/dist/compose/util-map-includes.d.ts create mode 100644 node_modules/yaml/dist/compose/util-map-includes.js create mode 100644 node_modules/yaml/dist/doc/Document.d.ts create mode 100644 node_modules/yaml/dist/doc/Document.js create mode 100644 node_modules/yaml/dist/doc/anchors.d.ts create mode 100644 node_modules/yaml/dist/doc/anchors.js create mode 100644 node_modules/yaml/dist/doc/applyReviver.d.ts create mode 100644 node_modules/yaml/dist/doc/applyReviver.js create mode 100644 node_modules/yaml/dist/doc/createNode.d.ts create mode 100644 node_modules/yaml/dist/doc/createNode.js create mode 100644 node_modules/yaml/dist/doc/directives.d.ts create mode 100644 node_modules/yaml/dist/doc/directives.js create mode 100644 node_modules/yaml/dist/errors.d.ts create mode 100644 node_modules/yaml/dist/errors.js create mode 100644 node_modules/yaml/dist/index.d.ts create mode 100644 node_modules/yaml/dist/index.js create mode 100644 node_modules/yaml/dist/log.d.ts create mode 100644 node_modules/yaml/dist/log.js create mode 100644 node_modules/yaml/dist/nodes/Alias.d.ts create mode 100644 node_modules/yaml/dist/nodes/Alias.js create mode 100644 node_modules/yaml/dist/nodes/Collection.d.ts create mode 100644 node_modules/yaml/dist/nodes/Collection.js create mode 100644 node_modules/yaml/dist/nodes/Node.d.ts create mode 100644 node_modules/yaml/dist/nodes/Node.js create mode 100644 node_modules/yaml/dist/nodes/Pair.d.ts create mode 100644 node_modules/yaml/dist/nodes/Pair.js create mode 100644 node_modules/yaml/dist/nodes/Scalar.d.ts create mode 100644 node_modules/yaml/dist/nodes/Scalar.js create mode 100644 node_modules/yaml/dist/nodes/YAMLMap.d.ts create mode 100644 node_modules/yaml/dist/nodes/YAMLMap.js create mode 100644 node_modules/yaml/dist/nodes/YAMLSeq.d.ts create mode 100644 node_modules/yaml/dist/nodes/YAMLSeq.js create mode 100644 node_modules/yaml/dist/nodes/addPairToJSMap.d.ts create mode 100644 node_modules/yaml/dist/nodes/addPairToJSMap.js create mode 100644 node_modules/yaml/dist/nodes/identity.d.ts create mode 100644 node_modules/yaml/dist/nodes/identity.js create mode 100644 node_modules/yaml/dist/nodes/toJS.d.ts create mode 100644 node_modules/yaml/dist/nodes/toJS.js create mode 100644 node_modules/yaml/dist/options.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-scalar.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-scalar.js create mode 100644 node_modules/yaml/dist/parse/cst-stringify.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-stringify.js create mode 100644 node_modules/yaml/dist/parse/cst-visit.d.ts create mode 100644 node_modules/yaml/dist/parse/cst-visit.js create mode 100644 node_modules/yaml/dist/parse/cst.d.ts create mode 100644 node_modules/yaml/dist/parse/cst.js create mode 100644 node_modules/yaml/dist/parse/lexer.d.ts create mode 100644 node_modules/yaml/dist/parse/lexer.js create mode 100644 node_modules/yaml/dist/parse/line-counter.d.ts create mode 100644 node_modules/yaml/dist/parse/line-counter.js create mode 100644 node_modules/yaml/dist/parse/parser.d.ts create mode 100644 node_modules/yaml/dist/parse/parser.js create mode 100644 node_modules/yaml/dist/public-api.d.ts create mode 100644 node_modules/yaml/dist/public-api.js create mode 100644 node_modules/yaml/dist/schema/Schema.d.ts create mode 100644 node_modules/yaml/dist/schema/Schema.js create mode 100644 node_modules/yaml/dist/schema/common/map.d.ts create mode 100644 node_modules/yaml/dist/schema/common/map.js create mode 100644 node_modules/yaml/dist/schema/common/null.d.ts create mode 100644 node_modules/yaml/dist/schema/common/null.js create mode 100644 node_modules/yaml/dist/schema/common/seq.d.ts create mode 100644 node_modules/yaml/dist/schema/common/seq.js create mode 100644 node_modules/yaml/dist/schema/common/string.d.ts create mode 100644 node_modules/yaml/dist/schema/common/string.js create mode 100644 node_modules/yaml/dist/schema/core/bool.d.ts create mode 100644 node_modules/yaml/dist/schema/core/bool.js create mode 100644 node_modules/yaml/dist/schema/core/float.d.ts create mode 100644 node_modules/yaml/dist/schema/core/float.js create mode 100644 node_modules/yaml/dist/schema/core/int.d.ts create mode 100644 node_modules/yaml/dist/schema/core/int.js create mode 100644 node_modules/yaml/dist/schema/core/schema.d.ts create mode 100644 node_modules/yaml/dist/schema/core/schema.js create mode 100644 node_modules/yaml/dist/schema/json-schema.d.ts create mode 100644 node_modules/yaml/dist/schema/json/schema.d.ts create mode 100644 node_modules/yaml/dist/schema/json/schema.js create mode 100644 node_modules/yaml/dist/schema/tags.d.ts create mode 100644 node_modules/yaml/dist/schema/tags.js create mode 100644 node_modules/yaml/dist/schema/types.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/binary.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/bool.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/float.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/float.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/int.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/int.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/omap.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/pairs.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/schema.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/set.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/set.js create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts create mode 100644 node_modules/yaml/dist/schema/yaml-1.1/timestamp.js create mode 100644 node_modules/yaml/dist/stringify/foldFlowLines.d.ts create mode 100644 node_modules/yaml/dist/stringify/foldFlowLines.js create mode 100644 node_modules/yaml/dist/stringify/stringify.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringify.js create mode 100644 node_modules/yaml/dist/stringify/stringifyCollection.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyCollection.js create mode 100644 node_modules/yaml/dist/stringify/stringifyComment.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyComment.js create mode 100644 node_modules/yaml/dist/stringify/stringifyDocument.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyDocument.js create mode 100644 node_modules/yaml/dist/stringify/stringifyNumber.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyNumber.js create mode 100644 node_modules/yaml/dist/stringify/stringifyPair.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyPair.js create mode 100644 node_modules/yaml/dist/stringify/stringifyString.d.ts create mode 100644 node_modules/yaml/dist/stringify/stringifyString.js create mode 100644 node_modules/yaml/dist/test-events.d.ts create mode 100644 node_modules/yaml/dist/test-events.js create mode 100644 node_modules/yaml/dist/util.d.ts create mode 100644 node_modules/yaml/dist/util.js create mode 100644 node_modules/yaml/dist/visit.d.ts create mode 100644 node_modules/yaml/dist/visit.js create mode 100644 node_modules/yaml/package.json create mode 100644 node_modules/yaml/util.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 static/css/main.css create mode 100644 static/css/output.css create mode 100644 static/img/images.jpg create mode 100644 static/img/lichess-svgrepo-com.svg create mode 100644 static/img/linkedin.svg create mode 100644 static/src/input.css create mode 100644 tailwind.config.js create mode 100644 templates/index.html diff --git a/README.md b/README.md new file mode 100644 index 0000000..f216b7c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Personal Website (Under Construction) +This is the source code for my personal website. It is built using tailwindcss and some flowbite components on top of flask. + diff --git a/app.py b/app.py new file mode 100644 index 0000000..87c911a --- /dev/null +++ b/app.py @@ -0,0 +1,18 @@ +from flask import Flask, render_template +import requests + +app = Flask(__name__) + +@app.route("/") +@app.route("/index") +def index(): + return render_template("index.html", projects=featured) + +if __name__ == '__main__': + response = requests.get('https://api.github.com/users/mabushelbaia/repos') + repos = response.json() + featured = [] + for repo in repos: + if repo['name'] in ["Ants-Simulator", "Course-Schedule", "Padding-Oracle-Attack", "PIC16F877A-Calculator"]: + featured.append(repo) + app.run(debug=True, port=5050) \ No newline at end of file diff --git a/node_modules/.bin/cssesc b/node_modules/.bin/cssesc new file mode 100644 index 0000000..c9b5214 --- /dev/null +++ b/node_modules/.bin/cssesc @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../cssesc/bin/cssesc" "$@" +else + exec node "$basedir/../cssesc/bin/cssesc" "$@" +fi diff --git a/node_modules/.bin/cssesc.cmd b/node_modules/.bin/cssesc.cmd new file mode 100644 index 0000000..a79d95b --- /dev/null +++ b/node_modules/.bin/cssesc.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\cssesc\bin\cssesc" %* diff --git a/node_modules/.bin/cssesc.ps1 b/node_modules/.bin/cssesc.ps1 new file mode 100644 index 0000000..480aa17 --- /dev/null +++ b/node_modules/.bin/cssesc.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args + } else { + & "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../cssesc/bin/cssesc" $args + } else { + & "node$exe" "$basedir/../cssesc/bin/cssesc" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/jiti b/node_modules/.bin/jiti new file mode 100644 index 0000000..c37115a --- /dev/null +++ b/node_modules/.bin/jiti @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../jiti/bin/jiti.js" "$@" +else + exec node "$basedir/../jiti/bin/jiti.js" "$@" +fi diff --git a/node_modules/.bin/jiti.cmd b/node_modules/.bin/jiti.cmd new file mode 100644 index 0000000..e947fc6 --- /dev/null +++ b/node_modules/.bin/jiti.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jiti\bin\jiti.js" %* diff --git a/node_modules/.bin/jiti.ps1 b/node_modules/.bin/jiti.ps1 new file mode 100644 index 0000000..44b2f0c --- /dev/null +++ b/node_modules/.bin/jiti.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../jiti/bin/jiti.js" $args + } else { + & "$basedir/node$exe" "$basedir/../jiti/bin/jiti.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../jiti/bin/jiti.js" $args + } else { + & "node$exe" "$basedir/../jiti/bin/jiti.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mini-svg-data-uri b/node_modules/.bin/mini-svg-data-uri new file mode 100644 index 0000000..969d84d --- /dev/null +++ b/node_modules/.bin/mini-svg-data-uri @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mini-svg-data-uri/cli.js" "$@" +else + exec node "$basedir/../mini-svg-data-uri/cli.js" "$@" +fi diff --git a/node_modules/.bin/mini-svg-data-uri.cmd b/node_modules/.bin/mini-svg-data-uri.cmd new file mode 100644 index 0000000..8793d4f --- /dev/null +++ b/node_modules/.bin/mini-svg-data-uri.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mini-svg-data-uri\cli.js" %* diff --git a/node_modules/.bin/mini-svg-data-uri.ps1 b/node_modules/.bin/mini-svg-data-uri.ps1 new file mode 100644 index 0000000..a1d6bf1 --- /dev/null +++ b/node_modules/.bin/mini-svg-data-uri.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mini-svg-data-uri/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mini-svg-data-uri/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mini-svg-data-uri/cli.js" $args + } else { + & "node$exe" "$basedir/../mini-svg-data-uri/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 100644 index 0000000..23254eb --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@" +else + exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@" +fi diff --git a/node_modules/.bin/nanoid.cmd b/node_modules/.bin/nanoid.cmd new file mode 100644 index 0000000..601a2c8 --- /dev/null +++ b/node_modules/.bin/nanoid.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %* diff --git a/node_modules/.bin/nanoid.ps1 b/node_modules/.bin/nanoid.ps1 new file mode 100644 index 0000000..d8a4d7a --- /dev/null +++ b/node_modules/.bin/nanoid.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } else { + & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } else { + & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 100644 index 0000000..757d454 --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" +else + exec node "$basedir/../resolve/bin/resolve" "$@" +fi diff --git a/node_modules/.bin/resolve.cmd b/node_modules/.bin/resolve.cmd new file mode 100644 index 0000000..6358238 --- /dev/null +++ b/node_modules/.bin/resolve.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %* diff --git a/node_modules/.bin/resolve.ps1 b/node_modules/.bin/resolve.ps1 new file mode 100644 index 0000000..f22b2d3 --- /dev/null +++ b/node_modules/.bin/resolve.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args + } else { + & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../resolve/bin/resolve" $args + } else { + & "node$exe" "$basedir/../resolve/bin/resolve" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/sucrase b/node_modules/.bin/sucrase new file mode 100644 index 0000000..e5c30f4 --- /dev/null +++ b/node_modules/.bin/sucrase @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../sucrase/bin/sucrase" "$@" +else + exec node "$basedir/../sucrase/bin/sucrase" "$@" +fi diff --git a/node_modules/.bin/sucrase-node b/node_modules/.bin/sucrase-node new file mode 100644 index 0000000..6f950d3 --- /dev/null +++ b/node_modules/.bin/sucrase-node @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../sucrase/bin/sucrase-node" "$@" +else + exec node "$basedir/../sucrase/bin/sucrase-node" "$@" +fi diff --git a/node_modules/.bin/sucrase-node.cmd b/node_modules/.bin/sucrase-node.cmd new file mode 100644 index 0000000..60bf079 --- /dev/null +++ b/node_modules/.bin/sucrase-node.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sucrase\bin\sucrase-node" %* diff --git a/node_modules/.bin/sucrase-node.ps1 b/node_modules/.bin/sucrase-node.ps1 new file mode 100644 index 0000000..9ec0672 --- /dev/null +++ b/node_modules/.bin/sucrase-node.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase-node" $args + } else { + & "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase-node" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../sucrase/bin/sucrase-node" $args + } else { + & "node$exe" "$basedir/../sucrase/bin/sucrase-node" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/sucrase.cmd b/node_modules/.bin/sucrase.cmd new file mode 100644 index 0000000..359672c --- /dev/null +++ b/node_modules/.bin/sucrase.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sucrase\bin\sucrase" %* diff --git a/node_modules/.bin/sucrase.ps1 b/node_modules/.bin/sucrase.ps1 new file mode 100644 index 0000000..667bb84 --- /dev/null +++ b/node_modules/.bin/sucrase.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase" $args + } else { + & "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../sucrase/bin/sucrase" $args + } else { + & "node$exe" "$basedir/../sucrase/bin/sucrase" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/tailwind b/node_modules/.bin/tailwind new file mode 100644 index 0000000..afd8c18 --- /dev/null +++ b/node_modules/.bin/tailwind @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../tailwindcss/lib/cli.js" "$@" +else + exec node "$basedir/../tailwindcss/lib/cli.js" "$@" +fi diff --git a/node_modules/.bin/tailwind.cmd b/node_modules/.bin/tailwind.cmd new file mode 100644 index 0000000..e341631 --- /dev/null +++ b/node_modules/.bin/tailwind.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\tailwindcss\lib\cli.js" %* diff --git a/node_modules/.bin/tailwind.ps1 b/node_modules/.bin/tailwind.ps1 new file mode 100644 index 0000000..5d60bef --- /dev/null +++ b/node_modules/.bin/tailwind.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/tailwindcss b/node_modules/.bin/tailwindcss new file mode 100644 index 0000000..afd8c18 --- /dev/null +++ b/node_modules/.bin/tailwindcss @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../tailwindcss/lib/cli.js" "$@" +else + exec node "$basedir/../tailwindcss/lib/cli.js" "$@" +fi diff --git a/node_modules/.bin/tailwindcss.cmd b/node_modules/.bin/tailwindcss.cmd new file mode 100644 index 0000000..e341631 --- /dev/null +++ b/node_modules/.bin/tailwindcss.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\tailwindcss\lib\cli.js" %* diff --git a/node_modules/.bin/tailwindcss.ps1 b/node_modules/.bin/tailwindcss.ps1 new file mode 100644 index 0000000..5d60bef --- /dev/null +++ b/node_modules/.bin/tailwindcss.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../tailwindcss/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..78aa7ef --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,979 @@ +{ + "name": "PersonalWeb", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flowbite": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-1.8.1.tgz", + "integrity": "sha512-lXTcO8a6dRTPFpINyOLcATCN/pK1Of/jY4PryklPllAiqH64tSDUsOdQpar3TO59ZXWwugm2e92oaqwH6X90Xg==", + "dependencies": { + "@popperjs/core": "^2.9.3", + "mini-svg-data-uri": "^1.4.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.20.0.tgz", + "integrity": "sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mini-svg-data-uri": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", + "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==", + "bin": { + "mini-svg-data-uri": "cli.js" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dev": true, + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz", + "integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==", + "dev": true, + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^2.1.1" + }, + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", + "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.11" + }, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sucrase": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", + "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", + "integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==", + "dev": true, + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.2.12", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.18.2", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", + "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", + "dev": true, + "engines": { + "node": ">= 14" + } + } + } +} diff --git a/node_modules/@alloc/quick-lru/index.d.ts b/node_modules/@alloc/quick-lru/index.d.ts new file mode 100644 index 0000000..eb819ba --- /dev/null +++ b/node_modules/@alloc/quick-lru/index.d.ts @@ -0,0 +1,128 @@ +declare namespace QuickLRU { + interface Options { + /** + The maximum number of milliseconds an item should remain in the cache. + + @default Infinity + + By default, `maxAge` will be `Infinity`, which means that items will never expire. + Lazy expiration upon the next write or read call. + + Individual expiration of an item can be specified by the `set(key, value, maxAge)` method. + */ + readonly maxAge?: number; + + /** + The maximum number of items before evicting the least recently used items. + */ + readonly maxSize: number; + + /** + Called right before an item is evicted from the cache. + + Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). + */ + onEviction?: (key: KeyType, value: ValueType) => void; + } +} + +declare class QuickLRU + implements Iterable<[KeyType, ValueType]> { + /** + The stored item count. + */ + readonly size: number; + + /** + Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29). + + The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. + + @example + ``` + import QuickLRU = require('quick-lru'); + + const lru = new QuickLRU({maxSize: 1000}); + + lru.set('🦄', '🌈'); + + lru.has('🦄'); + //=> true + + lru.get('🦄'); + //=> '🌈' + ``` + */ + constructor(options: QuickLRU.Options); + + [Symbol.iterator](): IterableIterator<[KeyType, ValueType]>; + + /** + Set an item. Returns the instance. + + Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire. + + @returns The list instance. + */ + set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this; + + /** + Get an item. + + @returns The stored item or `undefined`. + */ + get(key: KeyType): ValueType | undefined; + + /** + Check if an item exists. + */ + has(key: KeyType): boolean; + + /** + Get an item without marking it as recently used. + + @returns The stored item or `undefined`. + */ + peek(key: KeyType): ValueType | undefined; + + /** + Delete an item. + + @returns `true` if the item is removed or `false` if the item doesn't exist. + */ + delete(key: KeyType): boolean; + + /** + Delete all items. + */ + clear(): void; + + /** + Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee. + + Useful for on-the-fly tuning of cache sizes in live systems. + */ + resize(maxSize: number): void; + + /** + Iterable for all the keys. + */ + keys(): IterableIterator; + + /** + Iterable for all the values. + */ + values(): IterableIterator; + + /** + Iterable for all entries, starting with the oldest (ascending in recency). + */ + entriesAscending(): IterableIterator<[KeyType, ValueType]>; + + /** + Iterable for all entries, starting with the newest (descending in recency). + */ + entriesDescending(): IterableIterator<[KeyType, ValueType]>; +} + +export = QuickLRU; diff --git a/node_modules/@alloc/quick-lru/index.js b/node_modules/@alloc/quick-lru/index.js new file mode 100644 index 0000000..7eeced2 --- /dev/null +++ b/node_modules/@alloc/quick-lru/index.js @@ -0,0 +1,263 @@ +'use strict'; + +class QuickLRU { + constructor(options = {}) { + if (!(options.maxSize && options.maxSize > 0)) { + throw new TypeError('`maxSize` must be a number greater than 0'); + } + + if (typeof options.maxAge === 'number' && options.maxAge === 0) { + throw new TypeError('`maxAge` must be a number greater than 0'); + } + + this.maxSize = options.maxSize; + this.maxAge = options.maxAge || Infinity; + this.onEviction = options.onEviction; + this.cache = new Map(); + this.oldCache = new Map(); + this._size = 0; + } + + _emitEvictions(cache) { + if (typeof this.onEviction !== 'function') { + return; + } + + for (const [key, item] of cache) { + this.onEviction(key, item.value); + } + } + + _deleteIfExpired(key, item) { + if (typeof item.expiry === 'number' && item.expiry <= Date.now()) { + if (typeof this.onEviction === 'function') { + this.onEviction(key, item.value); + } + + return this.delete(key); + } + + return false; + } + + _getOrDeleteIfExpired(key, item) { + const deleted = this._deleteIfExpired(key, item); + if (deleted === false) { + return item.value; + } + } + + _getItemValue(key, item) { + return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value; + } + + _peek(key, cache) { + const item = cache.get(key); + + return this._getItemValue(key, item); + } + + _set(key, value) { + this.cache.set(key, value); + this._size++; + + if (this._size >= this.maxSize) { + this._size = 0; + this._emitEvictions(this.oldCache); + this.oldCache = this.cache; + this.cache = new Map(); + } + } + + _moveToRecent(key, item) { + this.oldCache.delete(key); + this._set(key, item); + } + + * _entriesAscending() { + for (const item of this.oldCache) { + const [key, value] = item; + if (!this.cache.has(key)) { + const deleted = this._deleteIfExpired(key, value); + if (deleted === false) { + yield item; + } + } + } + + for (const item of this.cache) { + const [key, value] = item; + const deleted = this._deleteIfExpired(key, value); + if (deleted === false) { + yield item; + } + } + } + + get(key) { + if (this.cache.has(key)) { + const item = this.cache.get(key); + + return this._getItemValue(key, item); + } + + if (this.oldCache.has(key)) { + const item = this.oldCache.get(key); + if (this._deleteIfExpired(key, item) === false) { + this._moveToRecent(key, item); + return item.value; + } + } + } + + set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) { + if (this.cache.has(key)) { + this.cache.set(key, { + value, + maxAge + }); + } else { + this._set(key, {value, expiry: maxAge}); + } + } + + has(key) { + if (this.cache.has(key)) { + return !this._deleteIfExpired(key, this.cache.get(key)); + } + + if (this.oldCache.has(key)) { + return !this._deleteIfExpired(key, this.oldCache.get(key)); + } + + return false; + } + + peek(key) { + if (this.cache.has(key)) { + return this._peek(key, this.cache); + } + + if (this.oldCache.has(key)) { + return this._peek(key, this.oldCache); + } + } + + delete(key) { + const deleted = this.cache.delete(key); + if (deleted) { + this._size--; + } + + return this.oldCache.delete(key) || deleted; + } + + clear() { + this.cache.clear(); + this.oldCache.clear(); + this._size = 0; + } + + resize(newSize) { + if (!(newSize && newSize > 0)) { + throw new TypeError('`maxSize` must be a number greater than 0'); + } + + const items = [...this._entriesAscending()]; + const removeCount = items.length - newSize; + if (removeCount < 0) { + this.cache = new Map(items); + this.oldCache = new Map(); + this._size = items.length; + } else { + if (removeCount > 0) { + this._emitEvictions(items.slice(0, removeCount)); + } + + this.oldCache = new Map(items.slice(removeCount)); + this.cache = new Map(); + this._size = 0; + } + + this.maxSize = newSize; + } + + * keys() { + for (const [key] of this) { + yield key; + } + } + + * values() { + for (const [, value] of this) { + yield value; + } + } + + * [Symbol.iterator]() { + for (const item of this.cache) { + const [key, value] = item; + const deleted = this._deleteIfExpired(key, value); + if (deleted === false) { + yield [key, value.value]; + } + } + + for (const item of this.oldCache) { + const [key, value] = item; + if (!this.cache.has(key)) { + const deleted = this._deleteIfExpired(key, value); + if (deleted === false) { + yield [key, value.value]; + } + } + } + } + + * entriesDescending() { + let items = [...this.cache]; + for (let i = items.length - 1; i >= 0; --i) { + const item = items[i]; + const [key, value] = item; + const deleted = this._deleteIfExpired(key, value); + if (deleted === false) { + yield [key, value.value]; + } + } + + items = [...this.oldCache]; + for (let i = items.length - 1; i >= 0; --i) { + const item = items[i]; + const [key, value] = item; + if (!this.cache.has(key)) { + const deleted = this._deleteIfExpired(key, value); + if (deleted === false) { + yield [key, value.value]; + } + } + } + } + + * entriesAscending() { + for (const [key, value] of this._entriesAscending()) { + yield [key, value.value]; + } + } + + get size() { + if (!this._size) { + return this.oldCache.size; + } + + let oldCacheSize = 0; + for (const key of this.oldCache.keys()) { + if (!this.cache.has(key)) { + oldCacheSize++; + } + } + + return Math.min(this._size + oldCacheSize, this.maxSize); + } +} + +module.exports = QuickLRU; diff --git a/node_modules/@alloc/quick-lru/license b/node_modules/@alloc/quick-lru/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/@alloc/quick-lru/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/@alloc/quick-lru/package.json b/node_modules/@alloc/quick-lru/package.json new file mode 100644 index 0000000..21f1072 --- /dev/null +++ b/node_modules/@alloc/quick-lru/package.json @@ -0,0 +1,43 @@ +{ + "name": "@alloc/quick-lru", + "version": "5.2.0", + "description": "Simple “Least Recently Used” (LRU) cache", + "license": "MIT", + "repository": "sindresorhus/quick-lru", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "lru", + "quick", + "cache", + "caching", + "least", + "recently", + "used", + "fast", + "map", + "hash", + "buffer" + ], + "devDependencies": { + "ava": "^2.0.0", + "coveralls": "^3.0.3", + "nyc": "^15.0.0", + "tsd": "^0.11.0", + "xo": "^0.26.0" + } +} diff --git a/node_modules/@alloc/quick-lru/readme.md b/node_modules/@alloc/quick-lru/readme.md new file mode 100644 index 0000000..7187ba5 --- /dev/null +++ b/node_modules/@alloc/quick-lru/readme.md @@ -0,0 +1,139 @@ +# quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master) + +> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) + +Useful when you need to cache something and limit memory usage. + +Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`. + +## Install + +``` +$ npm install quick-lru +``` + +## Usage + +```js +const QuickLRU = require('quick-lru'); + +const lru = new QuickLRU({maxSize: 1000}); + +lru.set('🦄', '🌈'); + +lru.has('🦄'); +//=> true + +lru.get('🦄'); +//=> '🌈' +``` + +## API + +### new QuickLRU(options?) + +Returns a new instance. + +### options + +Type: `object` + +#### maxSize + +*Required*\ +Type: `number` + +The maximum number of items before evicting the least recently used items. + +#### maxAge + +Type: `number`\ +Default: `Infinity` + +The maximum number of milliseconds an item should remain in cache. +By default maxAge will be Infinity, which means that items will never expire. + +Lazy expiration happens upon the next `write` or `read` call. + +Individual expiration of an item can be specified by the `set(key, value, options)` method. + +#### onEviction + +*Optional*\ +Type: `(key, value) => void` + +Called right before an item is evicted from the cache. + +Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). + +### Instance + +The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. + +Both `key` and `value` can be of any type. + +#### .set(key, value, options?) + +Set an item. Returns the instance. + +Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire. + +#### .get(key) + +Get an item. + +#### .has(key) + +Check if an item exists. + +#### .peek(key) + +Get an item without marking it as recently used. + +#### .delete(key) + +Delete an item. + +Returns `true` if the item is removed or `false` if the item doesn't exist. + +#### .clear() + +Delete all items. + +#### .resize(maxSize) + +Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee. + +Useful for on-the-fly tuning of cache sizes in live systems. + +#### .keys() + +Iterable for all the keys. + +#### .values() + +Iterable for all the values. + +#### .entriesAscending() + +Iterable for all entries, starting with the oldest (ascending in recency). + +#### .entriesDescending() + +Iterable for all entries, starting with the newest (descending in recency). + +#### .size + +The stored item count. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/@jridgewell/gen-mapping/LICENSE b/node_modules/@jridgewell/gen-mapping/LICENSE new file mode 100644 index 0000000..352f071 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 Justin Ridgewell + +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/@jridgewell/gen-mapping/README.md b/node_modules/@jridgewell/gen-mapping/README.md new file mode 100644 index 0000000..4066cdb --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/README.md @@ -0,0 +1,227 @@ +# @jridgewell/gen-mapping + +> Generate source maps + +`gen-mapping` allows you to generate a source map during transpilation or minification. +With a source map, you're able to trace the original location in the source file, either in Chrome's +DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This +provides the same `addMapping` and `setSourceContent` API. + +## Installation + +```sh +npm install @jridgewell/gen-mapping +``` + +## Usage + +```typescript +import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; + +const map = new GenMapping({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); + +setSourceContent(map, 'input.js', `function foo() {}`); + +addMapping(map, { + // Lines start at line 1, columns at column 0. + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +addMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 9 }, + name: 'foo', +}); + +assert.deepEqual(toDecodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: [ + [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] + ], +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: 'AAAA,SAASA', +}); +``` + +### Smaller Sourcemaps + +Not everything needs to be added to a sourcemap, and needless markings can cause signficantly +larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will +intelligently determine if this marking adds useful information. If not, the marking will be +skipped. + +```typescript +import { maybeAddMapping } from '@jridgewell/gen-mapping'; + +const map = new GenMapping(); + +// Adding a sourceless marking at the beginning of a line isn't useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, +}); + +// Adding a new source marking is useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +// But adding another marking pointing to the exact same original location isn't, even if the +// generated column changed. +maybeAddMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + names: [], + sources: ['input.js'], + sourcesContent: [null], + mappings: 'AAAA', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map +Memory Usage: +gen-mapping: addSegment 5852872 bytes +gen-mapping: addMapping 7716042 bytes +source-map-js 6143250 bytes +source-map-0.6.1 6124102 bytes +source-map-0.8.0 6121173 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) +gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) +source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) +source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) +source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) +gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) +source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) +source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) +source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +babel.min.js.map +Memory Usage: +gen-mapping: addSegment 37578063 bytes +gen-mapping: addMapping 37212897 bytes +source-map-js 47638527 bytes +source-map-0.6.1 47690503 bytes +source-map-0.8.0 47470188 bytes +Smallest memory usage is gen-mapping: addMapping + +Adding speed: +gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) +gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) +source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) +source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) +source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) +gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) +source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) +source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) +source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +preact.js.map +Memory Usage: +gen-mapping: addSegment 416247 bytes +gen-mapping: addMapping 419824 bytes +source-map-js 1024619 bytes +source-map-0.6.1 1146004 bytes +source-map-0.8.0 1113250 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) +gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) +source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) +source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) +source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) +gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) +source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) +source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) +source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +react.js.map +Memory Usage: +gen-mapping: addSegment 975096 bytes +gen-mapping: addMapping 1102981 bytes +source-map-js 2918836 bytes +source-map-0.6.1 2885435 bytes +source-map-0.8.0 2874336 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) +gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) +source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) +source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) +source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) +gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) +source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) +source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) +source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) +Fastest is gen-mapping: decoded output +``` + +[source-map]: https://www.npmjs.com/package/source-map +[trace-mapping]: https://github.com/jridgewell/trace-mapping diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs new file mode 100644 index 0000000..5aeb5cc --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs @@ -0,0 +1,230 @@ +import { SetArray, put } from '@jridgewell/set-array'; +import { encode } from '@jridgewell/sourcemap-codec'; +import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; + +const NO_NAME = -1; +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +let addSegment; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +let addMapping; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +let maybeAddSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +let maybeAddMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +let setSourceContent; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toDecodedMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toEncodedMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +let fromMap; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +let allMappings; +// This split declaration is only so that terser can elminiate the static initialization block. +let addSegmentInternal; +/** + * Provides the state to generate a sourcemap. + */ +class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } +} +(() => { + addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + addMapping = (map, mapping) => { + return addMappingInternal(false, map, mapping); + }; + maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); + }; + setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[put(sources, source)] = content; + }; + toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + toEncodedMap = (map) => { + const decoded = toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); + }; + allMappings = (map) => { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = map; + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = undefined; + let original = undefined; + let name = undefined; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) + name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; + }; + fromMap = (input) => { + const map = new TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(gen._names, map.names); + putAll(gen._sources, map.sources); + gen._sourcesContent = map.sourcesContent || map.sources.map(() => null); + gen._mappings = decodedMappings(map); + return gen; + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; +})(); +function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; +} +function putAll(strarr, array) { + for (let i = 0; i < array.length; i++) + put(strarr, array[i]); +} +function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null); + } + const s = source; + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content); +} + +export { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap }; +//# sourceMappingURL=gen-mapping.mjs.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map new file mode 100644 index 0000000..2fee0cd --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.mjs","sources":["../src/sourcemap-segment.ts","../src/gen-mapping.ts"],"sourcesContent":["type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,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AAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,EAChE;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,QAAiB,EACjB,GAAe,EACf,OAMC,EAAA;AAED,IAAA,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC/D,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;AACH,KAAA;IACD,MAAM,CAAC,GAAW,MAAM,CAAC;AAEzB,IAAA,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,QAAQ,CAAC,IAAI,GAAG,CAAC,EACjB,QAAQ,CAAC,MAAM,EACf,IAAI,EACJ,OAAO,CACR,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js new file mode 100644 index 0000000..d9fcf5c --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js @@ -0,0 +1,236 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/set-array'), require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')) : + typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/set-array', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.genMapping = {}, global.setArray, global.sourcemapCodec, global.traceMapping)); +})(this, (function (exports, setArray, sourcemapCodec, traceMapping) { 'use strict'; + + const COLUMN = 0; + const SOURCES_INDEX = 1; + const SOURCE_LINE = 2; + const SOURCE_COLUMN = 3; + const NAMES_INDEX = 4; + + const NO_NAME = -1; + /** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ + exports.addSegment = void 0; + /** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ + exports.addMapping = void 0; + /** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ + exports.maybeAddSegment = void 0; + /** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ + exports.maybeAddMapping = void 0; + /** + * Adds/removes the content of the source file to the source map. + */ + exports.setSourceContent = void 0; + /** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.toDecodedMap = void 0; + /** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.toEncodedMap = void 0; + /** + * Constructs a new GenMapping, using the already present mappings of the input. + */ + exports.fromMap = void 0; + /** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ + exports.allMappings = void 0; + // This split declaration is only so that terser can elminiate the static initialization block. + let addSegmentInternal; + /** + * Provides the state to generate a sourcemap. + */ + class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new setArray.SetArray(); + this._sources = new setArray.SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } + } + (() => { + exports.addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + exports.maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + exports.addMapping = (map, mapping) => { + return addMappingInternal(false, map, mapping); + }; + exports.maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); + }; + exports.setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[setArray.put(sources, source)] = content; + }; + exports.toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + exports.toEncodedMap = (map) => { + const decoded = exports.toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: sourcemapCodec.encode(decoded.mappings) }); + }; + exports.allMappings = (map) => { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = map; + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = undefined; + let original = undefined; + let name = undefined; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) + name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; + }; + exports.fromMap = (input) => { + const map = new traceMapping.TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(gen._names, map.names); + putAll(gen._sources, map.sources); + gen._sourcesContent = map.sourcesContent || map.sources.map(() => null); + gen._mappings = traceMapping.decodedMappings(map); + return gen; + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = setArray.put(sources, source); + const namesIndex = name ? setArray.put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; + })(); + function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; + } + function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; + } + function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; + } + function putAll(strarr, array) { + for (let i = 0; i < array.length; i++) + setArray.put(strarr, array[i]); + } + function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; + } + function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); + } + function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null); + } + const s = source; + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content); + } + + exports.GenMapping = GenMapping; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=gen-mapping.umd.js.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map new file mode 100644 index 0000000..7cc8d14 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.umd.js","sources":["../src/sourcemap-segment.ts","../src/gen-mapping.ts"],"sourcesContent":["type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,\n original.column,\n name,\n content,\n );\n}\n"],"names":["addSegment","addMapping","maybeAddSegment","maybeAddMapping","setSourceContent","toDecodedMap","toEncodedMap","fromMap","allMappings","SetArray","put","encode","TraceMap","decodedMappings"],"mappings":";;;;;;IAWO,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC,CAAC;IACtB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC;;ICQ5B,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC;IAEnB;;;IAGG;AACQA,gCA+BT;IAEF;;;IAGG;AACQC,gCA+BT;IAEF;;;;IAIG;AACQ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GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;IACH,KAAA;QACD,MAAM,CAAC,GAAW,MAAM,CAAC;IAEzB,IAAA,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,QAAQ,CAAC,IAAI,GAAG,CAAC,EACjB,QAAQ,CAAC,MAAM,EACf,IAAI,EACJ,OAAO,CACR,CAAC;IACJ;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts new file mode 100644 index 0000000..d510d74 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts @@ -0,0 +1,90 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export declare type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare let addSegment: { + (map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; + (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; + (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +}; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare let addMapping: { + (map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; + }): void; + (map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; + }): void; + (map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; + }): void; +}; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare let maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare let maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare let setSourceContent: (map: GenMapping, source: string, content: string | null) => void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let toDecodedMap: (map: GenMapping) => DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let toEncodedMap: (map: GenMapping) => EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare let fromMap: (input: SourceMapInput) => GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare let allMappings: (map: GenMapping) => Mapping[]; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts new file mode 100644 index 0000000..e187ba9 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts @@ -0,0 +1,12 @@ +declare type GeneratedColumn = number; +declare type SourcesIndex = number; +declare type SourceLine = number; +declare type SourceColumn = number; +declare type NamesIndex = number; +export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts new file mode 100644 index 0000000..b309c81 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts @@ -0,0 +1,35 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export declare type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; diff --git a/node_modules/@jridgewell/gen-mapping/package.json b/node_modules/@jridgewell/gen-mapping/package.json new file mode 100644 index 0000000..69e0ac8 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/package.json @@ -0,0 +1,77 @@ +{ + "name": "@jridgewell/gen-mapping", + "version": "0.3.3", + "description": "Generate source maps", + "keywords": [ + "source", + "map" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/gen-mapping", + "main": "dist/gen-mapping.umd.js", + "module": "dist/gen-mapping.mjs", + "types": "dist/types/gen-mapping.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/gen-mapping.d.ts", + "browser": "./dist/gen-mapping.umd.js", + "require": "./dist/gen-mapping.umd.js", + "import": "./dist/gen-mapping.mjs" + }, + "./dist/gen-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "benchmark": "run-s build:rollup benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node benchmark/index.mjs", + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:coverage", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "run-p 'build:rollup -- --watch' 'test:only -- --watch'", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.3.2", + "@types/mocha": "9.1.1", + "@types/node": "17.0.29", + "@typescript-eslint/eslint-plugin": "5.21.0", + "@typescript-eslint/parser": "5.21.0", + "benchmark": "2.1.4", + "c8": "7.11.2", + "eslint": "8.14.0", + "eslint-config-prettier": "8.5.0", + "mocha": "9.2.2", + "npm-run-all": "4.1.5", + "prettier": "2.6.2", + "rollup": "2.70.2", + "typescript": "4.6.3" + }, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } +} diff --git a/node_modules/@jridgewell/resolve-uri/LICENSE b/node_modules/@jridgewell/resolve-uri/LICENSE new file mode 100644 index 0000000..0a81b2a --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/LICENSE @@ -0,0 +1,19 @@ +Copyright 2019 Justin Ridgewell + +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. \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/README.md b/node_modules/@jridgewell/resolve-uri/README.md new file mode 100644 index 0000000..2fe70df --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/README.md @@ -0,0 +1,40 @@ +# @jridgewell/resolve-uri + +> Resolve a URI relative to an optional base URI + +Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. + +## Installation + +```sh +npm install @jridgewell/resolve-uri +``` + +## Usage + +```typescript +function resolve(input: string, base?: string): string; +``` + +```js +import resolve from '@jridgewell/resolve-uri'; + +resolve('foo', 'https://example.com'); // => 'https://example.com/foo' +``` + +| Input | Base | Resolution | Explanation | +|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| +| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | +| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | +| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | +| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | +| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | +| `/example` | _rest_ | `/example` | Input is normalized only | +| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | +| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | +| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | +| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | +| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | +| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | +| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | +| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs new file mode 100644 index 0000000..94d8dce --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs @@ -0,0 +1,242 @@ +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +var UrlType; +(function (UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; +})(UrlType || (UrlType = {})); +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); +} +function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: UrlType.Absolute, + }; +} +function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = UrlType.SchemeRelative; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = UrlType.AbsolutePath; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? UrlType.Query + : input.startsWith('#') + ? UrlType.Hash + : UrlType.RelativePath + : UrlType.Empty; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath(url, type) { + const rel = type <= UrlType.RelativePath; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== UrlType.Absolute) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case UrlType.Empty: + url.hash = baseUrl.hash; + // fall through + case UrlType.Hash: + url.query = baseUrl.query; + // fall through + case UrlType.Query: + case UrlType.RelativePath: + mergePaths(url, baseUrl); + // fall through + case UrlType.AbsolutePath: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case UrlType.SchemeRelative: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case UrlType.Hash: + case UrlType.Query: + return queryHash; + case UrlType.RelativePath: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case UrlType.AbsolutePath: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } +} + +export { resolve as default }; +//# sourceMappingURL=resolve-uri.mjs.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map new file mode 100644 index 0000000..009d043 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":"AAAA;AACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F;;;;;;;;;AASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;AAapF,IAAK,OAQJ;AARD,WAAK,OAAO;IACV,uCAAS,CAAA;IACT,qCAAQ,CAAA;IACR,uCAAS,CAAA;IACT,qDAAgB,CAAA;IAChB,qDAAgB,CAAA;IAChB,yDAAkB,CAAA;IAClB,6CAAY,CAAA;AACd,CAAC,EARI,OAAO,KAAP,OAAO,QAQX;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,G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,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;KACpF;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js new file mode 100644 index 0000000..0700a2d --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js @@ -0,0 +1,250 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory()); +})(this, (function () { 'use strict'; + + // Matches the scheme of a URL, eg "http://" + const schemeRegex = /^[\w+.-]+:\/\//; + /** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; + /** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; + var UrlType; + (function (UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; + })(UrlType || (UrlType = {})); + function isAbsoluteUrl(input) { + return schemeRegex.test(input); + } + function isSchemeRelativeUrl(input) { + return input.startsWith('//'); + } + function isAbsolutePath(input) { + return input.startsWith('/'); + } + function isFileUrl(input) { + return input.startsWith('file:'); + } + function isRelative(input) { + return /^[.?#]/.test(input); + } + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); + } + function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: UrlType.Absolute, + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = UrlType.SchemeRelative; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = UrlType.AbsolutePath; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? UrlType.Query + : input.startsWith('#') + ? UrlType.Hash + : UrlType.RelativePath + : UrlType.Empty; + return url; + } + function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } + } + /** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ + function normalizePath(url, type) { + const rel = type <= UrlType.RelativePath; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; + } + /** + * Attempts to resolve `input` URL/path relative to `base`. + */ + function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== UrlType.Absolute) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case UrlType.Empty: + url.hash = baseUrl.hash; + // fall through + case UrlType.Hash: + url.query = baseUrl.query; + // fall through + case UrlType.Query: + case UrlType.RelativePath: + mergePaths(url, baseUrl); + // fall through + case UrlType.AbsolutePath: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case UrlType.SchemeRelative: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case UrlType.Hash: + case UrlType.Query: + return queryHash; + case UrlType.RelativePath: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case UrlType.AbsolutePath: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } + } + + return resolve; + +})); +//# sourceMappingURL=resolve-uri.umd.js.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map new file mode 100644 index 0000000..a3e39eb --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAErC;;;;;;;;;;IAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;IAE5F;;;;;;;;;IASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;IAapF,IAAK,OAQJ;IARD,WAAK,OAAO;QACV,uCAAS,CAAA;QACT,qCAAQ,CAAA;QACR,uCAAS,CAAA;QACT,qDAAgB,CAAA;QAChB,qDAAgB,CAAA;QAChB,yDAAkB,CAAA;QAClB,6CAAY,CAAA;IACd,CAAC,EARI,OAAO,KAAP,OAAO,QAQX;IAED,SAAS,aAAa,CAAC,KAAa;QAClC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,mBAAmB,CAAC,KAAa;QACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,SAAS,cAAc,CAAC,KAAa;QACnC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,SAAS,CAAC,KAAa;QA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AAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;SACpF;IACH;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts new file mode 100644 index 0000000..b7f0b3b --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts @@ -0,0 +1,4 @@ +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/resolve-uri/package.json b/node_modules/@jridgewell/resolve-uri/package.json new file mode 100644 index 0000000..6bffa7b --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/package.json @@ -0,0 +1,69 @@ +{ + "name": "@jridgewell/resolve-uri", + "version": "3.1.1", + "description": "Resolve a URI relative to an optional base URI", + "keywords": [ + "resolve", + "uri", + "url", + "path" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/resolve-uri", + "main": "dist/resolve-uri.umd.js", + "module": "dist/resolve-uri.mjs", + "types": "dist/types/resolve-uri.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/resolve-uri.d.ts", + "browser": "./dist/resolve-uri.umd.js", + "require": "./dist/resolve-uri.umd.js", + "import": "./dist/resolve-uri.mjs" + }, + "./dist/resolve-uri.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*", + "@rollup/plugin-typescript": "8.3.0", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + } +} diff --git a/node_modules/@jridgewell/set-array/LICENSE b/node_modules/@jridgewell/set-array/LICENSE new file mode 100644 index 0000000..352f071 --- /dev/null +++ b/node_modules/@jridgewell/set-array/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 Justin Ridgewell + +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/@jridgewell/set-array/README.md b/node_modules/@jridgewell/set-array/README.md new file mode 100644 index 0000000..2ed155f --- /dev/null +++ b/node_modules/@jridgewell/set-array/README.md @@ -0,0 +1,37 @@ +# @jridgewell/set-array + +> Like a Set, but provides the index of the `key` in the backing array + +This is designed to allow synchronizing a second array with the contents of the backing array, like +how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, and there +are never duplicates. + +## Installation + +```sh +npm install @jridgewell/set-array +``` + +## Usage + +```js +import { SetArray, get, put, pop } from '@jridgewell/set-array'; + +const sa = new SetArray(); + +let index = put(sa, 'first'); +assert.strictEqual(index, 0); + +index = put(sa, 'second'); +assert.strictEqual(index, 1); + +assert.deepEqual(sa.array, [ 'first', 'second' ]); + +index = get(sa, 'first'); +assert.strictEqual(index, 0); + +pop(sa); +index = get(sa, 'second'); +assert.strictEqual(index, undefined); +assert.deepEqual(sa.array, [ 'first' ]); +``` diff --git a/node_modules/@jridgewell/set-array/dist/set-array.mjs b/node_modules/@jridgewell/set-array/dist/set-array.mjs new file mode 100644 index 0000000..b7f1a9c --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.mjs @@ -0,0 +1,48 @@ +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +let get; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +let put; +/** + * Pops the last added item out of the SetArray. + */ +let pop; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +} +(() => { + get = (strarr, key) => strarr._indexes[key]; + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; + pop = (strarr) => { + const { array, _indexes: indexes } = strarr; + if (array.length === 0) + return; + const last = array.pop(); + indexes[last] = undefined; + }; +})(); + +export { SetArray, get, pop, put }; +//# sourceMappingURL=set-array.mjs.map diff --git a/node_modules/@jridgewell/set-array/dist/set-array.mjs.map b/node_modules/@jridgewell/set-array/dist/set-array.mjs.map new file mode 100644 index 0000000..ead5643 --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.mjs","sources":["../src/set-array.ts"],"sourcesContent":["/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n"],"names":[],"mappings":"AAAA;;;IAGW,IAA2D;AAEtE;;;;IAIW,IAA+C;AAE1D;;;IAGW,IAAgC;AAE3C;;;;;;;;MAQa,QAAQ;IAInB;QACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACjB;CAuBF;AArBC;IACE,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE5C,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG;;QAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;KAC3D,CAAC;IAEF,GAAG,GAAG,CAAC,MAAM;QACX,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE/B,MAAM,IAAI,GAAI,KAAkB,CAAC,GAAG,EAAG,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;KAC3B,CAAC;AACJ,CAAC,GAAA;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/set-array/dist/set-array.umd.js b/node_modules/@jridgewell/set-array/dist/set-array.umd.js new file mode 100644 index 0000000..a1c200a --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.umd.js @@ -0,0 +1,58 @@ +(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.setArray = {})); +})(this, (function (exports) { 'use strict'; + + /** + * Gets the index associated with `key` in the backing array, if it is already present. + */ + exports.get = void 0; + /** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ + exports.put = void 0; + /** + * Pops the last added item out of the SetArray. + */ + exports.pop = void 0; + /** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ + class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } + } + (() => { + exports.get = (strarr, key) => strarr._indexes[key]; + exports.put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = exports.get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; + exports.pop = (strarr) => { + const { array, _indexes: indexes } = strarr; + if (array.length === 0) + return; + const last = array.pop(); + indexes[last] = undefined; + }; + })(); + + exports.SetArray = SetArray; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=set-array.umd.js.map diff --git a/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map b/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map new file mode 100644 index 0000000..10005af --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.umd.js","sources":["../src/set-array.ts"],"sourcesContent":["/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n"],"names":["get","put","pop"],"mappings":";;;;;;IAAA;;;AAGWA,yBAA2D;IAEtE;;;;AAIWC,yBAA+C;IAE1D;;;AAGWC,yBAAgC;IAE3C;;;;;;;;UAQa,QAAQ;QAInB;YACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;YAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;SACjB;KAuBF;IArBC;QACEF,WAAG,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAE5CC,WAAG,GAAG,CAAC,MAAM,EAAE,GAAG;;YAEhB,MAAM,KAAK,GAAGD,WAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;YAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;SAC3D,CAAC;QAEFE,WAAG,GAAG,CAAC,MAAM;YACX,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YAE/B,MAAM,IAAI,GAAI,KAAkB,CAAC,GAAG,EAAG,CAAC;YACxC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;SAC3B,CAAC;IACJ,CAAC,GAAA;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts b/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts new file mode 100644 index 0000000..7ed59b9 --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts @@ -0,0 +1,26 @@ +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare let get: (strarr: SetArray, key: string) => number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare let put: (strarr: SetArray, key: string) => number; +/** + * Pops the last added item out of the SetArray. + */ +export declare let pop: (strarr: SetArray) => void; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly string[]; + constructor(); +} diff --git a/node_modules/@jridgewell/set-array/package.json b/node_modules/@jridgewell/set-array/package.json new file mode 100644 index 0000000..aec4ee0 --- /dev/null +++ b/node_modules/@jridgewell/set-array/package.json @@ -0,0 +1,66 @@ +{ + "name": "@jridgewell/set-array", + "version": "1.1.2", + "description": "Like a Set, but provides the index of the `key` in the backing array", + "keywords": [], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/set-array", + "main": "dist/set-array.umd.js", + "module": "dist/set-array.mjs", + "typings": "dist/types/set-array.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/set-array.d.ts", + "browser": "./dist/set-array.umd.js", + "require": "./dist/set-array.umd.js", + "import": "./dist/set-array.mjs" + }, + "./dist/set-array.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.3.0", + "@types/mocha": "9.1.1", + "@types/node": "17.0.29", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + } +} diff --git a/node_modules/@jridgewell/set-array/src/set-array.ts b/node_modules/@jridgewell/set-array/src/set-array.ts new file mode 100644 index 0000000..f9ff604 --- /dev/null +++ b/node_modules/@jridgewell/set-array/src/set-array.ts @@ -0,0 +1,55 @@ +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export let get: (strarr: SetArray, key: string) => number | undefined; + +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export let put: (strarr: SetArray, key: string) => number; + +/** + * Pops the last added item out of the SetArray. + */ +export let pop: (strarr: SetArray) => void; + +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export class SetArray { + private declare _indexes: { [key: string]: number | undefined }; + declare array: readonly string[]; + + constructor() { + this._indexes = { __proto__: null } as any; + this.array = []; + } + + static { + get = (strarr, key) => strarr._indexes[key]; + + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) return index; + + const { array, _indexes: indexes } = strarr; + + return (indexes[key] = (array as string[]).push(key) - 1); + }; + + pop = (strarr) => { + const { array, _indexes: indexes } = strarr; + if (array.length === 0) return; + + const last = (array as string[]).pop()!; + indexes[last] = undefined; + }; + } +} diff --git a/node_modules/@jridgewell/sourcemap-codec/LICENSE b/node_modules/@jridgewell/sourcemap-codec/LICENSE new file mode 100644 index 0000000..a331065 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2015 Rich Harris + +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/@jridgewell/sourcemap-codec/README.md b/node_modules/@jridgewell/sourcemap-codec/README.md new file mode 100644 index 0000000..5cbb315 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/README.md @@ -0,0 +1,200 @@ +# @jridgewell/sourcemap-codec + +Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). + + +## Why? + +Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. + +This package makes the process slightly easier. + + +## Installation + +```bash +npm install @jridgewell/sourcemap-codec +``` + + +## Usage + +```js +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); + +assert.deepEqual( decoded, [ + // the first line (of the generated code) has no mappings, + // as shown by the starting semi-colon (which separates lines) + [], + + // the second line contains four (comma-separated) segments + [ + // segments are encoded as you'd expect: + // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] + + // i.e. the first segment begins at column 2, and maps back to the second column + // of the second line (both zero-based) of the 0th source, and uses the 0th + // name in the `map.names` array + [ 2, 0, 2, 2, 0 ], + + // the remaining segments are 4-length rather than 5-length, + // because they don't map a name + [ 4, 0, 2, 4 ], + [ 6, 0, 2, 5 ], + [ 7, 0, 2, 7 ] + ], + + // the final line contains two segments + [ + [ 2, 1, 10, 19 ], + [ 12, 1, 11, 20 ] + ] +]); + +var encoded = encode( decoded ); +assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map - 45120 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 5479160 bytes +sourcemap-codec 5659336 bytes +source-map-0.6.1 17144440 bytes +source-map-0.8.0 6867424 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 502 ops/sec ±1.03% (90 runs sampled) +decode: sourcemap-codec x 445 ops/sec ±0.97% (92 runs sampled) +decode: source-map-0.6.1 x 36.01 ops/sec ±1.64% (49 runs sampled) +decode: source-map-0.8.0 x 367 ops/sec ±0.04% (95 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec + +Encode Memory Usage: +@jridgewell/sourcemap-codec 1261620 bytes +sourcemap-codec 9119248 bytes +source-map-0.6.1 8968560 bytes +source-map-0.8.0 8952952 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 738 ops/sec ±0.42% (98 runs sampled) +encode: sourcemap-codec x 238 ops/sec ±0.73% (88 runs sampled) +encode: source-map-0.6.1 x 162 ops/sec ±0.43% (84 runs sampled) +encode: source-map-0.8.0 x 191 ops/sec ±0.34% (90 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec + + +*** + + +babel.min.js.map - 347793 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 35338184 bytes +sourcemap-codec 35922736 bytes +source-map-0.6.1 62366360 bytes +source-map-0.8.0 44337416 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 40.35 ops/sec ±4.47% (54 runs sampled) +decode: sourcemap-codec x 36.76 ops/sec ±3.67% (51 runs sampled) +decode: source-map-0.6.1 x 4.44 ops/sec ±2.15% (16 runs sampled) +decode: source-map-0.8.0 x 59.35 ops/sec ±0.05% (78 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +@jridgewell/sourcemap-codec 7212604 bytes +sourcemap-codec 21421456 bytes +source-map-0.6.1 25286888 bytes +source-map-0.8.0 25498744 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 112 ops/sec ±0.13% (84 runs sampled) +encode: sourcemap-codec x 30.23 ops/sec ±2.76% (53 runs sampled) +encode: source-map-0.6.1 x 19.43 ops/sec ±3.70% (37 runs sampled) +encode: source-map-0.8.0 x 19.40 ops/sec ±3.26% (37 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec + + +*** + + +preact.js.map - 1992 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 500272 bytes +sourcemap-codec 516864 bytes +source-map-0.6.1 1596672 bytes +source-map-0.8.0 517272 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 16,137 ops/sec ±0.17% (99 runs sampled) +decode: sourcemap-codec x 12,139 ops/sec ±0.13% (99 runs sampled) +decode: source-map-0.6.1 x 1,264 ops/sec ±0.12% (100 runs sampled) +decode: source-map-0.8.0 x 9,894 ops/sec ±0.08% (101 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec + +Encode Memory Usage: +@jridgewell/sourcemap-codec 321026 bytes +sourcemap-codec 830832 bytes +source-map-0.6.1 586608 bytes +source-map-0.8.0 586680 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 19,876 ops/sec ±0.78% (95 runs sampled) +encode: sourcemap-codec x 6,983 ops/sec ±0.15% (100 runs sampled) +encode: source-map-0.6.1 x 5,070 ops/sec ±0.12% (102 runs sampled) +encode: source-map-0.8.0 x 5,641 ops/sec ±0.17% (100 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec + + +*** + + +react.js.map - 5726 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 734848 bytes +sourcemap-codec 954200 bytes +source-map-0.6.1 2276432 bytes +source-map-0.8.0 955488 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 5,723 ops/sec ±0.12% (98 runs sampled) +decode: sourcemap-codec x 4,555 ops/sec ±0.09% (101 runs sampled) +decode: source-map-0.6.1 x 437 ops/sec ±0.11% (93 runs sampled) +decode: source-map-0.8.0 x 3,441 ops/sec ±0.15% (100 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec + +Encode Memory Usage: +@jridgewell/sourcemap-codec 638672 bytes +sourcemap-codec 1109840 bytes +source-map-0.6.1 1321224 bytes +source-map-0.8.0 1324448 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 6,801 ops/sec ±0.48% (98 runs sampled) +encode: sourcemap-codec x 2,533 ops/sec ±0.13% (101 runs sampled) +encode: source-map-0.6.1 x 2,248 ops/sec ±0.08% (100 runs sampled) +encode: source-map-0.8.0 x 2,303 ops/sec ±0.15% (100 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec +``` + +# License + +MIT diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs new file mode 100644 index 0000000..3dff372 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs @@ -0,0 +1,164 @@ +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index = 0; + do { + const semi = indexOf(mappings, index); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i = index; i < semi; i++) { + let seg; + i = decodeInteger(mappings, i, state, 0); // genColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 1); // sourcesIndex + i = decodeInteger(mappings, i, state, 2); // sourceLine + i = decodeInteger(mappings, i, state, 3); // sourceColumn + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 4); // namesIndex + seg = [col, state[1], state[2], state[3], state[4]]; + } + else { + seg = [col, state[1], state[2], state[3]]; + } + } + else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index = semi + 1; + } while (index <= mappings.length); + return decoded; +} +function indexOf(mappings, index) { + const idx = mappings.indexOf(';', index); + return idx === -1 ? mappings.length : idx; +} +function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; +} +function hasMoreVlq(mappings, i, length) { + if (i >= length) + return false; + return mappings.charCodeAt(i) !== comma; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} + +export { decode, encode }; +//# sourceMappingURL=sourcemap-codec.mjs.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map new file mode 100644 index 0000000..236fd12 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.mjs","sources":["../src/sourcemap-codec.ts"],"sourcesContent":["export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACrC,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9B,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjB,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAClB;AAED;AACA,MAAM,EAAE,GACN,OAAO,WAAW,KAAK,WAAW;sBACd,IAAI,WAAW,EAAE;MACjC,OAAO,MAAM,KAAK,WAAW;UAC7B;YACE,MAAM,CAAC,GAAe;gBACpB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;gBACpE,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;aACvB;SACF;UACD;YACE,MAAM,CAAC,GAAe;gBACpB,IAAI,GAAG,GAAG,EAAE,CAAC;gBACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACnC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAA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GAAG,GAAG,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAEjD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACnC,GAAG,GAAG,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;SAClD;KACF;IAED,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,aAAa,CACpB,GAAe,EACf,GAAW,EACX,KAAuB,EACvB,OAAyB,EACzB,CAAS;IAET,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEhB,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IAC3C,GAAG;QACD,IAAI,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC;QAC7B,GAAG,MAAM,CAAC,CAAC;QACX,IAAI,GAAG,GAAG,CAAC;YAAE,OAAO,IAAI,QAAQ,CAAC;QACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;KACjC,QAAQ,GAAG,GAAG,CAAC,EAAE;IAElB,OAAO,GAAG,CAAC;AACb;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js new file mode 100644 index 0000000..bec92a9 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js @@ -0,0 +1,175 @@ +(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.sourcemapCodec = {})); +})(this, (function (exports) { 'use strict'; + + const comma = ','.charCodeAt(0); + const semicolon = ';'.charCodeAt(0); + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + const intToChar = new Uint8Array(64); // 64 possible chars. + const charToInt = new Uint8Array(128); // z is 122 in ASCII + for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; + } + // Provide a fallback for older environments. + const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; + function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index = 0; + do { + const semi = indexOf(mappings, index); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i = index; i < semi; i++) { + let seg; + i = decodeInteger(mappings, i, state, 0); // genColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 1); // sourcesIndex + i = decodeInteger(mappings, i, state, 2); // sourceLine + i = decodeInteger(mappings, i, state, 3); // sourceColumn + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 4); // namesIndex + seg = [col, state[1], state[2], state[3], state[4]]; + } + else { + seg = [col, state[1], state[2], state[3]]; + } + } + else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index = semi + 1; + } while (index <= mappings.length); + return decoded; + } + function indexOf(mappings, index) { + const idx = mappings.indexOf(';', index); + return idx === -1 ? mappings.length : idx; + } + function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; + } + function hasMoreVlq(mappings, i, length) { + if (i >= length) + return false; + return mappings.charCodeAt(i) !== comma; + } + function sort(line) { + line.sort(sortComparator); + } + function sortComparator(a, b) { + return a[0] - b[0]; + } + function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); + } + function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; + } + + exports.decode = decode; + exports.encode = encode; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=sourcemap-codec.umd.js.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map new file mode 100644 index 0000000..b6b2003 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.umd.js","sources":["../src/sourcemap-codec.ts"],"sourcesContent":["export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n"],"names":[],"mappings":";;;;;;IAOA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;IACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEtC,KAAK,IAAI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CACpB,GAAe,EACf,GAAW,EACX,KAAuB,EACvB,OAAyB,EACzB,CAAS;QAET,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAEhB,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QAC3C,GAAG;YACD,IAAI,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC;YAC7B,GAAG,MAAM,CAAC,CAAC;YACX,IAAI,GAAG,GAAG,CAAC;gBAAE,OAAO,IAAI,QAAQ,CAAC;YACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;SACjC,QAAQ,GAAG,GAAG,CAAC,EAAE;QAElB,OAAO,GAAG,CAAC;IACb;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts b/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts new file mode 100644 index 0000000..410d320 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts @@ -0,0 +1,6 @@ +export declare type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; +export declare type SourceMapLine = SourceMapSegment[]; +export declare type SourceMapMappings = SourceMapLine[]; +export declare function decode(mappings: string): SourceMapMappings; +export declare function encode(decoded: SourceMapMappings): string; +export declare function encode(decoded: Readonly): string; diff --git a/node_modules/@jridgewell/sourcemap-codec/package.json b/node_modules/@jridgewell/sourcemap-codec/package.json new file mode 100644 index 0000000..578448f --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/package.json @@ -0,0 +1,74 @@ +{ + "name": "@jridgewell/sourcemap-codec", + "version": "1.4.15", + "description": "Encode/decode sourcemap mappings", + "keywords": [ + "sourcemap", + "vlq" + ], + "main": "dist/sourcemap-codec.umd.js", + "module": "dist/sourcemap-codec.mjs", + "types": "dist/types/sourcemap-codec.d.ts", + "files": [ + "dist" + ], + "exports": { + ".": [ + { + "types": "./dist/types/sourcemap-codec.d.ts", + "browser": "./dist/sourcemap-codec.umd.js", + "require": "./dist/sourcemap-codec.umd.js", + "import": "./dist/sourcemap-codec.mjs" + }, + "./dist/sourcemap-codec.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:rollup benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "prebuild": "rm -rf dist", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemap-codec.git" + }, + "author": "Rich Harris", + "license": "MIT", + "devDependencies": { + "@rollup/plugin-typescript": "8.3.0", + "@types/node": "17.0.15", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "benchmark": "2.1.4", + "c8": "7.11.2", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.64.0", + "source-map": "0.6.1", + "source-map-js": "1.0.2", + "sourcemap-codec": "1.4.8", + "typescript": "4.5.4" + } +} diff --git a/node_modules/@jridgewell/trace-mapping/LICENSE b/node_modules/@jridgewell/trace-mapping/LICENSE new file mode 100644 index 0000000..37bb488 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 Justin Ridgewell + +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/@jridgewell/trace-mapping/README.md b/node_modules/@jridgewell/trace-mapping/README.md new file mode 100644 index 0000000..cc5e4f9 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/README.md @@ -0,0 +1,252 @@ +# @jridgewell/trace-mapping + +> Trace the original position through a source map + +`trace-mapping` allows you to take the line and column of an output file and trace it to the +original location in the source file through a source map. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This +provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. + +## Installation + +```sh +npm install @jridgewell/trace-mapping +``` + +## Usage + +```typescript +import { + TraceMap, + originalPositionFor, + generatedPositionFor, + sourceContentFor, +} from '@jridgewell/trace-mapping'; + +const tracer = new TraceMap({ + version: 3, + sources: ['input.js'], + sourcesContent: ['content of input.js'], + names: ['foo'], + mappings: 'KAyCIA', +}); + +// Lines start at line 1, columns at column 0. +const traced = originalPositionFor(tracer, { line: 1, column: 5 }); +assert.deepEqual(traced, { + source: 'input.js', + line: 42, + column: 4, + name: 'foo', +}); + +const content = sourceContentFor(tracer, traced.source); +assert.strictEqual(content, 'content for input.js'); + +const generated = generatedPositionFor(tracer, { + source: 'input.js', + line: 42, + column: 4, +}); +assert.deepEqual(generated, { + line: 1, + column: 5, +}); +``` + +We also provide a lower level API to get the actual segment that matches our line and column. Unlike +`originalPositionFor`, `traceSegment` uses a 0-base for `line`: + +```typescript +import { traceSegment } from '@jridgewell/trace-mapping'; + +// line is 0-base. +const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); + +// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] +// Again, line is 0-base and so is sourceLine +assert.deepEqual(traced, [5, 0, 41, 4, 0]); +``` + +### SectionedSourceMaps + +The sourcemap spec defines a special `sections` field that's designed to handle concatenation of +output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool +produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` +helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a +`TraceMap` instance: + +```typescript +import { AnyMap } from '@jridgewell/trace-mapping'; +const fooOutput = 'foo'; +const barOutput = 'bar'; +const output = [fooOutput, barOutput].join('\n'); + +const sectioned = new AnyMap({ + version: 3, + sections: [ + { + // 0-base line and column + offset: { line: 0, column: 0 }, + // fooOutput's sourcemap + map: { + version: 3, + sources: ['foo.js'], + names: ['foo'], + mappings: 'AAAAA', + }, + }, + { + // barOutput's sourcemap will not affect the first line, only the second + offset: { line: 1, column: 0 }, + map: { + version: 3, + sources: ['bar.js'], + names: ['bar'], + mappings: 'AAAAA', + }, + }, + ], +}); + +const traced = originalPositionFor(sectioned, { + line: 2, + column: 0, +}); + +assert.deepEqual(traced, { + source: 'bar.js', + line: 1, + column: 0, + name: 'bar', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map - 45120 segments + +Memory Usage: +trace-mapping decoded 562400 bytes +trace-mapping encoded 5706544 bytes +source-map-js 10717664 bytes +source-map-0.6.1 17446384 bytes +source-map-0.8.0 9701757 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 180 ops/sec ±0.34% (85 runs sampled) +trace-mapping: encoded JSON input x 364 ops/sec ±1.77% (89 runs sampled) +trace-mapping: decoded Object input x 3,116 ops/sec ±0.50% (96 runs sampled) +trace-mapping: encoded Object input x 410 ops/sec ±2.62% (85 runs sampled) +source-map-js: encoded Object input x 84.23 ops/sec ±0.91% (73 runs sampled) +source-map-0.6.1: encoded Object input x 37.21 ops/sec ±2.08% (51 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 3,952,212 ops/sec ±0.17% (98 runs sampled) +trace-mapping: encoded originalPositionFor x 3,487,468 ops/sec ±1.58% (90 runs sampled) +source-map-js: encoded originalPositionFor x 827,730 ops/sec ±0.78% (97 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 748,991 ops/sec ±0.53% (94 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 2,532,894 ops/sec ±0.57% (95 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +babel.min.js.map - 347793 segments + +Memory Usage: +trace-mapping decoded 89832 bytes +trace-mapping encoded 35474640 bytes +source-map-js 51257176 bytes +source-map-0.6.1 63515664 bytes +source-map-0.8.0 42933752 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 15.41 ops/sec ±8.65% (34 runs sampled) +trace-mapping: encoded JSON input x 28.20 ops/sec ±12.87% (42 runs sampled) +trace-mapping: decoded Object input x 964 ops/sec ±0.36% (99 runs sampled) +trace-mapping: encoded Object input x 31.77 ops/sec ±13.79% (45 runs sampled) +source-map-js: encoded Object input x 6.45 ops/sec ±5.16% (21 runs sampled) +source-map-0.6.1: encoded Object input x 4.07 ops/sec ±5.24% (15 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 7,183,038 ops/sec ±0.58% (95 runs sampled) +trace-mapping: encoded originalPositionFor x 5,192,185 ops/sec ±0.41% (100 runs sampled) +source-map-js: encoded originalPositionFor x 4,259,489 ops/sec ±0.79% (94 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 3,742,629 ops/sec ±0.71% (95 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 6,270,211 ops/sec ±0.64% (94 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +preact.js.map - 1992 segments + +Memory Usage: +trace-mapping decoded 37128 bytes +trace-mapping encoded 247280 bytes +source-map-js 1143536 bytes +source-map-0.6.1 1290992 bytes +source-map-0.8.0 96544 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 3,483 ops/sec ±0.30% (98 runs sampled) +trace-mapping: encoded JSON input x 6,092 ops/sec ±0.18% (97 runs sampled) +trace-mapping: decoded Object input x 249,076 ops/sec ±0.24% (98 runs sampled) +trace-mapping: encoded Object input x 14,555 ops/sec ±0.48% (100 runs sampled) +source-map-js: encoded Object input x 2,447 ops/sec ±0.36% (99 runs sampled) +source-map-0.6.1: encoded Object input x 1,201 ops/sec ±0.57% (96 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 7,620,192 ops/sec ±0.09% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 6,872,554 ops/sec ±0.30% (97 runs sampled) +source-map-js: encoded originalPositionFor x 2,489,570 ops/sec ±0.35% (94 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 1,698,633 ops/sec ±0.28% (98 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 4,015,644 ops/sec ±0.22% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +react.js.map - 5726 segments + +Memory Usage: +trace-mapping decoded 16176 bytes +trace-mapping encoded 681552 bytes +source-map-js 2418352 bytes +source-map-0.6.1 2443672 bytes +source-map-0.8.0 111768 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1,720 ops/sec ±0.34% (98 runs sampled) +trace-mapping: encoded JSON input x 4,406 ops/sec ±0.35% (100 runs sampled) +trace-mapping: decoded Object input x 92,122 ops/sec ±0.10% (99 runs sampled) +trace-mapping: encoded Object input x 5,385 ops/sec ±0.37% (99 runs sampled) +source-map-js: encoded Object input x 794 ops/sec ±0.40% (98 runs sampled) +source-map-0.6.1: encoded Object input x 416 ops/sec ±0.54% (91 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 32,759,519 ops/sec ±0.33% (100 runs sampled) +trace-mapping: encoded originalPositionFor x 31,116,306 ops/sec ±0.33% (97 runs sampled) +source-map-js: encoded originalPositionFor x 17,458,435 ops/sec ±0.44% (97 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 12,687,097 ops/sec ±0.43% (95 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 23,538,275 ops/sec ±0.38% (95 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor +``` + +[source-map]: https://www.npmjs.com/package/source-map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs new file mode 100644 index 0000000..917a330 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs @@ -0,0 +1,552 @@ +import { encode, decode } from '@jridgewell/sourcemap-codec'; +import resolveUri from '@jridgewell/resolve-uri'; + +function resolve(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolveUri(input, base); +} + +/** + * Removes everything after the last "/", but leaves the slash. + */ +function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; +const REV_GENERATED_LINE = 1; +const REV_GENERATED_COLUMN = 2; + +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; +} + +let found = false; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} + +// Rebuilds the original source files, with mappings that are ordered by source line/column instead +// of generated line/column. +function buildBySources(decoded, memos) { + const sources = memos.map(buildNullArray); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) + continue; + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const originalSource = sources[sourceIndex]; + const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); + const memo = memos[sourceIndex]; + // The binary search either found a match, or it found the left-index just before where the + // segment should go. Either way, we want to insert after that. And there may be multiple + // generated segments associated with an original location, so there may need to move several + // indexes before we find where we need to insert. + const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); + insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); + } + } + return sources; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like +// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. +// Numeric properties on objects are magically sorted in ascending order by the engine regardless of +// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending +// order when iterating with for-in. +function buildNullArray() { + return { __proto__: null }; +} + +const AnyMap = function (map, mapUrl) { + const parsed = typeof map === 'string' ? JSON.parse(map) : map; + if (!('sections' in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + }; + return presortedDecodedMap(joined); +}; +function recurse(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } + else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection(map, mapUrl, mappings, sources, sourcesContent, names, lineOffset + offset.line, columnOffset + offset.column, sl, sc); + } +} +function addSection(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + if ('sections' in input) + return recurse(...arguments); + const map = new TraceMap(input, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) + append(sourcesContent, contents); + else + for (let i = 0; i < resolvedSources.length; i++) + sourcesContent.push(null); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. But it may not have any columns that overstep, so we + // still need to check that we don't overstep lines, too. + if (lineI > stopLine) + return; + // The out line may already exist in mappings (if we're continuing the line started by a + // previous section). Or, we may have jumped ahead several lines to start this section. + const out = getLine(mappings, lineI); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (lineI === stopLine && column >= stopColumn) + return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push(seg.length === 4 + ? [column, sourcesIndex, sourceLine, sourceColumn] + : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) + arr.push(other[i]); +} +function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) + arr[i] = []; + return arr[index]; +} + +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; +const LEAST_UPPER_BOUND = -1; +const GREATEST_LOWER_BOUND = 1; +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +let encodedMappings; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +let decodedMappings; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +let traceSegment; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +let originalPositionFor; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +let generatedPositionFor; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +let allGeneratedPositionsFor; +/** + * Iterates each mapping in generated position order. + */ +let eachMapping; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +let sourceContentFor; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +let presortedDecodedMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let decodedMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let encodedMap; +class TraceMap { + constructor(map, mapUrl) { + const isString = typeof map === 'string'; + if (!isString && map._decodedMemo) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + const from = resolve(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve(s || '', from)); + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } +} +(() => { + encodedMappings = (map) => { + var _a; + return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded))); + }; + decodedMappings = (map) => { + return (map._decoded || (map._decoded = decode(map._encoded))); + }; + traceSegment = (map, line, column) => { + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; + }; + originalPositionFor = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) + return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) + return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null); + }; + allGeneratedPositionsFor = (map, { source, line, column, bias }) => { + // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); + }; + generatedPositionFor = (map, { source, line, column, bias }) => { + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); + }; + eachMapping = (map, cb) => { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) + name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name, + }); + } + } + }; + sourceContentFor = (map, source) => { + const { sources, resolvedSources, sourcesContent } = map; + if (sourcesContent == null) + return null; + let index = sources.indexOf(source); + if (index === -1) + index = resolvedSources.indexOf(source); + return index === -1 ? null : sourcesContent[index]; + }; + presortedDecodedMap = (map, mapUrl) => { + const tracer = new TraceMap(clone(map, []), mapUrl); + tracer._decoded = map.mappings; + return tracer; + }; + decodedMap = (map) => { + return clone(map, decodedMappings(map)); + }; + encodedMap = (map) => { + return clone(map, encodedMappings(map)); + }; + function generatedPosition(map, source, line, column, bias, all) { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) + sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) + return all ? [] : GMapping(null, null); + const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); + const segments = generated[sourceIndex][line]; + if (segments == null) + return all ? [] : GMapping(null, null); + const memo = map._bySourceMemos[sourceIndex]; + if (all) + return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) + return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); + } +})(); +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function GMapping(line, column) { + return { line, column }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return -1; + return index; +} +function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in + // insertion order) segment that matched. Even if we did respect the bias when tracing, we would + // still need to call `lowerBound()` to find the first segment, which is slower than just looking + // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the + // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to + // match LEAST_UPPER_BOUND. + if (!found && bias === LEAST_UPPER_BOUND) + min++; + if (min === -1 || min === segments.length) + return []; + // We may have found the segment that started at an earlier column. If this is the case, then we + // need to slice all generated segments that match _that_ column, because all such segments span + // to our desired column. + const matchedColumn = found ? column : segments[min][COLUMN]; + // The binary search is not guaranteed to find the lower bound when a match wasn't found. + if (!found) + min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} + +export { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, allGeneratedPositionsFor, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, sourceContentFor, traceSegment }; +//# sourceMappingURL=trace-mapping.mjs.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map new file mode 100644 index 0000000..4d40aa1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.mjs","sources":["../src/resolve.ts","../src/strip-filename.ts","../src/sourcemap-segment.ts","../src/sort.ts","../src/binary-search.ts","../src/by-source.ts","../src/any-map.ts","../src/trace-mapping.ts"],"sourcesContent":["import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMapInput,\n SectionedSourceMapInput,\n DecodedSourceMap,\n EncodedSourceMap,\n SectionedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping as Mapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n EachMapping,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\n"],"names":["bsFound"],"mappings":";;;AAEc,SAAU,OAAO,CAAC,KAAa,EAAE,IAAwB,EAAA;;;;IAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,IAAI,IAAI,GAAG,CAAC;AAE7C,IAAA,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC;;ACTA;;AAEG;AACqB,SAAA,aAAa,CAAC,IAA+B,EAAA;AACnE,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,EAAE,CAAC;IACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAClC;;ACQO,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,oBAAoB,GAAG,CAAC;;AClBvB,SAAU,SAAS,CAC/B,QAA8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AAC,CAAC;IAC7D,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,IAAA,OAAO,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE;AACxB,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9B,QAAA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvF,KAAA;AACD,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js new file mode 100644 index 0000000..a3251f1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js @@ -0,0 +1,566 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/sourcemap-codec'), require('@jridgewell/resolve-uri')) : + typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/sourcemap-codec', '@jridgewell/resolve-uri'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.traceMapping = {}, global.sourcemapCodec, global.resolveURI)); +})(this, (function (exports, sourcemapCodec, resolveUri) { 'use strict'; + + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + + var resolveUri__default = /*#__PURE__*/_interopDefaultLegacy(resolveUri); + + function resolve(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolveUri__default["default"](input, base); + } + + /** + * Removes everything after the last "/", but leaves the slash. + */ + function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + + const COLUMN = 0; + const SOURCES_INDEX = 1; + const SOURCE_LINE = 2; + const SOURCE_COLUMN = 3; + const NAMES_INDEX = 4; + const REV_GENERATED_LINE = 1; + const REV_GENERATED_COLUMN = 2; + + function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; + } + function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; + } + function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; + } + function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); + } + function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; + } + + let found = false; + /** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ + function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; + } + function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; + } + function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; + } + function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; + } + /** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ + function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); + } + + // Rebuilds the original source files, with mappings that are ordered by source line/column instead + // of generated line/column. + function buildBySources(decoded, memos) { + const sources = memos.map(buildNullArray); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) + continue; + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const originalSource = sources[sourceIndex]; + const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); + const memo = memos[sourceIndex]; + // The binary search either found a match, or it found the left-index just before where the + // segment should go. Either way, we want to insert after that. And there may be multiple + // generated segments associated with an original location, so there may need to move several + // indexes before we find where we need to insert. + const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); + insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); + } + } + return sources; + } + function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + // Null arrays allow us to use ordered index keys without actually allocating contiguous memory like + // a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. + // Numeric properties on objects are magically sorted in ascending order by the engine regardless of + // the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending + // order when iterating with for-in. + function buildNullArray() { + return { __proto__: null }; + } + + const AnyMap = function (map, mapUrl) { + const parsed = typeof map === 'string' ? JSON.parse(map) : map; + if (!('sections' in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + }; + return exports.presortedDecodedMap(joined); + }; + function recurse(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } + else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection(map, mapUrl, mappings, sources, sourcesContent, names, lineOffset + offset.line, columnOffset + offset.column, sl, sc); + } + } + function addSection(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + if ('sections' in input) + return recurse(...arguments); + const map = new TraceMap(input, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = exports.decodedMappings(map); + const { resolvedSources, sourcesContent: contents } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) + append(sourcesContent, contents); + else + for (let i = 0; i < resolvedSources.length; i++) + sourcesContent.push(null); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. But it may not have any columns that overstep, so we + // still need to check that we don't overstep lines, too. + if (lineI > stopLine) + return; + // The out line may already exist in mappings (if we're continuing the line started by a + // previous section). Or, we may have jumped ahead several lines to start this section. + const out = getLine(mappings, lineI); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (lineI === stopLine && column >= stopColumn) + return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push(seg.length === 4 + ? [column, sourcesIndex, sourceLine, sourceColumn] + : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); + } + } + } + function append(arr, other) { + for (let i = 0; i < other.length; i++) + arr.push(other[i]); + } + function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) + arr[i] = []; + return arr[index]; + } + + const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; + const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; + const LEAST_UPPER_BOUND = -1; + const GREATEST_LOWER_BOUND = 1; + /** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ + exports.encodedMappings = void 0; + /** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ + exports.decodedMappings = void 0; + /** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ + exports.traceSegment = void 0; + /** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ + exports.originalPositionFor = void 0; + /** + * Finds the generated line/column position of the provided source/line/column source position. + */ + exports.generatedPositionFor = void 0; + /** + * Finds all generated line/column positions of the provided source/line/column source position. + */ + exports.allGeneratedPositionsFor = void 0; + /** + * Iterates each mapping in generated position order. + */ + exports.eachMapping = void 0; + /** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ + exports.sourceContentFor = void 0; + /** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ + exports.presortedDecodedMap = void 0; + /** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.decodedMap = void 0; + /** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.encodedMap = void 0; + class TraceMap { + constructor(map, mapUrl) { + const isString = typeof map === 'string'; + if (!isString && map._decodedMemo) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + const from = resolve(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve(s || '', from)); + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } + } + (() => { + exports.encodedMappings = (map) => { + var _a; + return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = sourcemapCodec.encode(map._decoded))); + }; + exports.decodedMappings = (map) => { + return (map._decoded || (map._decoded = sourcemapCodec.decode(map._encoded))); + }; + exports.traceSegment = (map, line, column) => { + const decoded = exports.decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; + }; + exports.originalPositionFor = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = exports.decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) + return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) + return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null); + }; + exports.allGeneratedPositionsFor = (map, { source, line, column, bias }) => { + // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); + }; + exports.generatedPositionFor = (map, { source, line, column, bias }) => { + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); + }; + exports.eachMapping = (map, cb) => { + const decoded = exports.decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) + name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name, + }); + } + } + }; + exports.sourceContentFor = (map, source) => { + const { sources, resolvedSources, sourcesContent } = map; + if (sourcesContent == null) + return null; + let index = sources.indexOf(source); + if (index === -1) + index = resolvedSources.indexOf(source); + return index === -1 ? null : sourcesContent[index]; + }; + exports.presortedDecodedMap = (map, mapUrl) => { + const tracer = new TraceMap(clone(map, []), mapUrl); + tracer._decoded = map.mappings; + return tracer; + }; + exports.decodedMap = (map) => { + return clone(map, exports.decodedMappings(map)); + }; + exports.encodedMap = (map) => { + return clone(map, exports.encodedMappings(map)); + }; + function generatedPosition(map, source, line, column, bias, all) { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) + sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) + return all ? [] : GMapping(null, null); + const generated = (map._bySources || (map._bySources = buildBySources(exports.decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); + const segments = generated[sourceIndex][line]; + if (segments == null) + return all ? [] : GMapping(null, null); + const memo = map._bySourceMemos[sourceIndex]; + if (all) + return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) + return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); + } + })(); + function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + }; + } + function OMapping(source, line, column, name) { + return { source, line, column, name }; + } + function GMapping(line, column) { + return { line, column }; + } + function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return -1; + return index; + } + function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in + // insertion order) segment that matched. Even if we did respect the bias when tracing, we would + // still need to call `lowerBound()` to find the first segment, which is slower than just looking + // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the + // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to + // match LEAST_UPPER_BOUND. + if (!found && bias === LEAST_UPPER_BOUND) + min++; + if (min === -1 || min === segments.length) + return []; + // We may have found the segment that started at an earlier column. If this is the case, then we + // need to slice all generated segments that match _that_ column, because all such segments span + // to our desired column. + const matchedColumn = found ? column : segments[min][COLUMN]; + // The binary search is not guaranteed to find the lower bound when a match wasn't found. + if (!found) + min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; + } + + exports.AnyMap = AnyMap; + exports.GREATEST_LOWER_BOUND = GREATEST_LOWER_BOUND; + exports.LEAST_UPPER_BOUND = LEAST_UPPER_BOUND; + exports.TraceMap = TraceMap; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map new file mode 100644 index 0000000..fee1219 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.umd.js","sources":["../src/resolve.ts","../src/strip-filename.ts","../src/sourcemap-segment.ts","../src/sort.ts","../src/binary-search.ts","../src/by-source.ts","../src/any-map.ts","../src/trace-mapping.ts"],"sourcesContent":["import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMapInput,\n SectionedSourceMapInput,\n DecodedSourceMap,\n EncodedSourceMap,\n SectionedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping as Mapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n EachMapping,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\n"],"names":["resolveUri","presortedDecodedMap","decodedMappings","encodedMappings","traceSegment","originalPositionFor","generatedPositionFor","allGeneratedPositionsFor","eachMapping","sourceContentFor","decodedMap","encodedMap","encode","decode","bsFound"],"mappings":";;;;;;;;;;IAEc,SAAU,OAAO,CAAC,KAAa,EAAE,IAAwB,EAAA;;;;QAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,IAAI,IAAI,GAAG,CAAC;IAE7C,IAAA,OAAOA,8BAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjC;;ICTA;;IAEG;IACqB,SAAA,aAAa,CAAC,IAA+B,EAAA;IACnE,IAAA,IAAI,CAAC,IAAI;IAAE,QAAA,OAAO,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC;;ICQO,MAAM,M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AI,GAAG,KAAK,QAAQ,CAAC,MAAM;IAAE,QAAA,OAAO,EAAE,CAAC;;;;IAKrD,IAAA,MAAM,aAAa,GAAGA,KAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;;IAG/D,IAAA,IAAI,CAACA,KAAO;YAAE,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;QAC7D,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,IAAA,OAAO,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE;IACxB,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9B,QAAA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACvF,KAAA;IACD,IAAA,OAAO,MAAM,CAAC;IAChB;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts new file mode 100644 index 0000000..08bca6b --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts @@ -0,0 +1,8 @@ +import { TraceMap } from './trace-mapping'; +import type { SectionedSourceMapInput } from './types'; +declare type AnyMap = { + new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; + (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; +}; +export declare const AnyMap: AnyMap; +export {}; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts new file mode 100644 index 0000000..88820e5 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts @@ -0,0 +1,32 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; +export declare type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; +export declare let found: boolean; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; +export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function memoizedState(): MemoState; +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts new file mode 100644 index 0000000..8d1e538 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts @@ -0,0 +1,7 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; +import type { MemoState } from './binary-search'; +export declare type Source = { + __proto__: null; + [line: number]: Exclude[]; +}; +export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: MemoState[]): Source[]; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts new file mode 100644 index 0000000..cf7d4f8 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts @@ -0,0 +1 @@ +export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts new file mode 100644 index 0000000..2bfb5dc --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts @@ -0,0 +1,2 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts new file mode 100644 index 0000000..6d70924 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts @@ -0,0 +1,16 @@ +declare type GeneratedColumn = number; +declare type SourcesIndex = number; +declare type SourceLine = number; +declare type SourceColumn = number; +declare type NamesIndex = number; +declare type GeneratedLine = number; +export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export declare const REV_GENERATED_LINE = 1; +export declare const REV_GENERATED_COLUMN = 2; +export {}; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts new file mode 100644 index 0000000..bead5c1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts @@ -0,0 +1,4 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export default function stripFilename(path: string | undefined | null): string; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts new file mode 100644 index 0000000..c125ead --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts @@ -0,0 +1,74 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping } from './types'; +export type { SourceMapSegment } from './sourcemap-segment'; +export type { SourceMapInput, SectionedSourceMapInput, DecodedSourceMap, EncodedSourceMap, SectionedSourceMap, InvalidOriginalMapping, OriginalMapping as Mapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, EachMapping, } from './types'; +export declare const LEAST_UPPER_BOUND = -1; +export declare const GREATEST_LOWER_BOUND = 1; +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export declare let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings']; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export declare let decodedMappings: (map: TraceMap) => Readonly; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export declare let traceSegment: (map: TraceMap, line: number, column: number) => Readonly | null; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export declare let originalPositionFor: (map: TraceMap, needle: Needle) => OriginalMapping | InvalidOriginalMapping; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export declare let generatedPositionFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping | InvalidGeneratedMapping; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export declare let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[]; +/** + * Iterates each mapping in generated position order. + */ +export declare let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export declare let sourceContentFor: (map: TraceMap, source: string) => string | null; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export declare let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let decodedMap: (map: TraceMap) => Omit & { + mappings: readonly SourceMapSegment[][]; +}; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let encodedMap: (map: TraceMap) => EncodedSourceMap; +export { AnyMap } from './any-map'; +export declare class TraceMap implements SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: string[]; + private _encoded; + private _decoded; + private _decodedMemo; + private _bySources; + private _bySourceMemos; + constructor(map: SourceMapInput, mapUrl?: string | null); +} diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts new file mode 100644 index 0000000..2f4fd45 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts @@ -0,0 +1,92 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping'; +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} +export interface Section { + offset: { + line: number; + column: number; + }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} +export declare type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; +export declare type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; +export declare type GeneratedMapping = { + line: number; + column: number; +}; +export declare type InvalidGeneratedMapping = { + line: null; + column: null; +}; +export declare type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; +export declare type SourceMapInput = string | Ro | Ro | TraceMap; +export declare type SectionedSourceMapInput = SourceMapInput | Ro; +export declare type Needle = { + line: number; + column: number; + bias?: Bias; +}; +export declare type SourceNeedle = { + source: string; + line: number; + column: number; + bias?: Bias; +}; +export declare type EachMapping = { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; +} | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; +}; +export declare abstract class SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: SourceMapV3['sources']; +} +export declare type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; +declare type RoArray = Ro[]; +declare type RoObject = { + [K in keyof T]: T[K] | Ro; +}; +export {}; diff --git a/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@jridgewell/trace-mapping/package.json new file mode 100644 index 0000000..7280d75 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/package.json @@ -0,0 +1,75 @@ +{ + "name": "@jridgewell/trace-mapping", + "version": "0.3.19", + "description": "Trace the original position through a source map", + "keywords": [ + "source", + "map" + ], + "main": "dist/trace-mapping.umd.js", + "module": "dist/trace-mapping.mjs", + "types": "dist/types/trace-mapping.d.ts", + "files": [ + "dist" + ], + "exports": { + ".": [ + { + "types": "./dist/types/trace-mapping.d.ts", + "browser": "./dist/trace-mapping.umd.js", + "require": "./dist/trace-mapping.umd.js", + "import": "./dist/trace-mapping.mjs" + }, + "./dist/trace-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "author": "Justin Ridgewell ", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/trace-mapping.git" + }, + "license": "MIT", + "scripts": { + "benchmark": "run-s build:rollup benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.mjs", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "prebuild": "rm -rf dist", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build", + "test": "run-s -n test:lint test:only", + "test:debug": "ava debug", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts' '**/*.md'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "c8 ava", + "test:watch": "ava --watch" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.5.0", + "@typescript-eslint/eslint-plugin": "5.39.0", + "@typescript-eslint/parser": "5.39.0", + "ava": "4.3.3", + "benchmark": "2.1.4", + "c8": "7.12.0", + "esbuild": "0.15.10", + "eslint": "8.25.0", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-no-only-tests": "3.0.0", + "npm-run-all": "4.1.5", + "prettier": "2.7.1", + "rollup": "2.79.1", + "tsx": "3.10.1", + "typescript": "4.8.4" + }, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } +} diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md new file mode 100644 index 0000000..e0b218b --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/README.md @@ -0,0 +1,171 @@ +# @nodelib/fs.scandir + +> List files and directories inside the specified directory. + +## :bulb: Highlights + +The package is aimed at obtaining information about entries in the directory. + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.scandir +``` + +## Usage + +```ts +import * as fsScandir from '@nodelib/fs.scandir'; + +fsScandir.scandir('path', (error, stats) => { /* … */ }); +``` + +## API + +### .scandir(path, [optionsOrSettings], callback) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. + +```ts +fsScandir.scandir('path', (error, entries) => { /* … */ }); +fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); +fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); +``` + +### .scandirSync(path, [optionsOrSettings]) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. + +```ts +const entries = fsScandir.scandirSync('path'); +const entries = fsScandir.scandirSync('path', {}); +const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsScandir.Settings({ followSymbolicLinks: false }); + +const entries = fsScandir.scandirSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. +* `stats` (optional) — An instance of `fs.Stats` class. + +For example, the `scandir` call for `tools` directory with one directory inside: + +```ts +{ + dirent: Dirent { name: 'typedoc', /* … */ }, + name: 'typedoc', + path: 'tools/typedoc' +} +``` + +## Options + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} + +const settings = new fsScandir.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## `old` and `modern` mode + +This package has two modes that are used depending on the environment and parameters of use. + +### old + +* Node.js below `10.10` or when the `stats` option is enabled + +When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). + +### modern + +* Node.js 10.10+ and the `stats` option is disabled + +In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. + +This mode makes fewer calls to the file system. It's faster. + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts new file mode 100644 index 0000000..827f1db --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts @@ -0,0 +1,20 @@ +import type * as fsStat from '@nodelib/fs.stat'; +import type { Dirent, ErrnoException } from '../types'; +export interface ReaddirAsynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; + (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; +} +export interface ReaddirSynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }): Dirent[]; + (filepath: string): string[]; +} +export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { + readdir: ReaddirAsynchronousMethod; + readdirSync: ReaddirSynchronousMethod; +}; +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js new file mode 100644 index 0000000..f0fe022 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts new file mode 100644 index 0000000..33f1749 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.d.ts @@ -0,0 +1,4 @@ +/** + * IS `true` for Node.js 10.10 and greater. + */ +export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js new file mode 100644 index 0000000..7e3d441 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts new file mode 100644 index 0000000..b9da83e --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Dirent, Entry } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function scandir(path: string, callback: AsyncCallback): void; +declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace scandir { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; +export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js new file mode 100644 index 0000000..99c70d3 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.scandirSync = exports.scandir = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.scandirSync = scandirSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts new file mode 100644 index 0000000..5829676 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts @@ -0,0 +1,7 @@ +/// +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; +export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js new file mode 100644 index 0000000..e8e2f0a --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const rpl = require("run-parallel"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); +} +exports.read = read; +function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); +} +exports.readdir = readdir; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts new file mode 100644 index 0000000..2b4d08b --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts @@ -0,0 +1 @@ +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js new file mode 100644 index 0000000..8724cb5 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = void 0; +function joinPathSegments(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts new file mode 100644 index 0000000..e05c8f0 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts @@ -0,0 +1,5 @@ +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare function read(directory: string, settings: Settings): Entry[]; +export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; +export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js new file mode 100644 index 0000000..146db34 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); +} +exports.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); +} +exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts new file mode 100644 index 0000000..a0db115 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.d.ts @@ -0,0 +1,20 @@ +import * as fsStat from '@nodelib/fs.stat'; +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLinks: boolean; + readonly fs: fs.FileSystemAdapter; + readonly pathSegmentSeparator: string; + readonly stats: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + readonly fsStatSettings: fsStat.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js new file mode 100644 index 0000000..15a3e8c --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsStat = require("@nodelib/fs.stat"); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts new file mode 100644 index 0000000..f326c5e --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts @@ -0,0 +1,20 @@ +/// +import type * as fs from 'fs'; +export interface Entry { + dirent: Dirent; + name: string; + path: string; + stats?: Stats; +} +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; +export interface Dirent { + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isDirectory: () => boolean; + isFIFO: () => boolean; + isFile: () => boolean; + isSocket: () => boolean; + isSymbolicLink: () => boolean; + name: string; +} diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts new file mode 100644 index 0000000..bb863f1 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts @@ -0,0 +1,2 @@ +import type { Dirent, Stats } from '../types'; +export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js new file mode 100644 index 0000000..ace7c74 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts new file mode 100644 index 0000000..1b41954 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts @@ -0,0 +1,2 @@ +import * as fs from './fs'; +export { fs }; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js new file mode 100644 index 0000000..f5de129 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const fs = require("./fs"); +exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json new file mode 100644 index 0000000..d3a8924 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.scandir", + "version": "2.1.5", + "description": "List files and directories inside the specified directory", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "scandir", + "readdir", + "dirent" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4", + "@types/run-parallel": "^1.1.0" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 0000000..686f047 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts new file mode 100644 index 0000000..3af759c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts @@ -0,0 +1,13 @@ +/// +import * as fs from 'fs'; +import type { ErrnoException } from '../types'; +export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; +export declare type StatSynchronousMethod = (path: string) => fs.Stats; +export interface FileSystemAdapter { + lstat: StatAsynchronousMethod; + stat: StatAsynchronousMethod; + lstatSync: StatSynchronousMethod; + statSync: StatSynchronousMethod; +} +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js new file mode 100644 index 0000000..8dc08c8 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts new file mode 100644 index 0000000..f95db99 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Stats } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function stat(path: string, callback: AsyncCallback): void; +declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace stat { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; +export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js new file mode 100644 index 0000000..b23f751 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.statSync = exports.stat = exports.Settings = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function stat(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.stat = stat; +function statSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.statSync = statSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts new file mode 100644 index 0000000..85423ce --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts @@ -0,0 +1,4 @@ +import type Settings from '../settings'; +import type { ErrnoException, Stats } from '../types'; +export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; +export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js new file mode 100644 index 0000000..983ff0e --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); +} +exports.read = read; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts new file mode 100644 index 0000000..428c3d7 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts @@ -0,0 +1,3 @@ +import type Settings from '../settings'; +import type { Stats } from '../types'; +export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js new file mode 100644 index 0000000..1521c36 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } +} +exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts new file mode 100644 index 0000000..f4b3d44 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.d.ts @@ -0,0 +1,16 @@ +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLink?: boolean; + fs?: Partial; + markSymbolicLink?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLink: boolean; + readonly fs: fs.FileSystemAdapter; + readonly markSymbolicLink: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js new file mode 100644 index 0000000..111ec09 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts new file mode 100644 index 0000000..74c08ed --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.d.ts @@ -0,0 +1,4 @@ +/// +import type * as fs from 'fs'; +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 0000000..f2540c2 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nodelib/fs.stat", + "version": "2.0.5", + "description": "Get the status of a file with some features", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md new file mode 100644 index 0000000..6ccc08d --- /dev/null +++ b/node_modules/@nodelib/fs.walk/README.md @@ -0,0 +1,215 @@ +# @nodelib/fs.walk + +> A library for efficiently walking a directory recursively. + +## :bulb: Highlights + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). +* :gear: Built-in directories/files and error filtering system. +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.walk +``` + +## Usage + +```ts +import * as fsWalk from '@nodelib/fs.walk'; + +fsWalk.walk('path', (error, entries) => { /* … */ }); +``` + +## API + +### .walk(path, [optionsOrSettings], callback) + +Reads the directory recursively and asynchronously. Requires a callback function. + +> :book: If you want to use the Promise API, use `util.promisify`. + +```ts +fsWalk.walk('path', (error, entries) => { /* … */ }); +fsWalk.walk('path', {}, (error, entries) => { /* … */ }); +fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); +``` + +### .walkStream(path, [optionsOrSettings]) + +Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. + +```ts +const stream = fsWalk.walkStream('path'); +const stream = fsWalk.walkStream('path', {}); +const stream = fsWalk.walkStream('path', new fsWalk.Settings()); +``` + +### .walkSync(path, [optionsOrSettings]) + +Reads the directory recursively and synchronously. Returns an array of entries. + +```ts +const entries = fsWalk.walkSync('path'); +const entries = fsWalk.walkSync('path', {}); +const entries = fsWalk.walkSync('path', new fsWalk.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsWalk.Settings({ followSymbolicLinks: true }); + +const entries = fsWalk.walkSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. +* [`stats`] — An instance of `fs.Stats` class. + +## Options + +### basePath + +* Type: `string` +* Default: `undefined` + +By default, all paths are built relative to the root path. You can use this option to set custom root path. + +In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. + +```ts +fsWalk.walkSync('root'); // → ['root/file.txt'] +fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] +``` + +### concurrency + +* Type: `number` +* Default: `Infinity` + +The maximum number of concurrent calls to `fs.readdir`. + +> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). + +### deepFilter + +* Type: [`DeepFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the directory will be read deep or not. + +```ts +// Skip all directories that starts with `node_modules` +const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); +``` + +### entryFilter + +* Type: [`EntryFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the entry will be included to results or not. + +```ts +// Exclude all `.js` files from results +const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); +``` + +### errorFilter + +* Type: [`ErrorFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that allows you to skip errors that occur when reading directories. + +For example, you can skip `ENOENT` errors if required: + +```ts +// Skip all ENOENT errors +const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; +``` + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: `FileSystemAdapter` +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat: typeof fs.lstat; + stat: typeof fs.stat; + lstatSync: typeof fs.lstatSync; + statSync: typeof fs.statSync; + readdir: typeof fs.readdir; + readdirSync: typeof fs.readdirSync; +} + +const settings = new fsWalk.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts new file mode 100644 index 0000000..8864c7b --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.d.ts @@ -0,0 +1,14 @@ +/// +import type { Readable } from 'stream'; +import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; +import { AsyncCallback } from './providers/async'; +import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; +import type { Entry } from './types'; +declare function walk(directory: string, callback: AsyncCallback): void; +declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace walk { + function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; +declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; +export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js new file mode 100644 index 0000000..1520787 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = require("./providers/async"); +const stream_1 = require("./providers/stream"); +const sync_1 = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts new file mode 100644 index 0000000..0f6717d --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts @@ -0,0 +1,12 @@ +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; +export default class AsyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + private readonly _storage; + constructor(_root: string, _settings: Settings); + read(callback: AsyncCallback): void; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js new file mode 100644 index 0000000..51d3be5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const async_1 = require("../readers/async"); +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } +} +exports.default = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, entries) { + callback(null, entries); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts new file mode 100644 index 0000000..874f60c --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts @@ -0,0 +1,4 @@ +import AsyncProvider from './async'; +import StreamProvider from './stream'; +import SyncProvider from './sync'; +export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js new file mode 100644 index 0000000..4c2529c --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; +const async_1 = require("./async"); +exports.AsyncProvider = async_1.default; +const stream_1 = require("./stream"); +exports.StreamProvider = stream_1.default; +const sync_1 = require("./sync"); +exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts new file mode 100644 index 0000000..294185f --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts @@ -0,0 +1,12 @@ +/// +import { Readable } from 'stream'; +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +export default class StreamProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + protected readonly _stream: Readable; + constructor(_root: string, _settings: Settings); + read(): Readable; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js new file mode 100644 index 0000000..51298b0 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const async_1 = require("../readers/async"); +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts new file mode 100644 index 0000000..551c42e --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts @@ -0,0 +1,10 @@ +import SyncReader from '../readers/sync'; +import type Settings from '../settings'; +import type { Entry } from '../types'; +export default class SyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: SyncReader; + constructor(_root: string, _settings: Settings); + read(): Entry[]; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js new file mode 100644 index 0000000..faab6ca --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = require("../readers/sync"); +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } +} +exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts new file mode 100644 index 0000000..9acf4e6 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts @@ -0,0 +1,30 @@ +/// +import { EventEmitter } from 'events'; +import * as fsScandir from '@nodelib/fs.scandir'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +import Reader from './reader'; +declare type EntryEventCallback = (entry: Entry) => void; +declare type ErrorEventCallback = (error: Errno) => void; +declare type EndEventCallback = () => void; +export default class AsyncReader extends Reader { + protected readonly _settings: Settings; + protected readonly _scandir: typeof fsScandir.scandir; + protected readonly _emitter: EventEmitter; + private readonly _queue; + private _isFatalError; + private _isDestroyed; + constructor(_root: string, _settings: Settings); + read(): EventEmitter; + get isDestroyed(): boolean; + destroy(): void; + onEntry(callback: EntryEventCallback): void; + onError(callback: ErrorEventCallback): void; + onEnd(callback: EndEventCallback): void; + private _pushToQueue; + private _worker; + private _handleError; + private _handleEntry; + private _emitEntry; +} +export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js new file mode 100644 index 0000000..ebe8dd5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("events"); +const fsScandir = require("@nodelib/fs.scandir"); +const fastq = require("fastq"); +const common = require("./common"); +const reader_1 = require("./reader"); +class AsyncReader extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } +} +exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts new file mode 100644 index 0000000..5985f97 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts @@ -0,0 +1,7 @@ +import type { FilterFunction } from '../settings'; +import type Settings from '../settings'; +import type { Errno } from '../types'; +export declare function isFatalError(settings: Settings, error: Errno): boolean; +export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; +export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js new file mode 100644 index 0000000..a93572f --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); +} +exports.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +exports.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +exports.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts new file mode 100644 index 0000000..e1f383b --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts @@ -0,0 +1,6 @@ +import type Settings from '../settings'; +export default class Reader { + protected readonly _root: string; + protected readonly _settings: Settings; + constructor(_root: string, _settings: Settings); +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js new file mode 100644 index 0000000..782f07c --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common = require("./common"); +class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +} +exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts new file mode 100644 index 0000000..af41033 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts @@ -0,0 +1,15 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry } from '../types'; +import Reader from './reader'; +export default class SyncReader extends Reader { + protected readonly _scandir: typeof fsScandir.scandirSync; + private readonly _storage; + private readonly _queue; + read(): Entry[]; + private _pushToQueue; + private _handleQueue; + private _handleDirectory; + private _handleError; + private _handleEntry; + private _pushToStorage; +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js new file mode 100644 index 0000000..9a8d5a6 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsScandir = require("@nodelib/fs.scandir"); +const common = require("./common"); +const reader_1 = require("./reader"); +class SyncReader extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts new file mode 100644 index 0000000..d1c4b45 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.d.ts @@ -0,0 +1,30 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry, Errno } from './types'; +export declare type FilterFunction = (value: T) => boolean; +export declare type DeepFilterFunction = FilterFunction; +export declare type EntryFilterFunction = FilterFunction; +export declare type ErrorFilterFunction = FilterFunction; +export interface Options { + basePath?: string; + concurrency?: number; + deepFilter?: DeepFilterFunction; + entryFilter?: EntryFilterFunction; + errorFilter?: ErrorFilterFunction; + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly basePath?: string; + readonly concurrency: number; + readonly deepFilter: DeepFilterFunction | null; + readonly entryFilter: EntryFilterFunction | null; + readonly errorFilter: ErrorFilterFunction | null; + readonly pathSegmentSeparator: string; + readonly fsScandirSettings: fsScandir.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js new file mode 100644 index 0000000..d7a85c8 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsScandir = require("@nodelib/fs.scandir"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts new file mode 100644 index 0000000..6ee9bd3 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.d.ts @@ -0,0 +1,8 @@ +/// +import type * as scandir from '@nodelib/fs.scandir'; +export declare type Entry = scandir.Entry; +export declare type Errno = NodeJS.ErrnoException; +export interface QueueItem { + directory: string; + base?: string; +} diff --git a/node_modules/@nodelib/fs.walk/out/types/index.js b/node_modules/@nodelib/fs.walk/out/types/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json new file mode 100644 index 0000000..86bfce4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.walk", + "version": "1.2.8", + "description": "A library for efficiently walking a directory recursively", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "walk", + "scanner", + "crawler" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*", + "!out/**/tests/**" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" +} diff --git a/node_modules/@popperjs/core/LICENSE.md b/node_modules/@popperjs/core/LICENSE.md new file mode 100644 index 0000000..0370c45 --- /dev/null +++ b/node_modules/@popperjs/core/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 Federico Zivolo + +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/@popperjs/core/README.md b/node_modules/@popperjs/core/README.md new file mode 100644 index 0000000..53be7b9 --- /dev/null +++ b/node_modules/@popperjs/core/README.md @@ -0,0 +1,376 @@ + +

+ Popper +

+ +
+

Tooltip & Popover Positioning Engine

+
+ +

+ + npm version + + + npm downloads per month (popper.js + @popperjs/core) + + + Rolling Versions + +

+ +
+ + +**Positioning tooltips and popovers is difficult. Popper is here to help!** + +Given an element, such as a button, and a tooltip element describing it, Popper +will automatically put the tooltip in the right place near the button. + +It will position _any_ UI element that "pops out" from the flow of your document +and floats near a target element. The most common example is a tooltip, but it +also includes popovers, drop-downs, and more. All of these can be generically +described as a "popper" element. + +## Demo + +[![Popper visualized](https://i.imgur.com/F7qWsmV.jpg)](https://popper.js.org) + +## Docs + +- [v2.x (latest)](https://popper.js.org/docs/v2/) +- [v1.x](https://popper.js.org/docs/v1/) + +We've created a +[Migration Guide](https://popper.js.org/docs/v2/migration-guide/) to help you +migrate from Popper 1 to Popper 2. + +To contribute to the Popper website and documentation, please visit the +[dedicated repository](https://github.com/popperjs/website). + +## Why not use pure CSS? + +- **Clipping and overflow issues**: Pure CSS poppers will not be prevented from + overflowing clipping boundaries, such as the viewport. It will get partially + cut off or overflows if it's near the edge since there is no dynamic + positioning logic. When using Popper, your popper will always be positioned in + the right place without needing manual adjustments. +- **No flipping**: CSS poppers will not flip to a different placement to fit + better in view if necessary. While you can manually adjust for the main axis + overflow, this feature cannot be achieved via CSS alone. Popper automatically + flips the tooltip to make it fit in view as best as possible for the user. +- **No virtual positioning**: CSS poppers cannot follow the mouse cursor or be + used as a context menu. Popper allows you to position your tooltip relative to + any coordinates you desire. +- **Slower development cycle**: When pure CSS is used to position popper + elements, the lack of dynamic positioning means they must be carefully placed + to consider overflow on all screen sizes. In reusable component libraries, + this means a developer can't just add the component anywhere on the page, + because these issues need to be considered and adjusted for every time. With + Popper, you can place your elements anywhere and they will be positioned + correctly, without needing to consider different screen sizes, layouts, etc. + This massively speeds up development time because this work is automatically + offloaded to Popper. +- **Lack of extensibility**: CSS poppers cannot be easily extended to fit any + arbitrary use case you may need to adjust for. Popper is built with + extensibility in mind. + +## Why Popper? + +With the CSS drawbacks out of the way, we now move on to Popper in the +JavaScript space itself. + +Naive JavaScript tooltip implementations usually have the following problems: + +- **Scrolling containers**: They don't ensure the tooltip stays with the + reference element while scrolling when inside any number of scrolling + containers. +- **DOM context**: They often require the tooltip move outside of its original + DOM context because they don't handle `offsetParent` contexts. +- **Compatibility**: Popper handles an incredible number of edge cases regarding + different browsers and environments (mobile viewports, RTL, scrollbars enabled + or disabled, etc.). Popper is a popular and well-maintained library, so you + can be confident positioning will work for your users on any device. +- **Configurability**: They often lack advanced configurability to suit any + possible use case. +- **Size**: They are usually relatively large in size, or require an ancient + jQuery dependency. +- **Performance**: They often have runtime performance issues and update the + tooltip position too slowly. + +**Popper solves all of these key problems in an elegant, performant manner.** It +is a lightweight ~3 kB library that aims to provide a reliable and extensible +positioning engine you can use to ensure all your popper elements are positioned +in the right place. + +When you start writing your own popper implementation, you'll quickly run into +all of the problems mentioned above. These widgets are incredibly common in our +UIs; we've done the hard work figuring this out so you don't need to spend hours +fixing and handling numerous edge cases that we already ran into while building +the library! + +Popper is used in popular libraries like Bootstrap, Foundation, Material UI, and +more. It's likely you've already used popper elements on the web positioned by +Popper at some point in the past few years. + +Since we write UIs using powerful abstraction libraries such as React or Angular +nowadays, you'll also be glad to know Popper can fully integrate with them and +be a good citizen together with your other components. Check out `react-popper` +for the official Popper wrapper for React. + +## Installation + +### 1. Package Manager + +```bash +# With npm +npm i @popperjs/core + +# With Yarn +yarn add @popperjs/core +``` + +### 2. CDN + +```html + + + + + +``` + +### 3. Direct Download? + +Managing dependencies by "directly downloading" them and placing them into your +source code is not recommended for a variety of reasons, including missing out +on feat/fix updates easily. Please use a versioning management system like a CDN +or npm/Yarn. + +## Usage + +The most straightforward way to get started is to import Popper from the `unpkg` +CDN, which includes all of its features. You can call the `Popper.createPopper` +constructor to create new popper instances. + +Here is a complete example: + +```html + +Popper example + + + + + + + + +``` + +Visit the [tutorial](https://popper.js.org/docs/v2/tutorial/) for an example of +how to build your own tooltip from scratch using Popper. + +### Module bundlers + +You can import the `createPopper` constructor from the fully-featured file: + +```js +import { createPopper } from '@popperjs/core'; + +const button = document.querySelector('#button'); +const tooltip = document.querySelector('#tooltip'); + +// Pass the button, the tooltip, and some options, and Popper will do the +// magic positioning for you: +createPopper(button, tooltip, { + placement: 'right', +}); +``` + +All the modifiers listed in the docs menu will be enabled and "just work", so +you don't need to think about setting Popper up. The size of Popper including +all of its features is about 5 kB minzipped, but it may grow a bit in the +future. + +#### Popper Lite (tree-shaking) + +If bundle size is important, you'll want to take advantage of tree-shaking. The +library is built in a modular way to allow to import only the parts you really +need. + +```js +import { createPopperLite as createPopper } from '@popperjs/core'; +``` + +The Lite version includes the most necessary modifiers that will compute the +offsets of the popper, compute and add the positioning styles, and add event +listeners. This is close in bundle size to pure CSS tooltip libraries, and +behaves somewhat similarly. + +However, this does not include the features that makes Popper truly useful. + +The two most useful modifiers not included in Lite are `preventOverflow` and +`flip`: + +```js +import { + createPopperLite as createPopper, + preventOverflow, + flip, +} from '@popperjs/core'; + +const button = document.querySelector('#button'); +const tooltip = document.querySelector('#tooltip'); + +createPopper(button, tooltip, { + modifiers: [preventOverflow, flip], +}); +``` + +As you make more poppers, you may be finding yourself needing other modifiers +provided by the library. + +See [tree-shaking](https://popper.js.org/docs/v2/performance/#tree-shaking) for more +information. + +## Distribution targets + +Popper is distributed in 3 different versions, in 3 different file formats. + +The 3 file formats are: + +- `esm` (works with `import` syntax — **recommended**) +- `umd` (works with ` +``` + +In [Node.js](https://nodejs.org/): + +```js +const cssesc = require('cssesc'); +``` + +In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc): + +```bash +gem install ruby-cssesc +``` + +```ruby +require 'ruby-cssesc' +CSSEsc.escape('I ♥ Ruby', is_identifier: true) +``` + +In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape): + +```bash +gem install sassy-escape +``` + +```scss +body { + content: escape('I ♥ Sass', $is-identifier: true); +} +``` + +## API + +### `cssesc(value, options)` + +This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes). + +```js +cssesc('Ich ♥ Bücher'); +// → 'Ich \\2665 B\\FC cher' + +cssesc('foo 𝌆 bar'); +// → 'foo \\1D306 bar' +``` + +By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below). + +The optional `options` argument accepts an object with the following options: + +#### `isIdentifier` + +The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`. + +```js +cssesc('123a2b'); +// → '123a2b' + +cssesc('123a2b', { + 'isIdentifier': true +}); +// → '\\31 23a2b' +``` + +#### `quotes` + +The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.'); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' +// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." + +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single' +}); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' +// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." +``` + +If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double' +}); +// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.' +// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc." +``` + +#### `wrap` + +The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. + +```js +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single', + 'wrap': true +}); +// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' +// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" + +cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double', + 'wrap': true +}); +// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' +// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" +``` + +#### `escapeEverything` + +The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols. + +```js +cssesc('lolwat"foo\'bar', { + 'escapeEverything': true +}); +// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72' +// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72" +``` + +#### Overriding the default options globally + +The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting. + +```js +// Read the global default setting for `escapeEverything`: +cssesc.options.escapeEverything; +// → `false` by default + +// Override the global default setting for `escapeEverything`: +cssesc.options.escapeEverything = true; + +// Using the global default setting for `escapeEverything`, which is now `true`: +cssesc('foo © bar ≠ baz 𝌆 qux'); +// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78' +``` + +### `cssesc.version` + +A string representing the semantic version number. + +### Using the `cssesc` binary + +To use the `cssesc` binary in your shell, simply install cssesc globally using npm: + +```bash +npm install -g cssesc +``` + +After that you will be able to escape text for use in CSS strings or identifiers from the command line: + +```bash +$ cssesc 'föo ♥ bår 𝌆 baz' +f\F6o \2665 b\E5r \1D306 baz +``` + +If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option: + +```bash +$ cssesc --identifier 'föo ♥ bår 𝌆 baz' +f\F6o\ \2665\ b\E5r\ \1D306\ baz +``` + +See `cssesc --help` for the full list of options. + +## Support + +This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0). + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +This library is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/cssesc/bin/cssesc b/node_modules/cssesc/bin/cssesc new file mode 100644 index 0000000..188c034 --- /dev/null +++ b/node_modules/cssesc/bin/cssesc @@ -0,0 +1,116 @@ +#!/usr/bin/env node +const fs = require('fs'); +const cssesc = require('../cssesc.js'); +const strings = process.argv.splice(2); +const stdin = process.stdin; +const options = {}; +const log = console.log; + +const main = function() { + const option = strings[0]; + + if (/^(?:-h|--help|undefined)$/.test(option)) { + log( + 'cssesc v%s - https://mths.be/cssesc', + cssesc.version + ); + log([ + '\nUsage:\n', + '\tcssesc [string]', + '\tcssesc [-i | --identifier] [string]', + '\tcssesc [-s | --single-quotes] [string]', + '\tcssesc [-d | --double-quotes] [string]', + '\tcssesc [-w | --wrap] [string]', + '\tcssesc [-e | --escape-everything] [string]', + '\tcssesc [-v | --version]', + '\tcssesc [-h | --help]', + '\nExamples:\n', + '\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc' + ].join('\n')); + return process.exit(1); + } + + if (/^(?:-v|--version)$/.test(option)) { + log('v%s', cssesc.version); + return process.exit(1); + } + + strings.forEach(function(string) { + // Process options + if (/^(?:-i|--identifier)$/.test(string)) { + options.isIdentifier = true; + return; + } + if (/^(?:-s|--single-quotes)$/.test(string)) { + options.quotes = 'single'; + return; + } + if (/^(?:-d|--double-quotes)$/.test(string)) { + options.quotes = 'double'; + return; + } + if (/^(?:-w|--wrap)$/.test(string)) { + options.wrap = true; + return; + } + if (/^(?:-e|--escape-everything)$/.test(string)) { + options.escapeEverything = true; + return; + } + + // Process string(s) + let result; + try { + result = cssesc(string, options); + log(result); + } catch (exception) { + log(exception.message + '\n'); + log('Error: failed to escape.'); + log('If you think this is a bug in cssesc, please report it:'); + log('https://github.com/mathiasbynens/cssesc/issues/new'); + log( + '\nStack trace using cssesc@%s:\n', + cssesc.version + ); + log(exception.stack); + return process.exit(1); + } + }); + // Return with exit status 0 outside of the `forEach` loop, in case + // multiple strings were passed in. + return process.exit(0); + +}; + +if (stdin.isTTY) { + // handle shell arguments + main(); +} else { + let timeout; + // Either the script is called from within a non-TTY context, or `stdin` + // content is being piped in. + if (!process.stdout.isTTY) { + // The script was called from a non-TTY context. This is a rather uncommon + // use case we don’t actively support. However, we don’t want the script + // to wait forever in such cases, so… + timeout = setTimeout(function() { + // …if no piped data arrived after a whole minute, handle shell + // arguments instead. + main(); + }, 60000); + } + let data = ''; + stdin.on('data', function(chunk) { + clearTimeout(timeout); + data += chunk; + }); + stdin.on('end', function() { + strings.push(data.trim()); + main(); + }); + stdin.resume(); +} diff --git a/node_modules/cssesc/cssesc.js b/node_modules/cssesc/cssesc.js new file mode 100644 index 0000000..1c0928e --- /dev/null +++ b/node_modules/cssesc/cssesc.js @@ -0,0 +1,110 @@ +/*! https://mths.be/cssesc v3.0.0 by @mathias */ +'use strict'; + +var object = {}; +var hasOwnProperty = object.hasOwnProperty; +var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; +}; + +var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; +var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; +var regexAlwaysEscape = /['"\\]/; +var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + +// https://mathiasbynens.be/notes/css-escapes#css +var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; +}; + +// Expose default options (so they can be overridden globally). +cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false +}; + +cssesc.version = '3.0.0'; + +module.exports = cssesc; diff --git a/node_modules/cssesc/man/cssesc.1 b/node_modules/cssesc/man/cssesc.1 new file mode 100644 index 0000000..eee4996 --- /dev/null +++ b/node_modules/cssesc/man/cssesc.1 @@ -0,0 +1,70 @@ +.Dd August 9, 2013 +.Dt cssesc 1 +.Sh NAME +.Nm cssesc +.Nd escape text for use in CSS string literals or identifiers +.Sh SYNOPSIS +.Nm +.Op Fl i | -identifier Ar string +.br +.Op Fl s | -single-quotes Ar string +.br +.Op Fl d | -double-quotes Ar string +.br +.Op Fl w | -wrap Ar string +.br +.Op Fl e | -escape-everything Ar string +.br +.Op Fl v | -version +.br +.Op Fl h | -help +.Sh DESCRIPTION +.Nm +escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output. +.Sh OPTIONS +.Bl -ohang -offset +.It Sy "-s, --single-quotes" +Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes. +.It Sy "-d, --double-quotes" +Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes. +.It Sy "-w, --wrap" +Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the +.Ar -s | --single-quotes +or +.Ar -d | --double-quotes +settings. +.It Sy "-e, --escape-everything" +Escape all the symbols in the output, even printable ASCII symbols. +.It Sy "-v, --version" +Print cssesc's version. +.It Sy "-h, --help" +Show the help screen. +.El +.Sh EXIT STATUS +The +.Nm cssesc +utility exits with one of the following values: +.Pp +.Bl -tag -width flag -compact +.It Li 0 +.Nm +successfully escaped the given text and printed the result. +.It Li 1 +.Nm +wasn't instructed to escape anything (for example, the +.Ar --help +flag was set); or, an error occurred. +.El +.Sh EXAMPLES +.Bl -ohang -offset +.It Sy "cssesc 'foo bar baz'" +Print an escaped version of the given text. +.It Sy echo\ 'foo bar baz'\ |\ cssesc +Print an escaped version of the text that gets piped in. +.El +.Sh BUGS +cssesc's bug tracker is located at . +.Sh AUTHOR +Mathias Bynens +.Sh WWW + diff --git a/node_modules/cssesc/package.json b/node_modules/cssesc/package.json new file mode 100644 index 0000000..076c84d --- /dev/null +++ b/node_modules/cssesc/package.json @@ -0,0 +1,51 @@ +{ + "name": "cssesc", + "version": "3.0.0", + "description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.", + "homepage": "https://mths.be/cssesc", + "engines": { + "node": ">=4" + }, + "main": "cssesc.js", + "bin": "bin/cssesc", + "man": "man/cssesc.1", + "keywords": [ + "css", + "escape", + "identifier", + "string", + "tool" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/cssesc.git" + }, + "bugs": "https://github.com/mathiasbynens/cssesc/issues", + "files": [ + "LICENSE-MIT.txt", + "cssesc.js", + "bin/", + "man/" + ], + "scripts": { + "build": "grunt template && babel cssesc.js -o cssesc.js", + "test": "mocha tests", + "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.6.1", + "codecov": "^1.0.1", + "grunt": "^1.0.1", + "grunt-template": "^1.0.0", + "istanbul": "^0.4.4", + "mocha": "^2.5.3", + "regenerate": "^1.2.1", + "requirejs": "^2.1.16" + } +} diff --git a/node_modules/didyoumean/LICENSE b/node_modules/didyoumean/LICENSE new file mode 100644 index 0000000..32c23db --- /dev/null +++ b/node_modules/didyoumean/LICENSE @@ -0,0 +1,14 @@ +## License + +didYouMean.js copyright (c) 2013 Dave Porter. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License +[here](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/didyoumean/README.md b/node_modules/didyoumean/README.md new file mode 100644 index 0000000..cd16698 --- /dev/null +++ b/node_modules/didyoumean/README.md @@ -0,0 +1,134 @@ +didYouMean.js - A simple JavaScript matching engine +=================================================== + +[Available on GitHub](https://github.com/dcporter/didyoumean.js). + +A super-simple, highly optimized JS library for matching human-quality input to a list of potential +matches. You can use it to suggest a misspelled command-line utility option to a user, or to offer +links to nearby valid URLs on your 404 page. (The examples below are taken from a personal project, +my [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct +URLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).) +Uses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance). + +didYouMean.js works in the browser as well as in node.js. To install it for use in node: + +``` +npm install didyoumean +``` + + +Examples +-------- + +Matching against a list of strings: +``` +var input = 'insargrm' +var list = ['facebook', 'twitter', 'instagram', 'linkedin']; +console.log(didYouMean(input, list)); +> 'instagram' +// The method matches 'insargrm' to 'instagram'. + +input = 'google plus'; +console.log(didYouMean(input, list)); +> null +// The method was unable to find 'google plus' in the list of options. +``` + +Matching against a list of objects: +``` +var input = 'insargrm'; +var list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ]; +var key = 'id'; +console.log(didYouMean(input, list, key)); +> 'instagram' +// The method returns the matching value. + +didYouMean.returnWinningObject = true; +console.log(didYouMean(input, list, key)); +> { id: 'instagram' } +// The method returns the matching object. +``` + + +didYouMean(str, list, [key]) +---------------------------- + +- str: The string input to match. +- list: An array of strings or objects to match against. +- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string + to match against. + +Returns: the closest matching string, or null if no strings exceed the threshold. + + +Options +------- + +Options are set on the didYouMean function object. You may change them at any time. + +### threshold + + By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length. + For example, if a ten-letter string is five edits away from its nearest match, the method will return null. + + You can control this by setting the "threshold" value on the didYouMean function. For example, to set the + edit distance threshold to 50% of the input string's length: + + ``` + didYouMean.threshold = 0.5; + ``` + + To return the nearest match no matter the threshold, set this value to null. + +### thresholdAbsolute + + This option behaves the same as threshold, but instead takes an integer number of edit steps. For example, + if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance + is less than 20. Both options apply. + +### caseSensitive + + By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set + the "caseSensitive" value to true: + + ``` + didYouMean.caseSensitive = true; + ``` + +### nullResultValue + + By default, the method will return null if there is no sufficiently close match. You can change this value here. + +### returnWinningObject + + By default, the method will return the winning string value (if any). If your list contains objects rather + than strings, you may set returnWinningObject to true. + + ``` + didYouMean.returnWinningObject = true; + ``` + + This option has no effect on lists of strings. + +### returnFirstMatch + + By default, the method will search all values and return the closest match. If you're simply looking for a "good- + enough" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed + things up. + + +License +------- + +didYouMean copyright (c) 2013-2014 Dave Porter. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License +[here](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/didyoumean/didYouMean-1.2.1.js b/node_modules/didyoumean/didYouMean-1.2.1.js new file mode 100644 index 0000000..febb30e --- /dev/null +++ b/node_modules/didyoumean/didYouMean-1.2.1.js @@ -0,0 +1,274 @@ +/* + +didYouMean.js - A simple JavaScript matching engine +=================================================== + +[Available on GitHub](https://github.com/dcporter/didyoumean.js). + +A super-simple, highly optimized JS library for matching human-quality input to a list of potential +matches. You can use it to suggest a misspelled command-line utility option to a user, or to offer +links to nearby valid URLs on your 404 page. (The examples below are taken from a personal project, +my [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct +URLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).) +Uses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance). + +didYouMean.js works in the browser as well as in node.js. To install it for use in node: + +``` +npm install didyoumean +``` + + +Examples +-------- + +Matching against a list of strings: +``` +var input = 'insargrm' +var list = ['facebook', 'twitter', 'instagram', 'linkedin']; +console.log(didYouMean(input, list)); +> 'instagram' +// The method matches 'insargrm' to 'instagram'. + +input = 'google plus'; +console.log(didYouMean(input, list)); +> null +// The method was unable to find 'google plus' in the list of options. +``` + +Matching against a list of objects: +``` +var input = 'insargrm'; +var list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ]; +var key = 'id'; +console.log(didYouMean(input, list, key)); +> 'instagram' +// The method returns the matching value. + +didYouMean.returnWinningObject = true; +console.log(didYouMean(input, list, key)); +> { id: 'instagram' } +// The method returns the matching object. +``` + + +didYouMean(str, list, [key]) +---------------------------- + +- str: The string input to match. +- list: An array of strings or objects to match against. +- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string + to match against. + +Returns: the closest matching string, or null if no strings exceed the threshold. + + +Options +------- + +Options are set on the didYouMean function object. You may change them at any time. + +### threshold + + By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length. + For example, if a ten-letter string is five edits away from its nearest match, the method will return null. + + You can control this by setting the "threshold" value on the didYouMean function. For example, to set the + edit distance threshold to 50% of the input string's length: + + ``` + didYouMean.threshold = 0.5; + ``` + + To return the nearest match no matter the threshold, set this value to null. + +### thresholdAbsolute + + This option behaves the same as threshold, but instead takes an integer number of edit steps. For example, + if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance + is less than 20. Both options apply. + +### caseSensitive + + By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set + the "caseSensitive" value to true: + + ``` + didYouMean.caseSensitive = true; + ``` + +### nullResultValue + + By default, the method will return null if there is no sufficiently close match. You can change this value here. + +### returnWinningObject + + By default, the method will return the winning string value (if any). If your list contains objects rather + than strings, you may set returnWinningObject to true. + + ``` + didYouMean.returnWinningObject = true; + ``` + + This option has no effect on lists of strings. + +### returnFirstMatch + + By default, the method will search all values and return the closest match. If you're simply looking for a "good- + enough" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed + things up. + + +License +------- + +didYouMean copyright (c) 2013-2014 Dave Porter. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License +[here](http://www.apache.org/licenses/LICENSE-2.0). + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +*/ +(function() { + "use strict"; + + // The didYouMean method. + function didYouMean(str, list, key) { + if (!str) return null; + + // If we're running a case-insensitive search, smallify str. + if (!didYouMean.caseSensitive) { str = str.toLowerCase(); } + + // Calculate the initial value (the threshold) if present. + var thresholdRelative = didYouMean.threshold === null ? null : didYouMean.threshold * str.length, + thresholdAbsolute = didYouMean.thresholdAbsolute, + winningVal; + if (thresholdRelative !== null && thresholdAbsolute !== null) winningVal = Math.min(thresholdRelative, thresholdAbsolute); + else if (thresholdRelative !== null) winningVal = thresholdRelative; + else if (thresholdAbsolute !== null) winningVal = thresholdAbsolute; + else winningVal = null; + + // Get the edit distance to each option. If the closest one is less than 40% (by default) of str's length, + // then return it. + var winner, candidate, testCandidate, val, + i, len = list.length; + for (i = 0; i < len; i++) { + // Get item. + candidate = list[i]; + // If there's a key, get the candidate value out of the object. + if (key) { candidate = candidate[key]; } + // Gatekeep. + if (!candidate) { continue; } + // If we're running a case-insensitive search, smallify the candidate. + if (!didYouMean.caseSensitive) { testCandidate = candidate.toLowerCase(); } + else { testCandidate = candidate; } + // Get and compare edit distance. + val = getEditDistance(str, testCandidate, winningVal); + // If this value is smaller than our current winning value, OR if we have no winning val yet (i.e. the + // threshold option is set to null, meaning the caller wants a match back no matter how bad it is), then + // this is our new winner. + if (winningVal === null || val < winningVal) { + winningVal = val; + // Set the winner to either the value or its object, depending on the returnWinningObject option. + if (key && didYouMean.returnWinningObject) winner = list[i]; + else winner = candidate; + // If we're returning the first match, return it now. + if (didYouMean.returnFirstMatch) return winner; + } + } + + // If we have a winner, return it. + return winner || didYouMean.nullResultValue; + } + + // Set default options. + didYouMean.threshold = 0.4; + didYouMean.thresholdAbsolute = 20; + didYouMean.caseSensitive = false; + didYouMean.nullResultValue = null; + didYouMean.returnWinningObject = null; + didYouMean.returnFirstMatch = false; + + // Expose. + // In node... + if (typeof module !== 'undefined' && module.exports) { + module.exports = didYouMean; + } + // Otherwise... + else { + window.didYouMean = didYouMean; + } + + var MAX_INT = Math.pow(2,32) - 1; // We could probably go higher than this, but for practical reasons let's not. + function getEditDistance(a, b, max) { + // Handle null or undefined max. + max = max || max === 0 ? max : MAX_INT; + + var lena = a.length; + var lenb = b.length; + + // Fast path - no A or B. + if (lena === 0) return Math.min(max + 1, lenb); + if (lenb === 0) return Math.min(max + 1, lena); + + // Fast path - length diff larger than max. + if (Math.abs(lena - lenb) > max) return max + 1; + + // Slow path. + var matrix = [], + i, j, colMin, minJ, maxJ; + + // Set up the first row ([0, 1, 2, 3, etc]). + for (i = 0; i <= lenb; i++) { matrix[i] = [i]; } + + // Set up the first column (same). + for (j = 0; j <= lena; j++) { matrix[0][j] = j; } + + // Loop over the rest of the columns. + for (i = 1; i <= lenb; i++) { + colMin = MAX_INT; + minJ = 1; + if (i > max) minJ = i - max; + maxJ = lenb + 1; + if (maxJ > max + i) maxJ = max + i; + // Loop over the rest of the rows. + for (j = 1; j <= lena; j++) { + // If j is out of bounds, just put a large value in the slot. + if (j < minJ || j > maxJ) { + matrix[i][j] = max + 1; + } + + // Otherwise do the normal Levenshtein thing. + else { + // If the characters are the same, there's no change in edit distance. + if (b.charAt(i - 1) === a.charAt(j - 1)) { + matrix[i][j] = matrix[i - 1][j - 1]; + } + // Otherwise, see if we're substituting, inserting or deleting. + else { + matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // Substitute + Math.min(matrix[i][j - 1] + 1, // Insert + matrix[i - 1][j] + 1)); // Delete + } + } + + // Either way, update colMin. + if (matrix[i][j] < colMin) colMin = matrix[i][j]; + } + + // If this column's minimum is greater than the allowed maximum, there's no point + // in going on with life. + if (colMin > max) return max + 1; + } + // If we made it this far without running into the max, then return the final matrix value. + return matrix[lenb][lena]; + } + +})(); diff --git a/node_modules/didyoumean/didYouMean-1.2.1.min.js b/node_modules/didyoumean/didYouMean-1.2.1.min.js new file mode 100644 index 0000000..c41abd8 --- /dev/null +++ b/node_modules/didyoumean/didYouMean-1.2.1.min.js @@ -0,0 +1,17 @@ +/* + didYouMean.js copyright (c) 2013-2014 Dave Porter. + + [Available on GitHub](https://github.com/dcporter/didyoumean.js). + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License + [here](http://www.apache.org/licenses/LICENSE-2.0). + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +(function(){"use strict";function e(t,r,i){if(!t)return null;if(!e.caseSensitive){t=t.toLowerCase()}var s=e.threshold===null?null:e.threshold*t.length,o=e.thresholdAbsolute,u;if(s!==null&&o!==null)u=Math.min(s,o);else if(s!==null)u=s;else if(o!==null)u=o;else u=null;var a,f,l,c,h,p=r.length;for(h=0;hr)return r+1;var o=[],u,a,f,l,c;for(u=0;u<=s;u++){o[u]=[u]}for(a=0;a<=i;a++){o[0][a]=a}for(u=1;u<=s;u++){f=t;l=1;if(u>r)l=u-r;c=s+1;if(c>r+u)c=r+u;for(a=1;a<=i;a++){if(ac){o[u][a]=r+1}else{if(n.charAt(u-1)===e.charAt(a-1)){o[u][a]=o[u-1][a-1]}else{o[u][a]=Math.min(o[u-1][a-1]+1,Math.min(o[u][a-1]+1,o[u-1][a]+1))}}if(o[u][a]r)return r+1}return o[s][i]}e.threshold=.4;e.thresholdAbsolute=20;e.caseSensitive=false;e.nullResultValue=null;e.returnWinningObject=null;e.returnFirstMatch=false;if(typeof module!=="undefined"&&module.exports){module.exports=e}else{window.didYouMean=e}var t=Math.pow(2,32)-1})(); \ No newline at end of file diff --git a/node_modules/didyoumean/package.json b/node_modules/didyoumean/package.json new file mode 100644 index 0000000..1301d03 --- /dev/null +++ b/node_modules/didyoumean/package.json @@ -0,0 +1,27 @@ +{ + "name": "didyoumean", + "version": "1.2.2", + "description": "Match human-quality input to potential matches by edit distance.", + "homepage": "https://github.com/dcporter/didyoumean.js", + "author": { + "name": "Dave Porter", + "email": "dcporter@gmail.com", + "url": "http://dcporter.net/" + }, + "keywords": [ + "didyoumean", + "mean", + "edit", + "distance", + "levenshtein" + ], + "main": "./didYouMean-1.2.1.js", + "repository": { + "type": "git", + "url": "https://github.com/dcporter/didyoumean.js.git" + }, + "bugs": { + "url": "https://github.com/dcporter/didyoumean.js/issues" + }, + "license": "Apache-2.0" +} diff --git a/node_modules/dlv/README.md b/node_modules/dlv/README.md new file mode 100644 index 0000000..6a8429d --- /dev/null +++ b/node_modules/dlv/README.md @@ -0,0 +1,76 @@ +# `dlv(obj, keypath)` [![NPM](https://img.shields.io/npm/v/dlv.svg)](https://npmjs.com/package/dlv) [![Build](https://travis-ci.org/developit/dlv.svg?branch=master)](https://travis-ci.org/developit/dlv) + +> Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined + + +### Why? + +Smallest possible implementation: only **130 bytes.** + +You could write this yourself, but then you'd have to write [tests]. + +Supports ES Modules, CommonJS and globals. + + +### Installation + +`npm install --save dlv` + + +### Usage + +`delve(object, keypath, [default])` + +```js +import delve from 'dlv'; + +let obj = { + a: { + b: { + c: 1, + d: undefined, + e: null + } + } +}; + +//use string dot notation for keys +delve(obj, 'a.b.c') === 1; + +//or use an array key +delve(obj, ['a', 'b', 'c']) === 1; + +delve(obj, 'a.b') === obj.a.b; + +//returns undefined if the full key path does not exist and no default is specified +delve(obj, 'a.b.f') === undefined; + +//optional third parameter for default if the full key in path is missing +delve(obj, 'a.b.f', 'foo') === 'foo'; + +//or if the key exists but the value is undefined +delve(obj, 'a.b.d', 'foo') === 'foo'; + +//Non-truthy defined values are still returned if they exist at the full keypath +delve(obj, 'a.b.e', 'foo') === null; + +//undefined obj or key returns undefined, unless a default is supplied +delve(undefined, 'a.b.c') === undefined; +delve(undefined, 'a.b.c', 'foo') === 'foo'; +delve(obj, undefined, 'foo') === 'foo'; +``` + + +### Setter Counterparts + +- [dset](https://github.com/lukeed/dset) by [@lukeed](https://github.com/lukeed) is the spiritual "set" counterpart of `dlv` and very fast. +- [bury](https://github.com/kalmbach/bury) by [@kalmbach](https://github.com/kalmbach) does the opposite of `dlv` and is implemented in a very similar manner. + + +### License + +[MIT](https://oss.ninja/mit/developit/) + + +[preact]: https://github.com/developit/preact +[tests]: https://github.com/developit/dlv/blob/master/test.js diff --git a/node_modules/dlv/dist/dlv.es.js b/node_modules/dlv/dist/dlv.es.js new file mode 100644 index 0000000..06b981b --- /dev/null +++ b/node_modules/dlv/dist/dlv.es.js @@ -0,0 +1,2 @@ +export default function(t,e,l,n,r){for(e=e.split?e.split("."):e,n=0;n (http://jasonformat.com)", + "repository": "developit/dlv", + "license": "MIT", + "devDependencies": { + "microbundle": "^0.11.0" + } +} diff --git a/node_modules/fast-glob/LICENSE b/node_modules/fast-glob/LICENSE new file mode 100644 index 0000000..65a9994 --- /dev/null +++ b/node_modules/fast-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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/fast-glob/README.md b/node_modules/fast-glob/README.md new file mode 100644 index 0000000..be60874 --- /dev/null +++ b/node_modules/fast-glob/README.md @@ -0,0 +1,830 @@ +# fast-glob + +> It's a very fast and efficient [glob][glob_definition] library for [Node.js][node_js]. + +This package provides methods for traversing the file system and returning pathnames that matched a defined set of a specified pattern according to the rules used by the Unix Bash shell with some simplifications, meanwhile results are returned in **arbitrary order**. Quick, simple, effective. + +## Table of Contents + +
+Details + +* [Highlights](#highlights) +* [Old and modern mode](#old-and-modern-mode) +* [Pattern syntax](#pattern-syntax) + * [Basic syntax](#basic-syntax) + * [Advanced syntax](#advanced-syntax) +* [Installation](#installation) +* [API](#api) + * [Asynchronous](#asynchronous) + * [Synchronous](#synchronous) + * [Stream](#stream) + * [patterns](#patterns) + * [[options]](#options) + * [Helpers](#helpers) + * [generateTasks](#generatetaskspatterns-options) + * [isDynamicPattern](#isdynamicpatternpattern-options) + * [escapePath](#escapepathpath) + * [convertPathToPattern](#convertpathtopatternpath) +* [Options](#options-3) + * [Common](#common) + * [concurrency](#concurrency) + * [cwd](#cwd) + * [deep](#deep) + * [followSymbolicLinks](#followsymboliclinks) + * [fs](#fs) + * [ignore](#ignore) + * [suppressErrors](#suppresserrors) + * [throwErrorOnBrokenSymbolicLink](#throwerroronbrokensymboliclink) + * [Output control](#output-control) + * [absolute](#absolute) + * [markDirectories](#markdirectories) + * [objectMode](#objectmode) + * [onlyDirectories](#onlydirectories) + * [onlyFiles](#onlyfiles) + * [stats](#stats) + * [unique](#unique) + * [Matching control](#matching-control) + * [braceExpansion](#braceexpansion) + * [caseSensitiveMatch](#casesensitivematch) + * [dot](#dot) + * [extglob](#extglob) + * [globstar](#globstar) + * [baseNameMatch](#basenamematch) +* [FAQ](#faq) + * [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern) + * [How to write patterns on Windows?](#how-to-write-patterns-on-windows) + * [Why are parentheses match wrong?](#why-are-parentheses-match-wrong) + * [How to exclude directory from reading?](#how-to-exclude-directory-from-reading) + * [How to use UNC path?](#how-to-use-unc-path) + * [Compatible with `node-glob`?](#compatible-with-node-glob) +* [Benchmarks](#benchmarks) + * [Server](#server) + * [Nettop](#nettop) +* [Changelog](#changelog) +* [License](#license) + +
+ +## Highlights + +* Fast. Probably the fastest. +* Supports multiple and negative patterns. +* Synchronous, Promise and Stream API. +* Object mode. Can return more than just strings. +* Error-tolerant. + +## Old and modern mode + +This package works in two modes, depending on the environment in which it is used. + +* **Old mode**. Node.js below 10.10 or when the [`stats`](#stats) option is *enabled*. +* **Modern mode**. Node.js 10.10+ and the [`stats`](#stats) option is *disabled*. + +The modern mode is faster. Learn more about the [internal mechanism][nodelib_fs_scandir_old_and_modern_modern]. + +## Pattern syntax + +> :warning: Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. + +There is more than one form of syntax: basic and advanced. Below is a brief overview of the supported features. Also pay attention to our [FAQ](#faq). + +> :book: This package uses [`micromatch`][micromatch] as a library for pattern matching. + +### Basic syntax + +* An asterisk (`*`) — matches everything except slashes (path separators), hidden files (names starting with `.`). +* A double star or globstar (`**`) — matches zero or more directories. +* Question mark (`?`) – matches any single character except slashes (path separators). +* Sequence (`[seq]`) — matches any character in sequence. + +> :book: A few additional words about the [basic matching behavior][picomatch_matching_behavior]. + +Some examples: + +* `src/**/*.js` — matches all files in the `src` directory (any level of nesting) that have the `.js` extension. +* `src/*.??` — matches all files in the `src` directory (only first level of nesting) that have a two-character extension. +* `file-[01].js` — matches files: `file-0.js`, `file-1.js`. + +### Advanced syntax + +* [Escapes characters][micromatch_backslashes] (`\\`) — matching special characters (`$^*+?()[]`) as literals. +* [POSIX character classes][picomatch_posix_brackets] (`[[:digit:]]`). +* [Extended globs][micromatch_extglobs] (`?(pattern-list)`). +* [Bash style brace expansions][micromatch_braces] (`{}`). +* [Regexp character classes][micromatch_regex_character_classes] (`[1-5]`). +* [Regex groups][regular_expressions_brackets] (`(a|b)`). + +> :book: A few additional words about the [advanced matching behavior][micromatch_extended_globbing]. + +Some examples: + +* `src/**/*.{css,scss}` — matches all files in the `src` directory (any level of nesting) that have the `.css` or `.scss` extension. +* `file-[[:digit:]].js` — matches files: `file-0.js`, `file-1.js`, …, `file-9.js`. +* `file-{1..3}.js` — matches files: `file-1.js`, `file-2.js`, `file-3.js`. +* `file-(1|2)` — matches files: `file-1.js`, `file-2.js`. + +## Installation + +```console +npm install fast-glob +``` + +## API + +### Asynchronous + +```js +fg(patterns, [options]) +fg.async(patterns, [options]) +fg.glob(patterns, [options]) +``` + +Returns a `Promise` with an array of matching entries. + +```js +const fg = require('fast-glob'); + +const entries = await fg(['.editorconfig', '**/index.js'], { dot: true }); + +// ['.editorconfig', 'services/index.js'] +``` + +### Synchronous + +```js +fg.sync(patterns, [options]) +fg.globSync(patterns, [options]) +``` + +Returns an array of matching entries. + +```js +const fg = require('fast-glob'); + +const entries = fg.sync(['.editorconfig', '**/index.js'], { dot: true }); + +// ['.editorconfig', 'services/index.js'] +``` + +### Stream + +```js +fg.stream(patterns, [options]) +fg.globStream(patterns, [options]) +``` + +Returns a [`ReadableStream`][node_js_stream_readable_streams] when the `data` event will be emitted with matching entry. + +```js +const fg = require('fast-glob'); + +const stream = fg.stream(['.editorconfig', '**/index.js'], { dot: true }); + +for await (const entry of stream) { + // .editorconfig + // services/index.js +} +``` + +#### patterns + +* Required: `true` +* Type: `string | string[]` + +Any correct pattern(s). + +> :1234: [Pattern syntax](#pattern-syntax) +> +> :warning: This package does not respect the order of patterns. First, all the negative patterns are applied, and only then the positive patterns. If you want to get a certain order of records, use sorting or split calls. + +#### [options] + +* Required: `false` +* Type: [`Options`](#options-3) + +See [Options](#options-3) section. + +### Helpers + +#### `generateTasks(patterns, [options])` + +Returns the internal representation of patterns ([`Task`](./src/managers/tasks.ts) is a combining patterns by base directory). + +```js +fg.generateTasks('*'); + +[{ + base: '.', // Parent directory for all patterns inside this task + dynamic: true, // Dynamic or static patterns are in this task + patterns: ['*'], + positive: ['*'], + negative: [] +}] +``` + +##### patterns + +* Required: `true` +* Type: `string | string[]` + +Any correct pattern(s). + +##### [options] + +* Required: `false` +* Type: [`Options`](#options-3) + +See [Options](#options-3) section. + +#### `isDynamicPattern(pattern, [options])` + +Returns `true` if the passed pattern is a dynamic pattern. + +> :1234: [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern) + +```js +fg.isDynamicPattern('*'); // true +fg.isDynamicPattern('abc'); // false +``` + +##### pattern + +* Required: `true` +* Type: `string` + +Any correct pattern. + +##### [options] + +* Required: `false` +* Type: [`Options`](#options-3) + +See [Options](#options-3) section. + +#### `escapePath(path)` + +Returns the path with escaped special characters depending on the platform. + +* Posix: + * `*?|(){}[]`; + * `!` at the beginning of line; + * `@+!` before the opening parenthesis; + * `\\` before non-special characters; +* Windows: + * `(){}` + * `!` at the beginning of line; + * `@+!` before the opening parenthesis; + * Characters like `*?|[]` cannot be used in the path ([windows_naming_conventions][windows_naming_conventions]), so they will not be escaped; + +```js +fg.escapePath('!abc'); +// \\!abc +fg.escapePath('[OpenSource] mrmlnc – fast-glob (Deluxe Edition) 2014') + '/*.flac' +// \\[OpenSource\\] mrmlnc – fast-glob \\(Deluxe Edition\\) 2014/*.flac + +fg.posix.escapePath('C:\\Program Files (x86)\\**\\*'); +// C:\\\\Program Files \\(x86\\)\\*\\*\\* +fg.win32.escapePath('C:\\Program Files (x86)\\**\\*'); +// Windows: C:\\Program Files \\(x86\\)\\**\\* +``` + +#### `convertPathToPattern(path)` + +Converts a path to a pattern depending on the platform, including special character escaping. + +* Posix. Works similarly to the `fg.posix.escapePath` method. +* Windows. Works similarly to the `fg.win32.escapePath` method, additionally converting backslashes to forward slashes in cases where they are not escape characters (`!()+@{}`). + +```js +fg.convertPathToPattern('[OpenSource] mrmlnc – fast-glob (Deluxe Edition) 2014') + '/*.flac'; +// \\[OpenSource\\] mrmlnc – fast-glob \\(Deluxe Edition\\) 2014/*.flac + +fg.convertPathToPattern('C:/Program Files (x86)/**/*'); +// Posix: C:/Program Files \\(x86\\)/\\*\\*/\\* +// Windows: C:/Program Files \\(x86\\)/**/* + +fg.convertPathToPattern('C:\\Program Files (x86)\\**\\*'); +// Posix: C:\\\\Program Files \\(x86\\)\\*\\*\\* +// Windows: C:/Program Files \\(x86\\)/**/* + +fg.posix.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**/*'; +// Posix: \\\\\\?\\\\c:\\\\Program Files \\(x86\\)/**/* (broken pattern) +fg.win32.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**/*'; +// Windows: //?/c:/Program Files \\(x86\\)/**/* +``` + +## Options + +### Common options + +#### concurrency + +* Type: `number` +* Default: `os.cpus().length` + +Specifies the maximum number of concurrent requests from a reader to read directories. + +> :book: The higher the number, the higher the performance and load on the file system. If you want to read in quiet mode, set the value to a comfortable number or `1`. + +
+ +More details + +In Node, there are [two types of threads][nodejs_thread_pool]: Event Loop (code) and a Thread Pool (fs, dns, …). The thread pool size controlled by the `UV_THREADPOOL_SIZE` environment variable. Its default size is 4 ([documentation][libuv_thread_pool]). The pool is one for all tasks within a single Node process. + +Any code can make 4 real concurrent accesses to the file system. The rest of the FS requests will wait in the queue. + +> :book: Each new instance of FG in the same Node process will use the same Thread pool. + +But this package also has the `concurrency` option. This option allows you to control the number of concurrent accesses to the FS at the package level. By default, this package has a value equal to the number of cores available for the current Node process. This allows you to set a value smaller than the pool size (`concurrency: 1`) or, conversely, to prepare tasks for the pool queue more quickly (`concurrency: Number.POSITIVE_INFINITY`). + +So, in fact, this package can **only make 4 concurrent requests to the FS**. You can increase this value by using an environment variable (`UV_THREADPOOL_SIZE`), but in practice this does not give a multiple advantage. + +
+ +#### cwd + +* Type: `string` +* Default: `process.cwd()` + +The current working directory in which to search. + +#### deep + +* Type: `number` +* Default: `Infinity` + +Specifies the maximum depth of a read directory relative to the start directory. + +For example, you have the following tree: + +```js +dir/ +└── one/ // 1 + └── two/ // 2 + └── file.js // 3 +``` + +```js +// With base directory +fg.sync('dir/**', { onlyFiles: false, deep: 1 }); // ['dir/one'] +fg.sync('dir/**', { onlyFiles: false, deep: 2 }); // ['dir/one', 'dir/one/two'] + +// With cwd option +fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 1 }); // ['one'] +fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 2 }); // ['one', 'one/two'] +``` + +> :book: If you specify a pattern with some base directory, this directory will not participate in the calculation of the depth of the found directories. Think of it as a [`cwd`](#cwd) option. + +#### followSymbolicLinks + +* Type: `boolean` +* Default: `true` + +Indicates whether to traverse descendants of symbolic link directories when expanding `**` patterns. + +> :book: Note that this option does not affect the base directory of the pattern. For example, if `./a` is a symlink to directory `./b` and you specified `['./a**', './b/**']` patterns, then directory `./a` will still be read. + +> :book: If the [`stats`](#stats) option is specified, the information about the symbolic link (`fs.lstat`) will be replaced with information about the entry (`fs.stat`) behind it. + +#### fs + +* Type: `FileSystemAdapter` +* Default: `fs.*` + +Custom implementation of methods for working with the file system. + +```ts +export interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} +``` + +#### ignore + +* Type: `string[]` +* Default: `[]` + +An array of glob patterns to exclude matches. This is an alternative way to use negative patterns. + +```js +dir/ +├── package-lock.json +└── package.json +``` + +```js +fg.sync(['*.json', '!package-lock.json']); // ['package.json'] +fg.sync('*.json', { ignore: ['package-lock.json'] }); // ['package.json'] +``` + +#### suppressErrors + +* Type: `boolean` +* Default: `false` + +By default this package suppress only `ENOENT` errors. Set to `true` to suppress any error. + +> :book: Can be useful when the directory has entries with a special level of access. + +#### throwErrorOnBrokenSymbolicLink + +* Type: `boolean` +* Default: `false` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +> :book: This option has no effect on errors when reading the symbolic link directory. + +### Output control + +#### absolute + +* Type: `boolean` +* Default: `false` + +Return the absolute path for entries. + +```js +fg.sync('*.js', { absolute: false }); // ['index.js'] +fg.sync('*.js', { absolute: true }); // ['/home/user/index.js'] +``` + +> :book: This option is required if you want to use negative patterns with absolute path, for example, `!${__dirname}/*.js`. + +#### markDirectories + +* Type: `boolean` +* Default: `false` + +Mark the directory path with the final slash. + +```js +fg.sync('*', { onlyFiles: false, markDirectories: false }); // ['index.js', 'controllers'] +fg.sync('*', { onlyFiles: false, markDirectories: true }); // ['index.js', 'controllers/'] +``` + +#### objectMode + +* Type: `boolean` +* Default: `false` + +Returns objects (instead of strings) describing entries. + +```js +fg.sync('*', { objectMode: false }); // ['src/index.js'] +fg.sync('*', { objectMode: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: }] +``` + +The object has the following fields: + +* name (`string`) — the last part of the path (basename) +* path (`string`) — full path relative to the pattern base directory +* dirent ([`fs.Dirent`][node_js_fs_class_fs_dirent]) — instance of `fs.Dirent` + +> :book: An object is an internal representation of entry, so getting it does not affect performance. + +#### onlyDirectories + +* Type: `boolean` +* Default: `false` + +Return only directories. + +```js +fg.sync('*', { onlyDirectories: false }); // ['index.js', 'src'] +fg.sync('*', { onlyDirectories: true }); // ['src'] +``` + +> :book: If `true`, the [`onlyFiles`](#onlyfiles) option is automatically `false`. + +#### onlyFiles + +* Type: `boolean` +* Default: `true` + +Return only files. + +```js +fg.sync('*', { onlyFiles: false }); // ['index.js', 'src'] +fg.sync('*', { onlyFiles: true }); // ['index.js'] +``` + +#### stats + +* Type: `boolean` +* Default: `false` + +Enables an [object mode](#objectmode) with an additional field: + +* stats ([`fs.Stats`][node_js_fs_class_fs_stats]) — instance of `fs.Stats` + +```js +fg.sync('*', { stats: false }); // ['src/index.js'] +fg.sync('*', { stats: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: , stats: }] +``` + +> :book: Returns `fs.stat` instead of `fs.lstat` for symbolic links when the [`followSymbolicLinks`](#followsymboliclinks) option is specified. +> +> :warning: Unlike [object mode](#objectmode) this mode requires additional calls to the file system. On average, this mode is slower at least twice. See [old and modern mode](#old-and-modern-mode) for more details. + +#### unique + +* Type: `boolean` +* Default: `true` + +Ensures that the returned entries are unique. + +```js +fg.sync(['*.json', 'package.json'], { unique: false }); // ['package.json', 'package.json'] +fg.sync(['*.json', 'package.json'], { unique: true }); // ['package.json'] +``` + +If `true` and similar entries are found, the result is the first found. + +### Matching control + +#### braceExpansion + +* Type: `boolean` +* Default: `true` + +Enables Bash-like brace expansion. + +> :1234: [Syntax description][bash_hackers_syntax_expansion_brace] or more [detailed description][micromatch_braces]. + +```js +dir/ +├── abd +├── acd +└── a{b,c}d +``` + +```js +fg.sync('a{b,c}d', { braceExpansion: false }); // ['a{b,c}d'] +fg.sync('a{b,c}d', { braceExpansion: true }); // ['abd', 'acd'] +``` + +#### caseSensitiveMatch + +* Type: `boolean` +* Default: `true` + +Enables a [case-sensitive][wikipedia_case_sensitivity] mode for matching files. + +```js +dir/ +├── file.txt +└── File.txt +``` + +```js +fg.sync('file.txt', { caseSensitiveMatch: false }); // ['file.txt', 'File.txt'] +fg.sync('file.txt', { caseSensitiveMatch: true }); // ['file.txt'] +``` + +#### dot + +* Type: `boolean` +* Default: `false` + +Allow patterns to match entries that begin with a period (`.`). + +> :book: Note that an explicit dot in a portion of the pattern will always match dot files. + +```js +dir/ +├── .editorconfig +└── package.json +``` + +```js +fg.sync('*', { dot: false }); // ['package.json'] +fg.sync('*', { dot: true }); // ['.editorconfig', 'package.json'] +``` + +#### extglob + +* Type: `boolean` +* Default: `true` + +Enables Bash-like `extglob` functionality. + +> :1234: [Syntax description][micromatch_extglobs]. + +```js +dir/ +├── README.md +└── package.json +``` + +```js +fg.sync('*.+(json|md)', { extglob: false }); // [] +fg.sync('*.+(json|md)', { extglob: true }); // ['README.md', 'package.json'] +``` + +#### globstar + +* Type: `boolean` +* Default: `true` + +Enables recursively repeats a pattern containing `**`. If `false`, `**` behaves exactly like `*`. + +```js +dir/ +└── a + └── b +``` + +```js +fg.sync('**', { onlyFiles: false, globstar: false }); // ['a'] +fg.sync('**', { onlyFiles: false, globstar: true }); // ['a', 'a/b'] +``` + +#### baseNameMatch + +* Type: `boolean` +* Default: `false` + +If set to `true`, then patterns without slashes will be matched against the basename of the path if it contains slashes. + +```js +dir/ +└── one/ + └── file.md +``` + +```js +fg.sync('*.md', { baseNameMatch: false }); // [] +fg.sync('*.md', { baseNameMatch: true }); // ['one/file.md'] +``` + +## FAQ + +## What is a static or dynamic pattern? + +All patterns can be divided into two types: + +* **static**. A pattern is considered static if it can be used to get an entry on the file system without using matching mechanisms. For example, the `file.js` pattern is a static pattern because we can just verify that it exists on the file system. +* **dynamic**. A pattern is considered dynamic if it cannot be used directly to find occurrences without using a matching mechanisms. For example, the `*` pattern is a dynamic pattern because we cannot use this pattern directly. + +A pattern is considered dynamic if it contains the following characters (`…` — any characters or their absence) or options: + +* The [`caseSensitiveMatch`](#casesensitivematch) option is disabled +* `\\` (the escape character) +* `*`, `?`, `!` (at the beginning of line) +* `[…]` +* `(…|…)` +* `@(…)`, `!(…)`, `*(…)`, `?(…)`, `+(…)` (respects the [`extglob`](#extglob) option) +* `{…,…}`, `{…..…}` (respects the [`braceExpansion`](#braceexpansion) option) + +## How to write patterns on Windows? + +Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. With the [`cwd`](#cwd) option use a convenient format. + +**Bad** + +```ts +[ + 'directory\\*', + path.join(process.cwd(), '**') +] +``` + +**Good** + +```ts +[ + 'directory/*', + fg.convertPathToPattern(process.cwd()) + '/**' +] +``` + +> :book: Use the [`.convertPathToPattern`](#convertpathtopatternpath) package to convert Windows-style path to a Unix-style path. + +Read more about [matching with backslashes][micromatch_backslashes]. + +## Why are parentheses match wrong? + +```js +dir/ +└── (special-*file).txt +``` + +```js +fg.sync(['(special-*file).txt']) // [] +``` + +Refers to Bash. You need to escape special characters: + +```js +fg.sync(['\\(special-*file\\).txt']) // ['(special-*file).txt'] +``` + +Read more about [matching special characters as literals][picomatch_matching_special_characters_as_literals]. Or use the [`.escapePath`](#escapepathpath). + +## How to exclude directory from reading? + +You can use a negative pattern like this: `!**/node_modules` or `!**/node_modules/**`. Also you can use [`ignore`](#ignore) option. Just look at the example below. + +```js +first/ +├── file.md +└── second/ + └── file.txt +``` + +If you don't want to read the `second` directory, you must write the following pattern: `!**/second` or `!**/second/**`. + +```js +fg.sync(['**/*.md', '!**/second']); // ['first/file.md'] +fg.sync(['**/*.md'], { ignore: ['**/second/**'] }); // ['first/file.md'] +``` + +> :warning: When you write `!**/second/**/*` it means that the directory will be **read**, but all the entries will not be included in the results. + +You have to understand that if you write the pattern to exclude directories, then the directory will not be read under any circumstances. + +## How to use UNC path? + +You cannot use [Uniform Naming Convention (UNC)][unc_path] paths as patterns (due to syntax) directly, but you can use them as [`cwd`](#cwd) directory or use the `fg.convertPathToPattern` method. + +```ts +// cwd +fg.sync('*', { cwd: '\\\\?\\C:\\Python27' /* or //?/C:/Python27 */ }); +fg.sync('Python27/*', { cwd: '\\\\?\\C:\\' /* or //?/C:/ */ }); + +// .convertPathToPattern +fg.sync(fg.convertPathToPattern('\\\\?\\c:\\Python27') + '/*'); +``` + +## Compatible with `node-glob`? + +| node-glob | fast-glob | +| :----------: | :-------: | +| `cwd` | [`cwd`](#cwd) | +| `root` | – | +| `dot` | [`dot`](#dot) | +| `nomount` | – | +| `mark` | [`markDirectories`](#markdirectories) | +| `nosort` | – | +| `nounique` | [`unique`](#unique) | +| `nobrace` | [`braceExpansion`](#braceexpansion) | +| `noglobstar` | [`globstar`](#globstar) | +| `noext` | [`extglob`](#extglob) | +| `nocase` | [`caseSensitiveMatch`](#casesensitivematch) | +| `matchBase` | [`baseNameMatch`](#basenamematch) | +| `nodir` | [`onlyFiles`](#onlyfiles) | +| `ignore` | [`ignore`](#ignore) | +| `follow` | [`followSymbolicLinks`](#followsymboliclinks) | +| `realpath` | – | +| `absolute` | [`absolute`](#absolute) | + +## Benchmarks + +You can see results [here](https://github.com/mrmlnc/fast-glob/actions/workflows/benchmark.yml?query=branch%3Amaster) for every commit into the `main` branch. + +* **Product benchmark** – comparison with the main competitors. +* **Regress benchmark** – regression between the current version and the version from the npm registry. + +## Changelog + +See the [Releases section of our GitHub project][github_releases] for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. + +[bash_hackers_syntax_expansion_brace]: https://wiki.bash-hackers.org/syntax/expansion/brace +[github_releases]: https://github.com/mrmlnc/fast-glob/releases +[glob_definition]: https://en.wikipedia.org/wiki/Glob_(programming) +[glob_linux_man]: http://man7.org/linux/man-pages/man3/glob.3.html +[micromatch_backslashes]: https://github.com/micromatch/micromatch#backslashes +[micromatch_braces]: https://github.com/micromatch/braces +[micromatch_extended_globbing]: https://github.com/micromatch/micromatch#extended-globbing +[micromatch_extglobs]: https://github.com/micromatch/micromatch#extglobs +[micromatch_regex_character_classes]: https://github.com/micromatch/micromatch#regex-character-classes +[micromatch]: https://github.com/micromatch/micromatch +[node_js_fs_class_fs_dirent]: https://nodejs.org/api/fs.html#fs_class_fs_dirent +[node_js_fs_class_fs_stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats +[node_js_stream_readable_streams]: https://nodejs.org/api/stream.html#stream_readable_streams +[node_js]: https://nodejs.org/en +[nodelib_fs_scandir_old_and_modern_modern]: https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode +[npm_normalize_path]: https://www.npmjs.com/package/normalize-path +[npm_unixify]: https://www.npmjs.com/package/unixify +[picomatch_matching_behavior]: https://github.com/micromatch/picomatch#matching-behavior-vs-bash +[picomatch_matching_special_characters_as_literals]: https://github.com/micromatch/picomatch#matching-special-characters-as-literals +[picomatch_posix_brackets]: https://github.com/micromatch/picomatch#posix-brackets +[regular_expressions_brackets]: https://www.regular-expressions.info/brackets.html +[unc_path]: https://learn.microsoft.com/openspecs/windows_protocols/ms-dtyp/62e862f4-2a51-452e-8eeb-dc4ff5ee33cc +[wikipedia_case_sensitivity]: https://en.wikipedia.org/wiki/Case_sensitivity +[nodejs_thread_pool]: https://nodejs.org/en/docs/guides/dont-block-the-event-loop +[libuv_thread_pool]: http://docs.libuv.org/en/v1.x/threadpool.html +[windows_naming_conventions]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions diff --git a/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md b/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md new file mode 100644 index 0000000..fb9de96 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md @@ -0,0 +1,110 @@ +### [5.1.2](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) (2021-03-06) + + +### Bug Fixes + +* eliminate ReDoS ([#36](https://github.com/gulpjs/glob-parent/issues/36)) ([f923116](https://github.com/gulpjs/glob-parent/commit/f9231168b0041fea3f8f954b3cceb56269fc6366)) + +### [5.1.1](https://github.com/gulpjs/glob-parent/compare/v5.1.0...v5.1.1) (2021-01-27) + + +### Bug Fixes + +* unescape exclamation mark ([#26](https://github.com/gulpjs/glob-parent/issues/26)) ([a98874f](https://github.com/gulpjs/glob-parent/commit/a98874f1a59e407f4fb1beb0db4efa8392da60bb)) + +## [5.1.0](https://github.com/gulpjs/glob-parent/compare/v5.0.0...v5.1.0) (2021-01-27) + + +### Features + +* add `flipBackslashes` option to disable auto conversion of slashes (closes [#24](https://github.com/gulpjs/glob-parent/issues/24)) ([#25](https://github.com/gulpjs/glob-parent/issues/25)) ([eecf91d](https://github.com/gulpjs/glob-parent/commit/eecf91d5e3834ed78aee39c4eaaae654d76b87b3)) + +## [5.0.0](https://github.com/gulpjs/glob-parent/compare/v4.0.0...v5.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* Drop support for node <6 & bump dependencies + +### Miscellaneous Chores + +* Drop support for node <6 & bump dependencies ([896c0c0](https://github.com/gulpjs/glob-parent/commit/896c0c00b4e7362f60b96e7fc295ae929245255a)) + +## [4.0.0](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v4.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* question marks are valid path characters on Windows so avoid flagging as a glob when alone +* Update is-glob dependency + +### Features + +* hoist regexps and strings for performance gains ([4a80667](https://github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457e)) +* question marks are valid path characters on Windows so avoid flagging as a glob when alone ([2a551dd](https://github.com/gulpjs/glob-parent/commit/2a551dd0dc3235e78bf3c94843d4107072d17841)) +* Update is-glob dependency ([e41fcd8](https://github.com/gulpjs/glob-parent/commit/e41fcd895d1f7bc617dba45c9d935a7949b9c281)) + +## [3.1.0](https://github.com/gulpjs/glob-parent/compare/v3.0.1...v3.1.0) (2021-01-27) + + +### Features + +* allow basic win32 backslash use ([272afa5](https://github.com/gulpjs/glob-parent/commit/272afa5fd070fc0f796386a5993d4ee4a846988b)) +* handle extglobs (parentheses) containing separators ([7db1bdb](https://github.com/gulpjs/glob-parent/commit/7db1bdb0756e55fd14619e8ce31aa31b17b117fd)) +* new approach to braces/brackets handling ([8269bd8](https://github.com/gulpjs/glob-parent/commit/8269bd89290d99fac9395a354fb56fdcdb80f0be)) +* pre-process braces/brackets sections ([9ef8a87](https://github.com/gulpjs/glob-parent/commit/9ef8a87f66b1a43d0591e7a8e4fc5a18415ee388)) +* preserve escaped brace/bracket at end of string ([8cfb0ba](https://github.com/gulpjs/glob-parent/commit/8cfb0ba84202d51571340dcbaf61b79d16a26c76)) + + +### Bug Fixes + +* trailing escaped square brackets ([99ec9fe](https://github.com/gulpjs/glob-parent/commit/99ec9fecc60ee488ded20a94dd4f18b4f55c4ccf)) + +### [3.0.1](https://github.com/gulpjs/glob-parent/compare/v3.0.0...v3.0.1) (2021-01-27) + + +### Features + +* use path-dirname ponyfill ([cdbea5f](https://github.com/gulpjs/glob-parent/commit/cdbea5f32a58a54e001a75ddd7c0fccd4776aacc)) + + +### Bug Fixes + +* unescape glob-escaped dirnames on output ([598c533](https://github.com/gulpjs/glob-parent/commit/598c533bdf49c1428bc063aa9b8db40c5a86b030)) + +## [3.0.0](https://github.com/gulpjs/glob-parent/compare/v2.0.0...v3.0.0) (2021-01-27) + + +### ⚠ BREAKING CHANGES + +* update is-glob dependency + +### Features + +* update is-glob dependency ([5c5f8ef](https://github.com/gulpjs/glob-parent/commit/5c5f8efcee362a8e7638cf8220666acd8784f6bd)) + +## [2.0.0](https://github.com/gulpjs/glob-parent/compare/v1.3.0...v2.0.0) (2021-01-27) + + +### Features + +* move up to dirname regardless of glob characters ([f97fb83](https://github.com/gulpjs/glob-parent/commit/f97fb83be2e0a9fc8d3b760e789d2ecadd6aa0c2)) + +## [1.3.0](https://github.com/gulpjs/glob-parent/compare/v1.2.0...v1.3.0) (2021-01-27) + +## [1.2.0](https://github.com/gulpjs/glob-parent/compare/v1.1.0...v1.2.0) (2021-01-27) + + +### Reverts + +* feat: make regex test strings smaller ([dc80fa9](https://github.com/gulpjs/glob-parent/commit/dc80fa9658dca20549cfeba44bbd37d5246fcce0)) + +## [1.1.0](https://github.com/gulpjs/glob-parent/compare/v1.0.0...v1.1.0) (2021-01-27) + + +### Features + +* make regex test strings smaller ([cd83220](https://github.com/gulpjs/glob-parent/commit/cd832208638f45169f986d80fcf66e401f35d233)) + +## 1.0.0 (2021-01-27) + diff --git a/node_modules/fast-glob/node_modules/glob-parent/LICENSE b/node_modules/fast-glob/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..63222d7 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fast-glob/node_modules/glob-parent/README.md b/node_modules/fast-glob/node_modules/glob-parent/README.md new file mode 100644 index 0000000..36a2793 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/README.md @@ -0,0 +1,137 @@ +

+ + + +

+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + +## License + +ISC + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg + +[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master +[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master + +[travis-url]: https://travis-ci.org/gulpjs/glob-parent +[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/fast-glob/node_modules/glob-parent/index.js b/node_modules/fast-glob/node_modules/glob-parent/index.js new file mode 100644 index 0000000..09e257e --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/index.js @@ -0,0 +1,42 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; diff --git a/node_modules/fast-glob/node_modules/glob-parent/package.json b/node_modules/fast-glob/node_modules/glob-parent/package.json new file mode 100644 index 0000000..125c971 --- /dev/null +++ b/node_modules/fast-glob/node_modules/glob-parent/package.json @@ -0,0 +1,48 @@ +{ + "name": "glob-parent", + "version": "5.1.2", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", + "contributors": [ + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " + ], + "repository": "gulpjs/glob-parent", + "license": "ISC", + "engines": { + "node": ">= 6" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only", + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "dependencies": { + "is-glob": "^4.0.1" + }, + "devDependencies": { + "coveralls": "^3.0.11", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "mocha": "^6.0.2", + "nyc": "^13.3.0" + }, + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ] +} diff --git a/node_modules/fast-glob/out/index.d.ts b/node_modules/fast-glob/out/index.d.ts new file mode 100644 index 0000000..46823bb --- /dev/null +++ b/node_modules/fast-glob/out/index.d.ts @@ -0,0 +1,40 @@ +/// +import * as taskManager from './managers/tasks'; +import { Options as OptionsInternal } from './settings'; +import { Entry as EntryInternal, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types'; +type EntryObjectModePredicate = { + [TKey in keyof Pick]-?: true; +}; +type EntryStatsPredicate = { + [TKey in keyof Pick]-?: true; +}; +type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate; +declare function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise; +declare function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise; +declare namespace FastGlob { + type Options = OptionsInternal; + type Entry = EntryInternal; + type Task = taskManager.Task; + type Pattern = PatternInternal; + type FileSystemAdapter = FileSystemAdapterInternal; + const glob: typeof FastGlob; + const globSync: typeof sync; + const globStream: typeof stream; + const async: typeof FastGlob; + function sync(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): EntryInternal[]; + function sync(source: PatternInternal | PatternInternal[], options?: OptionsInternal): string[]; + function stream(source: PatternInternal | PatternInternal[], options?: OptionsInternal): NodeJS.ReadableStream; + function generateTasks(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Task[]; + function isDynamicPattern(source: PatternInternal, options?: OptionsInternal): boolean; + function escapePath(source: string): PatternInternal; + function convertPathToPattern(source: string): PatternInternal; + namespace posix { + function escapePath(source: string): PatternInternal; + function convertPathToPattern(source: string): PatternInternal; + } + namespace win32 { + function escapePath(source: string): PatternInternal; + function convertPathToPattern(source: string): PatternInternal; + } +} +export = FastGlob; diff --git a/node_modules/fast-glob/out/index.js b/node_modules/fast-glob/out/index.js new file mode 100644 index 0000000..90365d4 --- /dev/null +++ b/node_modules/fast-glob/out/index.js @@ -0,0 +1,102 @@ +"use strict"; +const taskManager = require("./managers/tasks"); +const async_1 = require("./providers/async"); +const stream_1 = require("./providers/stream"); +const sync_1 = require("./providers/sync"); +const settings_1 = require("./settings"); +const utils = require("./utils"); +async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); +} +// https://github.com/typescript-eslint/typescript-eslint/issues/60 +// eslint-disable-next-line no-redeclare +(function (FastGlob) { + FastGlob.glob = FastGlob; + FastGlob.globSync = sync; + FastGlob.globStream = stream; + FastGlob.async = FastGlob; + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); + } + FastGlob.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + /** + * The stream returned by the provider cannot work with an asynchronous iterator. + * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. + * This affects performance (+25%). I don't see best solution right now. + */ + return utils.stream.merge(works); + } + FastGlob.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = [].concat(source); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); + } + FastGlob.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); + } + FastGlob.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); + } + FastGlob.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPathToPattern(source); + } + FastGlob.convertPathToPattern = convertPathToPattern; + let posix; + (function (posix) { + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escapePosixPath(source); + } + posix.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPosixPathToPattern(source); + } + posix.convertPathToPattern = convertPathToPattern; + })(posix = FastGlob.posix || (FastGlob.posix = {})); + let win32; + (function (win32) { + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escapeWindowsPath(source); + } + win32.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertWindowsPathToPattern(source); + } + win32.convertPathToPattern = convertPathToPattern; + })(win32 = FastGlob.win32 || (FastGlob.win32 = {})); +})(FastGlob || (FastGlob = {})); +function getWorks(source, _Provider, options) { + const patterns = [].concat(source); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); +} +function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError('Patterns must be a string (non empty) or an array of strings'); + } +} +module.exports = FastGlob; diff --git a/node_modules/fast-glob/out/managers/tasks.d.ts b/node_modules/fast-glob/out/managers/tasks.d.ts new file mode 100644 index 0000000..59d2c42 --- /dev/null +++ b/node_modules/fast-glob/out/managers/tasks.d.ts @@ -0,0 +1,22 @@ +import Settings from '../settings'; +import { Pattern, PatternsGroup } from '../types'; +export type Task = { + base: string; + dynamic: boolean; + patterns: Pattern[]; + positive: Pattern[]; + negative: Pattern[]; +}; +export declare function generate(input: Pattern[], settings: Settings): Task[]; +/** + * Returns tasks grouped by basic pattern directories. + * + * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. + * This is necessary because directory traversal starts at the base directory and goes deeper. + */ +export declare function convertPatternsToTasks(positive: Pattern[], negative: Pattern[], dynamic: boolean): Task[]; +export declare function getPositivePatterns(patterns: Pattern[]): Pattern[]; +export declare function getNegativePatternsAsPositive(patterns: Pattern[], ignore: Pattern[]): Pattern[]; +export declare function groupPatternsByBaseDirectory(patterns: Pattern[]): PatternsGroup; +export declare function convertPatternGroupsToTasks(positive: PatternsGroup, negative: Pattern[], dynamic: boolean): Task[]; +export declare function convertPatternGroupToTask(base: string, positive: Pattern[], negative: Pattern[], dynamic: boolean): Task; diff --git a/node_modules/fast-glob/out/managers/tasks.js b/node_modules/fast-glob/out/managers/tasks.js new file mode 100644 index 0000000..335a765 --- /dev/null +++ b/node_modules/fast-glob/out/managers/tasks.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; +const utils = require("../utils"); +function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +exports.generate = generate; +function processPatterns(input, settings) { + let patterns = input; + /** + * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry + * and some problems with the micromatch package (see fast-glob issues: #365, #394). + * + * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown + * in matching in the case of a large set of patterns after expansion. + */ + if (settings.braceExpansion) { + patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); + } + /** + * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used + * at any nesting level. + * + * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change + * the pattern in the filter before creating a regular expression. There is no need to change the patterns + * in the application. Only on the input. + */ + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`); + } + /** + * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion. + */ + return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); +} +/** + * Returns tasks grouped by basic pattern directories. + * + * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. + * This is necessary because directory traversal starts at the base directory and goes deeper. + */ +function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + /* + * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory + * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. + */ + if ('.' in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); + } + else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; +} +exports.convertPatternsToTasks = convertPatternsToTasks; +function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); +} +exports.getPositivePatterns = getPositivePatterns; +function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; +} +exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, group); +} +exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; +} +exports.convertPatternGroupToTask = convertPatternGroupToTask; diff --git a/node_modules/fast-glob/out/providers/async.d.ts b/node_modules/fast-glob/out/providers/async.d.ts new file mode 100644 index 0000000..2742616 --- /dev/null +++ b/node_modules/fast-glob/out/providers/async.d.ts @@ -0,0 +1,9 @@ +import { Task } from '../managers/tasks'; +import { Entry, EntryItem, ReaderOptions } from '../types'; +import ReaderAsync from '../readers/async'; +import Provider from './provider'; +export default class ProviderAsync extends Provider> { + protected _reader: ReaderAsync; + read(task: Task): Promise; + api(root: string, task: Task, options: ReaderOptions): Promise; +} diff --git a/node_modules/fast-glob/out/providers/async.js b/node_modules/fast-glob/out/providers/async.js new file mode 100644 index 0000000..0c5286e --- /dev/null +++ b/node_modules/fast-glob/out/providers/async.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const async_1 = require("../readers/async"); +const provider_1 = require("./provider"); +class ProviderAsync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new async_1.default(this._settings); + } + async read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = await this.api(root, task, options); + return entries.map((entry) => options.transform(entry)); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports.default = ProviderAsync; diff --git a/node_modules/fast-glob/out/providers/filters/deep.d.ts b/node_modules/fast-glob/out/providers/filters/deep.d.ts new file mode 100644 index 0000000..377fab8 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/deep.d.ts @@ -0,0 +1,16 @@ +import { MicromatchOptions, EntryFilterFunction, Pattern } from '../../types'; +import Settings from '../../settings'; +export default class DeepFilter { + private readonly _settings; + private readonly _micromatchOptions; + constructor(_settings: Settings, _micromatchOptions: MicromatchOptions); + getFilter(basePath: string, positive: Pattern[], negative: Pattern[]): EntryFilterFunction; + private _getMatcher; + private _getNegativePatternsRe; + private _filter; + private _isSkippedByDeep; + private _getEntryLevel; + private _isSkippedSymbolicLink; + private _isSkippedByPositivePatterns; + private _isSkippedByNegativePatterns; +} diff --git a/node_modules/fast-glob/out/providers/filters/deep.js b/node_modules/fast-glob/out/providers/filters/deep.js new file mode 100644 index 0000000..644bf41 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/deep.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = require("../../utils"); +const partial_1 = require("../matchers/partial"); +class DeepFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + /** + * Avoid unnecessary depth calculations when it doesn't matter. + */ + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split('/').length; + if (basePath === '') { + return entryPathDepth; + } + const basePathDepth = basePath.split('/').length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } +} +exports.default = DeepFilter; diff --git a/node_modules/fast-glob/out/providers/filters/entry.d.ts b/node_modules/fast-glob/out/providers/filters/entry.d.ts new file mode 100644 index 0000000..ee71281 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/entry.d.ts @@ -0,0 +1,16 @@ +import Settings from '../../settings'; +import { EntryFilterFunction, MicromatchOptions, Pattern } from '../../types'; +export default class EntryFilter { + private readonly _settings; + private readonly _micromatchOptions; + readonly index: Map; + constructor(_settings: Settings, _micromatchOptions: MicromatchOptions); + getFilter(positive: Pattern[], negative: Pattern[]): EntryFilterFunction; + private _filter; + private _isDuplicateEntry; + private _createIndexRecord; + private _onlyFileFilter; + private _onlyDirectoryFilter; + private _isSkippedByAbsoluteNegativePatterns; + private _isMatchToPatterns; +} diff --git a/node_modules/fast-glob/out/providers/filters/entry.js b/node_modules/fast-glob/out/providers/filters/entry.js new file mode 100644 index 0000000..361a7b4 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/entry.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = require("../../utils"); +class EntryFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = new Map(); + } + getFilter(positive, negative) { + const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); + return (entry) => this._filter(entry, positiveRe, negativeRe); + } + _filter(entry, positiveRe, negativeRe) { + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { + return false; + } + const isDirectory = entry.dirent.isDirectory(); + const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); + } + return isMatched; + } + _isDuplicateEntry(filepath) { + return this.index.has(filepath); + } + _createIndexRecord(filepath) { + this.index.set(filepath, undefined); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); + } + _isMatchToPatterns(filepath, patternsRe, isDirectory) { + // Trying to match files and directories by patterns. + const isMatched = utils.pattern.matchAny(filepath, patternsRe); + // A pattern with a trailling slash can be used for directory matching. + // To apply such pattern, we need to add a tralling slash to the path. + if (!isMatched && isDirectory) { + return utils.pattern.matchAny(filepath + '/', patternsRe); + } + return isMatched; + } +} +exports.default = EntryFilter; diff --git a/node_modules/fast-glob/out/providers/filters/error.d.ts b/node_modules/fast-glob/out/providers/filters/error.d.ts new file mode 100644 index 0000000..170eb25 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/error.d.ts @@ -0,0 +1,8 @@ +import Settings from '../../settings'; +import { ErrorFilterFunction } from '../../types'; +export default class ErrorFilter { + private readonly _settings; + constructor(_settings: Settings); + getFilter(): ErrorFilterFunction; + private _isNonFatalError; +} diff --git a/node_modules/fast-glob/out/providers/filters/error.js b/node_modules/fast-glob/out/providers/filters/error.js new file mode 100644 index 0000000..1c6f241 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/error.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = require("../../utils"); +class ErrorFilter { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } +} +exports.default = ErrorFilter; diff --git a/node_modules/fast-glob/out/providers/matchers/matcher.d.ts b/node_modules/fast-glob/out/providers/matchers/matcher.d.ts new file mode 100644 index 0000000..d04c232 --- /dev/null +++ b/node_modules/fast-glob/out/providers/matchers/matcher.d.ts @@ -0,0 +1,33 @@ +import { Pattern, MicromatchOptions, PatternRe } from '../../types'; +import Settings from '../../settings'; +export type PatternSegment = StaticPatternSegment | DynamicPatternSegment; +type StaticPatternSegment = { + dynamic: false; + pattern: Pattern; +}; +type DynamicPatternSegment = { + dynamic: true; + pattern: Pattern; + patternRe: PatternRe; +}; +export type PatternSection = PatternSegment[]; +export type PatternInfo = { + /** + * Indicates that the pattern has a globstar (more than a single section). + */ + complete: boolean; + pattern: Pattern; + segments: PatternSegment[]; + sections: PatternSection[]; +}; +export default abstract class Matcher { + private readonly _patterns; + private readonly _settings; + private readonly _micromatchOptions; + protected readonly _storage: PatternInfo[]; + constructor(_patterns: Pattern[], _settings: Settings, _micromatchOptions: MicromatchOptions); + private _fillStorage; + private _getPatternSegments; + private _splitSegmentsIntoSections; +} +export {}; diff --git a/node_modules/fast-glob/out/providers/matchers/matcher.js b/node_modules/fast-glob/out/providers/matchers/matcher.js new file mode 100644 index 0000000..eae67c9 --- /dev/null +++ b/node_modules/fast-glob/out/providers/matchers/matcher.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = require("../../utils"); +class Matcher { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } +} +exports.default = Matcher; diff --git a/node_modules/fast-glob/out/providers/matchers/partial.d.ts b/node_modules/fast-glob/out/providers/matchers/partial.d.ts new file mode 100644 index 0000000..91520f6 --- /dev/null +++ b/node_modules/fast-glob/out/providers/matchers/partial.d.ts @@ -0,0 +1,4 @@ +import Matcher from './matcher'; +export default class PartialMatcher extends Matcher { + match(filepath: string): boolean; +} diff --git a/node_modules/fast-glob/out/providers/matchers/partial.js b/node_modules/fast-glob/out/providers/matchers/partial.js new file mode 100644 index 0000000..1dfffeb --- /dev/null +++ b/node_modules/fast-glob/out/providers/matchers/partial.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const matcher_1 = require("./matcher"); +class PartialMatcher extends matcher_1.default { + match(filepath) { + const parts = filepath.split('/'); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + /** + * In this case, the pattern has a globstar and we must read all directories unconditionally, + * but only if the level has reached the end of the first group. + * + * fixtures/{a,b}/** + * ^ true/false ^ always true + */ + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; + } +} +exports.default = PartialMatcher; diff --git a/node_modules/fast-glob/out/providers/provider.d.ts b/node_modules/fast-glob/out/providers/provider.d.ts new file mode 100644 index 0000000..1053460 --- /dev/null +++ b/node_modules/fast-glob/out/providers/provider.d.ts @@ -0,0 +1,19 @@ +import { Task } from '../managers/tasks'; +import Settings from '../settings'; +import { MicromatchOptions, ReaderOptions } from '../types'; +import DeepFilter from './filters/deep'; +import EntryFilter from './filters/entry'; +import ErrorFilter from './filters/error'; +import EntryTransformer from './transformers/entry'; +export default abstract class Provider { + protected readonly _settings: Settings; + readonly errorFilter: ErrorFilter; + readonly entryFilter: EntryFilter; + readonly deepFilter: DeepFilter; + readonly entryTransformer: EntryTransformer; + constructor(_settings: Settings); + abstract read(_task: Task): T; + protected _getRootDirectory(task: Task): string; + protected _getReaderOptions(task: Task): ReaderOptions; + protected _getMicromatchOptions(): MicromatchOptions; +} diff --git a/node_modules/fast-glob/out/providers/provider.js b/node_modules/fast-glob/out/providers/provider.js new file mode 100644 index 0000000..da88ee0 --- /dev/null +++ b/node_modules/fast-glob/out/providers/provider.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const deep_1 = require("./filters/deep"); +const entry_1 = require("./filters/entry"); +const error_1 = require("./filters/error"); +const entry_2 = require("./transformers/entry"); +class Provider { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); + } + _getRootDirectory(task) { + return path.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === '.' ? '' : task.base; + return { + basePath, + pathSegmentSeparator: '/', + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } +} +exports.default = Provider; diff --git a/node_modules/fast-glob/out/providers/stream.d.ts b/node_modules/fast-glob/out/providers/stream.d.ts new file mode 100644 index 0000000..3d02a1f --- /dev/null +++ b/node_modules/fast-glob/out/providers/stream.d.ts @@ -0,0 +1,11 @@ +/// +import { Readable } from 'stream'; +import { Task } from '../managers/tasks'; +import ReaderStream from '../readers/stream'; +import { ReaderOptions } from '../types'; +import Provider from './provider'; +export default class ProviderStream extends Provider { + protected _reader: ReaderStream; + read(task: Task): Readable; + api(root: string, task: Task, options: ReaderOptions): Readable; +} diff --git a/node_modules/fast-glob/out/providers/stream.js b/node_modules/fast-glob/out/providers/stream.js new file mode 100644 index 0000000..85da62e --- /dev/null +++ b/node_modules/fast-glob/out/providers/stream.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const stream_2 = require("../readers/stream"); +const provider_1 = require("./provider"); +class ProviderStream extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); + source + .once('error', (error) => destination.emit('error', error)) + .on('data', (entry) => destination.emit('data', options.transform(entry))) + .once('end', () => destination.emit('end')); + destination + .once('close', () => source.destroy()); + return destination; + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports.default = ProviderStream; diff --git a/node_modules/fast-glob/out/providers/sync.d.ts b/node_modules/fast-glob/out/providers/sync.d.ts new file mode 100644 index 0000000..9c0fe1e --- /dev/null +++ b/node_modules/fast-glob/out/providers/sync.d.ts @@ -0,0 +1,9 @@ +import { Task } from '../managers/tasks'; +import ReaderSync from '../readers/sync'; +import { Entry, EntryItem, ReaderOptions } from '../types'; +import Provider from './provider'; +export default class ProviderSync extends Provider { + protected _reader: ReaderSync; + read(task: Task): EntryItem[]; + api(root: string, task: Task, options: ReaderOptions): Entry[]; +} diff --git a/node_modules/fast-glob/out/providers/sync.js b/node_modules/fast-glob/out/providers/sync.js new file mode 100644 index 0000000..d70aa1b --- /dev/null +++ b/node_modules/fast-glob/out/providers/sync.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = require("../readers/sync"); +const provider_1 = require("./provider"); +class ProviderSync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports.default = ProviderSync; diff --git a/node_modules/fast-glob/out/providers/transformers/entry.d.ts b/node_modules/fast-glob/out/providers/transformers/entry.d.ts new file mode 100644 index 0000000..e9b85fa --- /dev/null +++ b/node_modules/fast-glob/out/providers/transformers/entry.d.ts @@ -0,0 +1,8 @@ +import Settings from '../../settings'; +import { EntryTransformerFunction } from '../../types'; +export default class EntryTransformer { + private readonly _settings; + constructor(_settings: Settings); + getTransformer(): EntryTransformerFunction; + private _transform; +} diff --git a/node_modules/fast-glob/out/providers/transformers/entry.js b/node_modules/fast-glob/out/providers/transformers/entry.js new file mode 100644 index 0000000..d11903c --- /dev/null +++ b/node_modules/fast-glob/out/providers/transformers/entry.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = require("../../utils"); +class EntryTransformer { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += '/'; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } +} +exports.default = EntryTransformer; diff --git a/node_modules/fast-glob/out/readers/async.d.ts b/node_modules/fast-glob/out/readers/async.d.ts new file mode 100644 index 0000000..fbca428 --- /dev/null +++ b/node_modules/fast-glob/out/readers/async.d.ts @@ -0,0 +1,10 @@ +import * as fsWalk from '@nodelib/fs.walk'; +import { Entry, ReaderOptions, Pattern } from '../types'; +import Reader from './reader'; +import ReaderStream from './stream'; +export default class ReaderAsync extends Reader> { + protected _walkAsync: typeof fsWalk.walk; + protected _readerStream: ReaderStream; + dynamic(root: string, options: ReaderOptions): Promise; + static(patterns: Pattern[], options: ReaderOptions): Promise; +} diff --git a/node_modules/fast-glob/out/readers/async.js b/node_modules/fast-glob/out/readers/async.js new file mode 100644 index 0000000..d024145 --- /dev/null +++ b/node_modules/fast-glob/out/readers/async.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsWalk = require("@nodelib/fs.walk"); +const reader_1 = require("./reader"); +const stream_1 = require("./stream"); +class ReaderAsync extends reader_1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk.walk; + this._readerStream = new stream_1.default(this._settings); + } + dynamic(root, options) { + return new Promise((resolve, reject) => { + this._walkAsync(root, options, (error, entries) => { + if (error === null) { + resolve(entries); + } + else { + reject(error); + } + }); + }); + } + async static(patterns, options) { + const entries = []; + const stream = this._readerStream.static(patterns, options); + // After #235, replace it with an asynchronous iterator. + return new Promise((resolve, reject) => { + stream.once('error', reject); + stream.on('data', (entry) => entries.push(entry)); + stream.once('end', () => resolve(entries)); + }); + } +} +exports.default = ReaderAsync; diff --git a/node_modules/fast-glob/out/readers/reader.d.ts b/node_modules/fast-glob/out/readers/reader.d.ts new file mode 100644 index 0000000..2af16b6 --- /dev/null +++ b/node_modules/fast-glob/out/readers/reader.d.ts @@ -0,0 +1,15 @@ +/// +import * as fs from 'fs'; +import * as fsStat from '@nodelib/fs.stat'; +import Settings from '../settings'; +import { Entry, ErrnoException, Pattern, ReaderOptions } from '../types'; +export default abstract class Reader { + protected readonly _settings: Settings; + protected readonly _fsStatSettings: fsStat.Settings; + constructor(_settings: Settings); + abstract dynamic(root: string, options: ReaderOptions): T; + abstract static(patterns: Pattern[], options: ReaderOptions): T; + protected _getFullEntryPath(filepath: string): string; + protected _makeEntry(stats: fs.Stats, pattern: Pattern): Entry; + protected _isFatalError(error: ErrnoException): boolean; +} diff --git a/node_modules/fast-glob/out/readers/reader.js b/node_modules/fast-glob/out/readers/reader.js new file mode 100644 index 0000000..7b40255 --- /dev/null +++ b/node_modules/fast-glob/out/readers/reader.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsStat = require("@nodelib/fs.stat"); +const utils = require("../utils"); +class Reader { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } +} +exports.default = Reader; diff --git a/node_modules/fast-glob/out/readers/stream.d.ts b/node_modules/fast-glob/out/readers/stream.d.ts new file mode 100644 index 0000000..1c74cac --- /dev/null +++ b/node_modules/fast-glob/out/readers/stream.d.ts @@ -0,0 +1,14 @@ +/// +import { Readable } from 'stream'; +import * as fsStat from '@nodelib/fs.stat'; +import * as fsWalk from '@nodelib/fs.walk'; +import { Pattern, ReaderOptions } from '../types'; +import Reader from './reader'; +export default class ReaderStream extends Reader { + protected _walkStream: typeof fsWalk.walkStream; + protected _stat: typeof fsStat.stat; + dynamic(root: string, options: ReaderOptions): Readable; + static(patterns: Pattern[], options: ReaderOptions): Readable; + private _getEntry; + private _getStat; +} diff --git a/node_modules/fast-glob/out/readers/stream.js b/node_modules/fast-glob/out/readers/stream.js new file mode 100644 index 0000000..317c6d5 --- /dev/null +++ b/node_modules/fast-glob/out/readers/stream.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const fsStat = require("@nodelib/fs.stat"); +const fsWalk = require("@nodelib/fs.walk"); +const reader_1 = require("./reader"); +class ReaderStream extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; + } + dynamic(root, options) { + return this._walkStream(root, options); + } + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options) + .then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }) + .catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options) { + return this._getStat(filepath) + .then((stats) => this._makeEntry(stats, pattern)) + .catch((error) => { + if (options.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve(stats) : reject(error); + }); + }); + } +} +exports.default = ReaderStream; diff --git a/node_modules/fast-glob/out/readers/sync.d.ts b/node_modules/fast-glob/out/readers/sync.d.ts new file mode 100644 index 0000000..c96ffee --- /dev/null +++ b/node_modules/fast-glob/out/readers/sync.d.ts @@ -0,0 +1,12 @@ +import * as fsStat from '@nodelib/fs.stat'; +import * as fsWalk from '@nodelib/fs.walk'; +import { Entry, Pattern, ReaderOptions } from '../types'; +import Reader from './reader'; +export default class ReaderSync extends Reader { + protected _walkSync: typeof fsWalk.walkSync; + protected _statSync: typeof fsStat.statSync; + dynamic(root: string, options: ReaderOptions): Entry[]; + static(patterns: Pattern[], options: ReaderOptions): Entry[]; + private _getEntry; + private _getStat; +} diff --git a/node_modules/fast-glob/out/readers/sync.js b/node_modules/fast-glob/out/readers/sync.js new file mode 100644 index 0000000..4704d65 --- /dev/null +++ b/node_modules/fast-glob/out/readers/sync.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsStat = require("@nodelib/fs.stat"); +const fsWalk = require("@nodelib/fs.walk"); +const reader_1 = require("./reader"); +class ReaderSync extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; + } + dynamic(root, options) { + return this._walkSync(root, options); + } + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; + } + _getEntry(filepath, pattern, options) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } + catch (error) { + if (options.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } +} +exports.default = ReaderSync; diff --git a/node_modules/fast-glob/out/settings.d.ts b/node_modules/fast-glob/out/settings.d.ts new file mode 100644 index 0000000..76a74f8 --- /dev/null +++ b/node_modules/fast-glob/out/settings.d.ts @@ -0,0 +1,164 @@ +import { FileSystemAdapter, Pattern } from './types'; +export declare const DEFAULT_FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export type Options = { + /** + * Return the absolute path for entries. + * + * @default false + */ + absolute?: boolean; + /** + * If set to `true`, then patterns without slashes will be matched against + * the basename of the path if it contains slashes. + * + * @default false + */ + baseNameMatch?: boolean; + /** + * Enables Bash-like brace expansion. + * + * @default true + */ + braceExpansion?: boolean; + /** + * Enables a case-sensitive mode for matching files. + * + * @default true + */ + caseSensitiveMatch?: boolean; + /** + * Specifies the maximum number of concurrent requests from a reader to read + * directories. + * + * @default os.cpus().length + */ + concurrency?: number; + /** + * The current working directory in which to search. + * + * @default process.cwd() + */ + cwd?: string; + /** + * Specifies the maximum depth of a read directory relative to the start + * directory. + * + * @default Infinity + */ + deep?: number; + /** + * Allow patterns to match entries that begin with a period (`.`). + * + * @default false + */ + dot?: boolean; + /** + * Enables Bash-like `extglob` functionality. + * + * @default true + */ + extglob?: boolean; + /** + * Indicates whether to traverse descendants of symbolic link directories. + * + * @default true + */ + followSymbolicLinks?: boolean; + /** + * Custom implementation of methods for working with the file system. + * + * @default fs.* + */ + fs?: Partial; + /** + * Enables recursively repeats a pattern containing `**`. + * If `false`, `**` behaves exactly like `*`. + * + * @default true + */ + globstar?: boolean; + /** + * An array of glob patterns to exclude matches. + * This is an alternative way to use negative patterns. + * + * @default [] + */ + ignore?: Pattern[]; + /** + * Mark the directory path with the final slash. + * + * @default false + */ + markDirectories?: boolean; + /** + * Returns objects (instead of strings) describing entries. + * + * @default false + */ + objectMode?: boolean; + /** + * Return only directories. + * + * @default false + */ + onlyDirectories?: boolean; + /** + * Return only files. + * + * @default true + */ + onlyFiles?: boolean; + /** + * Enables an object mode (`objectMode`) with an additional `stats` field. + * + * @default false + */ + stats?: boolean; + /** + * By default this package suppress only `ENOENT` errors. + * Set to `true` to suppress any error. + * + * @default false + */ + suppressErrors?: boolean; + /** + * Throw an error when symbolic link is broken if `true` or safely + * return `lstat` call if `false`. + * + * @default false + */ + throwErrorOnBrokenSymbolicLink?: boolean; + /** + * Ensures that the returned entries are unique. + * + * @default true + */ + unique?: boolean; +}; +export default class Settings { + private readonly _options; + readonly absolute: boolean; + readonly baseNameMatch: boolean; + readonly braceExpansion: boolean; + readonly caseSensitiveMatch: boolean; + readonly concurrency: number; + readonly cwd: string; + readonly deep: number; + readonly dot: boolean; + readonly extglob: boolean; + readonly followSymbolicLinks: boolean; + readonly fs: FileSystemAdapter; + readonly globstar: boolean; + readonly ignore: Pattern[]; + readonly markDirectories: boolean; + readonly objectMode: boolean; + readonly onlyDirectories: boolean; + readonly onlyFiles: boolean; + readonly stats: boolean; + readonly suppressErrors: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + readonly unique: boolean; + constructor(_options?: Options); + private _getValue; + private _getFileSystemMethods; +} diff --git a/node_modules/fast-glob/out/settings.js b/node_modules/fast-glob/out/settings.js new file mode 100644 index 0000000..23f916c --- /dev/null +++ b/node_modules/fast-glob/out/settings.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +const os = require("os"); +/** + * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. + * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 + */ +const CPU_COUNT = Math.max(os.cpus().length, 1); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + lstatSync: fs.lstatSync, + stat: fs.stat, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +class Settings { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + // Remove the cast to the array in the next major (#404). + this.ignore = [].concat(this.ignore); + } + _getValue(option, value) { + return option === undefined ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } +} +exports.default = Settings; diff --git a/node_modules/fast-glob/out/types/index.d.ts b/node_modules/fast-glob/out/types/index.d.ts new file mode 100644 index 0000000..6506caf --- /dev/null +++ b/node_modules/fast-glob/out/types/index.d.ts @@ -0,0 +1,31 @@ +/// +import * as fsWalk from '@nodelib/fs.walk'; +export type ErrnoException = NodeJS.ErrnoException; +export type Entry = fsWalk.Entry; +export type EntryItem = string | Entry; +export type Pattern = string; +export type PatternRe = RegExp; +export type PatternsGroup = Record; +export type ReaderOptions = fsWalk.Options & { + transform(entry: Entry): EntryItem; + deepFilter: DeepFilterFunction; + entryFilter: EntryFilterFunction; + errorFilter: ErrorFilterFunction; + fs: FileSystemAdapter; + stats: boolean; +}; +export type ErrorFilterFunction = fsWalk.ErrorFilterFunction; +export type EntryFilterFunction = fsWalk.EntryFilterFunction; +export type DeepFilterFunction = fsWalk.DeepFilterFunction; +export type EntryTransformerFunction = (entry: Entry) => EntryItem; +export type MicromatchOptions = { + dot?: boolean; + matchBase?: boolean; + nobrace?: boolean; + nocase?: boolean; + noext?: boolean; + noglobstar?: boolean; + posix?: boolean; + strictSlashes?: boolean; +}; +export type FileSystemAdapter = fsWalk.FileSystemAdapter; diff --git a/node_modules/fast-glob/out/types/index.js b/node_modules/fast-glob/out/types/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/fast-glob/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/fast-glob/out/utils/array.d.ts b/node_modules/fast-glob/out/utils/array.d.ts new file mode 100644 index 0000000..98e7325 --- /dev/null +++ b/node_modules/fast-glob/out/utils/array.d.ts @@ -0,0 +1,2 @@ +export declare function flatten(items: T[][]): T[]; +export declare function splitWhen(items: T[], predicate: (item: T) => boolean): T[][]; diff --git a/node_modules/fast-glob/out/utils/array.js b/node_modules/fast-glob/out/utils/array.js new file mode 100644 index 0000000..50c406e --- /dev/null +++ b/node_modules/fast-glob/out/utils/array.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.splitWhen = exports.flatten = void 0; +function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); +} +exports.flatten = flatten; +function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } + else { + result[groupIndex].push(item); + } + } + return result; +} +exports.splitWhen = splitWhen; diff --git a/node_modules/fast-glob/out/utils/errno.d.ts b/node_modules/fast-glob/out/utils/errno.d.ts new file mode 100644 index 0000000..1c08d3b --- /dev/null +++ b/node_modules/fast-glob/out/utils/errno.d.ts @@ -0,0 +1,2 @@ +import { ErrnoException } from '../types'; +export declare function isEnoentCodeError(error: ErrnoException): boolean; diff --git a/node_modules/fast-glob/out/utils/errno.js b/node_modules/fast-glob/out/utils/errno.js new file mode 100644 index 0000000..f0bd801 --- /dev/null +++ b/node_modules/fast-glob/out/utils/errno.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEnoentCodeError = void 0; +function isEnoentCodeError(error) { + return error.code === 'ENOENT'; +} +exports.isEnoentCodeError = isEnoentCodeError; diff --git a/node_modules/fast-glob/out/utils/fs.d.ts b/node_modules/fast-glob/out/utils/fs.d.ts new file mode 100644 index 0000000..64c61ce --- /dev/null +++ b/node_modules/fast-glob/out/utils/fs.d.ts @@ -0,0 +1,4 @@ +/// +import * as fs from 'fs'; +import { Dirent } from '@nodelib/fs.walk'; +export declare function createDirentFromStats(name: string, stats: fs.Stats): Dirent; diff --git a/node_modules/fast-glob/out/utils/fs.js b/node_modules/fast-glob/out/utils/fs.js new file mode 100644 index 0000000..ace7c74 --- /dev/null +++ b/node_modules/fast-glob/out/utils/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/fast-glob/out/utils/index.d.ts b/node_modules/fast-glob/out/utils/index.d.ts new file mode 100644 index 0000000..f634cad --- /dev/null +++ b/node_modules/fast-glob/out/utils/index.d.ts @@ -0,0 +1,8 @@ +import * as array from './array'; +import * as errno from './errno'; +import * as fs from './fs'; +import * as path from './path'; +import * as pattern from './pattern'; +import * as stream from './stream'; +import * as string from './string'; +export { array, errno, fs, path, pattern, stream, string }; diff --git a/node_modules/fast-glob/out/utils/index.js b/node_modules/fast-glob/out/utils/index.js new file mode 100644 index 0000000..0f92c16 --- /dev/null +++ b/node_modules/fast-glob/out/utils/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; +const array = require("./array"); +exports.array = array; +const errno = require("./errno"); +exports.errno = errno; +const fs = require("./fs"); +exports.fs = fs; +const path = require("./path"); +exports.path = path; +const pattern = require("./pattern"); +exports.pattern = pattern; +const stream = require("./stream"); +exports.stream = stream; +const string = require("./string"); +exports.string = string; diff --git a/node_modules/fast-glob/out/utils/path.d.ts b/node_modules/fast-glob/out/utils/path.d.ts new file mode 100644 index 0000000..0b13f4b --- /dev/null +++ b/node_modules/fast-glob/out/utils/path.d.ts @@ -0,0 +1,13 @@ +import { Pattern } from '../types'; +/** + * Designed to work only with simple paths: `dir\\file`. + */ +export declare function unixify(filepath: string): string; +export declare function makeAbsolute(cwd: string, filepath: string): string; +export declare function removeLeadingDotSegment(entry: string): string; +export declare const escape: typeof escapeWindowsPath; +export declare function escapeWindowsPath(pattern: Pattern): Pattern; +export declare function escapePosixPath(pattern: Pattern): Pattern; +export declare const convertPathToPattern: typeof convertWindowsPathToPattern; +export declare function convertWindowsPathToPattern(filepath: string): Pattern; +export declare function convertPosixPathToPattern(filepath: string): Pattern; diff --git a/node_modules/fast-glob/out/utils/path.js b/node_modules/fast-glob/out/utils/path.js new file mode 100644 index 0000000..97a7b49 --- /dev/null +++ b/node_modules/fast-glob/out/utils/path.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; +const os = require("os"); +const path = require("path"); +const IS_WINDOWS_PLATFORM = os.platform() === 'win32'; +const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ +/** + * All non-escaped special characters. + * Posix: ()*?[\]{|}, !+@ before (, ! at the beginning, \\ before non-special characters. + * Windows: (){}, !+@ before (, ! at the beginning. + */ +const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; +const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g; +/** + * The device path (\\.\ or \\?\). + * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths + */ +const DOS_DEVICE_PATH_RE = /^\\\\([.?])/; +/** + * All backslashes except those escaping special characters. + * Windows: !()+@{} + * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions + */ +const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g; +/** + * Designed to work only with simple paths: `dir\\file`. + */ +function unixify(filepath) { + return filepath.replace(/\\/g, '/'); +} +exports.unixify = unixify; +function makeAbsolute(cwd, filepath) { + return path.resolve(cwd, filepath); +} +exports.makeAbsolute = makeAbsolute; +function removeLeadingDotSegment(entry) { + // We do not use `startsWith` because this is 10x slower than current implementation for some cases. + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with + if (entry.charAt(0) === '.') { + const secondCharactery = entry.charAt(1); + if (secondCharactery === '/' || secondCharactery === '\\') { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } + } + return entry; +} +exports.removeLeadingDotSegment = removeLeadingDotSegment; +exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; +function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +exports.escapeWindowsPath = escapeWindowsPath; +function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +exports.escapePosixPath = escapePosixPath; +exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; +function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath) + .replace(DOS_DEVICE_PATH_RE, '//$1') + .replace(WINDOWS_BACKSLASHES_RE, '/'); +} +exports.convertWindowsPathToPattern = convertWindowsPathToPattern; +function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); +} +exports.convertPosixPathToPattern = convertPosixPathToPattern; diff --git a/node_modules/fast-glob/out/utils/pattern.d.ts b/node_modules/fast-glob/out/utils/pattern.d.ts new file mode 100644 index 0000000..e7ff07b --- /dev/null +++ b/node_modules/fast-glob/out/utils/pattern.d.ts @@ -0,0 +1,47 @@ +import { MicromatchOptions, Pattern, PatternRe } from '../types'; +type PatternTypeOptions = { + braceExpansion?: boolean; + caseSensitiveMatch?: boolean; + extglob?: boolean; +}; +export declare function isStaticPattern(pattern: Pattern, options?: PatternTypeOptions): boolean; +export declare function isDynamicPattern(pattern: Pattern, options?: PatternTypeOptions): boolean; +export declare function convertToPositivePattern(pattern: Pattern): Pattern; +export declare function convertToNegativePattern(pattern: Pattern): Pattern; +export declare function isNegativePattern(pattern: Pattern): boolean; +export declare function isPositivePattern(pattern: Pattern): boolean; +export declare function getNegativePatterns(patterns: Pattern[]): Pattern[]; +export declare function getPositivePatterns(patterns: Pattern[]): Pattern[]; +/** + * Returns patterns that can be applied inside the current directory. + * + * @example + * // ['./*', '*', 'a/*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +export declare function getPatternsInsideCurrentDirectory(patterns: Pattern[]): Pattern[]; +/** + * Returns patterns to be expanded relative to (outside) the current directory. + * + * @example + * // ['../*', './../*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +export declare function getPatternsOutsideCurrentDirectory(patterns: Pattern[]): Pattern[]; +export declare function isPatternRelatedToParentDirectory(pattern: Pattern): boolean; +export declare function getBaseDirectory(pattern: Pattern): string; +export declare function hasGlobStar(pattern: Pattern): boolean; +export declare function endsWithSlashGlobStar(pattern: Pattern): boolean; +export declare function isAffectDepthOfReadingPattern(pattern: Pattern): boolean; +export declare function expandPatternsWithBraceExpansion(patterns: Pattern[]): Pattern[]; +export declare function expandBraceExpansion(pattern: Pattern): Pattern[]; +export declare function getPatternParts(pattern: Pattern, options: MicromatchOptions): Pattern[]; +export declare function makeRe(pattern: Pattern, options: MicromatchOptions): PatternRe; +export declare function convertPatternsToRe(patterns: Pattern[], options: MicromatchOptions): PatternRe[]; +export declare function matchAny(entry: string, patternsRe: PatternRe[]): boolean; +/** + * This package only works with forward slashes as a path separator. + * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. + */ +export declare function removeDuplicateSlashes(pattern: string): string; +export {}; diff --git a/node_modules/fast-glob/out/utils/pattern.js b/node_modules/fast-glob/out/utils/pattern.js new file mode 100644 index 0000000..0f5e9ca --- /dev/null +++ b/node_modules/fast-glob/out/utils/pattern.js @@ -0,0 +1,188 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; +const path = require("path"); +const globParent = require("glob-parent"); +const micromatch = require("micromatch"); +const GLOBSTAR = '**'; +const ESCAPE_SYMBOL = '\\'; +const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; +const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; +const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; +const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; +const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; +/** + * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. + * The latter is due to the presence of the device path at the beginning of the UNC path. + */ +const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; +function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); +} +exports.isStaticPattern = isStaticPattern; +function isDynamicPattern(pattern, options = {}) { + /** + * A special case with an empty string is necessary for matching patterns that start with a forward slash. + * An empty string cannot be a dynamic pattern. + * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. + */ + if (pattern === '') { + return false; + } + /** + * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check + * filepath directly (without read directory). + */ + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; + } + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; + } + return false; +} +exports.isDynamicPattern = isDynamicPattern; +function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf('{'); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; + } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); +} +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; +} +exports.convertToPositivePattern = convertToPositivePattern; +function convertToNegativePattern(pattern) { + return '!' + pattern; +} +exports.convertToNegativePattern = convertToNegativePattern; +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +exports.isNegativePattern = isNegativePattern; +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +exports.isPositivePattern = isPositivePattern; +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +exports.getNegativePatterns = getNegativePatterns; +function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Returns patterns that can be applied inside the current directory. + * + * @example + * // ['./*', '*', 'a/*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); +} +exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; +/** + * Returns patterns to be expanded relative to (outside) the current directory. + * + * @example + * // ['../*', './../*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); +} +exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; +function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith('..') || pattern.startsWith('./..'); +} +exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; +function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); +} +exports.getBaseDirectory = getBaseDirectory; +function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); +} +exports.hasGlobStar = hasGlobStar; +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR); +} +exports.endsWithSlashGlobStar = endsWithSlashGlobStar; +function isAffectDepthOfReadingPattern(pattern) { + const basename = path.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); +} +exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; +function expandBraceExpansion(pattern) { + const patterns = micromatch.braces(pattern, { expand: true, nodupes: true }); + /** + * Sort the patterns by length so that the same depth patterns are processed side by side. + * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']` + */ + patterns.sort((a, b) => a.length - b.length); + /** + * Micromatch can return an empty string in the case of patterns like `{a,}`. + */ + return patterns.filter((pattern) => pattern !== ''); +} +exports.expandBraceExpansion = expandBraceExpansion; +function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + /** + * The scan method returns an empty array in some cases. + * See micromatch/picomatch#58 for more details. + */ + if (parts.length === 0) { + parts = [pattern]; + } + /** + * The scan method does not return an empty part for the pattern with a forward slash. + * This is another part of micromatch/picomatch#58. + */ + if (parts[0].startsWith('/')) { + parts[0] = parts[0].slice(1); + parts.unshift(''); + } + return parts; +} +exports.getPatternParts = getPatternParts; +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +exports.makeRe = makeRe; +function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); +} +exports.convertPatternsToRe = convertPatternsToRe; +function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); +} +exports.matchAny = matchAny; +/** + * This package only works with forward slashes as a path separator. + * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. + */ +function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, '/'); +} +exports.removeDuplicateSlashes = removeDuplicateSlashes; diff --git a/node_modules/fast-glob/out/utils/stream.d.ts b/node_modules/fast-glob/out/utils/stream.d.ts new file mode 100644 index 0000000..4daf913 --- /dev/null +++ b/node_modules/fast-glob/out/utils/stream.d.ts @@ -0,0 +1,4 @@ +/// +/// +import { Readable } from 'stream'; +export declare function merge(streams: Readable[]): NodeJS.ReadableStream; diff --git a/node_modules/fast-glob/out/utils/stream.js b/node_modules/fast-glob/out/utils/stream.js new file mode 100644 index 0000000..b32028c --- /dev/null +++ b/node_modules/fast-glob/out/utils/stream.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.merge = void 0; +const merge2 = require("merge2"); +function merge(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once('error', (error) => mergedStream.emit('error', error)); + }); + mergedStream.once('close', () => propagateCloseEventToSources(streams)); + mergedStream.once('end', () => propagateCloseEventToSources(streams)); + return mergedStream; +} +exports.merge = merge; +function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit('close')); +} diff --git a/node_modules/fast-glob/out/utils/string.d.ts b/node_modules/fast-glob/out/utils/string.d.ts new file mode 100644 index 0000000..c884735 --- /dev/null +++ b/node_modules/fast-glob/out/utils/string.d.ts @@ -0,0 +1,2 @@ +export declare function isString(input: unknown): input is string; +export declare function isEmpty(input: string): boolean; diff --git a/node_modules/fast-glob/out/utils/string.js b/node_modules/fast-glob/out/utils/string.js new file mode 100644 index 0000000..76e7ea5 --- /dev/null +++ b/node_modules/fast-glob/out/utils/string.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEmpty = exports.isString = void 0; +function isString(input) { + return typeof input === 'string'; +} +exports.isString = isString; +function isEmpty(input) { + return input === ''; +} +exports.isEmpty = isEmpty; diff --git a/node_modules/fast-glob/package.json b/node_modules/fast-glob/package.json new file mode 100644 index 0000000..bbcc0ea --- /dev/null +++ b/node_modules/fast-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "fast-glob", + "version": "3.3.1", + "description": "It's a very fast and efficient glob library for Node.js", + "license": "MIT", + "repository": "mrmlnc/fast-glob", + "author": { + "name": "Denis Malinochkin", + "url": "https://mrmlnc.com" + }, + "engines": { + "node": ">=8.6.0" + }, + "main": "out/index.js", + "typings": "out/index.d.ts", + "files": [ + "out", + "!out/{benchmark,tests}", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "keywords": [ + "glob", + "patterns", + "fast", + "implementation" + ], + "devDependencies": { + "@nodelib/fs.macchiato": "^1.0.1", + "@types/glob-parent": "^5.1.0", + "@types/merge2": "^1.1.4", + "@types/micromatch": "^4.0.0", + "@types/mocha": "^5.2.7", + "@types/node": "^14.18.53", + "@types/picomatch": "^2.3.0", + "@types/sinon": "^7.5.0", + "bencho": "^0.1.1", + "eslint": "^6.5.1", + "eslint-config-mrmlnc": "^1.1.0", + "execa": "^7.1.1", + "fast-glob": "^3.0.4", + "fdir": "^6.0.1", + "glob": "^10.0.0", + "hereby": "^1.8.1", + "mocha": "^6.2.1", + "rimraf": "^5.0.0", + "sinon": "^7.5.0", + "snap-shot-it": "^7.9.10", + "typescript": "^4.9.5" + }, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "scripts": { + "clean": "rimraf out", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "test:e2e": "mocha \"out/**/*.e2e.js\" -s 0", + "test:e2e:sync": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(sync\\)\"", + "test:e2e:async": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(async\\)\"", + "test:e2e:stream": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(stream\\)\"", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile -- --sourceMap --watch", + "bench:async": "npm run bench:product:async && npm run bench:regression:async", + "bench:stream": "npm run bench:product:stream && npm run bench:regression:stream", + "bench:sync": "npm run bench:product:sync && npm run bench:regression:sync", + "bench:product": "npm run bench:product:async && npm run bench:product:sync && npm run bench:product:stream", + "bench:product:async": "hereby bench:product:async", + "bench:product:sync": "hereby bench:product:sync", + "bench:product:stream": "hereby bench:product:stream", + "bench:regression": "npm run bench:regression:async && npm run bench:regression:sync && npm run bench:regression:stream", + "bench:regression:async": "hereby bench:regression:async", + "bench:regression:sync": "hereby bench:regression:sync", + "bench:regression:stream": "hereby bench:regression:stream" + } +} diff --git a/node_modules/fastq/.github/dependabot.yml b/node_modules/fastq/.github/dependabot.yml new file mode 100644 index 0000000..7e7cbe1 --- /dev/null +++ b/node_modules/fastq/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + ignore: + - dependency-name: standard + versions: + - 16.0.3 diff --git a/node_modules/fastq/.github/workflows/ci.yml b/node_modules/fastq/.github/workflows/ci.yml new file mode 100644 index 0000000..50e66b5 --- /dev/null +++ b/node_modules/fastq/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: ci + +on: [push, pull_request] + +jobs: + legacy: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['0.10', '0.12', 4.x, 6.x, 8.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install + run: | + npm install --production && npm install tape + + - name: Run tests + run: | + npm run legacy + + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 13.x, 14.x, 15.x, 16.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install + run: | + npm install + + - name: Run tests + run: | + npm run test diff --git a/node_modules/fastq/LICENSE b/node_modules/fastq/LICENSE new file mode 100644 index 0000000..27c7bb4 --- /dev/null +++ b/node_modules/fastq/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015-2020, Matteo Collina + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fastq/README.md b/node_modules/fastq/README.md new file mode 100644 index 0000000..8a25fef --- /dev/null +++ b/node_modules/fastq/README.md @@ -0,0 +1,309 @@ +# fastq + +![ci][ci-url] +[![npm version][npm-badge]][npm-url] +[![Dependency Status][david-badge]][david-url] + +Fast, in memory work queue. + +Benchmarks (1 million tasks): + +* setImmediate: 812ms +* fastq: 854ms +* async.queue: 1298ms +* neoAsync.queue: 1249ms + +Obtained on node 12.16.1, on a dedicated server. + +If you need zero-overhead series function call, check out +[fastseries](http://npm.im/fastseries). For zero-overhead parallel +function call, check out [fastparallel](http://npm.im/fastparallel). + +[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard) + + * Installation + * Usage + * API + * Licence & copyright + +## Install + +`npm i fastq --save` + +## Usage (callback API) + +```js +'use strict' + +const queue = require('fastq')(worker, 1) + +queue.push(42, function (err, result) { + if (err) { throw err } + console.log('the result is', result) +}) + +function worker (arg, cb) { + cb(null, arg * 2) +} +``` + +## Usage (promise API) + +```js +const queue = require('fastq').promise(worker, 1) + +async function worker (arg) { + return arg * 2 +} + +async function run () { + const result = await queue.push(42) + console.log('the result is', result) +} + +run() +``` + +### Setting "this" + +```js +'use strict' + +const that = { hello: 'world' } +const queue = require('fastq')(that, worker, 1) + +queue.push(42, function (err, result) { + if (err) { throw err } + console.log(this) + console.log('the result is', result) +}) + +function worker (arg, cb) { + console.log(this) + cb(null, arg * 2) +} +``` + +### Using with TypeScript (callback API) + +```ts +'use strict' + +import * as fastq from "fastq"; +import type { queue, done } from "fastq"; + +type Task = { + id: number +} + +const q: queue = fastq(worker, 1) + +q.push({ id: 42}) + +function worker (arg: Task, cb: done) { + console.log(arg.id) + cb(null) +} +``` + +### Using with TypeScript (promise API) + +```ts +'use strict' + +import * as fastq from "fastq"; +import type { queueAsPromised } from "fastq"; + +type Task = { + id: number +} + +const q: queueAsPromised = fastq.promise(asyncWorker, 1) + +q.push({ id: 42}).catch((err) => console.error(err)) + +async function asyncWorker (arg: Task): Promise { + // No need for a try-catch block, fastq handles errors automatically + console.log(arg.id) +} +``` + +## API + +* fastqueue() +* queue#push() +* queue#unshift() +* queue#pause() +* queue#resume() +* queue#idle() +* queue#length() +* queue#getQueue() +* queue#kill() +* queue#killAndDrain() +* queue#error() +* queue#concurrency +* queue#drain +* queue#empty +* queue#saturated +* fastqueue.promise() + +------------------------------------------------------- + +### fastqueue([that], worker, concurrency) + +Creates a new queue. + +Arguments: + +* `that`, optional context of the `worker` function. +* `worker`, worker function, it would be called with `that` as `this`, + if that is specified. +* `concurrency`, number of concurrent tasks that could be executed in + parallel. + +------------------------------------------------------- + +### queue.push(task, done) + +Add a task at the end of the queue. `done(err, result)` will be called +when the task was processed. + +------------------------------------------------------- + +### queue.unshift(task, done) + +Add a task at the beginning of the queue. `done(err, result)` will be called +when the task was processed. + +------------------------------------------------------- + +### queue.pause() + +Pause the processing of tasks. Currently worked tasks are not +stopped. + +------------------------------------------------------- + +### queue.resume() + +Resume the processing of tasks. + +------------------------------------------------------- + +### queue.idle() + +Returns `false` if there are tasks being processed or waiting to be processed. +`true` otherwise. + +------------------------------------------------------- + +### queue.length() + +Returns the number of tasks waiting to be processed (in the queue). + +------------------------------------------------------- + +### queue.getQueue() + +Returns all the tasks be processed (in the queue). Returns empty array when there are no tasks + +------------------------------------------------------- + +### queue.kill() + +Removes all tasks waiting to be processed, and reset `drain` to an empty +function. + +------------------------------------------------------- + +### queue.killAndDrain() + +Same than `kill` but the `drain` function will be called before reset to empty. + +------------------------------------------------------- + +### queue.error(handler) + +Set a global error handler. `handler(err, task)` will be called +each time a task is completed, `err` will be not null if the task has thrown an error. + +------------------------------------------------------- + +### queue.concurrency + +Property that returns the number of concurrent tasks that could be executed in +parallel. It can be altered at runtime. + +------------------------------------------------------- + +### queue.drain + +Function that will be called when the last +item from the queue has been processed by a worker. +It can be altered at runtime. + +------------------------------------------------------- + +### queue.empty + +Function that will be called when the last +item from the queue has been assigned to a worker. +It can be altered at runtime. + +------------------------------------------------------- + +### queue.saturated + +Function that will be called when the queue hits the concurrency +limit. +It can be altered at runtime. + +------------------------------------------------------- + +### fastqueue.promise([that], worker(arg), concurrency) + +Creates a new queue with `Promise` apis. It also offers all the methods +and properties of the object returned by [`fastqueue`](#fastqueue) with the modified +[`push`](#pushPromise) and [`unshift`](#unshiftPromise) methods. + +Node v10+ is required to use the promisified version. + +Arguments: +* `that`, optional context of the `worker` function. +* `worker`, worker function, it would be called with `that` as `this`, + if that is specified. It MUST return a `Promise`. +* `concurrency`, number of concurrent tasks that could be executed in + parallel. + + +#### queue.push(task) => Promise + +Add a task at the end of the queue. The returned `Promise` will be fulfilled (rejected) +when the task is completed successfully (unsuccessfully). + +This promise could be ignored as it will not lead to a `'unhandledRejection'`. + + +#### queue.unshift(task) => Promise + +Add a task at the beginning of the queue. The returned `Promise` will be fulfilled (rejected) +when the task is completed successfully (unsuccessfully). + +This promise could be ignored as it will not lead to a `'unhandledRejection'`. + + +#### queue.drained() => Promise + +Wait for the queue to be drained. The returned `Promise` will be resolved when all tasks in the queue have been processed by a worker. + +This promise could be ignored as it will not lead to a `'unhandledRejection'`. + +## License + +ISC + +[ci-url]: https://github.com/mcollina/fastq/workflows/ci/badge.svg +[npm-badge]: https://badge.fury.io/js/fastq.svg +[npm-url]: https://badge.fury.io/js/fastq +[david-badge]: https://david-dm.org/mcollina/fastq.svg +[david-url]: https://david-dm.org/mcollina/fastq diff --git a/node_modules/fastq/bench.js b/node_modules/fastq/bench.js new file mode 100644 index 0000000..4eaa829 --- /dev/null +++ b/node_modules/fastq/bench.js @@ -0,0 +1,66 @@ +'use strict' + +const max = 1000000 +const fastqueue = require('./')(worker, 1) +const { promisify } = require('util') +const immediate = promisify(setImmediate) +const qPromise = require('./').promise(immediate, 1) +const async = require('async') +const neo = require('neo-async') +const asyncqueue = async.queue(worker, 1) +const neoqueue = neo.queue(worker, 1) + +function bench (func, done) { + const key = max + '*' + func.name + let count = -1 + + console.time(key) + end() + + function end () { + if (++count < max) { + func(end) + } else { + console.timeEnd(key) + if (done) { + done() + } + } + } +} + +function benchFastQ (done) { + fastqueue.push(42, done) +} + +function benchAsyncQueue (done) { + asyncqueue.push(42, done) +} + +function benchNeoQueue (done) { + neoqueue.push(42, done) +} + +function worker (arg, cb) { + setImmediate(cb) +} + +function benchSetImmediate (cb) { + worker(42, cb) +} + +function benchFastQPromise (done) { + qPromise.push(42).then(function () { done() }, done) +} + +function runBench (done) { + async.eachSeries([ + benchSetImmediate, + benchFastQ, + benchNeoQueue, + benchAsyncQueue, + benchFastQPromise + ], bench, done) +} + +runBench(runBench) diff --git a/node_modules/fastq/example.js b/node_modules/fastq/example.js new file mode 100644 index 0000000..665fdc8 --- /dev/null +++ b/node_modules/fastq/example.js @@ -0,0 +1,14 @@ +'use strict' + +/* eslint-disable no-var */ + +var queue = require('./')(worker, 1) + +queue.push(42, function (err, result) { + if (err) { throw err } + console.log('the result is', result) +}) + +function worker (arg, cb) { + cb(null, 42 * 2) +} diff --git a/node_modules/fastq/example.mjs b/node_modules/fastq/example.mjs new file mode 100644 index 0000000..81be789 --- /dev/null +++ b/node_modules/fastq/example.mjs @@ -0,0 +1,11 @@ +import { promise as queueAsPromised } from './queue.js' + +/* eslint-disable */ + +const queue = queueAsPromised(worker, 1) + +console.log('the result is', await queue.push(42)) + +async function worker (arg) { + return 42 * 2 +} diff --git a/node_modules/fastq/index.d.ts b/node_modules/fastq/index.d.ts new file mode 100644 index 0000000..65ebe65 --- /dev/null +++ b/node_modules/fastq/index.d.ts @@ -0,0 +1,37 @@ +declare function fastq(context: C, worker: fastq.worker, concurrency: number): fastq.queue +declare function fastq(worker: fastq.worker, concurrency: number): fastq.queue + +declare namespace fastq { + type worker = (this: C, task: T, cb: fastq.done) => void + type asyncWorker = (this: C, task: T) => Promise + type done = (err: Error | null, result?: R) => void + type errorHandler = (err: Error, task: T) => void + + interface queue { + push(task: T, done?: done): void + unshift(task: T, done?: done): void + pause(): any + resume(): any + idle(): boolean + length(): number + getQueue(): T[] + kill(): any + killAndDrain(): any + error(handler: errorHandler): void + concurrency: number + drain(): any + empty: () => void + saturated: () => void + } + + interface queueAsPromised extends queue { + push(task: T): Promise + unshift(task: T): Promise + drained(): Promise + } + + function promise(context: C, worker: fastq.asyncWorker, concurrency: number): fastq.queueAsPromised + function promise(worker: fastq.asyncWorker, concurrency: number): fastq.queueAsPromised +} + +export = fastq diff --git a/node_modules/fastq/package.json b/node_modules/fastq/package.json new file mode 100644 index 0000000..bf572e3 --- /dev/null +++ b/node_modules/fastq/package.json @@ -0,0 +1,52 @@ +{ + "name": "fastq", + "version": "1.15.0", + "description": "Fast, in memory work queue", + "main": "queue.js", + "scripts": { + "lint": "standard --verbose | snazzy", + "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js test/promise.js", + "coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js test/promise.js", + "test:report": "npm run lint && npm run unit:report", + "test": "npm run lint && npm run unit && npm run typescript", + "typescript": "tsc --project ./test/tsconfig.json", + "legacy": "tape test/test.js" + }, + "pre-commit": [ + "test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/fastq.git" + }, + "keywords": [ + "fast", + "queue", + "async", + "worker" + ], + "author": "Matteo Collina ", + "license": "ISC", + "bugs": { + "url": "https://github.com/mcollina/fastq/issues" + }, + "homepage": "https://github.com/mcollina/fastq#readme", + "devDependencies": { + "async": "^3.1.0", + "neo-async": "^2.6.1", + "nyc": "^15.0.0", + "pre-commit": "^1.2.2", + "snazzy": "^9.0.0", + "standard": "^16.0.0", + "tape": "^5.0.0", + "typescript": "^4.0.2" + }, + "dependencies": { + "reusify": "^1.0.4" + }, + "standard": { + "ignore": [ + "example.mjs" + ] + } +} diff --git a/node_modules/fastq/queue.js b/node_modules/fastq/queue.js new file mode 100644 index 0000000..03fe112 --- /dev/null +++ b/node_modules/fastq/queue.js @@ -0,0 +1,289 @@ +'use strict' + +/* eslint-disable no-var */ + +var reusify = require('reusify') + +function fastqueue (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker + worker = context + context = null + } + + if (concurrency < 1) { + throw new Error('fastqueue concurrency must be greater than 1') + } + + var cache = reusify(Task) + var queueHead = null + var queueTail = null + var _running = 0 + var errorHandler = null + + var self = { + push: push, + drain: noop, + saturated: noop, + pause: pause, + paused: false, + concurrency: concurrency, + running: running, + resume: resume, + idle: idle, + length: length, + getQueue: getQueue, + unshift: unshift, + empty: noop, + kill: kill, + killAndDrain: killAndDrain, + error: error + } + + return self + + function running () { + return _running + } + + function pause () { + self.paused = true + } + + function length () { + var current = queueHead + var counter = 0 + + while (current) { + current = current.next + counter++ + } + + return counter + } + + function getQueue () { + var current = queueHead + var tasks = [] + + while (current) { + tasks.push(current.value) + current = current.next + } + + return tasks + } + + function resume () { + if (!self.paused) return + self.paused = false + for (var i = 0; i < self.concurrency; i++) { + _running++ + release() + } + } + + function idle () { + return _running === 0 && self.length() === 0 + } + + function push (value, done) { + var current = cache.get() + + current.context = context + current.release = release + current.value = value + current.callback = done || noop + current.errorHandler = errorHandler + + if (_running === self.concurrency || self.paused) { + if (queueTail) { + queueTail.next = current + queueTail = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) + } + } + + function unshift (value, done) { + var current = cache.get() + + current.context = context + current.release = release + current.value = value + current.callback = done || noop + + if (_running === self.concurrency || self.paused) { + if (queueHead) { + current.next = queueHead + queueHead = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) + } + } + + function release (holder) { + if (holder) { + cache.release(holder) + } + var next = queueHead + if (next) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null + } + queueHead = next.next + next.next = null + worker.call(context, next.value, next.worked) + if (queueTail === null) { + self.empty() + } + } else { + _running-- + } + } else if (--_running === 0) { + self.drain() + } + } + + function kill () { + queueHead = null + queueTail = null + self.drain = noop + } + + function killAndDrain () { + queueHead = null + queueTail = null + self.drain() + self.drain = noop + } + + function error (handler) { + errorHandler = handler + } +} + +function noop () {} + +function Task () { + this.value = null + this.callback = noop + this.next = null + this.release = noop + this.context = null + this.errorHandler = null + + var self = this + + this.worked = function worked (err, result) { + var callback = self.callback + var errorHandler = self.errorHandler + var val = self.value + self.value = null + self.callback = noop + if (self.errorHandler) { + errorHandler(err, val) + } + callback.call(self.context, err, result) + self.release(self) + } +} + +function queueAsPromised (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker + worker = context + context = null + } + + function asyncWrapper (arg, cb) { + worker.call(this, arg) + .then(function (res) { + cb(null, res) + }, cb) + } + + var queue = fastqueue(context, asyncWrapper, concurrency) + + var pushCb = queue.push + var unshiftCb = queue.unshift + + queue.push = push + queue.unshift = unshift + queue.drained = drained + + return queue + + function push (value) { + var p = new Promise(function (resolve, reject) { + pushCb(value, function (err, result) { + if (err) { + reject(err) + return + } + resolve(result) + }) + }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function unshift (value) { + var p = new Promise(function (resolve, reject) { + unshiftCb(value, function (err, result) { + if (err) { + reject(err) + return + } + resolve(result) + }) + }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function drained () { + if (queue.idle()) { + return new Promise(function (resolve) { + resolve() + }) + } + + var previousDrain = queue.drain + + var p = new Promise(function (resolve) { + queue.drain = function () { + previousDrain() + resolve() + } + }) + + return p + } +} + +module.exports = fastqueue +module.exports.promise = queueAsPromised diff --git a/node_modules/fastq/test/example.ts b/node_modules/fastq/test/example.ts new file mode 100644 index 0000000..c454e9d --- /dev/null +++ b/node_modules/fastq/test/example.ts @@ -0,0 +1,81 @@ +import * as fastq from '../' +import { promise as queueAsPromised } from '../' + +// Basic example + +const queue = fastq(worker, 1) + +queue.push('world', (err, result) => { + if (err) throw err + console.log('the result is', result) +}) + +queue.push('push without cb') + +queue.concurrency + +queue.drain() + +queue.empty = () => undefined + +console.log('the queue tasks are', queue.getQueue()) + +queue.idle() + +queue.kill() + +queue.killAndDrain() + +queue.length + +queue.pause() + +queue.resume() + +queue.saturated = () => undefined + +queue.unshift('world', (err, result) => { + if (err) throw err + console.log('the result is', result) +}) + +queue.unshift('unshift without cb') + +function worker(task: any, cb: fastq.done) { + cb(null, 'hello ' + task) +} + +// Generics example + +interface GenericsContext { + base: number; +} + +const genericsQueue = fastq({ base: 6 }, genericsWorker, 1) + +genericsQueue.push(7, (err, done) => { + if (err) throw err + console.log('the result is', done) +}) + +genericsQueue.unshift(7, (err, done) => { + if (err) throw err + console.log('the result is', done) +}) + +function genericsWorker(this: GenericsContext, task: number, cb: fastq.done) { + cb(null, 'the meaning of life is ' + (this.base * task)) +} + +const queue2 = queueAsPromised(asyncWorker, 1) + +async function asyncWorker(task: any) { + return 'hello ' + task +} + +async function run () { + await queue.push(42) + await queue.unshift(42) +} + +run() diff --git a/node_modules/fastq/test/promise.js b/node_modules/fastq/test/promise.js new file mode 100644 index 0000000..fe014ff --- /dev/null +++ b/node_modules/fastq/test/promise.js @@ -0,0 +1,248 @@ +'use strict' + +const test = require('tape') +const buildQueue = require('../').promise +const { promisify } = require('util') +const sleep = promisify(setTimeout) +const immediate = promisify(setImmediate) + +test('concurrency', function (t) { + t.plan(2) + t.throws(buildQueue.bind(null, worker, 0)) + t.doesNotThrow(buildQueue.bind(null, worker, 1)) + + async function worker (arg) { + return true + } +}) + +test('worker execution', async function (t) { + const queue = buildQueue(worker, 1) + + const result = await queue.push(42) + + t.equal(result, true, 'result matches') + + async function worker (arg) { + t.equal(arg, 42) + return true + } +}) + +test('limit', async function (t) { + const queue = buildQueue(worker, 1) + + const [res1, res2] = await Promise.all([queue.push(10), queue.push(0)]) + t.equal(res1, 10, 'the result matches') + t.equal(res2, 0, 'the result matches') + + async function worker (arg) { + await sleep(arg) + return arg + } +}) + +test('multiple executions', async function (t) { + const queue = buildQueue(worker, 1) + const toExec = [1, 2, 3, 4, 5] + const expected = ['a', 'b', 'c', 'd', 'e'] + let count = 0 + + await Promise.all(toExec.map(async function (task, i) { + const result = await queue.push(task) + t.equal(result, expected[i], 'the result matches') + })) + + async function worker (arg) { + t.equal(arg, toExec[count], 'arg matches') + return expected[count++] + } +}) + +test('drained', async function (t) { + const queue = buildQueue(worker, 2) + + const toExec = new Array(10).fill(10) + let count = 0 + + async function worker (arg) { + await sleep(arg) + count++ + } + + toExec.forEach(function (i) { + queue.push(i) + }) + + await queue.drained() + + t.equal(count, toExec.length) + + toExec.forEach(function (i) { + queue.push(i) + }) + + await queue.drained() + + t.equal(count, toExec.length * 2) +}) + +test('drained with exception should not throw', async function (t) { + const queue = buildQueue(worker, 2) + + const toExec = new Array(10).fill(10) + + async function worker () { + throw new Error('foo') + } + + toExec.forEach(function (i) { + queue.push(i) + }) + + await queue.drained() +}) + +test('drained with drain function', async function (t) { + let drainCalled = false + const queue = buildQueue(worker, 2) + + queue.drain = function () { + drainCalled = true + } + + const toExec = new Array(10).fill(10) + let count = 0 + + async function worker (arg) { + await sleep(arg) + count++ + } + + toExec.forEach(function () { + queue.push() + }) + + await queue.drained() + + t.equal(count, toExec.length) + t.equal(drainCalled, true) +}) + +test('drained while idle should resolve', async function (t) { + const queue = buildQueue(worker, 2) + + async function worker (arg) { + await sleep(arg) + } + + await queue.drained() +}) + +test('drained while idle should not call the drain function', async function (t) { + let drainCalled = false + const queue = buildQueue(worker, 2) + + queue.drain = function () { + drainCalled = true + } + + async function worker (arg) { + await sleep(arg) + } + + await queue.drained() + + t.equal(drainCalled, false) +}) + +test('set this', async function (t) { + t.plan(1) + const that = {} + const queue = buildQueue(that, worker, 1) + + await queue.push(42) + + async function worker (arg) { + t.equal(this, that, 'this matches') + } +}) + +test('unshift', async function (t) { + const queue = buildQueue(worker, 1) + const expected = [1, 2, 3, 4] + + await Promise.all([ + queue.push(1), + queue.push(4), + queue.unshift(3), + queue.unshift(2) + ]) + + t.is(expected.length, 0) + + async function worker (arg) { + t.equal(expected.shift(), arg, 'tasks come in order') + } +}) + +test('push with worker throwing error', async function (t) { + t.plan(5) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + q.error(function (err, task) { + t.ok(err instanceof Error, 'global error handler should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + t.equal(task, 42, 'The task executed should be passed') + }) + try { + await q.push(42) + } catch (err) { + t.ok(err instanceof Error, 'push callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + } +}) + +test('unshift with worker throwing error', async function (t) { + t.plan(2) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + try { + await q.unshift(42) + } catch (err) { + t.ok(err instanceof Error, 'push callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + } +}) + +test('no unhandledRejection (push)', async function (t) { + function handleRejection () { + t.fail('unhandledRejection') + } + process.once('unhandledRejection', handleRejection) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + + q.push(42) + + await immediate() + process.removeListener('unhandledRejection', handleRejection) +}) + +test('no unhandledRejection (unshift)', async function (t) { + function handleRejection () { + t.fail('unhandledRejection') + } + process.once('unhandledRejection', handleRejection) + const q = buildQueue(async function (task, cb) { + throw new Error('test error') + }, 1) + + q.unshift(42) + + await immediate() + process.removeListener('unhandledRejection', handleRejection) +}) diff --git a/node_modules/fastq/test/test.js b/node_modules/fastq/test/test.js new file mode 100644 index 0000000..1cc78a5 --- /dev/null +++ b/node_modules/fastq/test/test.js @@ -0,0 +1,566 @@ +'use strict' + +/* eslint-disable no-var */ + +var test = require('tape') +var buildQueue = require('../') + +test('concurrency', function (t) { + t.plan(2) + t.throws(buildQueue.bind(null, worker, 0)) + t.doesNotThrow(buildQueue.bind(null, worker, 1)) + + function worker (arg, cb) { + cb(null, true) + } +}) + +test('worker execution', function (t) { + t.plan(3) + + var queue = buildQueue(worker, 1) + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + function worker (arg, cb) { + t.equal(arg, 42) + cb(null, true) + } +}) + +test('limit', function (t) { + t.plan(4) + + var expected = [10, 0] + var queue = buildQueue(worker, 1) + + queue.push(10, result) + queue.push(0, result) + + function result (err, arg) { + t.error(err, 'no error') + t.equal(arg, expected.shift(), 'the result matches') + } + + function worker (arg, cb) { + setTimeout(cb, arg, null, arg) + } +}) + +test('multiple executions', function (t) { + t.plan(15) + + var queue = buildQueue(worker, 1) + var toExec = [1, 2, 3, 4, 5] + var count = 0 + + toExec.forEach(function (task) { + queue.push(task, done) + }) + + function done (err, result) { + t.error(err, 'no error') + t.equal(result, toExec[count - 1], 'the result matches') + } + + function worker (arg, cb) { + t.equal(arg, toExec[count], 'arg matches') + count++ + setImmediate(cb, null, arg) + } +}) + +test('multiple executions, one after another', function (t) { + t.plan(15) + + var queue = buildQueue(worker, 1) + var toExec = [1, 2, 3, 4, 5] + var count = 0 + + queue.push(toExec[0], done) + + function done (err, result) { + t.error(err, 'no error') + t.equal(result, toExec[count - 1], 'the result matches') + if (count < toExec.length) { + queue.push(toExec[count], done) + } + } + + function worker (arg, cb) { + t.equal(arg, toExec[count], 'arg matches') + count++ + setImmediate(cb, null, arg) + } +}) + +test('set this', function (t) { + t.plan(3) + + var that = {} + var queue = buildQueue(that, worker, 1) + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(this, that, 'this matches') + }) + + function worker (arg, cb) { + t.equal(this, that, 'this matches') + cb(null, true) + } +}) + +test('drain', function (t) { + t.plan(4) + + var queue = buildQueue(worker, 1) + var worked = false + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + queue.drain = function () { + t.equal(true, worked, 'drained') + } + + function worker (arg, cb) { + t.equal(arg, 42) + worked = true + setImmediate(cb, null, true) + } +}) + +test('pause && resume', function (t) { + t.plan(7) + + var queue = buildQueue(worker, 1) + var worked = false + + t.notOk(queue.paused, 'it should not be paused') + + queue.pause() + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + t.notOk(worked, 'it should be paused') + t.ok(queue.paused, 'it should be paused') + + queue.resume() + queue.resume() // second resume is a no-op + + t.notOk(queue.paused, 'it should not be paused') + + function worker (arg, cb) { + t.equal(arg, 42) + worked = true + cb(null, true) + } +}) + +test('pause in flight && resume', function (t) { + t.plan(9) + + var queue = buildQueue(worker, 1) + var expected = [42, 24] + + t.notOk(queue.paused, 'it should not be paused') + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.ok(queue.paused, 'it should be paused') + process.nextTick(function () { queue.resume() }) + }) + + queue.push(24, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.notOk(queue.paused, 'it should not be paused') + }) + + queue.pause() + + function worker (arg, cb) { + t.equal(arg, expected.shift()) + process.nextTick(function () { cb(null, true) }) + } +}) + +test('altering concurrency', function (t) { + t.plan(7) + + var queue = buildQueue(worker, 1) + var count = 0 + + queue.pause() + + queue.push(24, workDone) + queue.push(24, workDone) + + queue.concurrency = 2 + + queue.resume() + + t.equal(queue.running(), 2, '2 jobs running') + + function workDone (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + } + + function worker (arg, cb) { + t.equal(0, count, 'works in parallel') + setImmediate(function () { + count++ + cb(null, true) + }) + } +}) + +test('idle()', function (t) { + t.plan(12) + + var queue = buildQueue(worker, 1) + + t.ok(queue.idle(), 'queue is idle') + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + t.notOk(queue.idle(), 'queue is not idle') + }) + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + // it will go idle after executing this function + setImmediate(function () { + t.ok(queue.idle(), 'queue is now idle') + }) + }) + + t.notOk(queue.idle(), 'queue is not idle') + + function worker (arg, cb) { + t.notOk(queue.idle(), 'queue is not idle') + t.equal(arg, 42) + setImmediate(cb, null, true) + } +}) + +test('saturated', function (t) { + t.plan(9) + + var queue = buildQueue(worker, 1) + var preworked = 0 + var worked = 0 + + queue.saturated = function () { + t.pass('saturated') + t.equal(preworked, 1, 'started 1 task') + t.equal(worked, 0, 'worked zero task') + } + + queue.push(42, done) + queue.push(42, done) + + function done (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + } + + function worker (arg, cb) { + t.equal(arg, 42) + preworked++ + setImmediate(function () { + worked++ + cb(null, true) + }) + } +}) + +test('length', function (t) { + t.plan(7) + + var queue = buildQueue(worker, 1) + + t.equal(queue.length(), 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.length(), 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.length(), 1, 'one task waiting') + queue.push(42, done) + t.equal(queue.length(), 2, 'two tasks waiting') + + function done (err, result) { + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('getQueue', function (t) { + t.plan(10) + + var queue = buildQueue(worker, 1) + + t.equal(queue.getQueue().length, 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.getQueue().length, 0, 'nothing waiting') + queue.push(42, done) + t.equal(queue.getQueue().length, 1, 'one task waiting') + t.equal(queue.getQueue()[0], 42, 'should be equal') + queue.push(43, done) + t.equal(queue.getQueue().length, 2, 'two tasks waiting') + t.equal(queue.getQueue()[0], 42, 'should be equal') + t.equal(queue.getQueue()[1], 43, 'should be equal') + + function done (err, result) { + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('unshift', function (t) { + t.plan(8) + + var queue = buildQueue(worker, 1) + var expected = [1, 2, 3, 4] + + queue.push(1, done) + queue.push(4, done) + queue.unshift(3, done) + queue.unshift(2, done) + + function done (err, result) { + t.error(err, 'no error') + } + + function worker (arg, cb) { + t.equal(expected.shift(), arg, 'tasks come in order') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('unshift && empty', function (t) { + t.plan(2) + + var queue = buildQueue(worker, 1) + var completed = false + + queue.pause() + + queue.empty = function () { + t.notOk(completed, 'the task has not completed yet') + } + + queue.unshift(1, done) + + queue.resume() + + function done (err, result) { + completed = true + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('push && empty', function (t) { + t.plan(2) + + var queue = buildQueue(worker, 1) + var completed = false + + queue.pause() + + queue.empty = function () { + t.notOk(completed, 'the task has not completed yet') + } + + queue.push(1, done) + + queue.resume() + + function done (err, result) { + completed = true + t.error(err, 'no error') + } + + function worker (arg, cb) { + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('kill', function (t) { + t.plan(5) + + var queue = buildQueue(worker, 1) + var expected = [1] + + var predrain = queue.drain + + queue.drain = function drain () { + t.fail('drain should never be called') + } + + queue.push(1, done) + queue.push(4, done) + queue.unshift(3, done) + queue.unshift(2, done) + queue.kill() + + function done (err, result) { + t.error(err, 'no error') + setImmediate(function () { + t.equal(queue.length(), 0, 'no queued tasks') + t.equal(queue.running(), 0, 'no running tasks') + t.equal(queue.drain, predrain, 'drain is back to default') + }) + } + + function worker (arg, cb) { + t.equal(expected.shift(), arg, 'tasks come in order') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('killAndDrain', function (t) { + t.plan(6) + + var queue = buildQueue(worker, 1) + var expected = [1] + + var predrain = queue.drain + + queue.drain = function drain () { + t.pass('drain has been called') + } + + queue.push(1, done) + queue.push(4, done) + queue.unshift(3, done) + queue.unshift(2, done) + queue.killAndDrain() + + function done (err, result) { + t.error(err, 'no error') + setImmediate(function () { + t.equal(queue.length(), 0, 'no queued tasks') + t.equal(queue.running(), 0, 'no running tasks') + t.equal(queue.drain, predrain, 'drain is back to default') + }) + } + + function worker (arg, cb) { + t.equal(expected.shift(), arg, 'tasks come in order') + setImmediate(function () { + cb(null, true) + }) + } +}) + +test('pause && idle', function (t) { + t.plan(11) + + var queue = buildQueue(worker, 1) + var worked = false + + t.notOk(queue.paused, 'it should not be paused') + t.ok(queue.idle(), 'should be idle') + + queue.pause() + + queue.push(42, function (err, result) { + t.error(err, 'no error') + t.equal(result, true, 'result matches') + }) + + t.notOk(worked, 'it should be paused') + t.ok(queue.paused, 'it should be paused') + t.notOk(queue.idle(), 'should not be idle') + + queue.resume() + + t.notOk(queue.paused, 'it should not be paused') + t.notOk(queue.idle(), 'it should not be idle') + + function worker (arg, cb) { + t.equal(arg, 42) + worked = true + process.nextTick(cb.bind(null, null, true)) + process.nextTick(function () { + t.ok(queue.idle(), 'is should be idle') + }) + } +}) + +test('push without cb', function (t) { + t.plan(1) + + var queue = buildQueue(worker, 1) + + queue.push(42) + + function worker (arg, cb) { + t.equal(arg, 42) + cb() + } +}) + +test('unshift without cb', function (t) { + t.plan(1) + + var queue = buildQueue(worker, 1) + + queue.unshift(42) + + function worker (arg, cb) { + t.equal(arg, 42) + cb() + } +}) + +test('push with worker throwing error', function (t) { + t.plan(5) + var q = buildQueue(function (task, cb) { + cb(new Error('test error'), null) + }, 1) + q.error(function (err, task) { + t.ok(err instanceof Error, 'global error handler should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + t.equal(task, 42, 'The task executed should be passed') + }) + q.push(42, function (err) { + t.ok(err instanceof Error, 'push callback should catch the error') + t.match(err.message, /test error/, 'error message should be "test error"') + }) +}) diff --git a/node_modules/fastq/test/tsconfig.json b/node_modules/fastq/test/tsconfig.json new file mode 100644 index 0000000..66e16e9 --- /dev/null +++ b/node_modules/fastq/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "noEmit": true, + "strict": true + }, + "files": [ + "./example.ts" + ] +} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +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/fill-range/README.md b/node_modules/fill-range/README.md new file mode 100644 index 0000000..8d756fe --- /dev/null +++ b/node_modules/fill-range/README.md @@ -0,0 +1,237 @@ +# fill-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fill-range +``` + +## Usage + +Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. + +```js +const fill = require('fill-range'); +// fill(from, to[, step, options]); + +console.log(fill('1', '10')); //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] +console.log(fill('1', '10', { toRegex: true })); //=> [1-9]|10 +``` + +**Params** + +* `from`: **{String|Number}** the number or letter to start with +* `to`: **{String|Number}** the number or letter to end with +* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. +* `options`: **{Object|Function}**: See all available [options](#options) + +## Examples + +By default, an array of values is returned. + +**Alphabetical ranges** + +```js +console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] +console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] +``` + +**Numerical ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] +``` + +**Negative ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] +console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] +``` + +**Steps (increments)** + +```js +// numerical ranges with increments +console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] +console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] +console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] + +// alphabetical ranges with increments +console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] +``` + +## Options + +### options.step + +**Type**: `number` (formatted as a string or number) + +**Default**: `undefined` + +**Description**: The increment to use for the range. Can be used with letters or numbers. + +**Example(s)** + +```js +// numbers +console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] +console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] +console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] + +// letters +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] +console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] +``` + +### options.strictRanges + +**Type**: `boolean` + +**Default**: `false` + +**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. + +**Example(s)** + +The following are all invalid: + +```js +fill('1.1', '2'); // decimals not supported in ranges +fill('a', '2'); // incompatible range values +fill(1, 10, 'foo'); // invalid "step" argument +``` + +### options.stringify + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Cast all returned values to strings. By default, integers are returned as numbers. + +**Example(s)** + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill(1, 5, { stringify: true })); //=> [ '1', '2', '3', '4', '5' ] +``` + +### options.toRegex + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Create a regex-compatible source string, instead of expanding values to an array. + +**Example(s)** + +```js +// alphabetical range +console.log(fill('a', 'e', { toRegex: true })); //=> '[a-e]' +// alphabetical with step +console.log(fill('a', 'z', 3, { toRegex: true })); //=> 'a|d|g|j|m|p|s|v|y' +// numerical range +console.log(fill('1', '100', { toRegex: true })); //=> '[1-9]|[1-9][0-9]|100' +// numerical range with zero padding +console.log(fill('000001', '100000', { toRegex: true })); +//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' +``` + +### options.transform + +**Type**: `function` + +**Default**: `undefined` + +**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. + +**Example(s)** + +```js +// add zero padding +console.log(fill(1, 5, value => String(value).padStart(4, '0'))); +//=> ['0001', '0002', '0003', '0004', '0005'] +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 116 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [paulmillr](https://github.com/paulmillr) | +| 2 | [realityking](https://github.com/realityking) | +| 2 | [bluelovers](https://github.com/bluelovers) | +| 1 | [edorivai](https://github.com/edorivai) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! + + + + + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js new file mode 100644 index 0000000..97ce35a --- /dev/null +++ b/node_modules/fill-range/index.js @@ -0,0 +1,249 @@ +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +const util = require('util'); +const toRegexRange = require('to-regex-range'); + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; + +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; + +const isNumber = num => Number.isInteger(+num); + +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; + +const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; + +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; + +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; +}; + +const toSequence = (parts, options) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; +}; + +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; + +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; + +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; + +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; + +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; + +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; +}; + +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; +}; + +const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; + +module.exports = fill; diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json new file mode 100644 index 0000000..07d3076 --- /dev/null +++ b/node_modules/fill-range/package.json @@ -0,0 +1,69 @@ +{ + "name": "fill-range", + "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", + "version": "7.0.1", + "homepage": "https://github.com/jonschlinkert/fill-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Edo Rivai (edo.rivai.nl)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Paul Miller (paulmillr.com)", + "Rouven Weßling (www.rouvenwessling.de)", + "(https://github.com/wtgtybhertgeghgtwtg)" + ], + "repository": "jonschlinkert/fill-range", + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "devDependencies": { + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1" + }, + "keywords": [ + "alpha", + "alphabetical", + "array", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/flowbite/LICENSE.md b/node_modules/flowbite/LICENSE.md new file mode 100644 index 0000000..6fff4a7 --- /dev/null +++ b/node_modules/flowbite/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Bergside Inc. + +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/flowbite/README.md b/node_modules/flowbite/README.md new file mode 100644 index 0000000..98db0f0 --- /dev/null +++ b/node_modules/flowbite/README.md @@ -0,0 +1,778 @@ +

+ + Flowbite - Tailwind CSS components +
+ Build websites even faster with components on top of Tailwind CSS +

+ +

+ Discord + Total Downloads + Latest Release + Licenese +

+ +------ +## Table of Contents + +- [Table of Contents](#table-of-contents) +- [Documentation](#documentation) +- [Getting started](#getting-started) + - [Install using NPM](#install-using-npm) + - [Include via CDN](#include-via-cdn) + - [Bundled JavaScript](#bundled-javascript) + - [Data attributes](#data-attributes) + - [Init functions](#init-functions) + - [ESM and CJS](#esm-and-cjs) + - [TypeScript](#typescript) + - [JavaScript Frameworks](#javascript-frameworks) + - [Back-end Frameworks](#back-end-frameworks) +- [Components](#components) +- [Figma Design System](#figma-design-system) +- [Flowbite Blocks](#flowbite-blocks) +- [Flowbite Icons](#flowbite-icons) +- [Pro version](#pro-version) +- [Learn Design Concepts](#learn-design-concepts) +- [Community](#community) +- [Copyright and license](#copyright-and-license) + +## Documentation + +For full documentation, visit [flowbite.com](https://flowbite.com/). + +## Getting started + +Flowbite can be included as a plugin into an existing Tailwind CSS project and it is supposed to help you build websites faster by having a set of web components to work with built with the utility classes from Tailwind CSS. + +### Install using NPM + +Make sure that you have Node.js and Tailwind CSS installed. + +1. Install Flowbite as a dependency using NPM by running the following command: + +```bash +npm install flowbite +``` + +2. Require Flowbite as a plugin inside the `tailwind.config.js` file: + +```javascript +module.exports = { + + plugins: [ + require('flowbite/plugin') + ] + +} +``` + +3. Make sure that you add the template path to the `tailwind.config.js` file: + +```javascript +module.exports = { + + content: [ + "./node_modules/flowbite/**/*.js" + ] + +} +``` + +4. Include the main JavaScript file to make interactive elements work: + +```html + +``` + +### Include via CDN + +The quickest way to get started working with Flowbite is to simply include the CSS and JavaScript into your project via a CDN service such as UNPKG or CDNJS (content delivery networks). + +Require the following minified stylesheet inside the `head` tag: + +```html + +``` + +And include the following javascript file before the end of the `body` tag: + +```html + +``` + +### Bundled JavaScript + +One of the most popular way of using Flowbite is to include the bundled Javascript file which is UMD ready using a bundler such as Webpack or Parcel which makes sure that all of the data attributes and functionality will work out-of-the-box. + +You can directly import the main JavaScript file inside your bundled `app-bundle.js` file like this: + +```javascript +import 'flowbite'; +``` + +This file has access to all of the components and it automatically applies event listeners to the data attributes. + +### Data attributes + +The preferred way to use the interactive UI components from Flowbite is via the data attributes interface which allows us to add functionality via the HTML element attributes and most of the examples on our documentation applies this strategy. + +For example, to set up a modal component all you need to do is use `data-modal-target` and `data-modal-{toggle|show|hide}` to toggle, show, or hide the component by clicking on any trigger element. + +```html + + + + +``` + +#### Init functions + +You can also use the init functions to set up the event listeners yourself. Here's an example how you can do it with Vue or Nuxt: + +``` + + + +``` + +The `initFlowbite` function sets up all of the init functions for dropdowns, modals, navbars, tooltips and so on to hook onto the data attributes. Alternatively, you can also initialise each component category class separately with `initDropdowns` or `initModals`. + +You can view more examples by browsing the [components from Flowbite](#components). + +### ESM and CJS + +Flowbite also offers an API for using the components programmatically and it supports both CJS and ESM for JavaScript which can be helpful if you need to expand the default capabilities of the data attributes interface and get access to function callbacks. + +Here's an example how you can import and create a new Modal component inside JavaScript: + +```javascript +import { Modal } from 'flowbite' + +const $modalElement = document.querySelector('#modalEl'); + +const modalOptions = { + placement: 'bottom-right', + backdrop: 'dynamic', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', + onHide: () => { + console.log('modal is hidden'); + }, + onShow: () => { + console.log('modal is shown'); + }, + onToggle: () => { + console.log('modal has been toggled'); + } +} + +const modal = new Modal($modalElement, modalOptions); + +modal.show(); +``` + +Check out the JavaScript behaviour section of each component's page to learn how you can use this. + +### TypeScript + +Flowbite supports type declarations for the interactive UI components including object interfaces and parameter types. Check out the following examples to learn how you can use types with Flowbite. + +Additionally to our code above, we will now import some relevant types from the Flowbite package, namely the `ModalOptions` and `ModalInterface`: + +```javascript +import { Modal } from 'flowbite' +import type { ModalOptions, ModalInterface } from 'flowbite' + +// other code +``` + +Generally speaking, all of the components have an interface definition that you can use whenever you create a new object to make sure that you're using the correct types of parameters and methods. + +When creating a new modal you can set the `ModalInterface` as the main type: + +```javascript +const modal: ModalInterface = new Modal($modalElement, modalOptions); +``` + +Flowbite also supports type definitions for the options object so if you want to set the placement of the modal based on types, here's how you would do that: + +```javascript +const modalOptions: ModalOptions = { + placement: 'top-right' +} + +const modal: ModalInterface = new Modal($modalElement, modalOptions); +``` + +Learn more about Flowbite and TypeScript in the [quickstart guide](https://flowbite.com/docs/getting-started/typescript/). + +### JavaScript Frameworks + +The awesome open-source community also built and currently maintains the following standalone libraries for React, Vue, Svelte, and Angular: + +- [🌀 Flowbite React Library](https://github.com/themesberg/flowbite-react) +- [🍀 Flowbite Vue Library](https://github.com/themesberg/flowbite-vue) +- [🎸 Flowbite Svelte Library](https://github.com/themesberg/flowbite-svelte) +- [📕 Flowbite Angular Library](https://github.com/themesberg/flowbite-angular) + +We also wrote integration guides for the following front-end frameworks and libraries: + +- [📝 Flowbite with React guide](https://flowbite.com/docs/getting-started/react/) +- [📝 Flowbite with Next.js guide](https://flowbite.com/docs/getting-started/next-js/) +- [📝 Flowbite with Remix guide](https://flowbite.com/docs/getting-started/remix/) +- [📝 Flowbite with Vue guide](https://flowbite.com/docs/getting-started/vue/) +- [📝 Flowbite with Nuxt guide](https://flowbite.com/docs/getting-started/nuxt-js/) +- [📝 Flowbite with Svelte guide](https://flowbite.com/docs/getting-started/svelte/) +- [📝 Flowbite with Astro guide](https://flowbite.com/docs/getting-started/astro/) +- [📝 Flowbite with Gatsby guide](https://flowbite.com/docs/getting-started/gatsby/) +- [📝 Flowbite with SolidJS guide](https://flowbite.com/docs/getting-started/solid-js/) + +### Back-end Frameworks + +Flowbite has a great integration with most of the back-end frameworks because it relies on vanilla JavaScript: + +- [📚 Using Flowbite with Laravel](https://flowbite.com/docs/getting-started/laravel/) +- [🎼 Using Flowbite with Symfony](https://flowbite.com/docs/getting-started/symfony/) +- [🚊 Using Flowbite with Ruby on Rails 7](https://flowbite.com/docs/getting-started/rails/) +- [🐉 Using Flowbite with Phoenix (Elixir)](https://flowbite.com/docs/getting-started/phoenix/) +- [🐸 Using Flowbite with Django](https://flowbite.com/docs/getting-started/django/) +- [🌶 Using Flowbite with Flask](https://flowbite.com/docs/getting-started/flask/) + +## Components + +Flowbite is an open source collection of UI components built with the utility classes from Tailwind CSS that you can use as a starting point when coding user interfaces and websites. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AlertsBadgeBreadcrumbs
+ + Tailwind CSS Alerts + + + + Tailwind CSS Badge + + + + Tailwind CSS Breadcrumbs + +
ButtonsButton groupCards
+ + Tailwind CSS Buttons + + + + Tailwind CSS Button Group + + + + Tailwind CSS Cards + +
DropdownFormsList group
+ + Tailwind CSS Dropdown + + + + Tailwind CSS Forms + + + + Tailwind CSS List group + +
TypographyModalTabs
+ + Tailwind CSS Typography + + + + Tailwind CSS Modal + + + + Tailwind CSS Tabs + +
NavbarPaginationTimeline
+ + Tailwind CSS Navbar + + + + Tailwind CSS Pagination + + + + Tailwind CSS Timeline + +
Progress barTablesToast
+ + Tailwind CSS Progress Bar + + + + Tailwind CSS Tables + + + + Tailwind CSS Toast + +
TooltipsDatepickerSpinner
+ + Tailwind CSS Tooltips + + + + Tailwind CSS Datepicker + + + + Tailwind CSS Spinner + +
FooterAccordionSidebar
+ + Tailwind CSS Footer + + + + Tailwind CSS Accordion + + + + Tailwind CSS Sidebar + +
CarouselAvatarRating
+ + Tailwind CSS Carousel + + + + Tailwind CSS Avatar + + + + Tailwind CSS Rating + +
Input FieldFile InputSearch Input
+ + Tailwind CSS Input Field + + + + Tailwind CSS File Input + + + + Tailwind CSS Search Input + +
SelectTextareaCheckbox
+ + Tailwind CSS Select + + + + Tailwind CSS Textarea + + + + Tailwind CSS Checkbox + +
RadioToggleRange Slider
+ + Tailwind CSS Radio + + + + Tailwind CSS Toggle + + + + Tailwind CSS Range Slider + +
Floating LabelMega MenuSkeleton
+ + Tailwind CSS Floating Label + + + + Tailwind CSS Mega Menu + + + + Tailwind CSS Skeleton + +
KBD (keyboard)Drawer (offcanvas)Popover
+ + Tailwind CSS KBD (Keyboard) + + + + Tailwind CSS Drawer (offcanvas) + + + + Tailwind CSS Popover + +
VideoHeadingParagraph
+ + Tailwind CSS Video + + + + Tailwind CSS Heading + + + + Tailwind CSS Paragraph + +
BlockquoteImageList
+ + Tailwind CSS Blockquote + + + + Tailwind CSS Image + + + + Tailwind CSS List + +
LinkTextHorizontal line (HR)
+ + Tailwind CSS Link + + + + Tailwind CSS Text + + + + Tailwind CSS HR + +
Speed DialStepperIndicators
+ + Tailwind CSS Speed Dial + + + + Tailwind CSS Stepper + + + + Tailwind CSS Indicators + +
Bottom NavigationSticky BannerGallery (Masonry)
+ + Tailwind CSS Bottom Navigation Bar + + + + Tailwind CSS Bottom Sticky Banner + + + + Tailwind CSS Image Gallery (Masonry) + +
JumbotronDevice mockupsCharts
+ + Tailwind CSS Jumbotron + + + + Tailwind CSS Device Mockups + + + + Tailwind CSS Charts + +
+ +## Figma Design System + +If you need the Figma files for the components you can check out our website for more information: + +🎨 [Get access to the Figma design files](https://flowbite.com/figma/) + +## Flowbite Blocks + +Check out Flowbite Blocks to get access to over 330+ website sections coded in Tailwind CSS and Flowbite: + +📦 [Check out Flowbite Blocks](https://flowbite.com/blocks/) + +## Flowbite Icons + +Start using over 430+ free and open-source collection of solid and outline SVG icons built for Tailwind CSS and with support for Figma and JSX (React): + +🔍 [Check out the icons](https://flowbite.com/icons/) + +## Pro version + +Get access to all premium features including the Figma design system, access to all Flowbite Block sections and a dashboard UI interface: + +💎 [Check out Flowbite Pro](https://flowbite.com/pro/) + +## Learn Design Concepts + +If you want to create even better Flowbite pages, learn design fundamentals from Teach Me Design - Enhance UI, a book that covers color theory, typography, UI and UX so you can make the most to implement the Flowbite Ecosystem! + +📖 [Learn with Enhance UI](https://www.enhanceui.com/?ref=flowbite-github) + +## Community + +If you need help or just want to discuss about the library join the community on Github: + +⌨️ [Discuss about Flowbite on GitHub](https://github.com/themesberg/flowbite/discussions) + +For casual chatting with others using the library: + +💬 [Join the Flowbite Discord Server](https://discord.gg/4eeurUVvTy) + +Video tutorials and presentations using Flowbite: + +🎥 [Subscribe to our YouTube channel](https://www.youtube.com/channel/UC_Ms4V2kYDsh7F_CSsHyQ6A) + +## Copyright and license + +The Flowbite name and logos are trademarks of Bergside Inc. + +- 📝 [Read about the licensing terms](https://flowbite.com/docs/getting-started/license/) +- 📀 [Brand guideline and trademark usage agreement](https://flowbite.com/brand/) diff --git a/node_modules/flowbite/dist/datepicker.js b/node_modules/flowbite/dist/datepicker.js new file mode 100644 index 0000000..6df2667 --- /dev/null +++ b/node_modules/flowbite/dist/datepicker.js @@ -0,0 +1,3119 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("Flowbite", [], factory); + else if(typeof exports === 'object') + exports["Flowbite"] = factory(); + else + root["Flowbite"] = factory(); +})(self, function() { +return /******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ 482: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Z": function() { return /* binding */ DateRangePicker; } +/* harmony export */ }); +/* harmony import */ var _lib_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(698); +/* harmony import */ var _lib_date_format_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(963); +/* harmony import */ var _Datepicker_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(770); + + + + +// filter out the config options inapproprite to pass to Datepicker +function filterOptions(options) { + const newOpts = Object.assign({}, options); + + delete newOpts.inputs; + delete newOpts.allowOneSidedRange; + delete newOpts.maxNumberOfDates; // to ensure each datepicker handles a single date + + return newOpts; +} + +function setupDatepicker(rangepicker, changeDateListener, el, options) { + (0,_lib_event_js__WEBPACK_IMPORTED_MODULE_0__/* .registerListeners */ .cF)(rangepicker, [ + [el, 'changeDate', changeDateListener], + ]); + new _Datepicker_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z(el, options, rangepicker); +} + +function onChangeDate(rangepicker, ev) { + // to prevent both datepickers trigger the other side's update each other + if (rangepicker._updating) { + return; + } + rangepicker._updating = true; + + const target = ev.target; + if (target.datepicker === undefined) { + return; + } + + const datepickers = rangepicker.datepickers; + const setDateOptions = {render: false}; + const changedSide = rangepicker.inputs.indexOf(target); + const otherSide = changedSide === 0 ? 1 : 0; + const changedDate = datepickers[changedSide].dates[0]; + const otherDate = datepickers[otherSide].dates[0]; + + if (changedDate !== undefined && otherDate !== undefined) { + // if the start of the range > the end, swap them + if (changedSide === 0 && changedDate > otherDate) { + datepickers[0].setDate(otherDate, setDateOptions); + datepickers[1].setDate(changedDate, setDateOptions); + } else if (changedSide === 1 && changedDate < otherDate) { + datepickers[0].setDate(changedDate, setDateOptions); + datepickers[1].setDate(otherDate, setDateOptions); + } + } else if (!rangepicker.allowOneSidedRange) { + // to prevent the range from becoming one-sided, copy changed side's + // selection (no matter if it's empty) to the other side + if (changedDate !== undefined || otherDate !== undefined) { + setDateOptions.clear = true; + datepickers[otherSide].setDate(datepickers[changedSide].dates, setDateOptions); + } + } + datepickers[0].picker.update().render(); + datepickers[1].picker.update().render(); + delete rangepicker._updating; +} + +/** + * Class representing a date range picker + */ +class DateRangePicker { + /** + * Create a date range picker + * @param {Element} element - element to bind a date range picker + * @param {Object} [options] - config options + */ + constructor(element, options = {}) { + const inputs = Array.isArray(options.inputs) + ? options.inputs + : Array.from(element.querySelectorAll('input')); + if (inputs.length < 2) { + return; + } + + element.rangepicker = this; + this.element = element; + this.inputs = inputs.slice(0, 2); + this.allowOneSidedRange = !!options.allowOneSidedRange; + + const changeDateListener = onChangeDate.bind(null, this); + const cleanOptions = filterOptions(options); + // in order for initial date setup to work right when pcicLvel > 0, + // let Datepicker constructor add the instance to the rangepicker + const datepickers = []; + Object.defineProperty(this, 'datepickers', { + get() { + return datepickers; + }, + }); + setupDatepicker(this, changeDateListener, this.inputs[0], cleanOptions); + setupDatepicker(this, changeDateListener, this.inputs[1], cleanOptions); + Object.freeze(datepickers); + // normalize the range if inital dates are given + if (datepickers[0].dates.length > 0) { + onChangeDate(this, {target: this.inputs[0]}); + } else if (datepickers[1].dates.length > 0) { + onChangeDate(this, {target: this.inputs[1]}); + } + } + + /** + * @type {Array} - selected date of the linked date pickers + */ + get dates() { + return this.datepickers.length === 2 + ? [ + this.datepickers[0].dates[0], + this.datepickers[1].dates[0], + ] + : undefined; + } + + /** + * Set new values to the config options + * @param {Object} options - config options to update + */ + setOptions(options) { + this.allowOneSidedRange = !!options.allowOneSidedRange; + + const cleanOptions = filterOptions(options); + this.datepickers[0].setOptions(cleanOptions); + this.datepickers[1].setOptions(cleanOptions); + } + + /** + * Destroy the DateRangePicker instance + * @return {DateRangePicker} - the instance destroyed + */ + destroy() { + this.datepickers[0].destroy(); + this.datepickers[1].destroy(); + (0,_lib_event_js__WEBPACK_IMPORTED_MODULE_0__/* .unregisterListeners */ .uV)(this); + delete this.element.rangepicker; + } + + /** + * Get the start and end dates of the date range + * + * The method returns Date objects by default. If format string is passed, + * it returns date strings formatted in given format. + * The result array always contains 2 items (start date/end date) and + * undefined is used for unselected side. (e.g. If none is selected, + * the result will be [undefined, undefined]. If only the end date is set + * when allowOneSidedRange config option is true, [undefined, endDate] will + * be returned.) + * + * @param {String} [format] - Format string to stringify the dates + * @return {Array} - Start and end dates + */ + getDates(format = undefined) { + const callback = format + ? date => (0,_lib_date_format_js__WEBPACK_IMPORTED_MODULE_1__/* .formatDate */ .p6)(date, format, this.datepickers[0].config.locale) + : date => new Date(date); + + return this.dates.map(date => date === undefined ? date : callback(date)); + } + + /** + * Set the start and end dates of the date range + * + * The method calls datepicker.setDate() internally using each of the + * arguments in start→end order. + * + * When a clear: true option object is passed instead of a date, the method + * clears the date. + * + * If an invalid date, the same date as the current one or an option object + * without clear: true is passed, the method considers that argument as an + * "ineffective" argument because calling datepicker.setDate() with those + * values makes no changes to the date selection. + * + * When the allowOneSidedRange config option is false, passing {clear: true} + * to clear the range works only when it is done to the last effective + * argument (in other words, passed to rangeEnd or to rangeStart along with + * ineffective rangeEnd). This is because when the date range is changed, + * it gets normalized based on the last change at the end of the changing + * process. + * + * @param {Date|Number|String|Object} rangeStart - Start date of the range + * or {clear: true} to clear the date + * @param {Date|Number|String|Object} rangeEnd - End date of the range + * or {clear: true} to clear the date + */ + setDates(rangeStart, rangeEnd) { + const [datepicker0, datepicker1] = this.datepickers; + const origDates = this.dates; + + // If range normalization runs on every change, we can't set a new range + // that starts after the end of the current range correctly because the + // normalization process swaps start↔︎end right after setting the new start + // date. To prevent this, the normalization process needs to run once after + // both of the new dates are set. + this._updating = true; + datepicker0.setDate(rangeStart); + datepicker1.setDate(rangeEnd); + delete this._updating; + + if (datepicker1.dates[0] !== origDates[1]) { + onChangeDate(this, {target: this.inputs[1]}); + } else if (datepicker0.dates[0] !== origDates[0]) { + onChangeDate(this, {target: this.inputs[0]}); + } + } +} + + +/***/ }), + +/***/ 770: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "Z": function() { return /* binding */ Datepicker; } +}); + +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/utils.js +var utils = __webpack_require__(105); +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/date.js +var lib_date = __webpack_require__(560); +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/date-format.js +var date_format = __webpack_require__(963); +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/event.js +var lib_event = __webpack_require__(698); +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/i18n/base-locales.js +// default locales +const locales = { + en: { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + clear: "Clear", + titleFormat: "MM y" + } +}; + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/options/defaultOptions.js +// config options updatable by setOptions() and their default values +const defaultOptions = { + autohide: false, + beforeShowDay: null, + beforeShowDecade: null, + beforeShowMonth: null, + beforeShowYear: null, + calendarWeeks: false, + clearBtn: false, + dateDelimiter: ',', + datesDisabled: [], + daysOfWeekDisabled: [], + daysOfWeekHighlighted: [], + defaultViewDate: undefined, // placeholder, defaults to today() by the program + disableTouchKeyboard: false, + format: 'mm/dd/yyyy', + language: 'en', + maxDate: null, + maxNumberOfDates: 1, + maxView: 3, + minDate: null, + nextArrow: '', + orientation: 'auto', + pickLevel: 0, + prevArrow: '', + showDaysOfWeek: true, + showOnClick: true, + showOnFocus: true, + startView: 0, + title: '', + todayBtn: false, + todayBtnMode: 0, + todayHighlight: false, + updateOnBlur: true, + weekStart: 0, +}; + +/* harmony default export */ var options_defaultOptions = (defaultOptions); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/lib/dom.js +const range = document.createRange(); + +function parseHTML(html) { + return range.createContextualFragment(html); +} + +// equivalent to jQuery's :visble +function isVisible(el) { + return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length); +} + +function hideElement(el) { + if (el.style.display === 'none') { + return; + } + // back up the existing display setting in data-style-display + if (el.style.display) { + el.dataset.styleDisplay = el.style.display; + } + el.style.display = 'none'; +} + +function showElement(el) { + if (el.style.display !== 'none') { + return; + } + if (el.dataset.styleDisplay) { + // restore backed-up dispay property + el.style.display = el.dataset.styleDisplay; + delete el.dataset.styleDisplay; + } else { + el.style.display = ''; + } +} + +function emptyChildNodes(el) { + if (el.firstChild) { + el.removeChild(el.firstChild); + emptyChildNodes(el); + } +} + +function replaceChildNodes(el, newChildNodes) { + emptyChildNodes(el); + if (newChildNodes instanceof DocumentFragment) { + el.appendChild(newChildNodes); + } else if (typeof newChildNodes === 'string') { + el.appendChild(parseHTML(newChildNodes)); + } else if (typeof newChildNodes.forEach === 'function') { + newChildNodes.forEach((node) => { + el.appendChild(node); + }); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/options/processOptions.js + + + + + + +const { + language: defaultLang, + format: defaultFormat, + weekStart: defaultWeekStart, +} = options_defaultOptions; + +// Reducer function to filter out invalid day-of-week from the input +function sanitizeDOW(dow, day) { + return dow.length < 6 && day >= 0 && day < 7 + ? (0,utils/* pushUnique */.$C)(dow, day) + : dow; +} + +function calcEndOfWeek(startOfWeek) { + return (startOfWeek + 6) % 7; +} + +// validate input date. if invalid, fallback to the original value +function validateDate(value, format, locale, origValue) { + const date = (0,date_format/* parseDate */.sG)(value, format, locale); + return date !== undefined ? date : origValue; +} + +// Validate viewId. if invalid, fallback to the original value +function validateViewId(value, origValue, max = 3) { + const viewId = parseInt(value, 10); + return viewId >= 0 && viewId <= max ? viewId : origValue; +} + +// Create Datepicker configuration to set +function processOptions(options, datepicker) { + const inOpts = Object.assign({}, options); + const config = {}; + const locales = datepicker.constructor.locales; + let { + format, + language, + locale, + maxDate, + maxView, + minDate, + pickLevel, + startView, + weekStart, + } = datepicker.config || {}; + + if (inOpts.language) { + let lang; + if (inOpts.language !== language) { + if (locales[inOpts.language]) { + lang = inOpts.language; + } else { + // Check if langauge + region tag can fallback to the one without + // region (e.g. fr-CA → fr) + lang = inOpts.language.split('-')[0]; + if (locales[lang] === undefined) { + lang = false; + } + } + } + delete inOpts.language; + if (lang) { + language = config.language = lang; + + // update locale as well when updating language + const origLocale = locale || locales[defaultLang]; + // use default language's properties for the fallback + locale = Object.assign({ + format: defaultFormat, + weekStart: defaultWeekStart + }, locales[defaultLang]); + if (language !== defaultLang) { + Object.assign(locale, locales[language]); + } + config.locale = locale; + // if format and/or weekStart are the same as old locale's defaults, + // update them to new locale's defaults + if (format === origLocale.format) { + format = config.format = locale.format; + } + if (weekStart === origLocale.weekStart) { + weekStart = config.weekStart = locale.weekStart; + config.weekEnd = calcEndOfWeek(locale.weekStart); + } + } + } + + if (inOpts.format) { + const hasToDisplay = typeof inOpts.format.toDisplay === 'function'; + const hasToValue = typeof inOpts.format.toValue === 'function'; + const validFormatString = date_format/* reFormatTokens.test */.CL.test(inOpts.format); + if ((hasToDisplay && hasToValue) || validFormatString) { + format = config.format = inOpts.format; + } + delete inOpts.format; + } + + //*** dates ***// + // while min and maxDate for "no limit" in the options are better to be null + // (especially when updating), the ones in the config have to be undefined + // because null is treated as 0 (= unix epoch) when comparing with time value + let minDt = minDate; + let maxDt = maxDate; + if (inOpts.minDate !== undefined) { + minDt = inOpts.minDate === null + ? (0,lib_date/* dateValue */.by)(0, 0, 1) // set 0000-01-01 to prevent negative values for year + : validateDate(inOpts.minDate, format, locale, minDt); + delete inOpts.minDate; + } + if (inOpts.maxDate !== undefined) { + maxDt = inOpts.maxDate === null + ? undefined + : validateDate(inOpts.maxDate, format, locale, maxDt); + delete inOpts.maxDate; + } + if (maxDt < minDt) { + minDate = config.minDate = maxDt; + maxDate = config.maxDate = minDt; + } else { + if (minDate !== minDt) { + minDate = config.minDate = minDt; + } + if (maxDate !== maxDt) { + maxDate = config.maxDate = maxDt; + } + } + + if (inOpts.datesDisabled) { + config.datesDisabled = inOpts.datesDisabled.reduce((dates, dt) => { + const date = (0,date_format/* parseDate */.sG)(dt, format, locale); + return date !== undefined ? (0,utils/* pushUnique */.$C)(dates, date) : dates; + }, []); + delete inOpts.datesDisabled; + } + if (inOpts.defaultViewDate !== undefined) { + const viewDate = (0,date_format/* parseDate */.sG)(inOpts.defaultViewDate, format, locale); + if (viewDate !== undefined) { + config.defaultViewDate = viewDate; + } + delete inOpts.defaultViewDate; + } + + //*** days of week ***// + if (inOpts.weekStart !== undefined) { + const wkStart = Number(inOpts.weekStart) % 7; + if (!isNaN(wkStart)) { + weekStart = config.weekStart = wkStart; + config.weekEnd = calcEndOfWeek(wkStart); + } + delete inOpts.weekStart; + } + if (inOpts.daysOfWeekDisabled) { + config.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []); + delete inOpts.daysOfWeekDisabled; + } + if (inOpts.daysOfWeekHighlighted) { + config.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []); + delete inOpts.daysOfWeekHighlighted; + } + + //*** multi date ***// + if (inOpts.maxNumberOfDates !== undefined) { + const maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10); + if (maxNumberOfDates >= 0) { + config.maxNumberOfDates = maxNumberOfDates; + config.multidate = maxNumberOfDates !== 1; + } + delete inOpts.maxNumberOfDates; + } + if (inOpts.dateDelimiter) { + config.dateDelimiter = String(inOpts.dateDelimiter); + delete inOpts.dateDelimiter; + } + + //*** pick level & view ***// + let newPickLevel = pickLevel; + if (inOpts.pickLevel !== undefined) { + newPickLevel = validateViewId(inOpts.pickLevel, 2); + delete inOpts.pickLevel; + } + if (newPickLevel !== pickLevel) { + pickLevel = config.pickLevel = newPickLevel; + } + + let newMaxView = maxView; + if (inOpts.maxView !== undefined) { + newMaxView = validateViewId(inOpts.maxView, maxView); + delete inOpts.maxView; + } + // ensure max view >= pick level + newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView; + if (newMaxView !== maxView) { + maxView = config.maxView = newMaxView; + } + + let newStartView = startView; + if (inOpts.startView !== undefined) { + newStartView = validateViewId(inOpts.startView, newStartView); + delete inOpts.startView; + } + // ensure pick level <= start view <= max view + if (newStartView < pickLevel) { + newStartView = pickLevel; + } else if (newStartView > maxView) { + newStartView = maxView; + } + if (newStartView !== startView) { + config.startView = newStartView; + } + + //*** template ***// + if (inOpts.prevArrow) { + const prevArrow = parseHTML(inOpts.prevArrow); + if (prevArrow.childNodes.length > 0) { + config.prevArrow = prevArrow.childNodes; + } + delete inOpts.prevArrow; + } + if (inOpts.nextArrow) { + const nextArrow = parseHTML(inOpts.nextArrow); + if (nextArrow.childNodes.length > 0) { + config.nextArrow = nextArrow.childNodes; + } + delete inOpts.nextArrow; + } + + //*** misc ***// + if (inOpts.disableTouchKeyboard !== undefined) { + config.disableTouchKeyboard = 'ontouchstart' in document && !!inOpts.disableTouchKeyboard; + delete inOpts.disableTouchKeyboard; + } + if (inOpts.orientation) { + const orientation = inOpts.orientation.toLowerCase().split(/\s+/g); + config.orientation = { + x: orientation.find(x => (x === 'left' || x === 'right')) || 'auto', + y: orientation.find(y => (y === 'top' || y === 'bottom')) || 'auto', + }; + delete inOpts.orientation; + } + if (inOpts.todayBtnMode !== undefined) { + switch(inOpts.todayBtnMode) { + case 0: + case 1: + config.todayBtnMode = inOpts.todayBtnMode; + } + delete inOpts.todayBtnMode; + } + + //*** copy the rest ***// + Object.keys(inOpts).forEach((key) => { + if (inOpts[key] !== undefined && (0,utils/* hasProperty */.l$)(options_defaultOptions, key)) { + config[key] = inOpts[key]; + } + }); + + return config; +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/templates/pickerTemplate.js + + +const pickerTemplate = (0,utils/* optimizeTemplateHTML */.zh)(``); + +/* harmony default export */ var templates_pickerTemplate = (pickerTemplate); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/templates/daysTemplate.js + + +const daysTemplate = (0,utils/* optimizeTemplateHTML */.zh)(`
+
${(0,utils/* createTagRepeat */.em)('span', 7, {class: 'dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
+
${(0,utils/* createTagRepeat */.em)('span', 42 , {class: 'block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400'})}
+
`); + +/* harmony default export */ var templates_daysTemplate = (daysTemplate); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/templates/calendarWeeksTemplate.js + + +const calendarWeeksTemplate = (0,utils/* optimizeTemplateHTML */.zh)(`
+
+
${(0,utils/* createTagRepeat */.em)('span', 6, {class: 'week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
+
`); + +/* harmony default export */ var templates_calendarWeeksTemplate = (calendarWeeksTemplate); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/View.js + + + +// Base class of the view classes +class View { + constructor(picker, config) { + Object.assign(this, config, { + picker, + element: parseHTML(`
`).firstChild, + selected: [], + }); + this.init(this.picker.datepicker.config); + } + + init(options) { + if (options.pickLevel !== undefined) { + this.isMinView = this.id === options.pickLevel; + } + this.setOptions(options); + this.updateFocus(); + this.updateSelection(); + } + + // Execute beforeShow() callback and apply the result to the element + // args: + // - current - current value on the iteration on view rendering + // - timeValue - time value of the date to pass to beforeShow() + performBeforeHook(el, current, timeValue) { + let result = this.beforeShow(new Date(timeValue)); + switch (typeof result) { + case 'boolean': + result = {enabled: result}; + break; + case 'string': + result = {classes: result}; + } + + if (result) { + if (result.enabled === false) { + el.classList.add('disabled'); + (0,utils/* pushUnique */.$C)(this.disabled, current); + } + if (result.classes) { + const extraClasses = result.classes.split(/\s+/); + el.classList.add(...extraClasses); + if (extraClasses.includes('disabled')) { + (0,utils/* pushUnique */.$C)(this.disabled, current); + } + } + if (result.content) { + replaceChildNodes(el, result.content); + } + } + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/DaysView.js + + + + + + + + +class DaysView extends View { + constructor(picker) { + super(picker, { + id: 0, + name: 'days', + cellClass: 'day', + }); + } + + init(options, onConstruction = true) { + if (onConstruction) { + const inner = parseHTML(templates_daysTemplate).firstChild; + this.dow = inner.firstChild; + this.grid = inner.lastChild; + this.element.appendChild(inner); + } + super.init(options); + } + + setOptions(options) { + let updateDOW; + + if ((0,utils/* hasProperty */.l$)(options, 'minDate')) { + this.minDate = options.minDate; + } + if ((0,utils/* hasProperty */.l$)(options, 'maxDate')) { + this.maxDate = options.maxDate; + } + if (options.datesDisabled) { + this.datesDisabled = options.datesDisabled; + } + if (options.daysOfWeekDisabled) { + this.daysOfWeekDisabled = options.daysOfWeekDisabled; + updateDOW = true; + } + if (options.daysOfWeekHighlighted) { + this.daysOfWeekHighlighted = options.daysOfWeekHighlighted; + } + if (options.todayHighlight !== undefined) { + this.todayHighlight = options.todayHighlight; + } + if (options.weekStart !== undefined) { + this.weekStart = options.weekStart; + this.weekEnd = options.weekEnd; + updateDOW = true; + } + if (options.locale) { + const locale = this.locale = options.locale; + this.dayNames = locale.daysMin; + this.switchLabelFormat = locale.titleFormat; + updateDOW = true; + } + if (options.beforeShowDay !== undefined) { + this.beforeShow = typeof options.beforeShowDay === 'function' + ? options.beforeShowDay + : undefined; + } + + if (options.calendarWeeks !== undefined) { + if (options.calendarWeeks && !this.calendarWeeks) { + const weeksElem = parseHTML(templates_calendarWeeksTemplate).firstChild; + this.calendarWeeks = { + element: weeksElem, + dow: weeksElem.firstChild, + weeks: weeksElem.lastChild, + }; + this.element.insertBefore(weeksElem, this.element.firstChild); + } else if (this.calendarWeeks && !options.calendarWeeks) { + this.element.removeChild(this.calendarWeeks.element); + this.calendarWeeks = null; + } + } + if (options.showDaysOfWeek !== undefined) { + if (options.showDaysOfWeek) { + showElement(this.dow); + if (this.calendarWeeks) { + showElement(this.calendarWeeks.dow); + } + } else { + hideElement(this.dow); + if (this.calendarWeeks) { + hideElement(this.calendarWeeks.dow); + } + } + } + + // update days-of-week when locale, daysOfweekDisabled or weekStart is changed + if (updateDOW) { + Array.from(this.dow.children).forEach((el, index) => { + const dow = (this.weekStart + index) % 7; + el.textContent = this.dayNames[dow]; + el.className = this.daysOfWeekDisabled.includes(dow) ? 'dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed' : 'dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400'; + }); + } + } + + // Apply update on the focused date to view's settings + updateFocus() { + const viewDate = new Date(this.picker.viewDate); + const viewYear = viewDate.getFullYear(); + const viewMonth = viewDate.getMonth(); + const firstOfMonth = (0,lib_date/* dateValue */.by)(viewYear, viewMonth, 1); + const start = (0,lib_date/* dayOfTheWeekOf */.fr)(firstOfMonth, this.weekStart, this.weekStart); + + this.first = firstOfMonth; + this.last = (0,lib_date/* dateValue */.by)(viewYear, viewMonth + 1, 0); + this.start = start; + this.focused = this.picker.viewDate; + } + + // Apply update on the selected dates to view's settings + updateSelection() { + const {dates, rangepicker} = this.picker.datepicker; + this.selected = dates; + if (rangepicker) { + this.range = rangepicker.dates; + } + } + + // Update the entire view UI + render() { + // update today marker on ever render + this.today = this.todayHighlight ? (0,lib_date/* today */.Lg)() : undefined; + // refresh disabled dates on every render in order to clear the ones added + // by beforeShow hook at previous render + this.disabled = [...this.datesDisabled]; + + const switchLabel = (0,date_format/* formatDate */.p6)(this.focused, this.switchLabelFormat, this.locale); + this.picker.setViewSwitchLabel(switchLabel); + this.picker.setPrevBtnDisabled(this.first <= this.minDate); + this.picker.setNextBtnDisabled(this.last >= this.maxDate); + + if (this.calendarWeeks) { + // start of the UTC week (Monday) of the 1st of the month + const startOfWeek = (0,lib_date/* dayOfTheWeekOf */.fr)(this.first, 1, 1); + Array.from(this.calendarWeeks.weeks.children).forEach((el, index) => { + el.textContent = (0,lib_date/* getWeek */.Qk)((0,lib_date/* addWeeks */.jh)(startOfWeek, index)); + }); + } + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + const current = (0,lib_date/* addDays */.E4)(this.start, index); + const date = new Date(current); + const day = date.getDay(); + + el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`; + el.dataset.date = current; + el.textContent = date.getDate(); + + if (current < this.first) { + classList.add('prev', 'text-gray-500', 'dark:text-white'); + } else if (current > this.last) { + classList.add('next', 'text-gray-500', 'dark:text-white'); + } + if (this.today === current) { + classList.add('today', 'bg-gray-100', 'dark:bg-gray-600'); + } + if (current < this.minDate || current > this.maxDate || this.disabled.includes(current)) { + classList.add('disabled', 'cursor-not-allowed'); + } + if (this.daysOfWeekDisabled.includes(day)) { + classList.add('disabled', 'cursor-not-allowed'); + (0,utils/* pushUnique */.$C)(this.disabled, current); + } + if (this.daysOfWeekHighlighted.includes(day)) { + classList.add('highlighted'); + } + if (this.range) { + const [rangeStart, rangeEnd] = this.range; + if (current > rangeStart && current < rangeEnd) { + classList.add('range', 'bg-gray-200', 'dark:bg-gray-600'); + classList.remove('rounded-lg', 'rounded-l-lg', 'rounded-r-lg') + } + if (current === rangeStart) { + classList.add('range-start', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-l-lg'); + classList.remove('rounded-lg', 'rounded-r-lg'); + } + if (current === rangeEnd) { + classList.add('range-end', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-r-lg'); + classList.remove('rounded-lg', 'rounded-l-lg'); + } + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'text-gray-500', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'dark:bg-gray-600', 'bg-gray-100', 'bg-gray-200'); + } + if (current === this.focused) { + classList.add('focused'); + } + + if (this.beforeShow) { + this.performBeforeHook(el, current, current); + } + }); + } + + // Update the view UI by applying the changes of selected and focused items + refresh() { + const [rangeStart, rangeEnd] = this.range || []; + this.grid + .querySelectorAll('.range, .range-start, .range-end, .selected, .focused') + .forEach((el) => { + el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused'); + el.classList.add('text-gray-900', 'rounded-lg', 'dark:text-white'); + }); + Array.from(this.grid.children).forEach((el) => { + const current = Number(el.dataset.date); + const classList = el.classList; + classList.remove('bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg', 'rounded-r-lg') + if (current > rangeStart && current < rangeEnd) { + classList.add('range', 'bg-gray-200', 'dark:bg-gray-600'); + classList.remove('rounded-lg'); + } + if (current === rangeStart) { + classList.add('range-start', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg'); + classList.remove('rounded-lg', 'rounded-r-lg'); + } + if (current === rangeEnd) { + classList.add('range-end', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-r-lg'); + classList.remove('rounded-lg', 'rounded-l-lg'); + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'bg-gray-100', 'bg-gray-200', 'dark:bg-gray-600'); + } + if (current === this.focused) { + classList.add('focused'); + } + }); + } + + // Update the view UI by applying the change of focused item + refreshFocus() { + const index = Math.round((this.focused - this.start) / 86400000); + this.grid.querySelectorAll('.focused').forEach((el) => { + el.classList.remove('focused'); + }); + this.grid.children[index].classList.add('focused'); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/MonthsView.js + + + + + +function computeMonthRange(range, thisYear) { + if (!range || !range[0] || !range[1]) { + return; + } + + const [[startY, startM], [endY, endM]] = range; + if (startY > thisYear || endY < thisYear) { + return; + } + return [ + startY === thisYear ? startM : -1, + endY === thisYear ? endM : 12, + ]; +} + +class MonthsView extends View { + constructor(picker) { + super(picker, { + id: 1, + name: 'months', + cellClass: 'month', + }); + } + + init(options, onConstruction = true) { + if (onConstruction) { + this.grid = this.element; + this.element.classList.add('months', 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4'); + this.grid.appendChild(parseHTML((0,utils/* createTagRepeat */.em)('span', 12, {'data-month': ix => ix}))); + } + super.init(options); + } + + setOptions(options) { + if (options.locale) { + this.monthNames = options.locale.monthsShort; + } + if ((0,utils/* hasProperty */.l$)(options, 'minDate')) { + if (options.minDate === undefined) { + this.minYear = this.minMonth = this.minDate = undefined; + } else { + const minDateObj = new Date(options.minDate); + this.minYear = minDateObj.getFullYear(); + this.minMonth = minDateObj.getMonth(); + this.minDate = minDateObj.setDate(1); + } + } + if ((0,utils/* hasProperty */.l$)(options, 'maxDate')) { + if (options.maxDate === undefined) { + this.maxYear = this.maxMonth = this.maxDate = undefined; + } else { + const maxDateObj = new Date(options.maxDate); + this.maxYear = maxDateObj.getFullYear(); + this.maxMonth = maxDateObj.getMonth(); + this.maxDate = (0,lib_date/* dateValue */.by)(this.maxYear, this.maxMonth + 1, 0); + } + } + if (options.beforeShowMonth !== undefined) { + this.beforeShow = typeof options.beforeShowMonth === 'function' + ? options.beforeShowMonth + : undefined; + } + } + + // Update view's settings to reflect the viewDate set on the picker + updateFocus() { + const viewDate = new Date(this.picker.viewDate); + this.year = viewDate.getFullYear(); + this.focused = viewDate.getMonth(); + } + + // Update view's settings to reflect the selected dates + updateSelection() { + const {dates, rangepicker} = this.picker.datepicker; + this.selected = dates.reduce((selected, timeValue) => { + const date = new Date(timeValue); + const year = date.getFullYear(); + const month = date.getMonth(); + if (selected[year] === undefined) { + selected[year] = [month]; + } else { + (0,utils/* pushUnique */.$C)(selected[year], month); + } + return selected; + }, {}); + if (rangepicker && rangepicker.dates) { + this.range = rangepicker.dates.map(timeValue => { + const date = new Date(timeValue); + return isNaN(date) ? undefined : [date.getFullYear(), date.getMonth()]; + }); + } + } + + // Update the entire view UI + render() { + // refresh disabled months on every render in order to clear the ones added + // by beforeShow hook at previous render + this.disabled = []; + + this.picker.setViewSwitchLabel(this.year); + this.picker.setPrevBtnDisabled(this.year <= this.minYear); + this.picker.setNextBtnDisabled(this.year >= this.maxYear); + + const selected = this.selected[this.year] || []; + const yrOutOfRange = this.year < this.minYear || this.year > this.maxYear; + const isMinYear = this.year === this.minYear; + const isMaxYear = this.year === this.maxYear; + const range = computeMonthRange(this.range, this.year); + + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + const date = (0,lib_date/* dateValue */.by)(this.year, index, 1); + + el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`; + if (this.isMinView) { + el.dataset.date = date; + } + // reset text on every render to clear the custom content set + // by beforeShow hook at previous render + el.textContent = this.monthNames[index]; + + if ( + yrOutOfRange + || isMinYear && index < this.minMonth + || isMaxYear && index > this.maxMonth + ) { + classList.add('disabled'); + } + if (range) { + const [rangeStart, rangeEnd] = range; + if (index > rangeStart && index < rangeEnd) { + classList.add('range'); + } + if (index === rangeStart) { + classList.add('range-start'); + } + if (index === rangeEnd) { + classList.add('range-end'); + } + } + if (selected.includes(index)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (index === this.focused) { + classList.add('focused'); + } + + if (this.beforeShow) { + this.performBeforeHook(el, index, date); + } + }); + } + + // Update the view UI by applying the changes of selected and focused items + refresh() { + const selected = this.selected[this.year] || []; + const [rangeStart, rangeEnd] = computeMonthRange(this.range, this.year) || []; + this.grid + .querySelectorAll('.range, .range-start, .range-end, .selected, .focused') + .forEach((el) => { + el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'dark:bg-blue-600', 'dark:text-white', 'text-white', 'focused'); + el.classList.add('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + }); + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + if (index > rangeStart && index < rangeEnd) { + classList.add('range'); + } + if (index === rangeStart) { + classList.add('range-start'); + } + if (index === rangeEnd) { + classList.add('range-end'); + } + if (selected.includes(index)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (index === this.focused) { + classList.add('focused'); + } + }); + } + + // Update the view UI by applying the change of focused item + refreshFocus() { + this.grid.querySelectorAll('.focused').forEach((el) => { + el.classList.remove('focused'); + }); + this.grid.children[this.focused].classList.add('focused'); + } +} +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/YearsView.js + + + + + +function toTitleCase(word) { + return [...word].reduce((str, ch, ix) => str += ix ? ch : ch.toUpperCase(), ''); +} + +// Class representing the years and decades view elements +class YearsView extends View { + constructor(picker, config) { + super(picker, config); + } + + init(options, onConstruction = true) { + if (onConstruction) { + this.navStep = this.step * 10; + this.beforeShowOption = `beforeShow${toTitleCase(this.cellClass)}`; + this.grid = this.element; + this.element.classList.add(this.name, 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4'); + this.grid.appendChild(parseHTML((0,utils/* createTagRepeat */.em)('span', 12))); + } + super.init(options); + } + + setOptions(options) { + if ((0,utils/* hasProperty */.l$)(options, 'minDate')) { + if (options.minDate === undefined) { + this.minYear = this.minDate = undefined; + } else { + this.minYear = (0,lib_date/* startOfYearPeriod */.ak)(options.minDate, this.step); + this.minDate = (0,lib_date/* dateValue */.by)(this.minYear, 0, 1); + } + } + if ((0,utils/* hasProperty */.l$)(options, 'maxDate')) { + if (options.maxDate === undefined) { + this.maxYear = this.maxDate = undefined; + } else { + this.maxYear = (0,lib_date/* startOfYearPeriod */.ak)(options.maxDate, this.step); + this.maxDate = (0,lib_date/* dateValue */.by)(this.maxYear, 11, 31); + } + } + if (options[this.beforeShowOption] !== undefined) { + const beforeShow = options[this.beforeShowOption]; + this.beforeShow = typeof beforeShow === 'function' ? beforeShow : undefined; + } + } + + // Update view's settings to reflect the viewDate set on the picker + updateFocus() { + const viewDate = new Date(this.picker.viewDate); + const first = (0,lib_date/* startOfYearPeriod */.ak)(viewDate, this.navStep); + const last = first + 9 * this.step; + + this.first = first; + this.last = last; + this.start = first - this.step; + this.focused = (0,lib_date/* startOfYearPeriod */.ak)(viewDate, this.step); + } + + // Update view's settings to reflect the selected dates + updateSelection() { + const {dates, rangepicker} = this.picker.datepicker; + this.selected = dates.reduce((years, timeValue) => { + return (0,utils/* pushUnique */.$C)(years, (0,lib_date/* startOfYearPeriod */.ak)(timeValue, this.step)); + }, []); + if (rangepicker && rangepicker.dates) { + this.range = rangepicker.dates.map(timeValue => { + if (timeValue !== undefined) { + return (0,lib_date/* startOfYearPeriod */.ak)(timeValue, this.step); + } + }); + } + } + + // Update the entire view UI + render() { + // refresh disabled years on every render in order to clear the ones added + // by beforeShow hook at previous render + this.disabled = []; + + this.picker.setViewSwitchLabel(`${this.first}-${this.last}`); + this.picker.setPrevBtnDisabled(this.first <= this.minYear); + this.picker.setNextBtnDisabled(this.last >= this.maxYear); + + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + const current = this.start + (index * this.step); + const date = (0,lib_date/* dateValue */.by)(current, 0, 1); + + el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`; + if (this.isMinView) { + el.dataset.date = date; + } + el.textContent = el.dataset.year = current; + + if (index === 0) { + classList.add('prev'); + } else if (index === 11) { + classList.add('next'); + } + if (current < this.minYear || current > this.maxYear) { + classList.add('disabled'); + } + if (this.range) { + const [rangeStart, rangeEnd] = this.range; + if (current > rangeStart && current < rangeEnd) { + classList.add('range'); + } + if (current === rangeStart) { + classList.add('range-start'); + } + if (current === rangeEnd) { + classList.add('range-end'); + } + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (current === this.focused) { + classList.add('focused'); + } + + if (this.beforeShow) { + this.performBeforeHook(el, current, date); + } + }); + } + + // Update the view UI by applying the changes of selected and focused items + refresh() { + const [rangeStart, rangeEnd] = this.range || []; + this.grid + .querySelectorAll('.range, .range-start, .range-end, .selected, .focused') + .forEach((el) => { + el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused'); + }); + Array.from(this.grid.children).forEach((el) => { + const current = Number(el.textContent); + const classList = el.classList; + if (current > rangeStart && current < rangeEnd) { + classList.add('range'); + } + if (current === rangeStart) { + classList.add('range-start'); + } + if (current === rangeEnd) { + classList.add('range-end'); + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (current === this.focused) { + classList.add('focused'); + } + }); + } + + // Update the view UI by applying the change of focused item + refreshFocus() { + const index = Math.round((this.focused - this.start) / this.step); + this.grid.querySelectorAll('.focused').forEach((el) => { + el.classList.remove('focused'); + }); + this.grid.children[index].classList.add('focused'); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/functions.js + + + +function triggerDatepickerEvent(datepicker, type) { + const detail = { + date: datepicker.getDate(), + viewDate: new Date(datepicker.picker.viewDate), + viewId: datepicker.picker.currentView.id, + datepicker, + }; + datepicker.element.dispatchEvent(new CustomEvent(type, {detail})); +} + +// direction: -1 (to previous), 1 (to next) +function goToPrevOrNext(datepicker, direction) { + const {minDate, maxDate} = datepicker.config; + const {currentView, viewDate} = datepicker.picker; + let newViewDate; + switch (currentView.id) { + case 0: + newViewDate = (0,lib_date/* addMonths */.zI)(viewDate, direction); + break; + case 1: + newViewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction); + break; + default: + newViewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction * currentView.navStep); + } + newViewDate = (0,utils/* limitToRange */.jG)(newViewDate, minDate, maxDate); + datepicker.picker.changeFocus(newViewDate).render(); +} + +function switchView(datepicker) { + const viewId = datepicker.picker.currentView.id; + if (viewId === datepicker.config.maxView) { + return; + } + datepicker.picker.changeView(viewId + 1).render(); +} + +function unfocus(datepicker) { + if (datepicker.config.updateOnBlur) { + datepicker.update({autohide: true}); + } else { + datepicker.refresh('input'); + datepicker.hide(); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/pickerListeners.js + + + + +function goToSelectedMonthOrYear(datepicker, selection) { + const picker = datepicker.picker; + const viewDate = new Date(picker.viewDate); + const viewId = picker.currentView.id; + const newDate = viewId === 1 + ? (0,lib_date/* addMonths */.zI)(viewDate, selection - viewDate.getMonth()) + : (0,lib_date/* addYears */.Bc)(viewDate, selection - viewDate.getFullYear()); + + picker.changeFocus(newDate).changeView(viewId - 1).render(); +} + +function onClickTodayBtn(datepicker) { + const picker = datepicker.picker; + const currentDate = (0,lib_date/* today */.Lg)(); + if (datepicker.config.todayBtnMode === 1) { + if (datepicker.config.autohide) { + datepicker.setDate(currentDate); + return; + } + datepicker.setDate(currentDate, {render: false}); + picker.update(); + } + if (picker.viewDate !== currentDate) { + picker.changeFocus(currentDate); + } + picker.changeView(0).render(); +} + +function onClickClearBtn(datepicker) { + datepicker.setDate({clear: true}); +} + +function onClickViewSwitch(datepicker) { + switchView(datepicker); +} + +function onClickPrevBtn(datepicker) { + goToPrevOrNext(datepicker, -1); +} + +function onClickNextBtn(datepicker) { + goToPrevOrNext(datepicker, 1); +} + +// For the picker's main block to delegete the events from `datepicker-cell`s +function onClickView(datepicker, ev) { + const target = (0,lib_event/* findElementInEventPath */.He)(ev, '.datepicker-cell'); + if (!target || target.classList.contains('disabled')) { + return; + } + + const {id, isMinView} = datepicker.picker.currentView; + if (isMinView) { + datepicker.setDate(Number(target.dataset.date)); + } else if (id === 1) { + goToSelectedMonthOrYear(datepicker, Number(target.dataset.month)); + } else { + goToSelectedMonthOrYear(datepicker, Number(target.dataset.year)); + } +} + +function onClickPicker(datepicker) { + if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) { + datepicker.inputField.focus(); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/Picker.js + + + + + + + + + + + +function processPickerOptions(picker, options) { + if (options.title !== undefined) { + if (options.title) { + picker.controls.title.textContent = options.title; + showElement(picker.controls.title); + } else { + picker.controls.title.textContent = ''; + hideElement(picker.controls.title); + } + } + if (options.prevArrow) { + const prevBtn = picker.controls.prevBtn; + emptyChildNodes(prevBtn); + options.prevArrow.forEach((node) => { + prevBtn.appendChild(node.cloneNode(true)); + }); + } + if (options.nextArrow) { + const nextBtn = picker.controls.nextBtn; + emptyChildNodes(nextBtn); + options.nextArrow.forEach((node) => { + nextBtn.appendChild(node.cloneNode(true)); + }); + } + if (options.locale) { + picker.controls.todayBtn.textContent = options.locale.today; + picker.controls.clearBtn.textContent = options.locale.clear; + } + if (options.todayBtn !== undefined) { + if (options.todayBtn) { + showElement(picker.controls.todayBtn); + } else { + hideElement(picker.controls.todayBtn); + } + } + if ((0,utils/* hasProperty */.l$)(options, 'minDate') || (0,utils/* hasProperty */.l$)(options, 'maxDate')) { + const {minDate, maxDate} = picker.datepicker.config; + picker.controls.todayBtn.disabled = !(0,utils/* isInRange */.mh)((0,lib_date/* today */.Lg)(), minDate, maxDate); + } + if (options.clearBtn !== undefined) { + if (options.clearBtn) { + showElement(picker.controls.clearBtn); + } else { + hideElement(picker.controls.clearBtn); + } + } +} + +// Compute view date to reset, which will be... +// - the last item of the selected dates or defaultViewDate if no selection +// - limitted to minDate or maxDate if it exceeds the range +function computeResetViewDate(datepicker) { + const {dates, config} = datepicker; + const viewDate = dates.length > 0 ? (0,utils/* lastItemOf */.Jm)(dates) : config.defaultViewDate; + return (0,utils/* limitToRange */.jG)(viewDate, config.minDate, config.maxDate); +} + +// Change current view's view date +function setViewDate(picker, newDate) { + const oldViewDate = new Date(picker.viewDate); + const newViewDate = new Date(newDate); + const {id, year, first, last} = picker.currentView; + const viewYear = newViewDate.getFullYear(); + + picker.viewDate = newDate; + if (viewYear !== oldViewDate.getFullYear()) { + triggerDatepickerEvent(picker.datepicker, 'changeYear'); + } + if (newViewDate.getMonth() !== oldViewDate.getMonth()) { + triggerDatepickerEvent(picker.datepicker, 'changeMonth'); + } + + // return whether the new date is in different period on time from the one + // displayed in the current view + // when true, the view needs to be re-rendered on the next UI refresh. + switch (id) { + case 0: + return newDate < first || newDate > last; + case 1: + return viewYear !== year; + default: + return viewYear < first || viewYear > last; + } +} + +function getTextDirection(el) { + return window.getComputedStyle(el).direction; +} + +// Class representing the picker UI +class Picker { + constructor(datepicker) { + this.datepicker = datepicker; + + const template = templates_pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass); + const element = this.element = parseHTML(template).firstChild; + const [header, main, footer] = element.firstChild.children; + const title = header.firstElementChild; + const [prevBtn, viewSwitch, nextBtn] = header.lastElementChild.children; + const [todayBtn, clearBtn] = footer.firstChild.children; + const controls = { + title, + prevBtn, + viewSwitch, + nextBtn, + todayBtn, + clearBtn, + }; + this.main = main; + this.controls = controls; + + const elementClass = datepicker.inline ? 'inline' : 'dropdown'; + element.classList.add(`datepicker-${elementClass}`); + elementClass === 'dropdown' ? element.classList.add('dropdown', 'absolute', 'top-0', 'left-0', 'z-50', 'pt-2') : null; + + processPickerOptions(this, datepicker.config); + this.viewDate = computeResetViewDate(datepicker); + + // set up event listeners + (0,lib_event/* registerListeners */.cF)(datepicker, [ + [element, 'click', onClickPicker.bind(null, datepicker), {capture: true}], + [main, 'click', onClickView.bind(null, datepicker)], + [controls.viewSwitch, 'click', onClickViewSwitch.bind(null, datepicker)], + [controls.prevBtn, 'click', onClickPrevBtn.bind(null, datepicker)], + [controls.nextBtn, 'click', onClickNextBtn.bind(null, datepicker)], + [controls.todayBtn, 'click', onClickTodayBtn.bind(null, datepicker)], + [controls.clearBtn, 'click', onClickClearBtn.bind(null, datepicker)], + ]); + + // set up views + this.views = [ + new DaysView(this), + new MonthsView(this), + new YearsView(this, {id: 2, name: 'years', cellClass: 'year', step: 1}), + new YearsView(this, {id: 3, name: 'decades', cellClass: 'decade', step: 10}), + ]; + this.currentView = this.views[datepicker.config.startView]; + + this.currentView.render(); + this.main.appendChild(this.currentView.element); + datepicker.config.container.appendChild(this.element); + } + + setOptions(options) { + processPickerOptions(this, options); + this.views.forEach((view) => { + view.init(options, false); + }); + this.currentView.render(); + } + + detach() { + this.datepicker.config.container.removeChild(this.element); + } + + show() { + if (this.active) { + return; + } + this.element.classList.add('active', 'block'); + this.element.classList.remove('hidden'); + this.active = true; + + const datepicker = this.datepicker; + if (!datepicker.inline) { + // ensure picker's direction matches input's + const inputDirection = getTextDirection(datepicker.inputField); + if (inputDirection !== getTextDirection(datepicker.config.container)) { + this.element.dir = inputDirection; + } else if (this.element.dir) { + this.element.removeAttribute('dir'); + } + + this.place(); + if (datepicker.config.disableTouchKeyboard) { + datepicker.inputField.blur(); + } + } + triggerDatepickerEvent(datepicker, 'show'); + } + + hide() { + if (!this.active) { + return; + } + this.datepicker.exitEditMode(); + this.element.classList.remove('active', 'block'); + this.element.classList.add('active', 'block', 'hidden'); + this.active = false; + triggerDatepickerEvent(this.datepicker, 'hide'); + } + + place() { + const {classList, style} = this.element; + const {config, inputField} = this.datepicker; + const container = config.container; + const { + width: calendarWidth, + height: calendarHeight, + } = this.element.getBoundingClientRect(); + const { + left: containerLeft, + top: containerTop, + width: containerWidth, + } = container.getBoundingClientRect(); + const { + left: inputLeft, + top: inputTop, + width: inputWidth, + height: inputHeight + } = inputField.getBoundingClientRect(); + let {x: orientX, y: orientY} = config.orientation; + let scrollTop; + let left; + let top; + + if (container === document.body) { + scrollTop = window.scrollY; + left = inputLeft + window.scrollX; + top = inputTop + scrollTop; + } else { + scrollTop = container.scrollTop; + left = inputLeft - containerLeft; + top = inputTop - containerTop + scrollTop; + } + + if (orientX === 'auto') { + if (left < 0) { + // align to the left and move into visible area if input's left edge < window's + orientX = 'left'; + left = 10; + } else if (left + calendarWidth > containerWidth) { + // align to the right if canlendar's right edge > container's + orientX = 'right'; + } else { + orientX = getTextDirection(inputField) === 'rtl' ? 'right' : 'left'; + } + } + if (orientX === 'right') { + left -= calendarWidth - inputWidth; + } + + if (orientY === 'auto') { + orientY = top - calendarHeight < scrollTop ? 'bottom' : 'top'; + } + if (orientY === 'top') { + top -= calendarHeight; + } else { + top += inputHeight; + } + + classList.remove( + 'datepicker-orient-top', + 'datepicker-orient-bottom', + 'datepicker-orient-right', + 'datepicker-orient-left' + ); + classList.add(`datepicker-orient-${orientY}`, `datepicker-orient-${orientX}`); + + style.top = top ? `${top}px` : top; + style.left = left ? `${left}px` : left; + } + + setViewSwitchLabel(labelText) { + this.controls.viewSwitch.textContent = labelText; + } + + setPrevBtnDisabled(disabled) { + this.controls.prevBtn.disabled = disabled; + } + + setNextBtnDisabled(disabled) { + this.controls.nextBtn.disabled = disabled; + } + + changeView(viewId) { + const oldView = this.currentView; + const newView = this.views[viewId]; + if (newView.id !== oldView.id) { + this.currentView = newView; + this._renderMethod = 'render'; + triggerDatepickerEvent(this.datepicker, 'changeView'); + this.main.replaceChild(newView.element, oldView.element); + } + return this; + } + + // Change the focused date (view date) + changeFocus(newViewDate) { + this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus'; + this.views.forEach((view) => { + view.updateFocus(); + }); + return this; + } + + // Apply the change of the selected dates + update() { + const newViewDate = computeResetViewDate(this.datepicker); + this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refresh'; + this.views.forEach((view) => { + view.updateFocus(); + view.updateSelection(); + }); + return this; + } + + // Refresh the picker UI + render(quickRender = true) { + const renderMethod = (quickRender && this._renderMethod) || 'render'; + delete this._renderMethod; + + this.currentView[renderMethod](); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/inputFieldListeners.js + + + + +// Find the closest date that doesn't meet the condition for unavailable date +// Returns undefined if no available date is found +// addFn: function to calculate the next date +// - args: time value, amount +// increase: amount to pass to addFn +// testFn: function to test the unavailablity of the date +// - args: time value; retun: true if unavailable +function findNextAvailableOne(date, addFn, increase, testFn, min, max) { + if (!(0,utils/* isInRange */.mh)(date, min, max)) { + return; + } + if (testFn(date)) { + const newDate = addFn(date, increase); + return findNextAvailableOne(newDate, addFn, increase, testFn, min, max); + } + return date; +} + +// direction: -1 (left/up), 1 (right/down) +// vertical: true for up/down, false for left/right +function moveByArrowKey(datepicker, ev, direction, vertical) { + const picker = datepicker.picker; + const currentView = picker.currentView; + const step = currentView.step || 1; + let viewDate = picker.viewDate; + let addFn; + let testFn; + switch (currentView.id) { + case 0: + if (vertical) { + viewDate = (0,lib_date/* addDays */.E4)(viewDate, direction * 7); + } else if (ev.ctrlKey || ev.metaKey) { + viewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction); + } else { + viewDate = (0,lib_date/* addDays */.E4)(viewDate, direction); + } + addFn = lib_date/* addDays */.E4; + testFn = (date) => currentView.disabled.includes(date); + break; + case 1: + viewDate = (0,lib_date/* addMonths */.zI)(viewDate, vertical ? direction * 4 : direction); + addFn = lib_date/* addMonths */.zI; + testFn = (date) => { + const dt = new Date(date); + const {year, disabled} = currentView; + return dt.getFullYear() === year && disabled.includes(dt.getMonth()); + }; + break; + default: + viewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction * (vertical ? 4 : 1) * step); + addFn = lib_date/* addYears */.Bc; + testFn = date => currentView.disabled.includes((0,lib_date/* startOfYearPeriod */.ak)(date, step)); + } + viewDate = findNextAvailableOne( + viewDate, + addFn, + direction < 0 ? -step : step, + testFn, + currentView.minDate, + currentView.maxDate + ); + if (viewDate !== undefined) { + picker.changeFocus(viewDate).render(); + } +} + +function onKeydown(datepicker, ev) { + if (ev.key === 'Tab') { + unfocus(datepicker); + return; + } + + const picker = datepicker.picker; + const {id, isMinView} = picker.currentView; + if (!picker.active) { + switch (ev.key) { + case 'ArrowDown': + case 'Escape': + picker.show(); + break; + case 'Enter': + datepicker.update(); + break; + default: + return; + } + } else if (datepicker.editMode) { + switch (ev.key) { + case 'Escape': + picker.hide(); + break; + case 'Enter': + datepicker.exitEditMode({update: true, autohide: datepicker.config.autohide}); + break; + default: + return; + } + } else { + switch (ev.key) { + case 'Escape': + picker.hide(); + break; + case 'ArrowLeft': + if (ev.ctrlKey || ev.metaKey) { + goToPrevOrNext(datepicker, -1); + } else if (ev.shiftKey) { + datepicker.enterEditMode(); + return; + } else { + moveByArrowKey(datepicker, ev, -1, false); + } + break; + case 'ArrowRight': + if (ev.ctrlKey || ev.metaKey) { + goToPrevOrNext(datepicker, 1); + } else if (ev.shiftKey) { + datepicker.enterEditMode(); + return; + } else { + moveByArrowKey(datepicker, ev, 1, false); + } + break; + case 'ArrowUp': + if (ev.ctrlKey || ev.metaKey) { + switchView(datepicker); + } else if (ev.shiftKey) { + datepicker.enterEditMode(); + return; + } else { + moveByArrowKey(datepicker, ev, -1, true); + } + break; + case 'ArrowDown': + if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) { + datepicker.enterEditMode(); + return; + } + moveByArrowKey(datepicker, ev, 1, true); + break; + case 'Enter': + if (isMinView) { + datepicker.setDate(picker.viewDate); + } else { + picker.changeView(id - 1).render(); + } + break; + case 'Backspace': + case 'Delete': + datepicker.enterEditMode(); + return; + default: + if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) { + datepicker.enterEditMode(); + } + return; + } + } + ev.preventDefault(); + ev.stopPropagation(); +} + +function onFocus(datepicker) { + if (datepicker.config.showOnFocus && !datepicker._showing) { + datepicker.show(); + } +} + +// for the prevention for entering edit mode while getting focus on click +function onMousedown(datepicker, ev) { + const el = ev.target; + if (datepicker.picker.active || datepicker.config.showOnClick) { + el._active = el === document.activeElement; + el._clicking = setTimeout(() => { + delete el._active; + delete el._clicking; + }, 2000); + } +} + +function onClickInput(datepicker, ev) { + const el = ev.target; + if (!el._clicking) { + return; + } + clearTimeout(el._clicking); + delete el._clicking; + + if (el._active) { + datepicker.enterEditMode(); + } + delete el._active; + + if (datepicker.config.showOnClick) { + datepicker.show(); + } +} + +function onPaste(datepicker, ev) { + if (ev.clipboardData.types.includes('text/plain')) { + datepicker.enterEditMode(); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/otherListeners.js + + + +// for the `document` to delegate the events from outside the picker/input field +function onClickOutside(datepicker, ev) { + const element = datepicker.element; + if (element !== document.activeElement) { + return; + } + const pickerElem = datepicker.picker.element; + if ((0,lib_event/* findElementInEventPath */.He)(ev, el => el === element || el === pickerElem)) { + return; + } + unfocus(datepicker); +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/Datepicker.js + + + + + + + + + + + + +function stringifyDates(dates, config) { + return dates + .map(dt => (0,date_format/* formatDate */.p6)(dt, config.format, config.locale)) + .join(config.dateDelimiter); +} + +// parse input dates and create an array of time values for selection +// returns undefined if there are no valid dates in inputDates +// when origDates (current selection) is passed, the function works to mix +// the input dates into the current selection +function processInputDates(datepicker, inputDates, clear = false) { + const {config, dates: origDates, rangepicker} = datepicker; + if (inputDates.length === 0) { + // empty input is considered valid unless origiDates is passed + return clear ? [] : undefined; + } + + const rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1]; + let newDates = inputDates.reduce((dates, dt) => { + let date = (0,date_format/* parseDate */.sG)(dt, config.format, config.locale); + if (date === undefined) { + return dates; + } + if (config.pickLevel > 0) { + // adjust to 1st of the month/Jan 1st of the year + // or to the last day of the monh/Dec 31st of the year if the datepicker + // is the range-end picker of a rangepicker + const dt = new Date(date); + if (config.pickLevel === 1) { + date = rangeEnd + ? dt.setMonth(dt.getMonth() + 1, 0) + : dt.setDate(1); + } else { + date = rangeEnd + ? dt.setFullYear(dt.getFullYear() + 1, 0, 0) + : dt.setMonth(0, 1); + } + } + if ( + (0,utils/* isInRange */.mh)(date, config.minDate, config.maxDate) + && !dates.includes(date) + && !config.datesDisabled.includes(date) + && !config.daysOfWeekDisabled.includes(new Date(date).getDay()) + ) { + dates.push(date); + } + return dates; + }, []); + if (newDates.length === 0) { + return; + } + if (config.multidate && !clear) { + // get the synmetric difference between origDates and newDates + newDates = newDates.reduce((dates, date) => { + if (!origDates.includes(date)) { + dates.push(date); + } + return dates; + }, origDates.filter(date => !newDates.includes(date))); + } + // do length check always because user can input multiple dates regardless of the mode + return config.maxNumberOfDates && newDates.length > config.maxNumberOfDates + ? newDates.slice(config.maxNumberOfDates * -1) + : newDates; +} + +// refresh the UI elements +// modes: 1: input only, 2, picker only, 3 both +function refreshUI(datepicker, mode = 3, quickRender = true) { + const {config, picker, inputField} = datepicker; + if (mode & 2) { + const newView = picker.active ? config.pickLevel : config.startView; + picker.update().changeView(newView).render(quickRender); + } + if (mode & 1 && inputField) { + inputField.value = stringifyDates(datepicker.dates, config); + } +} + +function setDate(datepicker, inputDates, options) { + let {clear, render, autohide} = options; + if (render === undefined) { + render = true; + } + if (!render) { + autohide = false; + } else if (autohide === undefined) { + autohide = datepicker.config.autohide; + } + + const newDates = processInputDates(datepicker, inputDates, clear); + if (!newDates) { + return; + } + if (newDates.toString() !== datepicker.dates.toString()) { + datepicker.dates = newDates; + refreshUI(datepicker, render ? 3 : 1); + triggerDatepickerEvent(datepicker, 'changeDate'); + } else { + refreshUI(datepicker, 1); + } + if (autohide) { + datepicker.hide(); + } +} + +/** + * Class representing a date picker + */ +class Datepicker { + /** + * Create a date picker + * @param {Element} element - element to bind a date picker + * @param {Object} [options] - config options + * @param {DateRangePicker} [rangepicker] - DateRangePicker instance the + * date picker belongs to. Use this only when creating date picker as a part + * of date range picker + */ + constructor(element, options = {}, rangepicker = undefined) { + element.datepicker = this; + this.element = element; + + // set up config + const config = this.config = Object.assign({ + buttonClass: (options.buttonClass && String(options.buttonClass)) || 'button', + container: document.body, + defaultViewDate: (0,lib_date/* today */.Lg)(), + maxDate: undefined, + minDate: undefined, + }, processOptions(options_defaultOptions, this)); + this._options = options; + Object.assign(config, processOptions(options, this)); + + // configure by type + const inline = this.inline = element.tagName !== 'INPUT'; + let inputField; + let initialDates; + + if (inline) { + config.container = element; + initialDates = (0,utils/* stringToArray */.W7)(element.dataset.date, config.dateDelimiter); + delete element.dataset.date; + } else { + const container = options.container ? document.querySelector(options.container) : null; + if (container) { + config.container = container; + } + inputField = this.inputField = element; + inputField.classList.add('datepicker-input'); + initialDates = (0,utils/* stringToArray */.W7)(inputField.value, config.dateDelimiter); + } + if (rangepicker) { + // check validiry + const index = rangepicker.inputs.indexOf(inputField); + const datepickers = rangepicker.datepickers; + if (index < 0 || index > 1 || !Array.isArray(datepickers)) { + throw Error('Invalid rangepicker object.'); + } + // attach itaelf to the rangepicker here so that processInputDates() can + // determine if this is the range-end picker of the rangepicker while + // setting inital values when pickLevel > 0 + datepickers[index] = this; + // add getter for rangepicker + Object.defineProperty(this, 'rangepicker', { + get() { + return rangepicker; + }, + }); + } + + // set initial dates + this.dates = []; + // process initial value + const inputDateValues = processInputDates(this, initialDates); + if (inputDateValues && inputDateValues.length > 0) { + this.dates = inputDateValues; + } + if (inputField) { + inputField.value = stringifyDates(this.dates, config); + } + + const picker = this.picker = new Picker(this); + + if (inline) { + this.show(); + } else { + // set up event listeners in other modes + const onMousedownDocument = onClickOutside.bind(null, this); + const listeners = [ + [inputField, 'keydown', onKeydown.bind(null, this)], + [inputField, 'focus', onFocus.bind(null, this)], + [inputField, 'mousedown', onMousedown.bind(null, this)], + [inputField, 'click', onClickInput.bind(null, this)], + [inputField, 'paste', onPaste.bind(null, this)], + [document, 'mousedown', onMousedownDocument], + [document, 'touchstart', onMousedownDocument], + [window, 'resize', picker.place.bind(picker)] + ]; + (0,lib_event/* registerListeners */.cF)(this, listeners); + } + } + + /** + * Format Date object or time value in given format and language + * @param {Date|Number} date - date or time value to format + * @param {String|Object} format - format string or object that contains + * toDisplay() custom formatter, whose signature is + * - args: + * - date: {Date} - Date instance of the date passed to the method + * - format: {Object} - the format object passed to the method + * - locale: {Object} - locale for the language specified by `lang` + * - return: + * {String} formatted date + * @param {String} [lang=en] - language code for the locale to use + * @return {String} formatted date + */ + static formatDate(date, format, lang) { + return (0,date_format/* formatDate */.p6)(date, format, lang && locales[lang] || locales.en); + } + + /** + * Parse date string + * @param {String|Date|Number} dateStr - date string, Date object or time + * value to parse + * @param {String|Object} format - format string or object that contains + * toValue() custom parser, whose signature is + * - args: + * - dateStr: {String|Date|Number} - the dateStr passed to the method + * - format: {Object} - the format object passed to the method + * - locale: {Object} - locale for the language specified by `lang` + * - return: + * {Date|Number} parsed date or its time value + * @param {String} [lang=en] - language code for the locale to use + * @return {Number} time value of parsed date + */ + static parseDate(dateStr, format, lang) { + return (0,date_format/* parseDate */.sG)(dateStr, format, lang && locales[lang] || locales.en); + } + + /** + * @type {Object} - Installed locales in `[languageCode]: localeObject` format + * en`:_English (US)_ is pre-installed. + */ + static get locales() { + return locales; + } + + /** + * @type {Boolean} - Whether the picker element is shown. `true` whne shown + */ + get active() { + return !!(this.picker && this.picker.active); + } + + /** + * @type {HTMLDivElement} - DOM object of picker element + */ + get pickerElement() { + return this.picker ? this.picker.element : undefined; + } + + /** + * Set new values to the config options + * @param {Object} options - config options to update + */ + setOptions(options) { + const picker = this.picker; + const newOptions = processOptions(options, this); + Object.assign(this._options, options); + Object.assign(this.config, newOptions); + picker.setOptions(newOptions); + + refreshUI(this, 3); + } + + /** + * Show the picker element + */ + show() { + if (this.inputField) { + if (this.inputField.disabled) { + return; + } + if (this.inputField !== document.activeElement) { + this._showing = true; + this.inputField.focus(); + delete this._showing; + } + } + this.picker.show(); + } + + /** + * Hide the picker element + * Not available on inline picker + */ + hide() { + if (this.inline) { + return; + } + this.picker.hide(); + this.picker.update().changeView(this.config.startView).render(); + } + + /** + * Destroy the Datepicker instance + * @return {Detepicker} - the instance destroyed + */ + destroy() { + this.hide(); + (0,lib_event/* unregisterListeners */.uV)(this); + this.picker.detach(); + if (!this.inline) { + this.inputField.classList.remove('datepicker-input'); + } + delete this.element.datepicker; + return this; + } + + /** + * Get the selected date(s) + * + * The method returns a Date object of selected date by default, and returns + * an array of selected dates in multidate mode. If format string is passed, + * it returns date string(s) formatted in given format. + * + * @param {String} [format] - Format string to stringify the date(s) + * @return {Date|String|Date[]|String[]} - selected date(s), or if none is + * selected, empty array in multidate mode and untitled in sigledate mode + */ + getDate(format = undefined) { + const callback = format + ? date => (0,date_format/* formatDate */.p6)(date, format, this.config.locale) + : date => new Date(date); + + if (this.config.multidate) { + return this.dates.map(callback); + } + if (this.dates.length > 0) { + return callback(this.dates[0]); + } + } + + /** + * Set selected date(s) + * + * In multidate mode, you can pass multiple dates as a series of arguments + * or an array. (Since each date is parsed individually, the type of the + * dates doesn't have to be the same.) + * The given dates are used to toggle the select status of each date. The + * number of selected dates is kept from exceeding the length set to + * maxNumberOfDates. + * + * With clear: true option, the method can be used to clear the selection + * and to replace the selection instead of toggling in multidate mode. + * If the option is passed with no date arguments or an empty dates array, + * it works as "clear" (clear the selection then set nothing), and if the + * option is passed with new dates to select, it works as "replace" (clear + * the selection then set the given dates) + * + * When render: false option is used, the method omits re-rendering the + * picker element. In this case, you need to call refresh() method later in + * order for the picker element to reflect the changes. The input field is + * refreshed always regardless of this option. + * + * When invalid (unparsable, repeated, disabled or out-of-range) dates are + * passed, the method ignores them and applies only valid ones. In the case + * that all the given dates are invalid, which is distinguished from passing + * no dates, the method considers it as an error and leaves the selection + * untouched. + * + * @param {...(Date|Number|String)|Array} [dates] - Date strings, Date + * objects, time values or mix of those for new selection + * @param {Object} [options] - function options + * - clear: {boolean} - Whether to clear the existing selection + * defualt: false + * - render: {boolean} - Whether to re-render the picker element + * default: true + * - autohide: {boolean} - Whether to hide the picker element after re-render + * Ignored when used with render: false + * default: config.autohide + */ + setDate(...args) { + const dates = [...args]; + const opts = {}; + const lastArg = (0,utils/* lastItemOf */.Jm)(args); + if ( + typeof lastArg === 'object' + && !Array.isArray(lastArg) + && !(lastArg instanceof Date) + && lastArg + ) { + Object.assign(opts, dates.pop()); + } + + const inputDates = Array.isArray(dates[0]) ? dates[0] : dates; + setDate(this, inputDates, opts); + } + + /** + * Update the selected date(s) with input field's value + * Not available on inline picker + * + * The input field will be refreshed with properly formatted date string. + * + * @param {Object} [options] - function options + * - autohide: {boolean} - whether to hide the picker element after refresh + * default: false + */ + update(options = undefined) { + if (this.inline) { + return; + } + + const opts = {clear: true, autohide: !!(options && options.autohide)}; + const inputDates = (0,utils/* stringToArray */.W7)(this.inputField.value, this.config.dateDelimiter); + setDate(this, inputDates, opts); + } + + /** + * Refresh the picker element and the associated input field + * @param {String} [target] - target item when refreshing one item only + * 'picker' or 'input' + * @param {Boolean} [forceRender] - whether to re-render the picker element + * regardless of its state instead of optimized refresh + */ + refresh(target = undefined, forceRender = false) { + if (target && typeof target !== 'string') { + forceRender = target; + target = undefined; + } + + let mode; + if (target === 'picker') { + mode = 2; + } else if (target === 'input') { + mode = 1; + } else { + mode = 3; + } + refreshUI(this, mode, !forceRender); + } + + /** + * Enter edit mode + * Not available on inline picker or when the picker element is hidden + */ + enterEditMode() { + if (this.inline || !this.picker.active || this.editMode) { + return; + } + this.editMode = true; + this.inputField.classList.add('in-edit', 'border-blue-700'); + } + + /** + * Exit from edit mode + * Not available on inline picker + * @param {Object} [options] - function options + * - update: {boolean} - whether to call update() after exiting + * If false, input field is revert to the existing selection + * default: false + */ + exitEditMode(options = undefined) { + if (this.inline || !this.editMode) { + return; + } + const opts = Object.assign({update: false}, options); + delete this.editMode; + this.inputField.classList.remove('in-edit', 'border-blue-700'); + if (opts.update) { + this.update(opts); + } + } +} + + +/***/ }), + +/***/ 963: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "CL": function() { return /* binding */ reFormatTokens; }, +/* harmony export */ "p6": function() { return /* binding */ formatDate; }, +/* harmony export */ "sG": function() { return /* binding */ parseDate; } +/* harmony export */ }); +/* unused harmony export reNonDateParts */ +/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(560); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(105); + + + +// pattern for format parts +const reFormatTokens = /dd?|DD?|mm?|MM?|yy?(?:yy)?/; +// pattern for non date parts +const reNonDateParts = /[\s!-/:-@[-`{-~年月日]+/; +// cache for persed formats +let knownFormats = {}; +// parse funtions for date parts +const parseFns = { + y(date, year) { + return new Date(date).setFullYear(parseInt(year, 10)); + }, + m(date, month, locale) { + const newDate = new Date(date); + let monthIndex = parseInt(month, 10) - 1; + + if (isNaN(monthIndex)) { + if (!month) { + return NaN; + } + + const monthName = month.toLowerCase(); + const compareNames = name => name.toLowerCase().startsWith(monthName); + // compare with both short and full names because some locales have periods + // in the short names (not equal to the first X letters of the full names) + monthIndex = locale.monthsShort.findIndex(compareNames); + if (monthIndex < 0) { + monthIndex = locale.months.findIndex(compareNames); + } + if (monthIndex < 0) { + return NaN; + } + } + + newDate.setMonth(monthIndex); + return newDate.getMonth() !== normalizeMonth(monthIndex) + ? newDate.setDate(0) + : newDate.getTime(); + }, + d(date, day) { + return new Date(date).setDate(parseInt(day, 10)); + }, +}; +// format functions for date parts +const formatFns = { + d(date) { + return date.getDate(); + }, + dd(date) { + return padZero(date.getDate(), 2); + }, + D(date, locale) { + return locale.daysShort[date.getDay()]; + }, + DD(date, locale) { + return locale.days[date.getDay()]; + }, + m(date) { + return date.getMonth() + 1; + }, + mm(date) { + return padZero(date.getMonth() + 1, 2); + }, + M(date, locale) { + return locale.monthsShort[date.getMonth()]; + }, + MM(date, locale) { + return locale.months[date.getMonth()]; + }, + y(date) { + return date.getFullYear(); + }, + yy(date) { + return padZero(date.getFullYear(), 2).slice(-2); + }, + yyyy(date) { + return padZero(date.getFullYear(), 4); + }, +}; + +// get month index in normal range (0 - 11) from any number +function normalizeMonth(monthIndex) { + return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12); +} + +function padZero(num, length) { + return num.toString().padStart(length, '0'); +} + +function parseFormatString(format) { + if (typeof format !== 'string') { + throw new Error("Invalid date format."); + } + if (format in knownFormats) { + return knownFormats[format]; + } + + // sprit the format string into parts and seprators + const separators = format.split(reFormatTokens); + const parts = format.match(new RegExp(reFormatTokens, 'g')); + if (separators.length === 0 || !parts) { + throw new Error("Invalid date format."); + } + + // collect format functions used in the format + const partFormatters = parts.map(token => formatFns[token]); + + // collect parse function keys used in the format + // iterate over parseFns' keys in order to keep the order of the keys. + const partParserKeys = Object.keys(parseFns).reduce((keys, key) => { + const token = parts.find(part => part[0] !== 'D' && part[0].toLowerCase() === key); + if (token) { + keys.push(key); + } + return keys; + }, []); + + return knownFormats[format] = { + parser(dateStr, locale) { + const dateParts = dateStr.split(reNonDateParts).reduce((dtParts, part, index) => { + if (part.length > 0 && parts[index]) { + const token = parts[index][0]; + if (token === 'M') { + dtParts.m = part; + } else if (token !== 'D') { + dtParts[token] = part; + } + } + return dtParts; + }, {}); + + // iterate over partParserkeys so that the parsing is made in the oder + // of year, month and day to prevent the day parser from correcting last + // day of month wrongly + return partParserKeys.reduce((origDate, key) => { + const newDate = parseFns[key](origDate, dateParts[key], locale); + // ingnore the part failed to parse + return isNaN(newDate) ? origDate : newDate; + }, (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .today */ .Lg)()); + }, + formatter(date, locale) { + let dateStr = partFormatters.reduce((str, fn, index) => { + return str += `${separators[index]}${fn(date, locale)}`; + }, ''); + // separators' length is always parts' length + 1, + return dateStr += (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .lastItemOf */ .Jm)(separators); + }, + }; +} + +function parseDate(dateStr, format, locale) { + if (dateStr instanceof Date || typeof dateStr === 'number') { + const date = (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .stripTime */ .xR)(dateStr); + return isNaN(date) ? undefined : date; + } + if (!dateStr) { + return undefined; + } + if (dateStr === 'today') { + return (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .today */ .Lg)(); + } + + if (format && format.toValue) { + const date = format.toValue(dateStr, format, locale); + return isNaN(date) ? undefined : (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .stripTime */ .xR)(date); + } + + return parseFormatString(format).parser(dateStr, locale); +} + +function formatDate(date, format, locale) { + if (isNaN(date) || (!date && date !== 0)) { + return ''; + } + + const dateObj = typeof date === 'number' ? new Date(date) : date; + + if (format.toDisplay) { + return format.toDisplay(dateObj, format, locale); + } + + return parseFormatString(format).formatter(dateObj, locale); +} + + +/***/ }), + +/***/ 560: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Bc": function() { return /* binding */ addYears; }, +/* harmony export */ "E4": function() { return /* binding */ addDays; }, +/* harmony export */ "Lg": function() { return /* binding */ today; }, +/* harmony export */ "Qk": function() { return /* binding */ getWeek; }, +/* harmony export */ "ak": function() { return /* binding */ startOfYearPeriod; }, +/* harmony export */ "by": function() { return /* binding */ dateValue; }, +/* harmony export */ "fr": function() { return /* binding */ dayOfTheWeekOf; }, +/* harmony export */ "jh": function() { return /* binding */ addWeeks; }, +/* harmony export */ "xR": function() { return /* binding */ stripTime; }, +/* harmony export */ "zI": function() { return /* binding */ addMonths; } +/* harmony export */ }); +function stripTime(timeValue) { + return new Date(timeValue).setHours(0, 0, 0, 0); +} + +function today() { + return new Date().setHours(0, 0, 0, 0); +} + +// Get the time value of the start of given date or year, month and day +function dateValue(...args) { + switch (args.length) { + case 0: + return today(); + case 1: + return stripTime(args[0]); + } + + // use setFullYear() to keep 2-digit year from being mapped to 1900-1999 + const newDate = new Date(0); + newDate.setFullYear(...args); + return newDate.setHours(0, 0, 0, 0); +} + +function addDays(date, amount) { + const newDate = new Date(date); + return newDate.setDate(newDate.getDate() + amount); +} + +function addWeeks(date, amount) { + return addDays(date, amount * 7); +} + +function addMonths(date, amount) { + // If the day of the date is not in the new month, the last day of the new + // month will be returned. e.g. Jan 31 + 1 month → Feb 28 (not Mar 03) + const newDate = new Date(date); + const monthsToSet = newDate.getMonth() + amount; + let expectedMonth = monthsToSet % 12; + if (expectedMonth < 0) { + expectedMonth += 12; + } + + const time = newDate.setMonth(monthsToSet); + return newDate.getMonth() !== expectedMonth ? newDate.setDate(0) : time; +} + +function addYears(date, amount) { + // If the date is Feb 29 and the new year is not a leap year, Feb 28 of the + // new year will be returned. + const newDate = new Date(date); + const expectedMonth = newDate.getMonth(); + const time = newDate.setFullYear(newDate.getFullYear() + amount); + return expectedMonth === 1 && newDate.getMonth() === 2 ? newDate.setDate(0) : time; +} + +// Calculate the distance bettwen 2 days of the week +function dayDiff(day, from) { + return (day - from + 7) % 7; +} + +// Get the date of the specified day of the week of given base date +function dayOfTheWeekOf(baseDate, dayOfWeek, weekStart = 0) { + const baseDay = new Date(baseDate).getDay(); + return addDays(baseDate, dayDiff(dayOfWeek, weekStart) - dayDiff(baseDay, weekStart)); +} + +// Get the ISO week of a date +function getWeek(date) { + // start of ISO week is Monday + const thuOfTheWeek = dayOfTheWeekOf(date, 4, 1); + // 1st week == the week where the 4th of January is in + const firstThu = dayOfTheWeekOf(new Date(thuOfTheWeek).setMonth(0, 4), 4, 1); + return Math.round((thuOfTheWeek - firstThu) / 604800000) + 1; +} + +// Get the start year of the period of years that includes given date +// years: length of the year period +function startOfYearPeriod(date, years) { + /* @see https://en.wikipedia.org/wiki/Year_zero#ISO_8601 */ + const year = new Date(date).getFullYear(); + return Math.floor(year / years) * years; +} + + +/***/ }), + +/***/ 698: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "He": function() { return /* binding */ findElementInEventPath; }, +/* harmony export */ "cF": function() { return /* binding */ registerListeners; }, +/* harmony export */ "uV": function() { return /* binding */ unregisterListeners; } +/* harmony export */ }); +const listenerRegistry = new WeakMap(); +const {addEventListener, removeEventListener} = EventTarget.prototype; + +// Register event listeners to a key object +// listeners: array of listener definitions; +// - each definition must be a flat array of event target and the arguments +// used to call addEventListener() on the target +function registerListeners(keyObj, listeners) { + let registered = listenerRegistry.get(keyObj); + if (!registered) { + registered = []; + listenerRegistry.set(keyObj, registered); + } + listeners.forEach((listener) => { + addEventListener.call(...listener); + registered.push(listener); + }); +} + +function unregisterListeners(keyObj) { + let listeners = listenerRegistry.get(keyObj); + if (!listeners) { + return; + } + listeners.forEach((listener) => { + removeEventListener.call(...listener); + }); + listenerRegistry.delete(keyObj); +} + +// Event.composedPath() polyfill for Edge +// based on https://gist.github.com/kleinfreund/e9787d73776c0e3750dcfcdc89f100ec +if (!Event.prototype.composedPath) { + const getComposedPath = (node, path = []) => { + path.push(node); + + let parent; + if (node.parentNode) { + parent = node.parentNode; + } else if (node.host) { // ShadowRoot + parent = node.host; + } else if (node.defaultView) { // Document + parent = node.defaultView; + } + return parent ? getComposedPath(parent, path) : path; + }; + + Event.prototype.composedPath = function () { + return getComposedPath(this.target); + }; +} + +function findFromPath(path, criteria, currentTarget, index = 0) { + const el = path[index]; + if (criteria(el)) { + return el; + } else if (el === currentTarget || !el.parentElement) { + // stop when reaching currentTarget or + return; + } + return findFromPath(path, criteria, currentTarget, index + 1); +} + +// Search for the actual target of a delegated event +function findElementInEventPath(ev, selector) { + const criteria = typeof selector === 'function' ? selector : el => el.matches(selector); + return findFromPath(ev.composedPath(), criteria, ev.currentTarget); +} + + +/***/ }), + +/***/ 105: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "$C": function() { return /* binding */ pushUnique; }, +/* harmony export */ "Jm": function() { return /* binding */ lastItemOf; }, +/* harmony export */ "W7": function() { return /* binding */ stringToArray; }, +/* harmony export */ "em": function() { return /* binding */ createTagRepeat; }, +/* harmony export */ "jG": function() { return /* binding */ limitToRange; }, +/* harmony export */ "l$": function() { return /* binding */ hasProperty; }, +/* harmony export */ "mh": function() { return /* binding */ isInRange; }, +/* harmony export */ "zh": function() { return /* binding */ optimizeTemplateHTML; } +/* harmony export */ }); +function hasProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +function lastItemOf(arr) { + return arr[arr.length - 1]; +} + +// push only the items not included in the array +function pushUnique(arr, ...items) { + items.forEach((item) => { + if (arr.includes(item)) { + return; + } + arr.push(item); + }); + return arr; +} + +function stringToArray(str, separator) { + // convert empty string to an empty array + return str ? str.split(separator) : []; +} + +function isInRange(testVal, min, max) { + const minOK = min === undefined || testVal >= min; + const maxOK = max === undefined || testVal <= max; + return minOK && maxOK; +} + +function limitToRange(val, min, max) { + if (val < min) { + return min; + } + if (val > max) { + return max; + } + return val; +} + +function createTagRepeat(tagName, repeat, attributes = {}, index = 0, html = '') { + const openTagSrc = Object.keys(attributes).reduce((src, attr) => { + let val = attributes[attr]; + if (typeof val === 'function') { + val = val(index); + } + return `${src} ${attr}="${val}"`; + }, tagName); + html += `<${openTagSrc}>`; + + const next = index + 1; + return next < repeat + ? createTagRepeat(tagName, repeat, attributes, next, html) + : html; +} + +// Remove the spacing surrounding tags for HTML parser not to create text nodes +// before/after elements +function optimizeTemplateHTML(html) { + return html.replace(/>\s+/g, '>').replace(/\s+ the end, swap them\n if (changedSide === 0 && changedDate > otherDate) {\n datepickers[0].setDate(otherDate, setDateOptions);\n datepickers[1].setDate(changedDate, setDateOptions);\n } else if (changedSide === 1 && changedDate < otherDate) {\n datepickers[0].setDate(changedDate, setDateOptions);\n datepickers[1].setDate(otherDate, setDateOptions);\n }\n } else if (!rangepicker.allowOneSidedRange) {\n // to prevent the range from becoming one-sided, copy changed side's\n // selection (no matter if it's empty) to the other side\n if (changedDate !== undefined || otherDate !== undefined) {\n setDateOptions.clear = true;\n datepickers[otherSide].setDate(datepickers[changedSide].dates, setDateOptions);\n }\n }\n datepickers[0].picker.update().render();\n datepickers[1].picker.update().render();\n delete rangepicker._updating;\n}\n\n/**\n * Class representing a date range picker\n */\nexport default class DateRangePicker {\n /**\n * Create a date range picker\n * @param {Element} element - element to bind a date range picker\n * @param {Object} [options] - config options\n */\n constructor(element, options = {}) {\n const inputs = Array.isArray(options.inputs)\n ? options.inputs\n : Array.from(element.querySelectorAll('input'));\n if (inputs.length < 2) {\n return;\n }\n\n element.rangepicker = this;\n this.element = element;\n this.inputs = inputs.slice(0, 2);\n this.allowOneSidedRange = !!options.allowOneSidedRange;\n\n const changeDateListener = onChangeDate.bind(null, this);\n const cleanOptions = filterOptions(options);\n // in order for initial date setup to work right when pcicLvel > 0,\n // let Datepicker constructor add the instance to the rangepicker\n const datepickers = [];\n Object.defineProperty(this, 'datepickers', {\n get() {\n return datepickers;\n },\n });\n setupDatepicker(this, changeDateListener, this.inputs[0], cleanOptions);\n setupDatepicker(this, changeDateListener, this.inputs[1], cleanOptions);\n Object.freeze(datepickers);\n // normalize the range if inital dates are given\n if (datepickers[0].dates.length > 0) {\n onChangeDate(this, {target: this.inputs[0]});\n } else if (datepickers[1].dates.length > 0) {\n onChangeDate(this, {target: this.inputs[1]});\n }\n }\n\n /**\n * @type {Array} - selected date of the linked date pickers\n */\n get dates() {\n return this.datepickers.length === 2\n ? [\n this.datepickers[0].dates[0],\n this.datepickers[1].dates[0],\n ]\n : undefined;\n }\n\n /**\n * Set new values to the config options\n * @param {Object} options - config options to update\n */\n setOptions(options) {\n this.allowOneSidedRange = !!options.allowOneSidedRange;\n\n const cleanOptions = filterOptions(options);\n this.datepickers[0].setOptions(cleanOptions);\n this.datepickers[1].setOptions(cleanOptions);\n }\n\n /**\n * Destroy the DateRangePicker instance\n * @return {DateRangePicker} - the instance destroyed\n */\n destroy() {\n this.datepickers[0].destroy();\n this.datepickers[1].destroy();\n unregisterListeners(this);\n delete this.element.rangepicker;\n }\n\n /**\n * Get the start and end dates of the date range\n *\n * The method returns Date objects by default. If format string is passed,\n * it returns date strings formatted in given format.\n * The result array always contains 2 items (start date/end date) and\n * undefined is used for unselected side. (e.g. If none is selected,\n * the result will be [undefined, undefined]. If only the end date is set\n * when allowOneSidedRange config option is true, [undefined, endDate] will\n * be returned.)\n *\n * @param {String} [format] - Format string to stringify the dates\n * @return {Array} - Start and end dates\n */\n getDates(format = undefined) {\n const callback = format\n ? date => formatDate(date, format, this.datepickers[0].config.locale)\n : date => new Date(date);\n\n return this.dates.map(date => date === undefined ? date : callback(date));\n }\n\n /**\n * Set the start and end dates of the date range\n *\n * The method calls datepicker.setDate() internally using each of the\n * arguments in start→end order.\n *\n * When a clear: true option object is passed instead of a date, the method\n * clears the date.\n *\n * If an invalid date, the same date as the current one or an option object\n * without clear: true is passed, the method considers that argument as an\n * \"ineffective\" argument because calling datepicker.setDate() with those\n * values makes no changes to the date selection.\n *\n * When the allowOneSidedRange config option is false, passing {clear: true}\n * to clear the range works only when it is done to the last effective\n * argument (in other words, passed to rangeEnd or to rangeStart along with\n * ineffective rangeEnd). This is because when the date range is changed,\n * it gets normalized based on the last change at the end of the changing\n * process.\n *\n * @param {Date|Number|String|Object} rangeStart - Start date of the range\n * or {clear: true} to clear the date\n * @param {Date|Number|String|Object} rangeEnd - End date of the range\n * or {clear: true} to clear the date\n */\n setDates(rangeStart, rangeEnd) {\n const [datepicker0, datepicker1] = this.datepickers;\n const origDates = this.dates;\n\n // If range normalization runs on every change, we can't set a new range\n // that starts after the end of the current range correctly because the\n // normalization process swaps start↔︎end right after setting the new start\n // date. To prevent this, the normalization process needs to run once after\n // both of the new dates are set.\n this._updating = true;\n datepicker0.setDate(rangeStart);\n datepicker1.setDate(rangeEnd);\n delete this._updating;\n\n if (datepicker1.dates[0] !== origDates[1]) {\n onChangeDate(this, {target: this.inputs[1]});\n } else if (datepicker0.dates[0] !== origDates[0]) {\n onChangeDate(this, {target: this.inputs[0]});\n }\n }\n}\n","// default locales\nexport const locales = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM y\"\n }\n};\n","// config options updatable by setOptions() and their default values\nconst defaultOptions = {\n autohide: false,\n beforeShowDay: null,\n beforeShowDecade: null,\n beforeShowMonth: null,\n beforeShowYear: null,\n calendarWeeks: false,\n clearBtn: false,\n dateDelimiter: ',',\n datesDisabled: [],\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n defaultViewDate: undefined, // placeholder, defaults to today() by the program\n disableTouchKeyboard: false,\n format: 'mm/dd/yyyy',\n language: 'en',\n maxDate: null,\n maxNumberOfDates: 1,\n maxView: 3,\n minDate: null,\n nextArrow: '',\n orientation: 'auto',\n pickLevel: 0,\n prevArrow: '',\n showDaysOfWeek: true,\n showOnClick: true,\n showOnFocus: true,\n startView: 0,\n title: '',\n todayBtn: false,\n todayBtnMode: 0,\n todayHighlight: false,\n updateOnBlur: true,\n weekStart: 0,\n};\n\nexport default defaultOptions;\n","const range = document.createRange();\n\nexport function parseHTML(html) {\n return range.createContextualFragment(html);\n}\n\n// equivalent to jQuery's :visble\nexport function isVisible(el) {\n return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n}\n\nexport function hideElement(el) {\n if (el.style.display === 'none') {\n return;\n }\n // back up the existing display setting in data-style-display\n if (el.style.display) {\n el.dataset.styleDisplay = el.style.display;\n }\n el.style.display = 'none';\n}\n\nexport function showElement(el) {\n if (el.style.display !== 'none') {\n return;\n }\n if (el.dataset.styleDisplay) {\n // restore backed-up dispay property\n el.style.display = el.dataset.styleDisplay;\n delete el.dataset.styleDisplay;\n } else {\n el.style.display = '';\n }\n}\n\nexport function emptyChildNodes(el) {\n if (el.firstChild) {\n el.removeChild(el.firstChild);\n emptyChildNodes(el);\n }\n}\n\nexport function replaceChildNodes(el, newChildNodes) {\n emptyChildNodes(el);\n if (newChildNodes instanceof DocumentFragment) {\n el.appendChild(newChildNodes);\n } else if (typeof newChildNodes === 'string') {\n el.appendChild(parseHTML(newChildNodes));\n } else if (typeof newChildNodes.forEach === 'function') {\n newChildNodes.forEach((node) => {\n el.appendChild(node);\n });\n }\n}\n","import {hasProperty, pushUnique} from '../lib/utils.js';\nimport {dateValue} from '../lib/date.js';\nimport {reFormatTokens, parseDate} from '../lib/date-format.js';\nimport {parseHTML} from '../lib/dom.js';\nimport defaultOptions from './defaultOptions.js';\n\nconst {\n language: defaultLang,\n format: defaultFormat,\n weekStart: defaultWeekStart,\n} = defaultOptions;\n\n// Reducer function to filter out invalid day-of-week from the input\nfunction sanitizeDOW(dow, day) {\n return dow.length < 6 && day >= 0 && day < 7\n ? pushUnique(dow, day)\n : dow;\n}\n\nfunction calcEndOfWeek(startOfWeek) {\n return (startOfWeek + 6) % 7;\n}\n\n// validate input date. if invalid, fallback to the original value\nfunction validateDate(value, format, locale, origValue) {\n const date = parseDate(value, format, locale);\n return date !== undefined ? date : origValue;\n}\n\n// Validate viewId. if invalid, fallback to the original value\nfunction validateViewId(value, origValue, max = 3) {\n const viewId = parseInt(value, 10);\n return viewId >= 0 && viewId <= max ? viewId : origValue;\n}\n\n// Create Datepicker configuration to set\nexport default function processOptions(options, datepicker) {\n const inOpts = Object.assign({}, options);\n const config = {};\n const locales = datepicker.constructor.locales;\n let {\n format,\n language,\n locale,\n maxDate,\n maxView,\n minDate,\n pickLevel,\n startView,\n weekStart,\n } = datepicker.config || {};\n\n if (inOpts.language) {\n let lang;\n if (inOpts.language !== language) {\n if (locales[inOpts.language]) {\n lang = inOpts.language;\n } else {\n // Check if langauge + region tag can fallback to the one without\n // region (e.g. fr-CA → fr)\n lang = inOpts.language.split('-')[0];\n if (locales[lang] === undefined) {\n lang = false;\n }\n }\n }\n delete inOpts.language;\n if (lang) {\n language = config.language = lang;\n\n // update locale as well when updating language\n const origLocale = locale || locales[defaultLang];\n // use default language's properties for the fallback\n locale = Object.assign({\n format: defaultFormat,\n weekStart: defaultWeekStart\n }, locales[defaultLang]);\n if (language !== defaultLang) {\n Object.assign(locale, locales[language]);\n }\n config.locale = locale;\n // if format and/or weekStart are the same as old locale's defaults,\n // update them to new locale's defaults\n if (format === origLocale.format) {\n format = config.format = locale.format;\n }\n if (weekStart === origLocale.weekStart) {\n weekStart = config.weekStart = locale.weekStart;\n config.weekEnd = calcEndOfWeek(locale.weekStart);\n }\n }\n }\n\n if (inOpts.format) {\n const hasToDisplay = typeof inOpts.format.toDisplay === 'function';\n const hasToValue = typeof inOpts.format.toValue === 'function';\n const validFormatString = reFormatTokens.test(inOpts.format);\n if ((hasToDisplay && hasToValue) || validFormatString) {\n format = config.format = inOpts.format;\n }\n delete inOpts.format;\n }\n\n //*** dates ***//\n // while min and maxDate for \"no limit\" in the options are better to be null\n // (especially when updating), the ones in the config have to be undefined\n // because null is treated as 0 (= unix epoch) when comparing with time value\n let minDt = minDate;\n let maxDt = maxDate;\n if (inOpts.minDate !== undefined) {\n minDt = inOpts.minDate === null\n ? dateValue(0, 0, 1) // set 0000-01-01 to prevent negative values for year\n : validateDate(inOpts.minDate, format, locale, minDt);\n delete inOpts.minDate;\n }\n if (inOpts.maxDate !== undefined) {\n maxDt = inOpts.maxDate === null\n ? undefined\n : validateDate(inOpts.maxDate, format, locale, maxDt);\n delete inOpts.maxDate;\n }\n if (maxDt < minDt) {\n minDate = config.minDate = maxDt;\n maxDate = config.maxDate = minDt;\n } else {\n if (minDate !== minDt) {\n minDate = config.minDate = minDt;\n }\n if (maxDate !== maxDt) {\n maxDate = config.maxDate = maxDt;\n }\n }\n\n if (inOpts.datesDisabled) {\n config.datesDisabled = inOpts.datesDisabled.reduce((dates, dt) => {\n const date = parseDate(dt, format, locale);\n return date !== undefined ? pushUnique(dates, date) : dates;\n }, []);\n delete inOpts.datesDisabled;\n }\n if (inOpts.defaultViewDate !== undefined) {\n const viewDate = parseDate(inOpts.defaultViewDate, format, locale);\n if (viewDate !== undefined) {\n config.defaultViewDate = viewDate;\n }\n delete inOpts.defaultViewDate;\n }\n\n //*** days of week ***//\n if (inOpts.weekStart !== undefined) {\n const wkStart = Number(inOpts.weekStart) % 7;\n if (!isNaN(wkStart)) {\n weekStart = config.weekStart = wkStart;\n config.weekEnd = calcEndOfWeek(wkStart);\n }\n delete inOpts.weekStart;\n }\n if (inOpts.daysOfWeekDisabled) {\n config.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekDisabled;\n }\n if (inOpts.daysOfWeekHighlighted) {\n config.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekHighlighted;\n }\n\n //*** multi date ***//\n if (inOpts.maxNumberOfDates !== undefined) {\n const maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10);\n if (maxNumberOfDates >= 0) {\n config.maxNumberOfDates = maxNumberOfDates;\n config.multidate = maxNumberOfDates !== 1;\n }\n delete inOpts.maxNumberOfDates;\n }\n if (inOpts.dateDelimiter) {\n config.dateDelimiter = String(inOpts.dateDelimiter);\n delete inOpts.dateDelimiter;\n }\n\n //*** pick level & view ***//\n let newPickLevel = pickLevel;\n if (inOpts.pickLevel !== undefined) {\n newPickLevel = validateViewId(inOpts.pickLevel, 2);\n delete inOpts.pickLevel;\n }\n if (newPickLevel !== pickLevel) {\n pickLevel = config.pickLevel = newPickLevel;\n }\n\n let newMaxView = maxView;\n if (inOpts.maxView !== undefined) {\n newMaxView = validateViewId(inOpts.maxView, maxView);\n delete inOpts.maxView;\n }\n // ensure max view >= pick level\n newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView;\n if (newMaxView !== maxView) {\n maxView = config.maxView = newMaxView;\n }\n\n let newStartView = startView;\n if (inOpts.startView !== undefined) {\n newStartView = validateViewId(inOpts.startView, newStartView);\n delete inOpts.startView;\n }\n // ensure pick level <= start view <= max view\n if (newStartView < pickLevel) {\n newStartView = pickLevel;\n } else if (newStartView > maxView) {\n newStartView = maxView;\n }\n if (newStartView !== startView) {\n config.startView = newStartView;\n }\n\n //*** template ***//\n if (inOpts.prevArrow) {\n const prevArrow = parseHTML(inOpts.prevArrow);\n if (prevArrow.childNodes.length > 0) {\n config.prevArrow = prevArrow.childNodes;\n }\n delete inOpts.prevArrow;\n }\n if (inOpts.nextArrow) {\n const nextArrow = parseHTML(inOpts.nextArrow);\n if (nextArrow.childNodes.length > 0) {\n config.nextArrow = nextArrow.childNodes;\n }\n delete inOpts.nextArrow;\n }\n\n //*** misc ***//\n if (inOpts.disableTouchKeyboard !== undefined) {\n config.disableTouchKeyboard = 'ontouchstart' in document && !!inOpts.disableTouchKeyboard;\n delete inOpts.disableTouchKeyboard;\n }\n if (inOpts.orientation) {\n const orientation = inOpts.orientation.toLowerCase().split(/\\s+/g);\n config.orientation = {\n x: orientation.find(x => (x === 'left' || x === 'right')) || 'auto',\n y: orientation.find(y => (y === 'top' || y === 'bottom')) || 'auto',\n };\n delete inOpts.orientation;\n }\n if (inOpts.todayBtnMode !== undefined) {\n switch(inOpts.todayBtnMode) {\n case 0:\n case 1:\n config.todayBtnMode = inOpts.todayBtnMode;\n }\n delete inOpts.todayBtnMode;\n }\n\n //*** copy the rest ***//\n Object.keys(inOpts).forEach((key) => {\n if (inOpts[key] !== undefined && hasProperty(defaultOptions, key)) {\n config[key] = inOpts[key];\n }\n });\n\n return config;\n}\n","import {optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst pickerTemplate = optimizeTemplateHTML(`
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
`);\n\nexport default pickerTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst daysTemplate = optimizeTemplateHTML(`
\n
${createTagRepeat('span', 7, {class: 'dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
\n
${createTagRepeat('span', 42 , {class: 'block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400'})}
\n
`);\n\nexport default daysTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst calendarWeeksTemplate = optimizeTemplateHTML(`
\n
\n
${createTagRepeat('span', 6, {class: 'week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
\n
`);\n\nexport default calendarWeeksTemplate;\n","import {pushUnique} from '../../lib/utils.js';\nimport {parseHTML, replaceChildNodes} from '../../lib/dom.js';\n\n// Base class of the view classes\nexport default class View {\n constructor(picker, config) {\n Object.assign(this, config, {\n picker,\n element: parseHTML(`
`).firstChild,\n selected: [],\n });\n this.init(this.picker.datepicker.config);\n }\n\n init(options) {\n if (options.pickLevel !== undefined) {\n this.isMinView = this.id === options.pickLevel;\n }\n this.setOptions(options);\n this.updateFocus();\n this.updateSelection();\n }\n\n // Execute beforeShow() callback and apply the result to the element\n // args:\n // - current - current value on the iteration on view rendering\n // - timeValue - time value of the date to pass to beforeShow()\n performBeforeHook(el, current, timeValue) {\n let result = this.beforeShow(new Date(timeValue));\n switch (typeof result) {\n case 'boolean':\n result = {enabled: result};\n break;\n case 'string':\n result = {classes: result};\n }\n\n if (result) {\n if (result.enabled === false) {\n el.classList.add('disabled');\n pushUnique(this.disabled, current);\n }\n if (result.classes) {\n const extraClasses = result.classes.split(/\\s+/);\n el.classList.add(...extraClasses);\n if (extraClasses.includes('disabled')) {\n pushUnique(this.disabled, current);\n }\n }\n if (result.content) {\n replaceChildNodes(el, result.content);\n }\n }\n }\n}\n","import {hasProperty, pushUnique} from '../../lib/utils.js';\nimport {today, dateValue, addDays, addWeeks, dayOfTheWeekOf, getWeek} from '../../lib/date.js';\nimport {formatDate} from '../../lib/date-format.js';\nimport {parseHTML, showElement, hideElement} from '../../lib/dom.js';\nimport daysTemplate from '../templates/daysTemplate.js';\nimport calendarWeeksTemplate from '../templates/calendarWeeksTemplate.js';\nimport View from './View.js';\n\nexport default class DaysView extends View {\n constructor(picker) {\n super(picker, {\n id: 0,\n name: 'days',\n cellClass: 'day',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n const inner = parseHTML(daysTemplate).firstChild;\n this.dow = inner.firstChild;\n this.grid = inner.lastChild;\n this.element.appendChild(inner);\n }\n super.init(options);\n }\n\n setOptions(options) {\n let updateDOW;\n\n if (hasProperty(options, 'minDate')) {\n this.minDate = options.minDate;\n }\n if (hasProperty(options, 'maxDate')) {\n this.maxDate = options.maxDate;\n }\n if (options.datesDisabled) {\n this.datesDisabled = options.datesDisabled;\n }\n if (options.daysOfWeekDisabled) {\n this.daysOfWeekDisabled = options.daysOfWeekDisabled;\n updateDOW = true;\n }\n if (options.daysOfWeekHighlighted) {\n this.daysOfWeekHighlighted = options.daysOfWeekHighlighted;\n }\n if (options.todayHighlight !== undefined) {\n this.todayHighlight = options.todayHighlight;\n }\n if (options.weekStart !== undefined) {\n this.weekStart = options.weekStart;\n this.weekEnd = options.weekEnd;\n updateDOW = true;\n }\n if (options.locale) {\n const locale = this.locale = options.locale;\n this.dayNames = locale.daysMin;\n this.switchLabelFormat = locale.titleFormat;\n updateDOW = true;\n }\n if (options.beforeShowDay !== undefined) {\n this.beforeShow = typeof options.beforeShowDay === 'function'\n ? options.beforeShowDay\n : undefined;\n }\n\n if (options.calendarWeeks !== undefined) {\n if (options.calendarWeeks && !this.calendarWeeks) {\n const weeksElem = parseHTML(calendarWeeksTemplate).firstChild;\n this.calendarWeeks = {\n element: weeksElem,\n dow: weeksElem.firstChild,\n weeks: weeksElem.lastChild,\n };\n this.element.insertBefore(weeksElem, this.element.firstChild);\n } else if (this.calendarWeeks && !options.calendarWeeks) {\n this.element.removeChild(this.calendarWeeks.element);\n this.calendarWeeks = null;\n }\n }\n if (options.showDaysOfWeek !== undefined) {\n if (options.showDaysOfWeek) {\n showElement(this.dow);\n if (this.calendarWeeks) {\n showElement(this.calendarWeeks.dow);\n }\n } else {\n hideElement(this.dow);\n if (this.calendarWeeks) {\n hideElement(this.calendarWeeks.dow);\n }\n }\n }\n\n // update days-of-week when locale, daysOfweekDisabled or weekStart is changed\n if (updateDOW) {\n Array.from(this.dow.children).forEach((el, index) => {\n const dow = (this.weekStart + index) % 7;\n el.textContent = this.dayNames[dow];\n el.className = this.daysOfWeekDisabled.includes(dow) ? 'dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed' : 'dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400';\n });\n }\n }\n\n // Apply update on the focused date to view's settings\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = dateValue(viewYear, viewMonth, 1);\n const start = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);\n\n this.first = firstOfMonth;\n this.last = dateValue(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }\n\n // Apply update on the selected dates to view's settings\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }\n\n // Update the entire view UI\n render() {\n // update today marker on ever render\n this.today = this.todayHighlight ? today() : undefined;\n // refresh disabled dates on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [...this.datesDisabled];\n\n const switchLabel = formatDate(this.focused, this.switchLabelFormat, this.locale);\n this.picker.setViewSwitchLabel(switchLabel);\n this.picker.setPrevBtnDisabled(this.first <= this.minDate);\n this.picker.setNextBtnDisabled(this.last >= this.maxDate);\n\n if (this.calendarWeeks) {\n // start of the UTC week (Monday) of the 1st of the month\n const startOfWeek = dayOfTheWeekOf(this.first, 1, 1);\n Array.from(this.calendarWeeks.weeks.children).forEach((el, index) => {\n el.textContent = getWeek(addWeeks(startOfWeek, index));\n });\n }\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = addDays(this.start, index);\n const date = new Date(current);\n const day = date.getDay();\n\n el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`;\n el.dataset.date = current;\n el.textContent = date.getDate();\n\n if (current < this.first) {\n classList.add('prev', 'text-gray-500', 'dark:text-white');\n } else if (current > this.last) {\n classList.add('next', 'text-gray-500', 'dark:text-white');\n }\n if (this.today === current) {\n classList.add('today', 'bg-gray-100', 'dark:bg-gray-600');\n }\n if (current < this.minDate || current > this.maxDate || this.disabled.includes(current)) {\n classList.add('disabled', 'cursor-not-allowed');\n }\n if (this.daysOfWeekDisabled.includes(day)) {\n classList.add('disabled', 'cursor-not-allowed');\n pushUnique(this.disabled, current);\n }\n if (this.daysOfWeekHighlighted.includes(day)) {\n classList.add('highlighted');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range', 'bg-gray-200', 'dark:bg-gray-600');\n classList.remove('rounded-lg', 'rounded-l-lg', 'rounded-r-lg')\n }\n if (current === rangeStart) {\n classList.add('range-start', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-l-lg');\n classList.remove('rounded-lg', 'rounded-r-lg');\n }\n if (current === rangeEnd) {\n classList.add('range-end', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-r-lg');\n classList.remove('rounded-lg', 'rounded-l-lg');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'text-gray-500', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'dark:bg-gray-600', 'bg-gray-100', 'bg-gray-200');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, current);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused');\n el.classList.add('text-gray-900', 'rounded-lg', 'dark:text-white');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.dataset.date);\n const classList = el.classList;\n classList.remove('bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg', 'rounded-r-lg')\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range', 'bg-gray-200', 'dark:bg-gray-600');\n classList.remove('rounded-lg');\n }\n if (current === rangeStart) {\n classList.add('range-start', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg');\n classList.remove('rounded-lg', 'rounded-r-lg');\n }\n if (current === rangeEnd) {\n classList.add('range-end', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-r-lg');\n classList.remove('rounded-lg', 'rounded-l-lg');\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'bg-gray-100', 'bg-gray-200', 'dark:bg-gray-600');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / 86400000);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction computeMonthRange(range, thisYear) {\n if (!range || !range[0] || !range[1]) {\n return;\n }\n\n const [[startY, startM], [endY, endM]] = range;\n if (startY > thisYear || endY < thisYear) {\n return;\n }\n return [\n startY === thisYear ? startM : -1,\n endY === thisYear ? endM : 12,\n ];\n}\n\nexport default class MonthsView extends View {\n constructor(picker) {\n super(picker, {\n id: 1,\n name: 'months',\n cellClass: 'month',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.grid = this.element;\n this.element.classList.add('months', 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12, {'data-month': ix => ix})));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (options.locale) {\n this.monthNames = options.locale.monthsShort;\n }\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minMonth = this.minDate = undefined;\n } else {\n const minDateObj = new Date(options.minDate);\n this.minYear = minDateObj.getFullYear();\n this.minMonth = minDateObj.getMonth();\n this.minDate = minDateObj.setDate(1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxMonth = this.maxDate = undefined;\n } else {\n const maxDateObj = new Date(options.maxDate);\n this.maxYear = maxDateObj.getFullYear();\n this.maxMonth = maxDateObj.getMonth();\n this.maxDate = dateValue(this.maxYear, this.maxMonth + 1, 0);\n }\n }\n if (options.beforeShowMonth !== undefined) {\n this.beforeShow = typeof options.beforeShowMonth === 'function'\n ? options.beforeShowMonth\n : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((selected, timeValue) => {\n const date = new Date(timeValue);\n const year = date.getFullYear();\n const month = date.getMonth();\n if (selected[year] === undefined) {\n selected[year] = [month];\n } else {\n pushUnique(selected[year], month);\n }\n return selected;\n }, {});\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n const date = new Date(timeValue);\n return isNaN(date) ? undefined : [date.getFullYear(), date.getMonth()];\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled months on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(this.year);\n this.picker.setPrevBtnDisabled(this.year <= this.minYear);\n this.picker.setNextBtnDisabled(this.year >= this.maxYear);\n\n const selected = this.selected[this.year] || [];\n const yrOutOfRange = this.year < this.minYear || this.year > this.maxYear;\n const isMinYear = this.year === this.minYear;\n const isMaxYear = this.year === this.maxYear;\n const range = computeMonthRange(this.range, this.year);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const date = dateValue(this.year, index, 1);\n\n el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n // reset text on every render to clear the custom content set\n // by beforeShow hook at previous render\n el.textContent = this.monthNames[index];\n\n if (\n yrOutOfRange\n || isMinYear && index < this.minMonth\n || isMaxYear && index > this.maxMonth\n ) {\n classList.add('disabled');\n }\n if (range) {\n const [rangeStart, rangeEnd] = range;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (selected.includes(index)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, index, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const selected = this.selected[this.year] || [];\n const [rangeStart, rangeEnd] = computeMonthRange(this.range, this.year) || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'dark:bg-blue-600', 'dark:text-white', 'text-white', 'focused');\n el.classList.add('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n });\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n if (selected.includes(index)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }\n}","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue, startOfYearPeriod} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction toTitleCase(word) {\n return [...word].reduce((str, ch, ix) => str += ix ? ch : ch.toUpperCase(), '');\n}\n\n// Class representing the years and decades view elements\nexport default class YearsView extends View {\n constructor(picker, config) {\n super(picker, config);\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.navStep = this.step * 10;\n this.beforeShowOption = `beforeShow${toTitleCase(this.cellClass)}`;\n this.grid = this.element;\n this.element.classList.add(this.name, 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12)));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minDate = undefined;\n } else {\n this.minYear = startOfYearPeriod(options.minDate, this.step);\n this.minDate = dateValue(this.minYear, 0, 1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxDate = undefined;\n } else {\n this.maxYear = startOfYearPeriod(options.maxDate, this.step);\n this.maxDate = dateValue(this.maxYear, 11, 31);\n }\n }\n if (options[this.beforeShowOption] !== undefined) {\n const beforeShow = options[this.beforeShowOption];\n this.beforeShow = typeof beforeShow === 'function' ? beforeShow : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return pushUnique(years, startOfYearPeriod(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return startOfYearPeriod(timeValue, this.step);\n }\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled years on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(`${this.first}-${this.last}`);\n this.picker.setPrevBtnDisabled(this.first <= this.minYear);\n this.picker.setNextBtnDisabled(this.last >= this.maxYear);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = this.start + (index * this.step);\n const date = dateValue(current, 0, 1);\n\n el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n el.textContent = el.dataset.year = current;\n\n if (index === 0) {\n classList.add('prev');\n } else if (index === 11) {\n classList.add('next');\n }\n if (current < this.minYear || current > this.maxYear) {\n classList.add('disabled');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.textContent);\n const classList = el.classList;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {limitToRange} from '../lib/utils.js';\nimport {addMonths, addYears} from '../lib/date.js';\n\nexport function triggerDatepickerEvent(datepicker, type) {\n const detail = {\n date: datepicker.getDate(),\n viewDate: new Date(datepicker.picker.viewDate),\n viewId: datepicker.picker.currentView.id,\n datepicker,\n };\n datepicker.element.dispatchEvent(new CustomEvent(type, {detail}));\n}\n\n// direction: -1 (to previous), 1 (to next)\nexport function goToPrevOrNext(datepicker, direction) {\n const {minDate, maxDate} = datepicker.config;\n const {currentView, viewDate} = datepicker.picker;\n let newViewDate;\n switch (currentView.id) {\n case 0:\n newViewDate = addMonths(viewDate, direction);\n break;\n case 1:\n newViewDate = addYears(viewDate, direction);\n break;\n default:\n newViewDate = addYears(viewDate, direction * currentView.navStep);\n }\n newViewDate = limitToRange(newViewDate, minDate, maxDate);\n datepicker.picker.changeFocus(newViewDate).render();\n}\n\nexport function switchView(datepicker) {\n const viewId = datepicker.picker.currentView.id;\n if (viewId === datepicker.config.maxView) {\n return;\n }\n datepicker.picker.changeView(viewId + 1).render();\n}\n\nexport function unfocus(datepicker) {\n if (datepicker.config.updateOnBlur) {\n datepicker.update({autohide: true});\n } else {\n datepicker.refresh('input');\n datepicker.hide();\n }\n}\n","import {today, addMonths, addYears} from '../lib/date.js';\nimport {findElementInEventPath} from '../lib/event.js';\nimport {goToPrevOrNext, switchView} from './functions.js';\n\nfunction goToSelectedMonthOrYear(datepicker, selection) {\n const picker = datepicker.picker;\n const viewDate = new Date(picker.viewDate);\n const viewId = picker.currentView.id;\n const newDate = viewId === 1\n ? addMonths(viewDate, selection - viewDate.getMonth())\n : addYears(viewDate, selection - viewDate.getFullYear());\n\n picker.changeFocus(newDate).changeView(viewId - 1).render();\n}\n\nexport function onClickTodayBtn(datepicker) {\n const picker = datepicker.picker;\n const currentDate = today();\n if (datepicker.config.todayBtnMode === 1) {\n if (datepicker.config.autohide) {\n datepicker.setDate(currentDate);\n return;\n }\n datepicker.setDate(currentDate, {render: false});\n picker.update();\n }\n if (picker.viewDate !== currentDate) {\n picker.changeFocus(currentDate);\n }\n picker.changeView(0).render();\n}\n\nexport function onClickClearBtn(datepicker) {\n datepicker.setDate({clear: true});\n}\n\nexport function onClickViewSwitch(datepicker) {\n switchView(datepicker);\n}\n\nexport function onClickPrevBtn(datepicker) {\n goToPrevOrNext(datepicker, -1);\n}\n\nexport function onClickNextBtn(datepicker) {\n goToPrevOrNext(datepicker, 1);\n}\n\n// For the picker's main block to delegete the events from `datepicker-cell`s\nexport function onClickView(datepicker, ev) {\n const target = findElementInEventPath(ev, '.datepicker-cell');\n if (!target || target.classList.contains('disabled')) {\n return;\n }\n\n const {id, isMinView} = datepicker.picker.currentView;\n if (isMinView) {\n datepicker.setDate(Number(target.dataset.date));\n } else if (id === 1) {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.month));\n } else {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.year));\n }\n}\n\nexport function onClickPicker(datepicker) {\n if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.focus();\n }\n}\n","import {hasProperty, lastItemOf, isInRange, limitToRange} from '../lib/utils.js';\nimport {today} from '../lib/date.js';\nimport {parseHTML, showElement, hideElement, emptyChildNodes} from '../lib/dom.js';\nimport {registerListeners} from '../lib/event.js';\nimport pickerTemplate from './templates/pickerTemplate.js';\nimport DaysView from './views/DaysView.js';\nimport MonthsView from './views/MonthsView.js';\nimport YearsView from './views/YearsView.js';\nimport {triggerDatepickerEvent} from '../events/functions.js';\nimport {\n onClickTodayBtn,\n onClickClearBtn,\n onClickViewSwitch,\n onClickPrevBtn,\n onClickNextBtn,\n onClickView,\n onClickPicker,\n} from '../events/pickerListeners.js';\n\nfunction processPickerOptions(picker, options) {\n if (options.title !== undefined) {\n if (options.title) {\n picker.controls.title.textContent = options.title;\n showElement(picker.controls.title);\n } else {\n picker.controls.title.textContent = '';\n hideElement(picker.controls.title);\n }\n }\n if (options.prevArrow) {\n const prevBtn = picker.controls.prevBtn;\n emptyChildNodes(prevBtn);\n options.prevArrow.forEach((node) => {\n prevBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.nextArrow) {\n const nextBtn = picker.controls.nextBtn;\n emptyChildNodes(nextBtn);\n options.nextArrow.forEach((node) => {\n nextBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.locale) {\n picker.controls.todayBtn.textContent = options.locale.today;\n picker.controls.clearBtn.textContent = options.locale.clear;\n }\n if (options.todayBtn !== undefined) {\n if (options.todayBtn) {\n showElement(picker.controls.todayBtn);\n } else {\n hideElement(picker.controls.todayBtn);\n }\n }\n if (hasProperty(options, 'minDate') || hasProperty(options, 'maxDate')) {\n const {minDate, maxDate} = picker.datepicker.config;\n picker.controls.todayBtn.disabled = !isInRange(today(), minDate, maxDate);\n }\n if (options.clearBtn !== undefined) {\n if (options.clearBtn) {\n showElement(picker.controls.clearBtn);\n } else {\n hideElement(picker.controls.clearBtn);\n }\n }\n}\n\n// Compute view date to reset, which will be...\n// - the last item of the selected dates or defaultViewDate if no selection\n// - limitted to minDate or maxDate if it exceeds the range\nfunction computeResetViewDate(datepicker) {\n const {dates, config} = datepicker;\n const viewDate = dates.length > 0 ? lastItemOf(dates) : config.defaultViewDate;\n return limitToRange(viewDate, config.minDate, config.maxDate);\n}\n\n// Change current view's view date\nfunction setViewDate(picker, newDate) {\n const oldViewDate = new Date(picker.viewDate);\n const newViewDate = new Date(newDate);\n const {id, year, first, last} = picker.currentView;\n const viewYear = newViewDate.getFullYear();\n\n picker.viewDate = newDate;\n if (viewYear !== oldViewDate.getFullYear()) {\n triggerDatepickerEvent(picker.datepicker, 'changeYear');\n }\n if (newViewDate.getMonth() !== oldViewDate.getMonth()) {\n triggerDatepickerEvent(picker.datepicker, 'changeMonth');\n }\n\n // return whether the new date is in different period on time from the one\n // displayed in the current view\n // when true, the view needs to be re-rendered on the next UI refresh.\n switch (id) {\n case 0:\n return newDate < first || newDate > last;\n case 1:\n return viewYear !== year;\n default:\n return viewYear < first || viewYear > last;\n }\n}\n\nfunction getTextDirection(el) {\n return window.getComputedStyle(el).direction;\n}\n\n// Class representing the picker UI\nexport default class Picker {\n constructor(datepicker) {\n this.datepicker = datepicker;\n\n const template = pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass);\n const element = this.element = parseHTML(template).firstChild;\n const [header, main, footer] = element.firstChild.children;\n const title = header.firstElementChild;\n const [prevBtn, viewSwitch, nextBtn] = header.lastElementChild.children;\n const [todayBtn, clearBtn] = footer.firstChild.children;\n const controls = {\n title,\n prevBtn,\n viewSwitch,\n nextBtn,\n todayBtn,\n clearBtn,\n };\n this.main = main;\n this.controls = controls;\n\n const elementClass = datepicker.inline ? 'inline' : 'dropdown';\n element.classList.add(`datepicker-${elementClass}`);\n elementClass === 'dropdown' ? element.classList.add('dropdown', 'absolute', 'top-0', 'left-0', 'z-50', 'pt-2') : null;\n\n processPickerOptions(this, datepicker.config);\n this.viewDate = computeResetViewDate(datepicker);\n\n // set up event listeners\n registerListeners(datepicker, [\n [element, 'click', onClickPicker.bind(null, datepicker), {capture: true}],\n [main, 'click', onClickView.bind(null, datepicker)],\n [controls.viewSwitch, 'click', onClickViewSwitch.bind(null, datepicker)],\n [controls.prevBtn, 'click', onClickPrevBtn.bind(null, datepicker)],\n [controls.nextBtn, 'click', onClickNextBtn.bind(null, datepicker)],\n [controls.todayBtn, 'click', onClickTodayBtn.bind(null, datepicker)],\n [controls.clearBtn, 'click', onClickClearBtn.bind(null, datepicker)],\n ]);\n\n // set up views\n this.views = [\n new DaysView(this),\n new MonthsView(this),\n new YearsView(this, {id: 2, name: 'years', cellClass: 'year', step: 1}),\n new YearsView(this, {id: 3, name: 'decades', cellClass: 'decade', step: 10}),\n ];\n this.currentView = this.views[datepicker.config.startView];\n\n this.currentView.render();\n this.main.appendChild(this.currentView.element);\n datepicker.config.container.appendChild(this.element);\n }\n\n setOptions(options) {\n processPickerOptions(this, options);\n this.views.forEach((view) => {\n view.init(options, false);\n });\n this.currentView.render();\n }\n\n detach() {\n this.datepicker.config.container.removeChild(this.element);\n }\n\n show() {\n if (this.active) {\n return;\n }\n this.element.classList.add('active', 'block');\n this.element.classList.remove('hidden');\n this.active = true;\n\n const datepicker = this.datepicker;\n if (!datepicker.inline) {\n // ensure picker's direction matches input's\n const inputDirection = getTextDirection(datepicker.inputField);\n if (inputDirection !== getTextDirection(datepicker.config.container)) {\n this.element.dir = inputDirection;\n } else if (this.element.dir) {\n this.element.removeAttribute('dir');\n }\n\n this.place();\n if (datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.blur();\n }\n }\n triggerDatepickerEvent(datepicker, 'show');\n }\n\n hide() {\n if (!this.active) {\n return;\n }\n this.datepicker.exitEditMode();\n this.element.classList.remove('active', 'block');\n this.element.classList.add('active', 'block', 'hidden');\n this.active = false;\n triggerDatepickerEvent(this.datepicker, 'hide');\n }\n\n place() {\n const {classList, style} = this.element;\n const {config, inputField} = this.datepicker;\n const container = config.container;\n const {\n width: calendarWidth,\n height: calendarHeight,\n } = this.element.getBoundingClientRect();\n const {\n left: containerLeft,\n top: containerTop,\n width: containerWidth,\n } = container.getBoundingClientRect();\n const {\n left: inputLeft,\n top: inputTop,\n width: inputWidth,\n height: inputHeight\n } = inputField.getBoundingClientRect();\n let {x: orientX, y: orientY} = config.orientation;\n let scrollTop;\n let left;\n let top;\n\n if (container === document.body) {\n scrollTop = window.scrollY;\n left = inputLeft + window.scrollX;\n top = inputTop + scrollTop;\n } else {\n scrollTop = container.scrollTop;\n left = inputLeft - containerLeft;\n top = inputTop - containerTop + scrollTop;\n }\n\n if (orientX === 'auto') {\n if (left < 0) {\n // align to the left and move into visible area if input's left edge < window's\n orientX = 'left';\n left = 10;\n } else if (left + calendarWidth > containerWidth) {\n // align to the right if canlendar's right edge > container's\n orientX = 'right';\n } else {\n orientX = getTextDirection(inputField) === 'rtl' ? 'right' : 'left';\n }\n }\n if (orientX === 'right') {\n left -= calendarWidth - inputWidth;\n }\n\n if (orientY === 'auto') {\n orientY = top - calendarHeight < scrollTop ? 'bottom' : 'top';\n }\n if (orientY === 'top') {\n top -= calendarHeight;\n } else {\n top += inputHeight;\n }\n\n classList.remove(\n 'datepicker-orient-top',\n 'datepicker-orient-bottom',\n 'datepicker-orient-right',\n 'datepicker-orient-left'\n );\n classList.add(`datepicker-orient-${orientY}`, `datepicker-orient-${orientX}`);\n\n style.top = top ? `${top}px` : top;\n style.left = left ? `${left}px` : left;\n }\n\n setViewSwitchLabel(labelText) {\n this.controls.viewSwitch.textContent = labelText;\n }\n\n setPrevBtnDisabled(disabled) {\n this.controls.prevBtn.disabled = disabled;\n }\n\n setNextBtnDisabled(disabled) {\n this.controls.nextBtn.disabled = disabled;\n }\n\n changeView(viewId) {\n const oldView = this.currentView;\n const newView = this.views[viewId];\n if (newView.id !== oldView.id) {\n this.currentView = newView;\n this._renderMethod = 'render';\n triggerDatepickerEvent(this.datepicker, 'changeView');\n this.main.replaceChild(newView.element, oldView.element);\n }\n return this;\n }\n\n // Change the focused date (view date)\n changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }\n\n // Apply the change of the selected dates\n update() {\n const newViewDate = computeResetViewDate(this.datepicker);\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refresh';\n this.views.forEach((view) => {\n view.updateFocus();\n view.updateSelection();\n });\n return this;\n }\n\n // Refresh the picker UI\n render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n\n this.currentView[renderMethod]();\n }\n}\n","import {isInRange} from '../lib/utils.js';\nimport {addDays, addMonths, addYears, startOfYearPeriod} from '../lib/date.js';\nimport {goToPrevOrNext, switchView, unfocus} from './functions.js';\n\n// Find the closest date that doesn't meet the condition for unavailable date\n// Returns undefined if no available date is found\n// addFn: function to calculate the next date\n// - args: time value, amount\n// increase: amount to pass to addFn\n// testFn: function to test the unavailablity of the date\n// - args: time value; retun: true if unavailable\nfunction findNextAvailableOne(date, addFn, increase, testFn, min, max) {\n if (!isInRange(date, min, max)) {\n return;\n }\n if (testFn(date)) {\n const newDate = addFn(date, increase);\n return findNextAvailableOne(newDate, addFn, increase, testFn, min, max);\n }\n return date;\n}\n\n// direction: -1 (left/up), 1 (right/down)\n// vertical: true for up/down, false for left/right\nfunction moveByArrowKey(datepicker, ev, direction, vertical) {\n const picker = datepicker.picker;\n const currentView = picker.currentView;\n const step = currentView.step || 1;\n let viewDate = picker.viewDate;\n let addFn;\n let testFn;\n switch (currentView.id) {\n case 0:\n if (vertical) {\n viewDate = addDays(viewDate, direction * 7);\n } else if (ev.ctrlKey || ev.metaKey) {\n viewDate = addYears(viewDate, direction);\n } else {\n viewDate = addDays(viewDate, direction);\n }\n addFn = addDays;\n testFn = (date) => currentView.disabled.includes(date);\n break;\n case 1:\n viewDate = addMonths(viewDate, vertical ? direction * 4 : direction);\n addFn = addMonths;\n testFn = (date) => {\n const dt = new Date(date);\n const {year, disabled} = currentView;\n return dt.getFullYear() === year && disabled.includes(dt.getMonth());\n };\n break;\n default:\n viewDate = addYears(viewDate, direction * (vertical ? 4 : 1) * step);\n addFn = addYears;\n testFn = date => currentView.disabled.includes(startOfYearPeriod(date, step));\n }\n viewDate = findNextAvailableOne(\n viewDate,\n addFn,\n direction < 0 ? -step : step,\n testFn,\n currentView.minDate,\n currentView.maxDate\n );\n if (viewDate !== undefined) {\n picker.changeFocus(viewDate).render();\n }\n}\n\nexport function onKeydown(datepicker, ev) {\n if (ev.key === 'Tab') {\n unfocus(datepicker);\n return;\n }\n\n const picker = datepicker.picker;\n const {id, isMinView} = picker.currentView;\n if (!picker.active) {\n switch (ev.key) {\n case 'ArrowDown':\n case 'Escape':\n picker.show();\n break;\n case 'Enter':\n datepicker.update();\n break;\n default:\n return;\n }\n } else if (datepicker.editMode) {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'Enter':\n datepicker.exitEditMode({update: true, autohide: datepicker.config.autohide});\n break;\n default:\n return;\n }\n } else {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'ArrowLeft':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, -1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, false);\n }\n break;\n case 'ArrowRight':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, 1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, 1, false);\n }\n break;\n case 'ArrowUp':\n if (ev.ctrlKey || ev.metaKey) {\n switchView(datepicker);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, true);\n }\n break;\n case 'ArrowDown':\n if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n return;\n }\n moveByArrowKey(datepicker, ev, 1, true);\n break;\n case 'Enter':\n if (isMinView) {\n datepicker.setDate(picker.viewDate);\n } else {\n picker.changeView(id - 1).render();\n }\n break;\n case 'Backspace':\n case 'Delete':\n datepicker.enterEditMode();\n return;\n default:\n if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n }\n return;\n }\n }\n ev.preventDefault();\n ev.stopPropagation();\n}\n\nexport function onFocus(datepicker) {\n if (datepicker.config.showOnFocus && !datepicker._showing) {\n datepicker.show();\n }\n}\n\n// for the prevention for entering edit mode while getting focus on click\nexport function onMousedown(datepicker, ev) {\n const el = ev.target;\n if (datepicker.picker.active || datepicker.config.showOnClick) {\n el._active = el === document.activeElement;\n el._clicking = setTimeout(() => {\n delete el._active;\n delete el._clicking;\n }, 2000);\n }\n}\n\nexport function onClickInput(datepicker, ev) {\n const el = ev.target;\n if (!el._clicking) {\n return;\n }\n clearTimeout(el._clicking);\n delete el._clicking;\n\n if (el._active) {\n datepicker.enterEditMode();\n }\n delete el._active;\n\n if (datepicker.config.showOnClick) {\n datepicker.show();\n }\n}\n\nexport function onPaste(datepicker, ev) {\n if (ev.clipboardData.types.includes('text/plain')) {\n datepicker.enterEditMode();\n }\n}\n","import {findElementInEventPath} from '../lib/event.js';\nimport {unfocus} from './functions.js';\n\n// for the `document` to delegate the events from outside the picker/input field\nexport function onClickOutside(datepicker, ev) {\n const element = datepicker.element;\n if (element !== document.activeElement) {\n return;\n }\n const pickerElem = datepicker.picker.element;\n if (findElementInEventPath(ev, el => el === element || el === pickerElem)) {\n return;\n }\n unfocus(datepicker);\n}\n","import {lastItemOf, stringToArray, isInRange} from './lib/utils.js';\nimport {today} from './lib/date.js';\nimport {parseDate, formatDate} from './lib/date-format.js';\nimport {registerListeners, unregisterListeners} from './lib/event.js';\nimport {locales} from './i18n/base-locales.js';\nimport defaultOptions from './options/defaultOptions.js';\nimport processOptions from './options/processOptions.js';\nimport Picker from './picker/Picker.js';\nimport {triggerDatepickerEvent} from './events/functions.js';\nimport {onKeydown, onFocus, onMousedown, onClickInput, onPaste} from './events/inputFieldListeners.js';\nimport {onClickOutside} from './events/otherListeners.js';\n\nfunction stringifyDates(dates, config) {\n return dates\n .map(dt => formatDate(dt, config.format, config.locale))\n .join(config.dateDelimiter);\n}\n\n// parse input dates and create an array of time values for selection\n// returns undefined if there are no valid dates in inputDates\n// when origDates (current selection) is passed, the function works to mix\n// the input dates into the current selection\nfunction processInputDates(datepicker, inputDates, clear = false) {\n const {config, dates: origDates, rangepicker} = datepicker;\n if (inputDates.length === 0) {\n // empty input is considered valid unless origiDates is passed\n return clear ? [] : undefined;\n }\n\n const rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1];\n let newDates = inputDates.reduce((dates, dt) => {\n let date = parseDate(dt, config.format, config.locale);\n if (date === undefined) {\n return dates;\n }\n if (config.pickLevel > 0) {\n // adjust to 1st of the month/Jan 1st of the year\n // or to the last day of the monh/Dec 31st of the year if the datepicker\n // is the range-end picker of a rangepicker\n const dt = new Date(date);\n if (config.pickLevel === 1) {\n date = rangeEnd\n ? dt.setMonth(dt.getMonth() + 1, 0)\n : dt.setDate(1);\n } else {\n date = rangeEnd\n ? dt.setFullYear(dt.getFullYear() + 1, 0, 0)\n : dt.setMonth(0, 1);\n }\n }\n if (\n isInRange(date, config.minDate, config.maxDate)\n && !dates.includes(date)\n && !config.datesDisabled.includes(date)\n && !config.daysOfWeekDisabled.includes(new Date(date).getDay())\n ) {\n dates.push(date);\n }\n return dates;\n }, []);\n if (newDates.length === 0) {\n return;\n }\n if (config.multidate && !clear) {\n // get the synmetric difference between origDates and newDates\n newDates = newDates.reduce((dates, date) => {\n if (!origDates.includes(date)) {\n dates.push(date);\n }\n return dates;\n }, origDates.filter(date => !newDates.includes(date)));\n }\n // do length check always because user can input multiple dates regardless of the mode\n return config.maxNumberOfDates && newDates.length > config.maxNumberOfDates\n ? newDates.slice(config.maxNumberOfDates * -1)\n : newDates;\n}\n\n// refresh the UI elements\n// modes: 1: input only, 2, picker only, 3 both\nfunction refreshUI(datepicker, mode = 3, quickRender = true) {\n const {config, picker, inputField} = datepicker;\n if (mode & 2) {\n const newView = picker.active ? config.pickLevel : config.startView;\n picker.update().changeView(newView).render(quickRender);\n }\n if (mode & 1 && inputField) {\n inputField.value = stringifyDates(datepicker.dates, config);\n }\n}\n\nfunction setDate(datepicker, inputDates, options) {\n let {clear, render, autohide} = options;\n if (render === undefined) {\n render = true;\n }\n if (!render) {\n autohide = false;\n } else if (autohide === undefined) {\n autohide = datepicker.config.autohide;\n }\n\n const newDates = processInputDates(datepicker, inputDates, clear);\n if (!newDates) {\n return;\n }\n if (newDates.toString() !== datepicker.dates.toString()) {\n datepicker.dates = newDates;\n refreshUI(datepicker, render ? 3 : 1);\n triggerDatepickerEvent(datepicker, 'changeDate');\n } else {\n refreshUI(datepicker, 1);\n }\n if (autohide) {\n datepicker.hide();\n }\n}\n\n/**\n * Class representing a date picker\n */\nexport default class Datepicker {\n /**\n * Create a date picker\n * @param {Element} element - element to bind a date picker\n * @param {Object} [options] - config options\n * @param {DateRangePicker} [rangepicker] - DateRangePicker instance the\n * date picker belongs to. Use this only when creating date picker as a part\n * of date range picker\n */\n constructor(element, options = {}, rangepicker = undefined) {\n element.datepicker = this;\n this.element = element;\n\n // set up config\n const config = this.config = Object.assign({\n buttonClass: (options.buttonClass && String(options.buttonClass)) || 'button',\n container: document.body,\n defaultViewDate: today(),\n maxDate: undefined,\n minDate: undefined,\n }, processOptions(defaultOptions, this));\n this._options = options;\n Object.assign(config, processOptions(options, this));\n\n // configure by type\n const inline = this.inline = element.tagName !== 'INPUT';\n let inputField;\n let initialDates;\n\n if (inline) {\n config.container = element;\n initialDates = stringToArray(element.dataset.date, config.dateDelimiter);\n delete element.dataset.date;\n } else {\n const container = options.container ? document.querySelector(options.container) : null;\n if (container) {\n config.container = container;\n }\n inputField = this.inputField = element;\n inputField.classList.add('datepicker-input');\n initialDates = stringToArray(inputField.value, config.dateDelimiter);\n }\n if (rangepicker) {\n // check validiry\n const index = rangepicker.inputs.indexOf(inputField);\n const datepickers = rangepicker.datepickers;\n if (index < 0 || index > 1 || !Array.isArray(datepickers)) {\n throw Error('Invalid rangepicker object.');\n }\n // attach itaelf to the rangepicker here so that processInputDates() can\n // determine if this is the range-end picker of the rangepicker while\n // setting inital values when pickLevel > 0\n datepickers[index] = this;\n // add getter for rangepicker\n Object.defineProperty(this, 'rangepicker', {\n get() {\n return rangepicker;\n },\n });\n }\n\n // set initial dates\n this.dates = [];\n // process initial value\n const inputDateValues = processInputDates(this, initialDates);\n if (inputDateValues && inputDateValues.length > 0) {\n this.dates = inputDateValues;\n }\n if (inputField) {\n inputField.value = stringifyDates(this.dates, config);\n }\n\n const picker = this.picker = new Picker(this);\n\n if (inline) {\n this.show();\n } else {\n // set up event listeners in other modes\n const onMousedownDocument = onClickOutside.bind(null, this);\n const listeners = [\n [inputField, 'keydown', onKeydown.bind(null, this)],\n [inputField, 'focus', onFocus.bind(null, this)],\n [inputField, 'mousedown', onMousedown.bind(null, this)],\n [inputField, 'click', onClickInput.bind(null, this)],\n [inputField, 'paste', onPaste.bind(null, this)],\n [document, 'mousedown', onMousedownDocument],\n [document, 'touchstart', onMousedownDocument],\n [window, 'resize', picker.place.bind(picker)]\n ];\n registerListeners(this, listeners);\n }\n }\n\n /**\n * Format Date object or time value in given format and language\n * @param {Date|Number} date - date or time value to format\n * @param {String|Object} format - format string or object that contains\n * toDisplay() custom formatter, whose signature is\n * - args:\n * - date: {Date} - Date instance of the date passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {String} formatted date\n * @param {String} [lang=en] - language code for the locale to use\n * @return {String} formatted date\n */\n static formatDate(date, format, lang) {\n return formatDate(date, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * Parse date string\n * @param {String|Date|Number} dateStr - date string, Date object or time\n * value to parse\n * @param {String|Object} format - format string or object that contains\n * toValue() custom parser, whose signature is\n * - args:\n * - dateStr: {String|Date|Number} - the dateStr passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {Date|Number} parsed date or its time value\n * @param {String} [lang=en] - language code for the locale to use\n * @return {Number} time value of parsed date\n */\n static parseDate(dateStr, format, lang) {\n return parseDate(dateStr, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * @type {Object} - Installed locales in `[languageCode]: localeObject` format\n * en`:_English (US)_ is pre-installed.\n */\n static get locales() {\n return locales;\n }\n\n /**\n * @type {Boolean} - Whether the picker element is shown. `true` whne shown\n */\n get active() {\n return !!(this.picker && this.picker.active);\n }\n\n /**\n * @type {HTMLDivElement} - DOM object of picker element\n */\n get pickerElement() {\n return this.picker ? this.picker.element : undefined;\n }\n\n /**\n * Set new values to the config options\n * @param {Object} options - config options to update\n */\n setOptions(options) {\n const picker = this.picker;\n const newOptions = processOptions(options, this);\n Object.assign(this._options, options);\n Object.assign(this.config, newOptions);\n picker.setOptions(newOptions);\n\n refreshUI(this, 3);\n }\n\n /**\n * Show the picker element\n */\n show() {\n if (this.inputField) {\n if (this.inputField.disabled) {\n return;\n }\n if (this.inputField !== document.activeElement) {\n this._showing = true;\n this.inputField.focus();\n delete this._showing;\n }\n }\n this.picker.show();\n }\n\n /**\n * Hide the picker element\n * Not available on inline picker\n */\n hide() {\n if (this.inline) {\n return;\n }\n this.picker.hide();\n this.picker.update().changeView(this.config.startView).render();\n }\n\n /**\n * Destroy the Datepicker instance\n * @return {Detepicker} - the instance destroyed\n */\n destroy() {\n this.hide();\n unregisterListeners(this);\n this.picker.detach();\n if (!this.inline) {\n this.inputField.classList.remove('datepicker-input');\n }\n delete this.element.datepicker;\n return this;\n }\n\n /**\n * Get the selected date(s)\n *\n * The method returns a Date object of selected date by default, and returns\n * an array of selected dates in multidate mode. If format string is passed,\n * it returns date string(s) formatted in given format.\n *\n * @param {String} [format] - Format string to stringify the date(s)\n * @return {Date|String|Date[]|String[]} - selected date(s), or if none is\n * selected, empty array in multidate mode and untitled in sigledate mode\n */\n getDate(format = undefined) {\n const callback = format\n ? date => formatDate(date, format, this.config.locale)\n : date => new Date(date);\n\n if (this.config.multidate) {\n return this.dates.map(callback);\n }\n if (this.dates.length > 0) {\n return callback(this.dates[0]);\n }\n }\n\n /**\n * Set selected date(s)\n *\n * In multidate mode, you can pass multiple dates as a series of arguments\n * or an array. (Since each date is parsed individually, the type of the\n * dates doesn't have to be the same.)\n * The given dates are used to toggle the select status of each date. The\n * number of selected dates is kept from exceeding the length set to\n * maxNumberOfDates.\n *\n * With clear: true option, the method can be used to clear the selection\n * and to replace the selection instead of toggling in multidate mode.\n * If the option is passed with no date arguments or an empty dates array,\n * it works as \"clear\" (clear the selection then set nothing), and if the\n * option is passed with new dates to select, it works as \"replace\" (clear\n * the selection then set the given dates)\n *\n * When render: false option is used, the method omits re-rendering the\n * picker element. In this case, you need to call refresh() method later in\n * order for the picker element to reflect the changes. The input field is\n * refreshed always regardless of this option.\n *\n * When invalid (unparsable, repeated, disabled or out-of-range) dates are\n * passed, the method ignores them and applies only valid ones. In the case\n * that all the given dates are invalid, which is distinguished from passing\n * no dates, the method considers it as an error and leaves the selection\n * untouched.\n *\n * @param {...(Date|Number|String)|Array} [dates] - Date strings, Date\n * objects, time values or mix of those for new selection\n * @param {Object} [options] - function options\n * - clear: {boolean} - Whether to clear the existing selection\n * defualt: false\n * - render: {boolean} - Whether to re-render the picker element\n * default: true\n * - autohide: {boolean} - Whether to hide the picker element after re-render\n * Ignored when used with render: false\n * default: config.autohide\n */\n setDate(...args) {\n const dates = [...args];\n const opts = {};\n const lastArg = lastItemOf(args);\n if (\n typeof lastArg === 'object'\n && !Array.isArray(lastArg)\n && !(lastArg instanceof Date)\n && lastArg\n ) {\n Object.assign(opts, dates.pop());\n }\n\n const inputDates = Array.isArray(dates[0]) ? dates[0] : dates;\n setDate(this, inputDates, opts);\n }\n\n /**\n * Update the selected date(s) with input field's value\n * Not available on inline picker\n *\n * The input field will be refreshed with properly formatted date string.\n *\n * @param {Object} [options] - function options\n * - autohide: {boolean} - whether to hide the picker element after refresh\n * default: false\n */\n update(options = undefined) {\n if (this.inline) {\n return;\n }\n\n const opts = {clear: true, autohide: !!(options && options.autohide)};\n const inputDates = stringToArray(this.inputField.value, this.config.dateDelimiter);\n setDate(this, inputDates, opts);\n }\n\n /**\n * Refresh the picker element and the associated input field\n * @param {String} [target] - target item when refreshing one item only\n * 'picker' or 'input'\n * @param {Boolean} [forceRender] - whether to re-render the picker element\n * regardless of its state instead of optimized refresh\n */\n refresh(target = undefined, forceRender = false) {\n if (target && typeof target !== 'string') {\n forceRender = target;\n target = undefined;\n }\n\n let mode;\n if (target === 'picker') {\n mode = 2;\n } else if (target === 'input') {\n mode = 1;\n } else {\n mode = 3;\n }\n refreshUI(this, mode, !forceRender);\n }\n\n /**\n * Enter edit mode\n * Not available on inline picker or when the picker element is hidden\n */\n enterEditMode() {\n if (this.inline || !this.picker.active || this.editMode) {\n return;\n }\n this.editMode = true;\n this.inputField.classList.add('in-edit', 'border-blue-700');\n }\n\n /**\n * Exit from edit mode\n * Not available on inline picker\n * @param {Object} [options] - function options\n * - update: {boolean} - whether to call update() after exiting\n * If false, input field is revert to the existing selection\n * default: false\n */\n exitEditMode(options = undefined) {\n if (this.inline || !this.editMode) {\n return;\n }\n const opts = Object.assign({update: false}, options);\n delete this.editMode;\n this.inputField.classList.remove('in-edit', 'border-blue-700');\n if (opts.update) {\n this.update(opts);\n }\n }\n}\n","import {stripTime, today} from './date.js';\nimport {lastItemOf} from './utils.js';\n\n// pattern for format parts\nexport const reFormatTokens = /dd?|DD?|mm?|MM?|yy?(?:yy)?/;\n// pattern for non date parts\nexport const reNonDateParts = /[\\s!-/:-@[-`{-~年月日]+/;\n// cache for persed formats\nlet knownFormats = {};\n// parse funtions for date parts\nconst parseFns = {\n y(date, year) {\n return new Date(date).setFullYear(parseInt(year, 10));\n },\n m(date, month, locale) {\n const newDate = new Date(date);\n let monthIndex = parseInt(month, 10) - 1;\n\n if (isNaN(monthIndex)) {\n if (!month) {\n return NaN;\n }\n\n const monthName = month.toLowerCase();\n const compareNames = name => name.toLowerCase().startsWith(monthName);\n // compare with both short and full names because some locales have periods\n // in the short names (not equal to the first X letters of the full names)\n monthIndex = locale.monthsShort.findIndex(compareNames);\n if (monthIndex < 0) {\n monthIndex = locale.months.findIndex(compareNames);\n }\n if (monthIndex < 0) {\n return NaN;\n }\n }\n\n newDate.setMonth(monthIndex);\n return newDate.getMonth() !== normalizeMonth(monthIndex)\n ? newDate.setDate(0)\n : newDate.getTime();\n },\n d(date, day) {\n return new Date(date).setDate(parseInt(day, 10));\n },\n};\n// format functions for date parts\nconst formatFns = {\n d(date) {\n return date.getDate();\n },\n dd(date) {\n return padZero(date.getDate(), 2);\n },\n D(date, locale) {\n return locale.daysShort[date.getDay()];\n },\n DD(date, locale) {\n return locale.days[date.getDay()];\n },\n m(date) {\n return date.getMonth() + 1;\n },\n mm(date) {\n return padZero(date.getMonth() + 1, 2);\n },\n M(date, locale) {\n return locale.monthsShort[date.getMonth()];\n },\n MM(date, locale) {\n return locale.months[date.getMonth()];\n },\n y(date) {\n return date.getFullYear();\n },\n yy(date) {\n return padZero(date.getFullYear(), 2).slice(-2);\n },\n yyyy(date) {\n return padZero(date.getFullYear(), 4);\n },\n};\n\n// get month index in normal range (0 - 11) from any number\nfunction normalizeMonth(monthIndex) {\n return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12);\n}\n\nfunction padZero(num, length) {\n return num.toString().padStart(length, '0');\n}\n\nfunction parseFormatString(format) {\n if (typeof format !== 'string') {\n throw new Error(\"Invalid date format.\");\n }\n if (format in knownFormats) {\n return knownFormats[format];\n }\n\n // sprit the format string into parts and seprators\n const separators = format.split(reFormatTokens);\n const parts = format.match(new RegExp(reFormatTokens, 'g'));\n if (separators.length === 0 || !parts) {\n throw new Error(\"Invalid date format.\");\n }\n\n // collect format functions used in the format\n const partFormatters = parts.map(token => formatFns[token]);\n\n // collect parse function keys used in the format\n // iterate over parseFns' keys in order to keep the order of the keys.\n const partParserKeys = Object.keys(parseFns).reduce((keys, key) => {\n const token = parts.find(part => part[0] !== 'D' && part[0].toLowerCase() === key);\n if (token) {\n keys.push(key);\n }\n return keys;\n }, []);\n\n return knownFormats[format] = {\n parser(dateStr, locale) {\n const dateParts = dateStr.split(reNonDateParts).reduce((dtParts, part, index) => {\n if (part.length > 0 && parts[index]) {\n const token = parts[index][0];\n if (token === 'M') {\n dtParts.m = part;\n } else if (token !== 'D') {\n dtParts[token] = part;\n }\n }\n return dtParts;\n }, {});\n\n // iterate over partParserkeys so that the parsing is made in the oder\n // of year, month and day to prevent the day parser from correcting last\n // day of month wrongly\n return partParserKeys.reduce((origDate, key) => {\n const newDate = parseFns[key](origDate, dateParts[key], locale);\n // ingnore the part failed to parse\n return isNaN(newDate) ? origDate : newDate;\n }, today());\n },\n formatter(date, locale) {\n let dateStr = partFormatters.reduce((str, fn, index) => {\n return str += `${separators[index]}${fn(date, locale)}`;\n }, '');\n // separators' length is always parts' length + 1,\n return dateStr += lastItemOf(separators);\n },\n };\n}\n\nexport function parseDate(dateStr, format, locale) {\n if (dateStr instanceof Date || typeof dateStr === 'number') {\n const date = stripTime(dateStr);\n return isNaN(date) ? undefined : date;\n }\n if (!dateStr) {\n return undefined;\n }\n if (dateStr === 'today') {\n return today();\n }\n\n if (format && format.toValue) {\n const date = format.toValue(dateStr, format, locale);\n return isNaN(date) ? undefined : stripTime(date);\n }\n\n return parseFormatString(format).parser(dateStr, locale);\n}\n\nexport function formatDate(date, format, locale) {\n if (isNaN(date) || (!date && date !== 0)) {\n return '';\n }\n\n const dateObj = typeof date === 'number' ? new Date(date) : date;\n\n if (format.toDisplay) {\n return format.toDisplay(dateObj, format, locale);\n }\n\n return parseFormatString(format).formatter(dateObj, locale);\n}\n","export function stripTime(timeValue) {\n return new Date(timeValue).setHours(0, 0, 0, 0);\n}\n\nexport function today() {\n return new Date().setHours(0, 0, 0, 0);\n}\n\n// Get the time value of the start of given date or year, month and day\nexport function dateValue(...args) {\n switch (args.length) {\n case 0:\n return today();\n case 1:\n return stripTime(args[0]);\n }\n\n // use setFullYear() to keep 2-digit year from being mapped to 1900-1999\n const newDate = new Date(0);\n newDate.setFullYear(...args);\n return newDate.setHours(0, 0, 0, 0);\n}\n\nexport function addDays(date, amount) {\n const newDate = new Date(date);\n return newDate.setDate(newDate.getDate() + amount);\n}\n\nexport function addWeeks(date, amount) {\n return addDays(date, amount * 7);\n}\n\nexport function addMonths(date, amount) {\n // If the day of the date is not in the new month, the last day of the new\n // month will be returned. e.g. Jan 31 + 1 month → Feb 28 (not Mar 03)\n const newDate = new Date(date);\n const monthsToSet = newDate.getMonth() + amount;\n let expectedMonth = monthsToSet % 12;\n if (expectedMonth < 0) {\n expectedMonth += 12;\n }\n\n const time = newDate.setMonth(monthsToSet);\n return newDate.getMonth() !== expectedMonth ? newDate.setDate(0) : time;\n}\n\nexport function addYears(date, amount) {\n // If the date is Feb 29 and the new year is not a leap year, Feb 28 of the\n // new year will be returned.\n const newDate = new Date(date);\n const expectedMonth = newDate.getMonth();\n const time = newDate.setFullYear(newDate.getFullYear() + amount);\n return expectedMonth === 1 && newDate.getMonth() === 2 ? newDate.setDate(0) : time;\n}\n\n// Calculate the distance bettwen 2 days of the week\nfunction dayDiff(day, from) {\n return (day - from + 7) % 7;\n}\n\n// Get the date of the specified day of the week of given base date\nexport function dayOfTheWeekOf(baseDate, dayOfWeek, weekStart = 0) {\n const baseDay = new Date(baseDate).getDay();\n return addDays(baseDate, dayDiff(dayOfWeek, weekStart) - dayDiff(baseDay, weekStart));\n}\n\n// Get the ISO week of a date\nexport function getWeek(date) {\n // start of ISO week is Monday\n const thuOfTheWeek = dayOfTheWeekOf(date, 4, 1);\n // 1st week == the week where the 4th of January is in\n const firstThu = dayOfTheWeekOf(new Date(thuOfTheWeek).setMonth(0, 4), 4, 1);\n return Math.round((thuOfTheWeek - firstThu) / 604800000) + 1;\n}\n\n// Get the start year of the period of years that includes given date\n// years: length of the year period\nexport function startOfYearPeriod(date, years) {\n /* @see https://en.wikipedia.org/wiki/Year_zero#ISO_8601 */\n const year = new Date(date).getFullYear();\n return Math.floor(year / years) * years;\n}\n","const listenerRegistry = new WeakMap();\nconst {addEventListener, removeEventListener} = EventTarget.prototype;\n\n// Register event listeners to a key object\n// listeners: array of listener definitions;\n// - each definition must be a flat array of event target and the arguments\n// used to call addEventListener() on the target\nexport function registerListeners(keyObj, listeners) {\n let registered = listenerRegistry.get(keyObj);\n if (!registered) {\n registered = [];\n listenerRegistry.set(keyObj, registered);\n }\n listeners.forEach((listener) => {\n addEventListener.call(...listener);\n registered.push(listener);\n });\n}\n\nexport function unregisterListeners(keyObj) {\n let listeners = listenerRegistry.get(keyObj);\n if (!listeners) {\n return;\n }\n listeners.forEach((listener) => {\n removeEventListener.call(...listener);\n });\n listenerRegistry.delete(keyObj);\n}\n\n// Event.composedPath() polyfill for Edge\n// based on https://gist.github.com/kleinfreund/e9787d73776c0e3750dcfcdc89f100ec\nif (!Event.prototype.composedPath) {\n const getComposedPath = (node, path = []) => {\n path.push(node);\n\n let parent;\n if (node.parentNode) {\n parent = node.parentNode;\n } else if (node.host) { // ShadowRoot\n parent = node.host;\n } else if (node.defaultView) { // Document\n parent = node.defaultView;\n }\n return parent ? getComposedPath(parent, path) : path;\n };\n\n Event.prototype.composedPath = function () {\n return getComposedPath(this.target);\n };\n}\n\nfunction findFromPath(path, criteria, currentTarget, index = 0) {\n const el = path[index];\n if (criteria(el)) {\n return el;\n } else if (el === currentTarget || !el.parentElement) {\n // stop when reaching currentTarget or \n return;\n }\n return findFromPath(path, criteria, currentTarget, index + 1);\n}\n\n// Search for the actual target of a delegated event\nexport function findElementInEventPath(ev, selector) {\n const criteria = typeof selector === 'function' ? selector : el => el.matches(selector);\n return findFromPath(ev.composedPath(), criteria, ev.currentTarget);\n}\n","export function hasProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function lastItemOf(arr) {\n return arr[arr.length - 1];\n}\n\n// push only the items not included in the array\nexport function pushUnique(arr, ...items) {\n items.forEach((item) => {\n if (arr.includes(item)) {\n return;\n }\n arr.push(item);\n });\n return arr;\n}\n\nexport function stringToArray(str, separator) {\n // convert empty string to an empty array\n return str ? str.split(separator) : [];\n}\n\nexport function isInRange(testVal, min, max) {\n const minOK = min === undefined || testVal >= min;\n const maxOK = max === undefined || testVal <= max;\n return minOK && maxOK;\n}\n\nexport function limitToRange(val, min, max) {\n if (val < min) {\n return min;\n }\n if (val > max) {\n return max;\n }\n return val;\n}\n\nexport function createTagRepeat(tagName, repeat, attributes = {}, index = 0, html = '') {\n const openTagSrc = Object.keys(attributes).reduce((src, attr) => {\n let val = attributes[attr];\n if (typeof val === 'function') {\n val = val(index);\n }\n return `${src} ${attr}=\"${val}\"`;\n }, tagName);\n html += `<${openTagSrc}>`;\n\n const next = index + 1;\n return next < repeat\n ? createTagRepeat(tagName, repeat, attributes, next, html)\n : html;\n}\n\n// Remove the spacing surrounding tags for HTML parser not to create text nodes\n// before/after elements\nexport function optimizeTemplateHTML(html) {\n return html.replace(/>\\s+/g, '>').replace(/\\s+ {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import Datepicker from 'flowbite-datepicker/Datepicker';\nimport DateRangePicker from 'flowbite-datepicker/DateRangePicker';\nimport Events from '../dom/events';\n\nconst getDatepickerOptions = (datepickerEl) => {\n const buttons = datepickerEl.hasAttribute('datepicker-buttons');\n const autohide = datepickerEl.hasAttribute('datepicker-autohide');\n const format = datepickerEl.hasAttribute('datepicker-format');\n const orientation = datepickerEl.hasAttribute('datepicker-orientation');\n const title = datepickerEl.hasAttribute('datepicker-title');\n\n const options = {};\n if (buttons) {\n options.todayBtn = true;\n options.clearBtn = true;\n }\n if (autohide) {\n options.autohide = true;\n }\n if (format) {\n options.format = datepickerEl.getAttribute('datepicker-format');\n }\n if (orientation) {\n options.orientation = datepickerEl.getAttribute(\n 'datepicker-orientation'\n );\n }\n if (title) {\n options.title = datepickerEl.getAttribute('datepicker-title');\n }\n\n return options;\n};\n\nexport function initDatepickers() {\n document.querySelectorAll('[datepicker]').forEach(function (datepickerEl) {\n new Datepicker(datepickerEl, getDatepickerOptions(datepickerEl));\n });\n\n document\n .querySelectorAll('[inline-datepicker]')\n .forEach(function (datepickerEl) {\n new Datepicker(datepickerEl, getDatepickerOptions(datepickerEl));\n });\n\n document\n .querySelectorAll('[date-rangepicker]')\n .forEach(function (datepickerEl) {\n new DateRangePicker(\n datepickerEl,\n getDatepickerOptions(datepickerEl)\n );\n });\n}\n\nconst events = new Events('DOMContentLoaded', [initDatepickers]);\nevents.init();\n"],"names":["Datepicker","DateRangePicker","Events","getDatepickerOptions","datepickerEl","buttons","hasAttribute","autohide","format","orientation","title","options","todayBtn","clearBtn","getAttribute","initDatepickers","document","querySelectorAll","forEach","events","init"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/datepicker.min.js b/node_modules/flowbite/dist/datepicker.min.js new file mode 100644 index 0000000..f0c9007 --- /dev/null +++ b/node_modules/flowbite/dist/datepicker.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Flowbite",[],t):"object"==typeof exports?exports.Flowbite=t():e.Flowbite=t()}(self,(function(){return function(){"use strict";var e={482:function(e,t,i){i.d(t,{Z:function(){return c}});var r=i(698),n=i(963),a=i(770);function s(e){const t=Object.assign({},e);return delete t.inputs,delete t.allowOneSidedRange,delete t.maxNumberOfDates,t}function o(e,t,i,n){(0,r.cF)(e,[[i,"changeDate",t]]),new a.Z(i,n,e)}function d(e,t){if(e._updating)return;e._updating=!0;const i=t.target;if(void 0===i.datepicker)return;const r=e.datepickers,n={render:!1},a=e.inputs.indexOf(i),s=0===a?1:0,o=r[a].dates[0],d=r[s].dates[0];void 0!==o&&void 0!==d?0===a&&o>d?(r[0].setDate(d,n),r[1].setDate(o,n)):1===a&&o0?d(this,{target:this.inputs[0]}):a[1].dates.length>0&&d(this,{target:this.inputs[1]})}get dates(){return 2===this.datepickers.length?[this.datepickers[0].dates[0],this.datepickers[1].dates[0]]:void 0}setOptions(e){this.allowOneSidedRange=!!e.allowOneSidedRange;const t=s(e);this.datepickers[0].setOptions(t),this.datepickers[1].setOptions(t)}destroy(){this.datepickers[0].destroy(),this.datepickers[1].destroy(),(0,r.uV)(this),delete this.element.rangepicker}getDates(e){const t=e?t=>(0,n.p6)(t,e,this.datepickers[0].config.locale):e=>new Date(e);return this.dates.map((e=>void 0===e?e:t(e)))}setDates(e,t){const[i,r]=this.datepickers,n=this.dates;this._updating=!0,i.setDate(e),r.setDate(t),delete this._updating,r.dates[0]!==n[1]?d(this,{target:this.inputs[1]}):i.dates[0]!==n[0]&&d(this,{target:this.inputs[0]})}}},770:function(e,t,i){i.d(t,{Z:function(){return ae}});var r=i(105),n=i(560),a=i(963),s=i(698);const o={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}};var d={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,calendarWeeks:!1,clearBtn:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:'',orientation:"auto",pickLevel:0,prevArrow:'',showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayBtn:!1,todayBtnMode:0,todayHighlight:!1,updateOnBlur:!0,weekStart:0};const c=document.createRange();function l(e){return c.createContextualFragment(e)}function h(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function u(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function g(e){e.firstChild&&(e.removeChild(e.firstChild),g(e))}const{language:f,format:p,weekStart:m}=d;function b(e,t){return e.length<6&&t>=0&&t<7?(0,r.$C)(e,t):e}function y(e){return(e+6)%7}function w(e,t,i,r){const n=(0,a.sG)(e,t,i);return void 0!==n?n:r}function k(e,t,i=3){const r=parseInt(e,10);return r>=0&&r<=i?r:t}function v(e,t){const i=Object.assign({},e),s={},o=t.constructor.locales;let{format:c,language:h,locale:u,maxDate:g,maxView:v,minDate:x,pickLevel:D,startView:M,weekStart:S}=t.config||{};if(i.language){let e;if(i.language!==h&&(o[i.language]?e=i.language:(e=i.language.split("-")[0],void 0===o[e]&&(e=!1))),delete i.language,e){h=s.language=e;const t=u||o[f];u=Object.assign({format:p,weekStart:m},o[f]),h!==f&&Object.assign(u,o[h]),s.locale=u,c===t.format&&(c=s.format=u.format),S===t.weekStart&&(S=s.weekStart=u.weekStart,s.weekEnd=y(u.weekStart))}}if(i.format){const e="function"==typeof i.format.toDisplay,t="function"==typeof i.format.toValue,r=a.CL.test(i.format);(e&&t||r)&&(c=s.format=i.format),delete i.format}let O=x,C=g;if(void 0!==i.minDate&&(O=null===i.minDate?(0,n.by)(0,0,1):w(i.minDate,c,u,O),delete i.minDate),void 0!==i.maxDate&&(C=null===i.maxDate?void 0:w(i.maxDate,c,u,C),delete i.maxDate),C{const i=(0,a.sG)(t,c,u);return void 0!==i?(0,r.$C)(e,i):e}),[]),delete i.datesDisabled),void 0!==i.defaultViewDate){const e=(0,a.sG)(i.defaultViewDate,c,u);void 0!==e&&(s.defaultViewDate=e),delete i.defaultViewDate}if(void 0!==i.weekStart){const e=Number(i.weekStart)%7;isNaN(e)||(S=s.weekStart=e,s.weekEnd=y(e)),delete i.weekStart}if(i.daysOfWeekDisabled&&(s.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(b,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(s.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(b,[]),delete i.daysOfWeekHighlighted),void 0!==i.maxNumberOfDates){const e=parseInt(i.maxNumberOfDates,10);e>=0&&(s.maxNumberOfDates=e,s.multidate=1!==e),delete i.maxNumberOfDates}i.dateDelimiter&&(s.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let E=D;void 0!==i.pickLevel&&(E=k(i.pickLevel,2),delete i.pickLevel),E!==D&&(D=s.pickLevel=E);let F=v;void 0!==i.maxView&&(F=k(i.maxView,v),delete i.maxView),F=D>F?D:F,F!==v&&(v=s.maxView=F);let L=M;if(void 0!==i.startView&&(L=k(i.startView,L),delete i.startView),Lv&&(L=v),L!==M&&(s.startView=L),i.prevArrow){const e=l(i.prevArrow);e.childNodes.length>0&&(s.prevArrow=e.childNodes),delete i.prevArrow}if(i.nextArrow){const e=l(i.nextArrow);e.childNodes.length>0&&(s.nextArrow=e.childNodes),delete i.nextArrow}if(void 0!==i.disableTouchKeyboard&&(s.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const e=i.orientation.toLowerCase().split(/\s+/g);s.orientation={x:e.find((e=>"left"===e||"right"===e))||"auto",y:e.find((e=>"top"===e||"bottom"===e))||"auto"},delete i.orientation}if(void 0!==i.todayBtnMode){switch(i.todayBtnMode){case 0:case 1:s.todayBtnMode=i.todayBtnMode}delete i.todayBtnMode}return Object.keys(i).forEach((e=>{void 0!==i[e]&&(0,r.l$)(d,e)&&(s[e]=i[e])})),s}var x=(0,r.zh)('');var D=(0,r.zh)(`
\n
${(0,r.em)("span",7,{class:"dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm"})}
\n
${(0,r.em)("span",42,{class:"block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400"})}
\n
`);var M=(0,r.zh)(`
\n
\n
${(0,r.em)("span",6,{class:"week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm"})}
\n
`);class S{constructor(e,t){Object.assign(this,t,{picker:e,element:l('
').firstChild,selected:[]}),this.init(this.picker.datepicker.config)}init(e){void 0!==e.pickLevel&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}performBeforeHook(e,t,i){let n=this.beforeShow(new Date(i));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){if(!1===n.enabled&&(e.classList.add("disabled"),(0,r.$C)(this.disabled,t)),n.classes){const i=n.classes.split(/\s+/);e.classList.add(...i),i.includes("disabled")&&(0,r.$C)(this.disabled,t)}n.content&&function(e,t){g(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(l(t)):"function"==typeof t.forEach&&t.forEach((t=>{e.appendChild(t)}))}(e,n.content)}}}class O extends S{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=l(D).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if((0,r.l$)(e,"minDate")&&(this.minDate=e.minDate),(0,r.l$)(e,"maxDate")&&(this.maxDate=e.maxDate),e.datesDisabled&&(this.datesDisabled=e.datesDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),void 0!==e.todayHighlight&&(this.todayHighlight=e.todayHighlight),void 0!==e.weekStart&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const i=this.locale=e.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,t=!0}if(void 0!==e.beforeShowDay&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),void 0!==e.calendarWeeks)if(e.calendarWeeks&&!this.calendarWeeks){const e=l(M).firstChild;this.calendarWeeks={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.calendarWeeks&&!e.calendarWeeks&&(this.element.removeChild(this.calendarWeeks.element),this.calendarWeeks=null);void 0!==e.showDaysOfWeek&&(e.showDaysOfWeek?(u(this.dow),this.calendarWeeks&&u(this.calendarWeeks.dow)):(h(this.dow),this.calendarWeeks&&h(this.calendarWeeks.dow))),t&&Array.from(this.dow.children).forEach(((e,t)=>{const i=(this.weekStart+t)%7;e.textContent=this.dayNames[i],e.className=this.daysOfWeekDisabled.includes(i)?"dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed":"dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400"}))}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),i=e.getMonth(),r=(0,n.by)(t,i,1),a=(0,n.fr)(r,this.weekStart,this.weekStart);this.first=r,this.last=(0,n.by)(t,i+1,0),this.start=a,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){this.today=this.todayHighlight?(0,n.Lg)():void 0,this.disabled=[...this.datesDisabled];const e=(0,a.p6)(this.focused,this.switchLabelFormat,this.locale);if(this.picker.setViewSwitchLabel(e),this.picker.setPrevBtnDisabled(this.first<=this.minDate),this.picker.setNextBtnDisabled(this.last>=this.maxDate),this.calendarWeeks){const e=(0,n.fr)(this.first,1,1);Array.from(this.calendarWeeks.weeks.children).forEach(((t,i)=>{t.textContent=(0,n.Qk)((0,n.jh)(e,i))}))}Array.from(this.grid.children).forEach(((e,t)=>{const i=e.classList,a=(0,n.E4)(this.start,t),s=new Date(a),o=s.getDay();if(e.className=`datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`,e.dataset.date=a,e.textContent=s.getDate(),athis.last&&i.add("next","text-gray-500","dark:text-white"),this.today===a&&i.add("today","bg-gray-100","dark:bg-gray-600"),(athis.maxDate||this.disabled.includes(a))&&i.add("disabled","cursor-not-allowed"),this.daysOfWeekDisabled.includes(o)&&(i.add("disabled","cursor-not-allowed"),(0,r.$C)(this.disabled,a)),this.daysOfWeekHighlighted.includes(o)&&i.add("highlighted"),this.range){const[e,t]=this.range;a>e&&a{e.classList.remove("range","range-start","range-end","selected","bg-blue-700","text-white","dark:bg-blue-600","dark:text-white","focused"),e.classList.add("text-gray-900","rounded-lg","dark:text-white")})),Array.from(this.grid.children).forEach((i=>{const r=Number(i.dataset.date),n=i.classList;n.remove("bg-gray-200","dark:bg-gray-600","rounded-l-lg","rounded-r-lg"),r>e&&r{e.classList.remove("focused")})),this.grid.children[e].classList.add("focused")}}function C(e,t){if(!e||!e[0]||!e[1])return;const[[i,r],[n,a]]=e;return i>t||ne})))),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),(0,r.l$)(e,"minDate"))if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if((0,r.l$)(e,"maxDate"))if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=(0,n.by)(this.maxYear,this.maxMonth+1,0)}void 0!==e.beforeShowMonth&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce(((e,t)=>{const i=new Date(t),n=i.getFullYear(),a=i.getMonth();return void 0===e[n]?e[n]=[a]:(0,r.$C)(e[n],a),e}),{}),t&&t.dates&&(this.range=t.dates.map((e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]})))}render(){this.disabled=[],this.picker.setViewSwitchLabel(this.year),this.picker.setPrevBtnDisabled(this.year<=this.minYear),this.picker.setNextBtnDisabled(this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.yearthis.maxYear,i=this.year===this.minYear,r=this.year===this.maxYear,a=C(this.range,this.year);Array.from(this.grid.children).forEach(((s,o)=>{const d=s.classList,c=(0,n.by)(this.year,o,1);if(s.className=`datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`,this.isMinView&&(s.dataset.date=c),s.textContent=this.monthNames[o],(t||i&&othis.maxMonth)&&d.add("disabled"),a){const[e,t]=a;o>e&&o{e.classList.remove("range","range-start","range-end","selected","bg-blue-700","dark:bg-blue-600","dark:text-white","text-white","focused"),e.classList.add("text-gray-900","hover:bg-gray-100","dark:text-white","dark:hover:bg-gray-600")})),Array.from(this.grid.children).forEach(((r,n)=>{const a=r.classList;n>t&&n{e.classList.remove("focused")})),this.grid.children[this.focused].classList.add("focused")}}class F extends S{constructor(e,t){super(e,t)}init(e,t=!0){var i;t&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce(((e,t,i)=>e+(i?t:t.toUpperCase())),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid","w-64","grid","grid-cols-4"),this.grid.appendChild(l((0,r.em)("span",12)))),super.init(e)}setOptions(e){if((0,r.l$)(e,"minDate")&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=(0,n.ak)(e.minDate,this.step),this.minDate=(0,n.by)(this.minYear,0,1))),(0,r.l$)(e,"maxDate")&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=(0,n.ak)(e.maxDate,this.step),this.maxDate=(0,n.by)(this.maxYear,11,31))),void 0!==e[this.beforeShowOption]){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=(0,n.ak)(e,this.navStep),i=t+9*this.step;this.first=t,this.last=i,this.start=t-this.step,this.focused=(0,n.ak)(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce(((e,t)=>(0,r.$C)(e,(0,n.ak)(t,this.step))),[]),t&&t.dates&&(this.range=t.dates.map((e=>{if(void 0!==e)return(0,n.ak)(e,this.step)})))}render(){this.disabled=[],this.picker.setViewSwitchLabel(`${this.first}-${this.last}`),this.picker.setPrevBtnDisabled(this.first<=this.minYear),this.picker.setNextBtnDisabled(this.last>=this.maxYear),Array.from(this.grid.children).forEach(((e,t)=>{const i=e.classList,r=this.start+t*this.step,a=(0,n.by)(r,0,1);if(e.className=`datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`,this.isMinView&&(e.dataset.date=a),e.textContent=e.dataset.year=r,0===t?i.add("prev"):11===t&&i.add("next"),(rthis.maxYear)&&i.add("disabled"),this.range){const[e,t]=this.range;r>e&&r{e.classList.remove("range","range-start","range-end","selected","bg-blue-700","text-white","dark:bg-blue-600","dark:text-white","focused")})),Array.from(this.grid.children).forEach((i=>{const r=Number(i.textContent),n=i.classList;r>e&&r{e.classList.remove("focused")})),this.grid.children[e].classList.add("focused")}}function L(e,t){const i={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:i}))}function V(e,t){const{minDate:i,maxDate:a}=e.config,{currentView:s,viewDate:o}=e.picker;let d;switch(s.id){case 0:d=(0,n.zI)(o,t);break;case 1:d=(0,n.Bc)(o,t);break;default:d=(0,n.Bc)(o,t*s.navStep)}d=(0,r.jG)(d,i,a),e.picker.changeFocus(d).render()}function B(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function A(e){e.config.updateOnBlur?e.update({autohide:!0}):(e.refresh("input"),e.hide())}function N(e,t){const i=e.picker,r=new Date(i.viewDate),a=i.currentView.id,s=1===a?(0,n.zI)(r,t-r.getMonth()):(0,n.Bc)(r,t-r.getFullYear());i.changeFocus(s).changeView(a-1).render()}function W(e){const t=e.picker,i=(0,n.Lg)();if(1===e.config.todayBtnMode){if(e.config.autohide)return void e.setDate(i);e.setDate(i,{render:!1}),t.update()}t.viewDate!==i&&t.changeFocus(i),t.changeView(0).render()}function Y(e){e.setDate({clear:!0})}function $(e){B(e)}function j(e){V(e,-1)}function _(e){V(e,1)}function H(e,t){const i=(0,s.He)(t,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:r,isMinView:n}=e.picker.currentView;n?e.setDate(Number(i.dataset.date)):N(e,Number(1===r?i.dataset.month:i.dataset.year))}function T(e){e.inline||e.config.disableTouchKeyboard||e.inputField.focus()}function K(e,t){if(void 0!==t.title&&(t.title?(e.controls.title.textContent=t.title,u(e.controls.title)):(e.controls.title.textContent="",h(e.controls.title))),t.prevArrow){const i=e.controls.prevBtn;g(i),t.prevArrow.forEach((e=>{i.appendChild(e.cloneNode(!0))}))}if(t.nextArrow){const i=e.controls.nextBtn;g(i),t.nextArrow.forEach((e=>{i.appendChild(e.cloneNode(!0))}))}if(t.locale&&(e.controls.todayBtn.textContent=t.locale.today,e.controls.clearBtn.textContent=t.locale.clear),void 0!==t.todayBtn&&(t.todayBtn?u(e.controls.todayBtn):h(e.controls.todayBtn)),(0,r.l$)(t,"minDate")||(0,r.l$)(t,"maxDate")){const{minDate:t,maxDate:i}=e.datepicker.config;e.controls.todayBtn.disabled=!(0,r.mh)((0,n.Lg)(),t,i)}void 0!==t.clearBtn&&(t.clearBtn?u(e.controls.clearBtn):h(e.controls.clearBtn))}function I(e){const{dates:t,config:i}=e,n=t.length>0?(0,r.Jm)(t):i.defaultViewDate;return(0,r.jG)(n,i.minDate,i.maxDate)}function P(e,t){const i=new Date(e.viewDate),r=new Date(t),{id:n,year:a,first:s,last:o}=e.currentView,d=r.getFullYear();switch(e.viewDate=t,d!==i.getFullYear()&&L(e.datepicker,"changeYear"),r.getMonth()!==i.getMonth()&&L(e.datepicker,"changeMonth"),n){case 0:return to;case 1:return d!==a;default:return do}}function R(e){return window.getComputedStyle(e).direction}class z{constructor(e){this.datepicker=e;const t=x.replace(/%buttonClass%/g,e.config.buttonClass),i=this.element=l(t).firstChild,[r,n,a]=i.firstChild.children,o=r.firstElementChild,[d,c,h]=r.lastElementChild.children,[u,g]=a.firstChild.children,f={title:o,prevBtn:d,viewSwitch:c,nextBtn:h,todayBtn:u,clearBtn:g};this.main=n,this.controls=f;const p=e.inline?"inline":"dropdown";i.classList.add(`datepicker-${p}`),"dropdown"===p&&i.classList.add("dropdown","absolute","top-0","left-0","z-50","pt-2"),K(this,e.config),this.viewDate=I(e),(0,s.cF)(e,[[i,"click",T.bind(null,e),{capture:!0}],[n,"click",H.bind(null,e)],[f.viewSwitch,"click",$.bind(null,e)],[f.prevBtn,"click",j.bind(null,e)],[f.nextBtn,"click",_.bind(null,e)],[f.todayBtn,"click",W.bind(null,e)],[f.clearBtn,"click",Y.bind(null,e)]]),this.views=[new O(this),new E(this),new F(this,{id:2,name:"years",cellClass:"year",step:1}),new F(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[e.config.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),e.config.container.appendChild(this.element)}setOptions(e){K(this,e),this.views.forEach((t=>{t.init(e,!1)})),this.currentView.render()}detach(){this.datepicker.config.container.removeChild(this.element)}show(){if(this.active)return;this.element.classList.add("active","block"),this.element.classList.remove("hidden"),this.active=!0;const e=this.datepicker;if(!e.inline){const t=R(e.inputField);t!==R(e.config.container)?this.element.dir=t:this.element.dir&&this.element.removeAttribute("dir"),this.place(),e.config.disableTouchKeyboard&&e.inputField.blur()}L(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active","block"),this.element.classList.add("active","block","hidden"),this.active=!1,L(this.datepicker,"hide"))}place(){const{classList:e,style:t}=this.element,{config:i,inputField:r}=this.datepicker,n=i.container,{width:a,height:s}=this.element.getBoundingClientRect(),{left:o,top:d,width:c}=n.getBoundingClientRect(),{left:l,top:h,width:u,height:g}=r.getBoundingClientRect();let f,p,m,{x:b,y:y}=i.orientation;n===document.body?(f=window.scrollY,p=l+window.scrollX,m=h+f):(f=n.scrollTop,p=l-o,m=h-d+f),"auto"===b&&(p<0?(b="left",p=10):b=p+a>c||"rtl"===R(r)?"right":"left"),"right"===b&&(p-=a-u),"auto"===y&&(y=m-s{e.updateFocus()})),this}update(){const e=I(this.datepicker);return this._renderMethod=P(this,e)?"render":"refresh",this.views.forEach((e=>{e.updateFocus(),e.updateSelection()})),this}render(e=!0){const t=e&&this._renderMethod||"render";delete this._renderMethod,this.currentView[t]()}}function q(e,t,i,n,a,s){if((0,r.mh)(e,a,s)){if(n(e)){return q(t(e,i),t,i,n,a,s)}return e}}function J(e,t,i,r){const a=e.picker,s=a.currentView,o=s.step||1;let d,c,l=a.viewDate;switch(s.id){case 0:l=r?(0,n.E4)(l,7*i):t.ctrlKey||t.metaKey?(0,n.Bc)(l,i):(0,n.E4)(l,i),d=n.E4,c=e=>s.disabled.includes(e);break;case 1:l=(0,n.zI)(l,r?4*i:i),d=n.zI,c=e=>{const t=new Date(e),{year:i,disabled:r}=s;return t.getFullYear()===i&&r.includes(t.getMonth())};break;default:l=(0,n.Bc)(l,i*(r?4:1)*o),d=n.Bc,c=e=>s.disabled.includes((0,n.ak)(e,o))}l=q(l,d,i<0?-o:o,c,s.minDate,s.maxDate),void 0!==l&&a.changeFocus(l).render()}function G(e,t){if("Tab"===t.key)return void A(e);const i=e.picker,{id:r,isMinView:n}=i.currentView;if(i.active)if(e.editMode)switch(t.key){case"Escape":i.hide();break;case"Enter":e.exitEditMode({update:!0,autohide:e.config.autohide});break;default:return}else switch(t.key){case"Escape":i.hide();break;case"ArrowLeft":if(t.ctrlKey||t.metaKey)V(e,-1);else{if(t.shiftKey)return void e.enterEditMode();J(e,t,-1,!1)}break;case"ArrowRight":if(t.ctrlKey||t.metaKey)V(e,1);else{if(t.shiftKey)return void e.enterEditMode();J(e,t,1,!1)}break;case"ArrowUp":if(t.ctrlKey||t.metaKey)B(e);else{if(t.shiftKey)return void e.enterEditMode();J(e,t,-1,!0)}break;case"ArrowDown":if(t.shiftKey&&!t.ctrlKey&&!t.metaKey)return void e.enterEditMode();J(e,t,1,!0);break;case"Enter":n?e.setDate(i.viewDate):i.changeView(r-1).render();break;case"Backspace":case"Delete":return void e.enterEditMode();default:return void(1!==t.key.length||t.ctrlKey||t.metaKey||e.enterEditMode())}else switch(t.key){case"ArrowDown":case"Escape":i.show();break;case"Enter":e.update();break;default:return}t.preventDefault(),t.stopPropagation()}function Z(e){e.config.showOnFocus&&!e._showing&&e.show()}function U(e,t){const i=t.target;(e.picker.active||e.config.showOnClick)&&(i._active=i===document.activeElement,i._clicking=setTimeout((()=>{delete i._active,delete i._clicking}),2e3))}function Q(e,t){const i=t.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&e.enterEditMode(),delete i._active,e.config.showOnClick&&e.show())}function X(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function ee(e,t){const i=e.element;if(i!==document.activeElement)return;const r=e.picker.element;(0,s.He)(t,(e=>e===i||e===r))||A(e)}function te(e,t){return e.map((e=>(0,a.p6)(e,t.format,t.locale))).join(t.dateDelimiter)}function ie(e,t,i=!1){const{config:n,dates:s,rangepicker:o}=e;if(0===t.length)return i?[]:void 0;const d=o&&e===o.datepickers[1];let c=t.reduce(((e,t)=>{let i=(0,a.sG)(t,n.format,n.locale);if(void 0===i)return e;if(n.pickLevel>0){const e=new Date(i);i=1===n.pickLevel?d?e.setMonth(e.getMonth()+1,0):e.setDate(1):d?e.setFullYear(e.getFullYear()+1,0,0):e.setMonth(0,1)}return!(0,r.mh)(i,n.minDate,n.maxDate)||e.includes(i)||n.datesDisabled.includes(i)||n.daysOfWeekDisabled.includes(new Date(i).getDay())||e.push(i),e}),[]);return 0!==c.length?(n.multidate&&!i&&(c=c.reduce(((e,t)=>(s.includes(t)||e.push(t),e)),s.filter((e=>!c.includes(e))))),n.maxNumberOfDates&&c.length>n.maxNumberOfDates?c.slice(-1*n.maxNumberOfDates):c):void 0}function re(e,t=3,i=!0){const{config:r,picker:n,inputField:a}=e;if(2&t){const e=n.active?r.pickLevel:r.startView;n.update().changeView(e).render(i)}1&t&&a&&(a.value=te(e.dates,r))}function ne(e,t,i){let{clear:r,render:n,autohide:a}=i;void 0===n&&(n=!0),n?void 0===a&&(a=e.config.autohide):a=!1;const s=ie(e,t,r);s&&(s.toString()!==e.dates.toString()?(e.dates=s,re(e,n?3:1),L(e,"changeDate")):re(e,1),a&&e.hide())}class ae{constructor(e,t={},i){e.datepicker=this,this.element=e;const a=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:document.body,defaultViewDate:(0,n.Lg)(),maxDate:void 0,minDate:void 0},v(d,this));this._options=t,Object.assign(a,v(t,this));const o=this.inline="INPUT"!==e.tagName;let c,l;if(o)a.container=e,l=(0,r.W7)(e.dataset.date,a.dateDelimiter),delete e.dataset.date;else{const i=t.container?document.querySelector(t.container):null;i&&(a.container=i),c=this.inputField=e,c.classList.add("datepicker-input"),l=(0,r.W7)(c.value,a.dateDelimiter)}if(i){const e=i.inputs.indexOf(c),t=i.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,Object.defineProperty(this,"rangepicker",{get(){return i}})}this.dates=[];const h=ie(this,l);h&&h.length>0&&(this.dates=h),c&&(c.value=te(this.dates,a));const u=this.picker=new z(this);if(o)this.show();else{const e=ee.bind(null,this),t=[[c,"keydown",G.bind(null,this)],[c,"focus",Z.bind(null,this)],[c,"mousedown",U.bind(null,this)],[c,"click",Q.bind(null,this)],[c,"paste",X.bind(null,this)],[document,"mousedown",e],[document,"touchstart",e],[window,"resize",u.place.bind(u)]];(0,s.cF)(this,t)}}static formatDate(e,t,i){return(0,a.p6)(e,t,i&&o[i]||o.en)}static parseDate(e,t,i){return(0,a.sG)(e,t,i&&o[i]||o.en)}static get locales(){return o}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=this.picker,i=v(e,this);Object.assign(this._options,e),Object.assign(this.config,i),t.setOptions(i),re(this,3)}show(){if(this.inputField){if(this.inputField.disabled)return;this.inputField!==document.activeElement&&(this._showing=!0,this.inputField.focus(),delete this._showing)}this.picker.show()}hide(){this.inline||(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}destroy(){return this.hide(),(0,s.uV)(this),this.picker.detach(),this.inline||this.inputField.classList.remove("datepicker-input"),delete this.element.datepicker,this}getDate(e){const t=e?t=>(0,a.p6)(t,e,this.config.locale):e=>new Date(e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],i={},n=(0,r.Jm)(e);"object"!=typeof n||Array.isArray(n)||n instanceof Date||!n||Object.assign(i,t.pop());ne(this,Array.isArray(t[0])?t[0]:t,i)}update(e){if(this.inline)return;const t={clear:!0,autohide:!(!e||!e.autohide)};ne(this,(0,r.W7)(this.inputField.value,this.config.dateDelimiter),t)}refresh(e,t=!1){let i;e&&"string"!=typeof e&&(t=e,e=void 0),i="picker"===e?2:"input"===e?1:3,re(this,i,!t)}enterEditMode(){this.inline||!this.picker.active||this.editMode||(this.editMode=!0,this.inputField.classList.add("in-edit","border-blue-700"))}exitEditMode(e){if(this.inline||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit","border-blue-700"),t.update&&this.update(t)}}},963:function(e,t,i){i.d(t,{CL:function(){return a},p6:function(){return f},sG:function(){return g}});var r=i(560),n=i(105);const a=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,s=/[\s!-/:-@[-`{-~年月日]+/;let o={};const d={y(e,t){return new Date(e).setFullYear(parseInt(t,10))},m(e,t,i){const r=new Date(e);let n=parseInt(t,10)-1;if(isNaN(n)){if(!t)return NaN;const e=t.toLowerCase(),r=t=>t.toLowerCase().startsWith(e);if(n=i.monthsShort.findIndex(r),n<0&&(n=i.months.findIndex(r)),n<0)return NaN}return r.setMonth(n),r.getMonth()!==l(n)?r.setDate(0):r.getTime()},d(e,t){return new Date(e).setDate(parseInt(t,10))}},c={d(e){return e.getDate()},dd(e){return h(e.getDate(),2)},D(e,t){return t.daysShort[e.getDay()]},DD(e,t){return t.days[e.getDay()]},m(e){return e.getMonth()+1},mm(e){return h(e.getMonth()+1,2)},M(e,t){return t.monthsShort[e.getMonth()]},MM(e,t){return t.months[e.getMonth()]},y(e){return e.getFullYear()},yy(e){return h(e.getFullYear(),2).slice(-2)},yyyy(e){return h(e.getFullYear(),4)}};function l(e){return e>-1?e%12:l(e+12)}function h(e,t){return e.toString().padStart(t,"0")}function u(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in o)return o[e];const t=e.split(a),i=e.match(new RegExp(a,"g"));if(0===t.length||!i)throw new Error("Invalid date format.");const l=i.map((e=>c[e])),h=Object.keys(d).reduce(((e,t)=>(i.find((e=>"D"!==e[0]&&e[0].toLowerCase()===t))&&e.push(t),e)),[]);return o[e]={parser(e,t){const n=e.split(s).reduce(((e,t,r)=>{if(t.length>0&&i[r]){const n=i[r][0];"M"===n?e.m=t:"D"!==n&&(e[n]=t)}return e}),{});return h.reduce(((e,i)=>{const r=d[i](e,n[i],t);return isNaN(r)?e:r}),(0,r.Lg)())},formatter(e,i){return l.reduce(((r,n,a)=>r+`${t[a]}${n(e,i)}`),"")+(0,n.Jm)(t)}}}function g(e,t,i){if(e instanceof Date||"number"==typeof e){const t=(0,r.xR)(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return(0,r.Lg)();if(t&&t.toValue){const n=t.toValue(e,t,i);return isNaN(n)?void 0:(0,r.xR)(n)}return u(t).parser(e,i)}}function f(e,t,i){if(isNaN(e)||!e&&0!==e)return"";const r="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(r,t,i):u(t).formatter(r,i)}},560:function(e,t,i){function r(e){return new Date(e).setHours(0,0,0,0)}function n(){return(new Date).setHours(0,0,0,0)}function a(...e){switch(e.length){case 0:return n();case 1:return r(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function s(e,t){const i=new Date(e);return i.setDate(i.getDate()+t)}function o(e,t){return s(e,7*t)}function d(e,t){const i=new Date(e),r=i.getMonth()+t;let n=r%12;n<0&&(n+=12);const a=i.setMonth(r);return i.getMonth()!==n?i.setDate(0):a}function c(e,t){const i=new Date(e),r=i.getMonth(),n=i.setFullYear(i.getFullYear()+t);return 1===r&&2===i.getMonth()?i.setDate(0):n}function l(e,t){return(e-t+7)%7}function h(e,t,i=0){const r=new Date(e).getDay();return s(e,l(t,i)-l(r,i))}function u(e){const t=h(e,4,1),i=h(new Date(t).setMonth(0,4),4,1);return Math.round((t-i)/6048e5)+1}function g(e,t){const i=new Date(e).getFullYear();return Math.floor(i/t)*t}i.d(t,{Bc:function(){return c},E4:function(){return s},Lg:function(){return n},Qk:function(){return u},ak:function(){return g},by:function(){return a},fr:function(){return h},jh:function(){return o},xR:function(){return r},zI:function(){return d}})},698:function(e,t,i){i.d(t,{He:function(){return c},cF:function(){return s},uV:function(){return o}});const r=new WeakMap,{addEventListener:n,removeEventListener:a}=EventTarget.prototype;function s(e,t){let i=r.get(e);i||(i=[],r.set(e,i)),t.forEach((e=>{n.call(...e),i.push(e)}))}function o(e){let t=r.get(e);t&&(t.forEach((e=>{a.call(...e)})),r.delete(e))}if(!Event.prototype.composedPath){const e=(t,i=[])=>{let r;return i.push(t),t.parentNode?r=t.parentNode:t.host?r=t.host:t.defaultView&&(r=t.defaultView),r?e(r,i):i};Event.prototype.composedPath=function(){return e(this.target)}}function d(e,t,i,r=0){const n=e[r];return t(n)?n:n!==i&&n.parentElement?d(e,t,i,r+1):void 0}function c(e,t){const i="function"==typeof t?t:e=>e.matches(t);return d(e.composedPath(),i,e.currentTarget)}},105:function(e,t,i){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return e[e.length-1]}function a(e,...t){return t.forEach((t=>{e.includes(t)||e.push(t)})),e}function s(e,t){return e?e.split(t):[]}function o(e,t,i){return(void 0===t||e>=t)&&(void 0===i||e<=i)}function d(e,t,i){return ei?i:e}function c(e,t,i={},r=0,n=""){n+=`<${Object.keys(i).reduce(((e,t)=>{let n=i[t];return"function"==typeof n&&(n=n(r)),`${e} ${t}="${n}"`}),e)}>`;const a=r+1;return a\s+/g,">").replace(/\s+ the end, swap them + if (changedSide === 0 && changedDate > otherDate) { + datepickers[0].setDate(otherDate, setDateOptions); + datepickers[1].setDate(changedDate, setDateOptions); + } else if (changedSide === 1 && changedDate < otherDate) { + datepickers[0].setDate(changedDate, setDateOptions); + datepickers[1].setDate(otherDate, setDateOptions); + } + } else if (!rangepicker.allowOneSidedRange) { + // to prevent the range from becoming one-sided, copy changed side's + // selection (no matter if it's empty) to the other side + if (changedDate !== undefined || otherDate !== undefined) { + setDateOptions.clear = true; + datepickers[otherSide].setDate(datepickers[changedSide].dates, setDateOptions); + } + } + datepickers[0].picker.update().render(); + datepickers[1].picker.update().render(); + delete rangepicker._updating; +} + +/** + * Class representing a date range picker + */ +class DateRangePicker { + /** + * Create a date range picker + * @param {Element} element - element to bind a date range picker + * @param {Object} [options] - config options + */ + constructor(element, options = {}) { + const inputs = Array.isArray(options.inputs) + ? options.inputs + : Array.from(element.querySelectorAll('input')); + if (inputs.length < 2) { + return; + } + + element.rangepicker = this; + this.element = element; + this.inputs = inputs.slice(0, 2); + this.allowOneSidedRange = !!options.allowOneSidedRange; + + const changeDateListener = onChangeDate.bind(null, this); + const cleanOptions = filterOptions(options); + // in order for initial date setup to work right when pcicLvel > 0, + // let Datepicker constructor add the instance to the rangepicker + const datepickers = []; + Object.defineProperty(this, 'datepickers', { + get() { + return datepickers; + }, + }); + setupDatepicker(this, changeDateListener, this.inputs[0], cleanOptions); + setupDatepicker(this, changeDateListener, this.inputs[1], cleanOptions); + Object.freeze(datepickers); + // normalize the range if inital dates are given + if (datepickers[0].dates.length > 0) { + onChangeDate(this, {target: this.inputs[0]}); + } else if (datepickers[1].dates.length > 0) { + onChangeDate(this, {target: this.inputs[1]}); + } + } + + /** + * @type {Array} - selected date of the linked date pickers + */ + get dates() { + return this.datepickers.length === 2 + ? [ + this.datepickers[0].dates[0], + this.datepickers[1].dates[0], + ] + : undefined; + } + + /** + * Set new values to the config options + * @param {Object} options - config options to update + */ + setOptions(options) { + this.allowOneSidedRange = !!options.allowOneSidedRange; + + const cleanOptions = filterOptions(options); + this.datepickers[0].setOptions(cleanOptions); + this.datepickers[1].setOptions(cleanOptions); + } + + /** + * Destroy the DateRangePicker instance + * @return {DateRangePicker} - the instance destroyed + */ + destroy() { + this.datepickers[0].destroy(); + this.datepickers[1].destroy(); + (0,_lib_event_js__WEBPACK_IMPORTED_MODULE_0__/* .unregisterListeners */ .uV)(this); + delete this.element.rangepicker; + } + + /** + * Get the start and end dates of the date range + * + * The method returns Date objects by default. If format string is passed, + * it returns date strings formatted in given format. + * The result array always contains 2 items (start date/end date) and + * undefined is used for unselected side. (e.g. If none is selected, + * the result will be [undefined, undefined]. If only the end date is set + * when allowOneSidedRange config option is true, [undefined, endDate] will + * be returned.) + * + * @param {String} [format] - Format string to stringify the dates + * @return {Array} - Start and end dates + */ + getDates(format = undefined) { + const callback = format + ? date => (0,_lib_date_format_js__WEBPACK_IMPORTED_MODULE_1__/* .formatDate */ .p6)(date, format, this.datepickers[0].config.locale) + : date => new Date(date); + + return this.dates.map(date => date === undefined ? date : callback(date)); + } + + /** + * Set the start and end dates of the date range + * + * The method calls datepicker.setDate() internally using each of the + * arguments in start→end order. + * + * When a clear: true option object is passed instead of a date, the method + * clears the date. + * + * If an invalid date, the same date as the current one or an option object + * without clear: true is passed, the method considers that argument as an + * "ineffective" argument because calling datepicker.setDate() with those + * values makes no changes to the date selection. + * + * When the allowOneSidedRange config option is false, passing {clear: true} + * to clear the range works only when it is done to the last effective + * argument (in other words, passed to rangeEnd or to rangeStart along with + * ineffective rangeEnd). This is because when the date range is changed, + * it gets normalized based on the last change at the end of the changing + * process. + * + * @param {Date|Number|String|Object} rangeStart - Start date of the range + * or {clear: true} to clear the date + * @param {Date|Number|String|Object} rangeEnd - End date of the range + * or {clear: true} to clear the date + */ + setDates(rangeStart, rangeEnd) { + const [datepicker0, datepicker1] = this.datepickers; + const origDates = this.dates; + + // If range normalization runs on every change, we can't set a new range + // that starts after the end of the current range correctly because the + // normalization process swaps start↔︎end right after setting the new start + // date. To prevent this, the normalization process needs to run once after + // both of the new dates are set. + this._updating = true; + datepicker0.setDate(rangeStart); + datepicker1.setDate(rangeEnd); + delete this._updating; + + if (datepicker1.dates[0] !== origDates[1]) { + onChangeDate(this, {target: this.inputs[1]}); + } else if (datepicker0.dates[0] !== origDates[0]) { + onChangeDate(this, {target: this.inputs[0]}); + } + } +} + + +/***/ }), + +/***/ 770: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "Z": function() { return /* binding */ Datepicker; } +}); + +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/utils.js +var utils = __webpack_require__(105); +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/date.js +var lib_date = __webpack_require__(560); +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/date-format.js +var date_format = __webpack_require__(963); +// EXTERNAL MODULE: ./node_modules/flowbite-datepicker/js/lib/event.js +var lib_event = __webpack_require__(698); +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/i18n/base-locales.js +// default locales +const locales = { + en: { + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + today: "Today", + clear: "Clear", + titleFormat: "MM y" + } +}; + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/options/defaultOptions.js +// config options updatable by setOptions() and their default values +const defaultOptions = { + autohide: false, + beforeShowDay: null, + beforeShowDecade: null, + beforeShowMonth: null, + beforeShowYear: null, + calendarWeeks: false, + clearBtn: false, + dateDelimiter: ',', + datesDisabled: [], + daysOfWeekDisabled: [], + daysOfWeekHighlighted: [], + defaultViewDate: undefined, // placeholder, defaults to today() by the program + disableTouchKeyboard: false, + format: 'mm/dd/yyyy', + language: 'en', + maxDate: null, + maxNumberOfDates: 1, + maxView: 3, + minDate: null, + nextArrow: '', + orientation: 'auto', + pickLevel: 0, + prevArrow: '', + showDaysOfWeek: true, + showOnClick: true, + showOnFocus: true, + startView: 0, + title: '', + todayBtn: false, + todayBtnMode: 0, + todayHighlight: false, + updateOnBlur: true, + weekStart: 0, +}; + +/* harmony default export */ var options_defaultOptions = (defaultOptions); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/lib/dom.js +const range = document.createRange(); + +function parseHTML(html) { + return range.createContextualFragment(html); +} + +// equivalent to jQuery's :visble +function isVisible(el) { + return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length); +} + +function hideElement(el) { + if (el.style.display === 'none') { + return; + } + // back up the existing display setting in data-style-display + if (el.style.display) { + el.dataset.styleDisplay = el.style.display; + } + el.style.display = 'none'; +} + +function showElement(el) { + if (el.style.display !== 'none') { + return; + } + if (el.dataset.styleDisplay) { + // restore backed-up dispay property + el.style.display = el.dataset.styleDisplay; + delete el.dataset.styleDisplay; + } else { + el.style.display = ''; + } +} + +function emptyChildNodes(el) { + if (el.firstChild) { + el.removeChild(el.firstChild); + emptyChildNodes(el); + } +} + +function replaceChildNodes(el, newChildNodes) { + emptyChildNodes(el); + if (newChildNodes instanceof DocumentFragment) { + el.appendChild(newChildNodes); + } else if (typeof newChildNodes === 'string') { + el.appendChild(parseHTML(newChildNodes)); + } else if (typeof newChildNodes.forEach === 'function') { + newChildNodes.forEach((node) => { + el.appendChild(node); + }); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/options/processOptions.js + + + + + + +const { + language: defaultLang, + format: defaultFormat, + weekStart: defaultWeekStart, +} = options_defaultOptions; + +// Reducer function to filter out invalid day-of-week from the input +function sanitizeDOW(dow, day) { + return dow.length < 6 && day >= 0 && day < 7 + ? (0,utils/* pushUnique */.$C)(dow, day) + : dow; +} + +function calcEndOfWeek(startOfWeek) { + return (startOfWeek + 6) % 7; +} + +// validate input date. if invalid, fallback to the original value +function validateDate(value, format, locale, origValue) { + const date = (0,date_format/* parseDate */.sG)(value, format, locale); + return date !== undefined ? date : origValue; +} + +// Validate viewId. if invalid, fallback to the original value +function validateViewId(value, origValue, max = 3) { + const viewId = parseInt(value, 10); + return viewId >= 0 && viewId <= max ? viewId : origValue; +} + +// Create Datepicker configuration to set +function processOptions(options, datepicker) { + const inOpts = Object.assign({}, options); + const config = {}; + const locales = datepicker.constructor.locales; + let { + format, + language, + locale, + maxDate, + maxView, + minDate, + pickLevel, + startView, + weekStart, + } = datepicker.config || {}; + + if (inOpts.language) { + let lang; + if (inOpts.language !== language) { + if (locales[inOpts.language]) { + lang = inOpts.language; + } else { + // Check if langauge + region tag can fallback to the one without + // region (e.g. fr-CA → fr) + lang = inOpts.language.split('-')[0]; + if (locales[lang] === undefined) { + lang = false; + } + } + } + delete inOpts.language; + if (lang) { + language = config.language = lang; + + // update locale as well when updating language + const origLocale = locale || locales[defaultLang]; + // use default language's properties for the fallback + locale = Object.assign({ + format: defaultFormat, + weekStart: defaultWeekStart + }, locales[defaultLang]); + if (language !== defaultLang) { + Object.assign(locale, locales[language]); + } + config.locale = locale; + // if format and/or weekStart are the same as old locale's defaults, + // update them to new locale's defaults + if (format === origLocale.format) { + format = config.format = locale.format; + } + if (weekStart === origLocale.weekStart) { + weekStart = config.weekStart = locale.weekStart; + config.weekEnd = calcEndOfWeek(locale.weekStart); + } + } + } + + if (inOpts.format) { + const hasToDisplay = typeof inOpts.format.toDisplay === 'function'; + const hasToValue = typeof inOpts.format.toValue === 'function'; + const validFormatString = date_format/* reFormatTokens.test */.CL.test(inOpts.format); + if ((hasToDisplay && hasToValue) || validFormatString) { + format = config.format = inOpts.format; + } + delete inOpts.format; + } + + //*** dates ***// + // while min and maxDate for "no limit" in the options are better to be null + // (especially when updating), the ones in the config have to be undefined + // because null is treated as 0 (= unix epoch) when comparing with time value + let minDt = minDate; + let maxDt = maxDate; + if (inOpts.minDate !== undefined) { + minDt = inOpts.minDate === null + ? (0,lib_date/* dateValue */.by)(0, 0, 1) // set 0000-01-01 to prevent negative values for year + : validateDate(inOpts.minDate, format, locale, minDt); + delete inOpts.minDate; + } + if (inOpts.maxDate !== undefined) { + maxDt = inOpts.maxDate === null + ? undefined + : validateDate(inOpts.maxDate, format, locale, maxDt); + delete inOpts.maxDate; + } + if (maxDt < minDt) { + minDate = config.minDate = maxDt; + maxDate = config.maxDate = minDt; + } else { + if (minDate !== minDt) { + minDate = config.minDate = minDt; + } + if (maxDate !== maxDt) { + maxDate = config.maxDate = maxDt; + } + } + + if (inOpts.datesDisabled) { + config.datesDisabled = inOpts.datesDisabled.reduce((dates, dt) => { + const date = (0,date_format/* parseDate */.sG)(dt, format, locale); + return date !== undefined ? (0,utils/* pushUnique */.$C)(dates, date) : dates; + }, []); + delete inOpts.datesDisabled; + } + if (inOpts.defaultViewDate !== undefined) { + const viewDate = (0,date_format/* parseDate */.sG)(inOpts.defaultViewDate, format, locale); + if (viewDate !== undefined) { + config.defaultViewDate = viewDate; + } + delete inOpts.defaultViewDate; + } + + //*** days of week ***// + if (inOpts.weekStart !== undefined) { + const wkStart = Number(inOpts.weekStart) % 7; + if (!isNaN(wkStart)) { + weekStart = config.weekStart = wkStart; + config.weekEnd = calcEndOfWeek(wkStart); + } + delete inOpts.weekStart; + } + if (inOpts.daysOfWeekDisabled) { + config.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []); + delete inOpts.daysOfWeekDisabled; + } + if (inOpts.daysOfWeekHighlighted) { + config.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []); + delete inOpts.daysOfWeekHighlighted; + } + + //*** multi date ***// + if (inOpts.maxNumberOfDates !== undefined) { + const maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10); + if (maxNumberOfDates >= 0) { + config.maxNumberOfDates = maxNumberOfDates; + config.multidate = maxNumberOfDates !== 1; + } + delete inOpts.maxNumberOfDates; + } + if (inOpts.dateDelimiter) { + config.dateDelimiter = String(inOpts.dateDelimiter); + delete inOpts.dateDelimiter; + } + + //*** pick level & view ***// + let newPickLevel = pickLevel; + if (inOpts.pickLevel !== undefined) { + newPickLevel = validateViewId(inOpts.pickLevel, 2); + delete inOpts.pickLevel; + } + if (newPickLevel !== pickLevel) { + pickLevel = config.pickLevel = newPickLevel; + } + + let newMaxView = maxView; + if (inOpts.maxView !== undefined) { + newMaxView = validateViewId(inOpts.maxView, maxView); + delete inOpts.maxView; + } + // ensure max view >= pick level + newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView; + if (newMaxView !== maxView) { + maxView = config.maxView = newMaxView; + } + + let newStartView = startView; + if (inOpts.startView !== undefined) { + newStartView = validateViewId(inOpts.startView, newStartView); + delete inOpts.startView; + } + // ensure pick level <= start view <= max view + if (newStartView < pickLevel) { + newStartView = pickLevel; + } else if (newStartView > maxView) { + newStartView = maxView; + } + if (newStartView !== startView) { + config.startView = newStartView; + } + + //*** template ***// + if (inOpts.prevArrow) { + const prevArrow = parseHTML(inOpts.prevArrow); + if (prevArrow.childNodes.length > 0) { + config.prevArrow = prevArrow.childNodes; + } + delete inOpts.prevArrow; + } + if (inOpts.nextArrow) { + const nextArrow = parseHTML(inOpts.nextArrow); + if (nextArrow.childNodes.length > 0) { + config.nextArrow = nextArrow.childNodes; + } + delete inOpts.nextArrow; + } + + //*** misc ***// + if (inOpts.disableTouchKeyboard !== undefined) { + config.disableTouchKeyboard = 'ontouchstart' in document && !!inOpts.disableTouchKeyboard; + delete inOpts.disableTouchKeyboard; + } + if (inOpts.orientation) { + const orientation = inOpts.orientation.toLowerCase().split(/\s+/g); + config.orientation = { + x: orientation.find(x => (x === 'left' || x === 'right')) || 'auto', + y: orientation.find(y => (y === 'top' || y === 'bottom')) || 'auto', + }; + delete inOpts.orientation; + } + if (inOpts.todayBtnMode !== undefined) { + switch(inOpts.todayBtnMode) { + case 0: + case 1: + config.todayBtnMode = inOpts.todayBtnMode; + } + delete inOpts.todayBtnMode; + } + + //*** copy the rest ***// + Object.keys(inOpts).forEach((key) => { + if (inOpts[key] !== undefined && (0,utils/* hasProperty */.l$)(options_defaultOptions, key)) { + config[key] = inOpts[key]; + } + }); + + return config; +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/templates/pickerTemplate.js + + +const pickerTemplate = (0,utils/* optimizeTemplateHTML */.zh)(``); + +/* harmony default export */ var templates_pickerTemplate = (pickerTemplate); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/templates/daysTemplate.js + + +const daysTemplate = (0,utils/* optimizeTemplateHTML */.zh)(`
+
${(0,utils/* createTagRepeat */.em)('span', 7, {class: 'dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
+
${(0,utils/* createTagRepeat */.em)('span', 42 , {class: 'block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400'})}
+
`); + +/* harmony default export */ var templates_daysTemplate = (daysTemplate); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/templates/calendarWeeksTemplate.js + + +const calendarWeeksTemplate = (0,utils/* optimizeTemplateHTML */.zh)(`
+
+
${(0,utils/* createTagRepeat */.em)('span', 6, {class: 'week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
+
`); + +/* harmony default export */ var templates_calendarWeeksTemplate = (calendarWeeksTemplate); + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/View.js + + + +// Base class of the view classes +class View { + constructor(picker, config) { + Object.assign(this, config, { + picker, + element: parseHTML(`
`).firstChild, + selected: [], + }); + this.init(this.picker.datepicker.config); + } + + init(options) { + if (options.pickLevel !== undefined) { + this.isMinView = this.id === options.pickLevel; + } + this.setOptions(options); + this.updateFocus(); + this.updateSelection(); + } + + // Execute beforeShow() callback and apply the result to the element + // args: + // - current - current value on the iteration on view rendering + // - timeValue - time value of the date to pass to beforeShow() + performBeforeHook(el, current, timeValue) { + let result = this.beforeShow(new Date(timeValue)); + switch (typeof result) { + case 'boolean': + result = {enabled: result}; + break; + case 'string': + result = {classes: result}; + } + + if (result) { + if (result.enabled === false) { + el.classList.add('disabled'); + (0,utils/* pushUnique */.$C)(this.disabled, current); + } + if (result.classes) { + const extraClasses = result.classes.split(/\s+/); + el.classList.add(...extraClasses); + if (extraClasses.includes('disabled')) { + (0,utils/* pushUnique */.$C)(this.disabled, current); + } + } + if (result.content) { + replaceChildNodes(el, result.content); + } + } + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/DaysView.js + + + + + + + + +class DaysView extends View { + constructor(picker) { + super(picker, { + id: 0, + name: 'days', + cellClass: 'day', + }); + } + + init(options, onConstruction = true) { + if (onConstruction) { + const inner = parseHTML(templates_daysTemplate).firstChild; + this.dow = inner.firstChild; + this.grid = inner.lastChild; + this.element.appendChild(inner); + } + super.init(options); + } + + setOptions(options) { + let updateDOW; + + if ((0,utils/* hasProperty */.l$)(options, 'minDate')) { + this.minDate = options.minDate; + } + if ((0,utils/* hasProperty */.l$)(options, 'maxDate')) { + this.maxDate = options.maxDate; + } + if (options.datesDisabled) { + this.datesDisabled = options.datesDisabled; + } + if (options.daysOfWeekDisabled) { + this.daysOfWeekDisabled = options.daysOfWeekDisabled; + updateDOW = true; + } + if (options.daysOfWeekHighlighted) { + this.daysOfWeekHighlighted = options.daysOfWeekHighlighted; + } + if (options.todayHighlight !== undefined) { + this.todayHighlight = options.todayHighlight; + } + if (options.weekStart !== undefined) { + this.weekStart = options.weekStart; + this.weekEnd = options.weekEnd; + updateDOW = true; + } + if (options.locale) { + const locale = this.locale = options.locale; + this.dayNames = locale.daysMin; + this.switchLabelFormat = locale.titleFormat; + updateDOW = true; + } + if (options.beforeShowDay !== undefined) { + this.beforeShow = typeof options.beforeShowDay === 'function' + ? options.beforeShowDay + : undefined; + } + + if (options.calendarWeeks !== undefined) { + if (options.calendarWeeks && !this.calendarWeeks) { + const weeksElem = parseHTML(templates_calendarWeeksTemplate).firstChild; + this.calendarWeeks = { + element: weeksElem, + dow: weeksElem.firstChild, + weeks: weeksElem.lastChild, + }; + this.element.insertBefore(weeksElem, this.element.firstChild); + } else if (this.calendarWeeks && !options.calendarWeeks) { + this.element.removeChild(this.calendarWeeks.element); + this.calendarWeeks = null; + } + } + if (options.showDaysOfWeek !== undefined) { + if (options.showDaysOfWeek) { + showElement(this.dow); + if (this.calendarWeeks) { + showElement(this.calendarWeeks.dow); + } + } else { + hideElement(this.dow); + if (this.calendarWeeks) { + hideElement(this.calendarWeeks.dow); + } + } + } + + // update days-of-week when locale, daysOfweekDisabled or weekStart is changed + if (updateDOW) { + Array.from(this.dow.children).forEach((el, index) => { + const dow = (this.weekStart + index) % 7; + el.textContent = this.dayNames[dow]; + el.className = this.daysOfWeekDisabled.includes(dow) ? 'dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed' : 'dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400'; + }); + } + } + + // Apply update on the focused date to view's settings + updateFocus() { + const viewDate = new Date(this.picker.viewDate); + const viewYear = viewDate.getFullYear(); + const viewMonth = viewDate.getMonth(); + const firstOfMonth = (0,lib_date/* dateValue */.by)(viewYear, viewMonth, 1); + const start = (0,lib_date/* dayOfTheWeekOf */.fr)(firstOfMonth, this.weekStart, this.weekStart); + + this.first = firstOfMonth; + this.last = (0,lib_date/* dateValue */.by)(viewYear, viewMonth + 1, 0); + this.start = start; + this.focused = this.picker.viewDate; + } + + // Apply update on the selected dates to view's settings + updateSelection() { + const {dates, rangepicker} = this.picker.datepicker; + this.selected = dates; + if (rangepicker) { + this.range = rangepicker.dates; + } + } + + // Update the entire view UI + render() { + // update today marker on ever render + this.today = this.todayHighlight ? (0,lib_date/* today */.Lg)() : undefined; + // refresh disabled dates on every render in order to clear the ones added + // by beforeShow hook at previous render + this.disabled = [...this.datesDisabled]; + + const switchLabel = (0,date_format/* formatDate */.p6)(this.focused, this.switchLabelFormat, this.locale); + this.picker.setViewSwitchLabel(switchLabel); + this.picker.setPrevBtnDisabled(this.first <= this.minDate); + this.picker.setNextBtnDisabled(this.last >= this.maxDate); + + if (this.calendarWeeks) { + // start of the UTC week (Monday) of the 1st of the month + const startOfWeek = (0,lib_date/* dayOfTheWeekOf */.fr)(this.first, 1, 1); + Array.from(this.calendarWeeks.weeks.children).forEach((el, index) => { + el.textContent = (0,lib_date/* getWeek */.Qk)((0,lib_date/* addWeeks */.jh)(startOfWeek, index)); + }); + } + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + const current = (0,lib_date/* addDays */.E4)(this.start, index); + const date = new Date(current); + const day = date.getDay(); + + el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`; + el.dataset.date = current; + el.textContent = date.getDate(); + + if (current < this.first) { + classList.add('prev', 'text-gray-500', 'dark:text-white'); + } else if (current > this.last) { + classList.add('next', 'text-gray-500', 'dark:text-white'); + } + if (this.today === current) { + classList.add('today', 'bg-gray-100', 'dark:bg-gray-600'); + } + if (current < this.minDate || current > this.maxDate || this.disabled.includes(current)) { + classList.add('disabled', 'cursor-not-allowed'); + } + if (this.daysOfWeekDisabled.includes(day)) { + classList.add('disabled', 'cursor-not-allowed'); + (0,utils/* pushUnique */.$C)(this.disabled, current); + } + if (this.daysOfWeekHighlighted.includes(day)) { + classList.add('highlighted'); + } + if (this.range) { + const [rangeStart, rangeEnd] = this.range; + if (current > rangeStart && current < rangeEnd) { + classList.add('range', 'bg-gray-200', 'dark:bg-gray-600'); + classList.remove('rounded-lg', 'rounded-l-lg', 'rounded-r-lg') + } + if (current === rangeStart) { + classList.add('range-start', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-l-lg'); + classList.remove('rounded-lg', 'rounded-r-lg'); + } + if (current === rangeEnd) { + classList.add('range-end', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-r-lg'); + classList.remove('rounded-lg', 'rounded-l-lg'); + } + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'text-gray-500', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'dark:bg-gray-600', 'bg-gray-100', 'bg-gray-200'); + } + if (current === this.focused) { + classList.add('focused'); + } + + if (this.beforeShow) { + this.performBeforeHook(el, current, current); + } + }); + } + + // Update the view UI by applying the changes of selected and focused items + refresh() { + const [rangeStart, rangeEnd] = this.range || []; + this.grid + .querySelectorAll('.range, .range-start, .range-end, .selected, .focused') + .forEach((el) => { + el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused'); + el.classList.add('text-gray-900', 'rounded-lg', 'dark:text-white'); + }); + Array.from(this.grid.children).forEach((el) => { + const current = Number(el.dataset.date); + const classList = el.classList; + classList.remove('bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg', 'rounded-r-lg') + if (current > rangeStart && current < rangeEnd) { + classList.add('range', 'bg-gray-200', 'dark:bg-gray-600'); + classList.remove('rounded-lg'); + } + if (current === rangeStart) { + classList.add('range-start', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg'); + classList.remove('rounded-lg', 'rounded-r-lg'); + } + if (current === rangeEnd) { + classList.add('range-end', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-r-lg'); + classList.remove('rounded-lg', 'rounded-l-lg'); + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'bg-gray-100', 'bg-gray-200', 'dark:bg-gray-600'); + } + if (current === this.focused) { + classList.add('focused'); + } + }); + } + + // Update the view UI by applying the change of focused item + refreshFocus() { + const index = Math.round((this.focused - this.start) / 86400000); + this.grid.querySelectorAll('.focused').forEach((el) => { + el.classList.remove('focused'); + }); + this.grid.children[index].classList.add('focused'); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/MonthsView.js + + + + + +function computeMonthRange(range, thisYear) { + if (!range || !range[0] || !range[1]) { + return; + } + + const [[startY, startM], [endY, endM]] = range; + if (startY > thisYear || endY < thisYear) { + return; + } + return [ + startY === thisYear ? startM : -1, + endY === thisYear ? endM : 12, + ]; +} + +class MonthsView extends View { + constructor(picker) { + super(picker, { + id: 1, + name: 'months', + cellClass: 'month', + }); + } + + init(options, onConstruction = true) { + if (onConstruction) { + this.grid = this.element; + this.element.classList.add('months', 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4'); + this.grid.appendChild(parseHTML((0,utils/* createTagRepeat */.em)('span', 12, {'data-month': ix => ix}))); + } + super.init(options); + } + + setOptions(options) { + if (options.locale) { + this.monthNames = options.locale.monthsShort; + } + if ((0,utils/* hasProperty */.l$)(options, 'minDate')) { + if (options.minDate === undefined) { + this.minYear = this.minMonth = this.minDate = undefined; + } else { + const minDateObj = new Date(options.minDate); + this.minYear = minDateObj.getFullYear(); + this.minMonth = minDateObj.getMonth(); + this.minDate = minDateObj.setDate(1); + } + } + if ((0,utils/* hasProperty */.l$)(options, 'maxDate')) { + if (options.maxDate === undefined) { + this.maxYear = this.maxMonth = this.maxDate = undefined; + } else { + const maxDateObj = new Date(options.maxDate); + this.maxYear = maxDateObj.getFullYear(); + this.maxMonth = maxDateObj.getMonth(); + this.maxDate = (0,lib_date/* dateValue */.by)(this.maxYear, this.maxMonth + 1, 0); + } + } + if (options.beforeShowMonth !== undefined) { + this.beforeShow = typeof options.beforeShowMonth === 'function' + ? options.beforeShowMonth + : undefined; + } + } + + // Update view's settings to reflect the viewDate set on the picker + updateFocus() { + const viewDate = new Date(this.picker.viewDate); + this.year = viewDate.getFullYear(); + this.focused = viewDate.getMonth(); + } + + // Update view's settings to reflect the selected dates + updateSelection() { + const {dates, rangepicker} = this.picker.datepicker; + this.selected = dates.reduce((selected, timeValue) => { + const date = new Date(timeValue); + const year = date.getFullYear(); + const month = date.getMonth(); + if (selected[year] === undefined) { + selected[year] = [month]; + } else { + (0,utils/* pushUnique */.$C)(selected[year], month); + } + return selected; + }, {}); + if (rangepicker && rangepicker.dates) { + this.range = rangepicker.dates.map(timeValue => { + const date = new Date(timeValue); + return isNaN(date) ? undefined : [date.getFullYear(), date.getMonth()]; + }); + } + } + + // Update the entire view UI + render() { + // refresh disabled months on every render in order to clear the ones added + // by beforeShow hook at previous render + this.disabled = []; + + this.picker.setViewSwitchLabel(this.year); + this.picker.setPrevBtnDisabled(this.year <= this.minYear); + this.picker.setNextBtnDisabled(this.year >= this.maxYear); + + const selected = this.selected[this.year] || []; + const yrOutOfRange = this.year < this.minYear || this.year > this.maxYear; + const isMinYear = this.year === this.minYear; + const isMaxYear = this.year === this.maxYear; + const range = computeMonthRange(this.range, this.year); + + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + const date = (0,lib_date/* dateValue */.by)(this.year, index, 1); + + el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`; + if (this.isMinView) { + el.dataset.date = date; + } + // reset text on every render to clear the custom content set + // by beforeShow hook at previous render + el.textContent = this.monthNames[index]; + + if ( + yrOutOfRange + || isMinYear && index < this.minMonth + || isMaxYear && index > this.maxMonth + ) { + classList.add('disabled'); + } + if (range) { + const [rangeStart, rangeEnd] = range; + if (index > rangeStart && index < rangeEnd) { + classList.add('range'); + } + if (index === rangeStart) { + classList.add('range-start'); + } + if (index === rangeEnd) { + classList.add('range-end'); + } + } + if (selected.includes(index)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (index === this.focused) { + classList.add('focused'); + } + + if (this.beforeShow) { + this.performBeforeHook(el, index, date); + } + }); + } + + // Update the view UI by applying the changes of selected and focused items + refresh() { + const selected = this.selected[this.year] || []; + const [rangeStart, rangeEnd] = computeMonthRange(this.range, this.year) || []; + this.grid + .querySelectorAll('.range, .range-start, .range-end, .selected, .focused') + .forEach((el) => { + el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'dark:bg-blue-600', 'dark:text-white', 'text-white', 'focused'); + el.classList.add('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + }); + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + if (index > rangeStart && index < rangeEnd) { + classList.add('range'); + } + if (index === rangeStart) { + classList.add('range-start'); + } + if (index === rangeEnd) { + classList.add('range-end'); + } + if (selected.includes(index)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (index === this.focused) { + classList.add('focused'); + } + }); + } + + // Update the view UI by applying the change of focused item + refreshFocus() { + this.grid.querySelectorAll('.focused').forEach((el) => { + el.classList.remove('focused'); + }); + this.grid.children[this.focused].classList.add('focused'); + } +} +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/views/YearsView.js + + + + + +function toTitleCase(word) { + return [...word].reduce((str, ch, ix) => str += ix ? ch : ch.toUpperCase(), ''); +} + +// Class representing the years and decades view elements +class YearsView extends View { + constructor(picker, config) { + super(picker, config); + } + + init(options, onConstruction = true) { + if (onConstruction) { + this.navStep = this.step * 10; + this.beforeShowOption = `beforeShow${toTitleCase(this.cellClass)}`; + this.grid = this.element; + this.element.classList.add(this.name, 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4'); + this.grid.appendChild(parseHTML((0,utils/* createTagRepeat */.em)('span', 12))); + } + super.init(options); + } + + setOptions(options) { + if ((0,utils/* hasProperty */.l$)(options, 'minDate')) { + if (options.minDate === undefined) { + this.minYear = this.minDate = undefined; + } else { + this.minYear = (0,lib_date/* startOfYearPeriod */.ak)(options.minDate, this.step); + this.minDate = (0,lib_date/* dateValue */.by)(this.minYear, 0, 1); + } + } + if ((0,utils/* hasProperty */.l$)(options, 'maxDate')) { + if (options.maxDate === undefined) { + this.maxYear = this.maxDate = undefined; + } else { + this.maxYear = (0,lib_date/* startOfYearPeriod */.ak)(options.maxDate, this.step); + this.maxDate = (0,lib_date/* dateValue */.by)(this.maxYear, 11, 31); + } + } + if (options[this.beforeShowOption] !== undefined) { + const beforeShow = options[this.beforeShowOption]; + this.beforeShow = typeof beforeShow === 'function' ? beforeShow : undefined; + } + } + + // Update view's settings to reflect the viewDate set on the picker + updateFocus() { + const viewDate = new Date(this.picker.viewDate); + const first = (0,lib_date/* startOfYearPeriod */.ak)(viewDate, this.navStep); + const last = first + 9 * this.step; + + this.first = first; + this.last = last; + this.start = first - this.step; + this.focused = (0,lib_date/* startOfYearPeriod */.ak)(viewDate, this.step); + } + + // Update view's settings to reflect the selected dates + updateSelection() { + const {dates, rangepicker} = this.picker.datepicker; + this.selected = dates.reduce((years, timeValue) => { + return (0,utils/* pushUnique */.$C)(years, (0,lib_date/* startOfYearPeriod */.ak)(timeValue, this.step)); + }, []); + if (rangepicker && rangepicker.dates) { + this.range = rangepicker.dates.map(timeValue => { + if (timeValue !== undefined) { + return (0,lib_date/* startOfYearPeriod */.ak)(timeValue, this.step); + } + }); + } + } + + // Update the entire view UI + render() { + // refresh disabled years on every render in order to clear the ones added + // by beforeShow hook at previous render + this.disabled = []; + + this.picker.setViewSwitchLabel(`${this.first}-${this.last}`); + this.picker.setPrevBtnDisabled(this.first <= this.minYear); + this.picker.setNextBtnDisabled(this.last >= this.maxYear); + + Array.from(this.grid.children).forEach((el, index) => { + const classList = el.classList; + const current = this.start + (index * this.step); + const date = (0,lib_date/* dateValue */.by)(current, 0, 1); + + el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`; + if (this.isMinView) { + el.dataset.date = date; + } + el.textContent = el.dataset.year = current; + + if (index === 0) { + classList.add('prev'); + } else if (index === 11) { + classList.add('next'); + } + if (current < this.minYear || current > this.maxYear) { + classList.add('disabled'); + } + if (this.range) { + const [rangeStart, rangeEnd] = this.range; + if (current > rangeStart && current < rangeEnd) { + classList.add('range'); + } + if (current === rangeStart) { + classList.add('range-start'); + } + if (current === rangeEnd) { + classList.add('range-end'); + } + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (current === this.focused) { + classList.add('focused'); + } + + if (this.beforeShow) { + this.performBeforeHook(el, current, date); + } + }); + } + + // Update the view UI by applying the changes of selected and focused items + refresh() { + const [rangeStart, rangeEnd] = this.range || []; + this.grid + .querySelectorAll('.range, .range-start, .range-end, .selected, .focused') + .forEach((el) => { + el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused'); + }); + Array.from(this.grid.children).forEach((el) => { + const current = Number(el.textContent); + const classList = el.classList; + if (current > rangeStart && current < rangeEnd) { + classList.add('range'); + } + if (current === rangeStart) { + classList.add('range-start'); + } + if (current === rangeEnd) { + classList.add('range-end'); + } + if (this.selected.includes(current)) { + classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white'); + classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600'); + } + if (current === this.focused) { + classList.add('focused'); + } + }); + } + + // Update the view UI by applying the change of focused item + refreshFocus() { + const index = Math.round((this.focused - this.start) / this.step); + this.grid.querySelectorAll('.focused').forEach((el) => { + el.classList.remove('focused'); + }); + this.grid.children[index].classList.add('focused'); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/functions.js + + + +function triggerDatepickerEvent(datepicker, type) { + const detail = { + date: datepicker.getDate(), + viewDate: new Date(datepicker.picker.viewDate), + viewId: datepicker.picker.currentView.id, + datepicker, + }; + datepicker.element.dispatchEvent(new CustomEvent(type, {detail})); +} + +// direction: -1 (to previous), 1 (to next) +function goToPrevOrNext(datepicker, direction) { + const {minDate, maxDate} = datepicker.config; + const {currentView, viewDate} = datepicker.picker; + let newViewDate; + switch (currentView.id) { + case 0: + newViewDate = (0,lib_date/* addMonths */.zI)(viewDate, direction); + break; + case 1: + newViewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction); + break; + default: + newViewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction * currentView.navStep); + } + newViewDate = (0,utils/* limitToRange */.jG)(newViewDate, minDate, maxDate); + datepicker.picker.changeFocus(newViewDate).render(); +} + +function switchView(datepicker) { + const viewId = datepicker.picker.currentView.id; + if (viewId === datepicker.config.maxView) { + return; + } + datepicker.picker.changeView(viewId + 1).render(); +} + +function unfocus(datepicker) { + if (datepicker.config.updateOnBlur) { + datepicker.update({autohide: true}); + } else { + datepicker.refresh('input'); + datepicker.hide(); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/pickerListeners.js + + + + +function goToSelectedMonthOrYear(datepicker, selection) { + const picker = datepicker.picker; + const viewDate = new Date(picker.viewDate); + const viewId = picker.currentView.id; + const newDate = viewId === 1 + ? (0,lib_date/* addMonths */.zI)(viewDate, selection - viewDate.getMonth()) + : (0,lib_date/* addYears */.Bc)(viewDate, selection - viewDate.getFullYear()); + + picker.changeFocus(newDate).changeView(viewId - 1).render(); +} + +function onClickTodayBtn(datepicker) { + const picker = datepicker.picker; + const currentDate = (0,lib_date/* today */.Lg)(); + if (datepicker.config.todayBtnMode === 1) { + if (datepicker.config.autohide) { + datepicker.setDate(currentDate); + return; + } + datepicker.setDate(currentDate, {render: false}); + picker.update(); + } + if (picker.viewDate !== currentDate) { + picker.changeFocus(currentDate); + } + picker.changeView(0).render(); +} + +function onClickClearBtn(datepicker) { + datepicker.setDate({clear: true}); +} + +function onClickViewSwitch(datepicker) { + switchView(datepicker); +} + +function onClickPrevBtn(datepicker) { + goToPrevOrNext(datepicker, -1); +} + +function onClickNextBtn(datepicker) { + goToPrevOrNext(datepicker, 1); +} + +// For the picker's main block to delegete the events from `datepicker-cell`s +function onClickView(datepicker, ev) { + const target = (0,lib_event/* findElementInEventPath */.He)(ev, '.datepicker-cell'); + if (!target || target.classList.contains('disabled')) { + return; + } + + const {id, isMinView} = datepicker.picker.currentView; + if (isMinView) { + datepicker.setDate(Number(target.dataset.date)); + } else if (id === 1) { + goToSelectedMonthOrYear(datepicker, Number(target.dataset.month)); + } else { + goToSelectedMonthOrYear(datepicker, Number(target.dataset.year)); + } +} + +function onClickPicker(datepicker) { + if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) { + datepicker.inputField.focus(); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/picker/Picker.js + + + + + + + + + + + +function processPickerOptions(picker, options) { + if (options.title !== undefined) { + if (options.title) { + picker.controls.title.textContent = options.title; + showElement(picker.controls.title); + } else { + picker.controls.title.textContent = ''; + hideElement(picker.controls.title); + } + } + if (options.prevArrow) { + const prevBtn = picker.controls.prevBtn; + emptyChildNodes(prevBtn); + options.prevArrow.forEach((node) => { + prevBtn.appendChild(node.cloneNode(true)); + }); + } + if (options.nextArrow) { + const nextBtn = picker.controls.nextBtn; + emptyChildNodes(nextBtn); + options.nextArrow.forEach((node) => { + nextBtn.appendChild(node.cloneNode(true)); + }); + } + if (options.locale) { + picker.controls.todayBtn.textContent = options.locale.today; + picker.controls.clearBtn.textContent = options.locale.clear; + } + if (options.todayBtn !== undefined) { + if (options.todayBtn) { + showElement(picker.controls.todayBtn); + } else { + hideElement(picker.controls.todayBtn); + } + } + if ((0,utils/* hasProperty */.l$)(options, 'minDate') || (0,utils/* hasProperty */.l$)(options, 'maxDate')) { + const {minDate, maxDate} = picker.datepicker.config; + picker.controls.todayBtn.disabled = !(0,utils/* isInRange */.mh)((0,lib_date/* today */.Lg)(), minDate, maxDate); + } + if (options.clearBtn !== undefined) { + if (options.clearBtn) { + showElement(picker.controls.clearBtn); + } else { + hideElement(picker.controls.clearBtn); + } + } +} + +// Compute view date to reset, which will be... +// - the last item of the selected dates or defaultViewDate if no selection +// - limitted to minDate or maxDate if it exceeds the range +function computeResetViewDate(datepicker) { + const {dates, config} = datepicker; + const viewDate = dates.length > 0 ? (0,utils/* lastItemOf */.Jm)(dates) : config.defaultViewDate; + return (0,utils/* limitToRange */.jG)(viewDate, config.minDate, config.maxDate); +} + +// Change current view's view date +function setViewDate(picker, newDate) { + const oldViewDate = new Date(picker.viewDate); + const newViewDate = new Date(newDate); + const {id, year, first, last} = picker.currentView; + const viewYear = newViewDate.getFullYear(); + + picker.viewDate = newDate; + if (viewYear !== oldViewDate.getFullYear()) { + triggerDatepickerEvent(picker.datepicker, 'changeYear'); + } + if (newViewDate.getMonth() !== oldViewDate.getMonth()) { + triggerDatepickerEvent(picker.datepicker, 'changeMonth'); + } + + // return whether the new date is in different period on time from the one + // displayed in the current view + // when true, the view needs to be re-rendered on the next UI refresh. + switch (id) { + case 0: + return newDate < first || newDate > last; + case 1: + return viewYear !== year; + default: + return viewYear < first || viewYear > last; + } +} + +function getTextDirection(el) { + return window.getComputedStyle(el).direction; +} + +// Class representing the picker UI +class Picker { + constructor(datepicker) { + this.datepicker = datepicker; + + const template = templates_pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass); + const element = this.element = parseHTML(template).firstChild; + const [header, main, footer] = element.firstChild.children; + const title = header.firstElementChild; + const [prevBtn, viewSwitch, nextBtn] = header.lastElementChild.children; + const [todayBtn, clearBtn] = footer.firstChild.children; + const controls = { + title, + prevBtn, + viewSwitch, + nextBtn, + todayBtn, + clearBtn, + }; + this.main = main; + this.controls = controls; + + const elementClass = datepicker.inline ? 'inline' : 'dropdown'; + element.classList.add(`datepicker-${elementClass}`); + elementClass === 'dropdown' ? element.classList.add('dropdown', 'absolute', 'top-0', 'left-0', 'z-50', 'pt-2') : null; + + processPickerOptions(this, datepicker.config); + this.viewDate = computeResetViewDate(datepicker); + + // set up event listeners + (0,lib_event/* registerListeners */.cF)(datepicker, [ + [element, 'click', onClickPicker.bind(null, datepicker), {capture: true}], + [main, 'click', onClickView.bind(null, datepicker)], + [controls.viewSwitch, 'click', onClickViewSwitch.bind(null, datepicker)], + [controls.prevBtn, 'click', onClickPrevBtn.bind(null, datepicker)], + [controls.nextBtn, 'click', onClickNextBtn.bind(null, datepicker)], + [controls.todayBtn, 'click', onClickTodayBtn.bind(null, datepicker)], + [controls.clearBtn, 'click', onClickClearBtn.bind(null, datepicker)], + ]); + + // set up views + this.views = [ + new DaysView(this), + new MonthsView(this), + new YearsView(this, {id: 2, name: 'years', cellClass: 'year', step: 1}), + new YearsView(this, {id: 3, name: 'decades', cellClass: 'decade', step: 10}), + ]; + this.currentView = this.views[datepicker.config.startView]; + + this.currentView.render(); + this.main.appendChild(this.currentView.element); + datepicker.config.container.appendChild(this.element); + } + + setOptions(options) { + processPickerOptions(this, options); + this.views.forEach((view) => { + view.init(options, false); + }); + this.currentView.render(); + } + + detach() { + this.datepicker.config.container.removeChild(this.element); + } + + show() { + if (this.active) { + return; + } + this.element.classList.add('active', 'block'); + this.element.classList.remove('hidden'); + this.active = true; + + const datepicker = this.datepicker; + if (!datepicker.inline) { + // ensure picker's direction matches input's + const inputDirection = getTextDirection(datepicker.inputField); + if (inputDirection !== getTextDirection(datepicker.config.container)) { + this.element.dir = inputDirection; + } else if (this.element.dir) { + this.element.removeAttribute('dir'); + } + + this.place(); + if (datepicker.config.disableTouchKeyboard) { + datepicker.inputField.blur(); + } + } + triggerDatepickerEvent(datepicker, 'show'); + } + + hide() { + if (!this.active) { + return; + } + this.datepicker.exitEditMode(); + this.element.classList.remove('active', 'block'); + this.element.classList.add('active', 'block', 'hidden'); + this.active = false; + triggerDatepickerEvent(this.datepicker, 'hide'); + } + + place() { + const {classList, style} = this.element; + const {config, inputField} = this.datepicker; + const container = config.container; + const { + width: calendarWidth, + height: calendarHeight, + } = this.element.getBoundingClientRect(); + const { + left: containerLeft, + top: containerTop, + width: containerWidth, + } = container.getBoundingClientRect(); + const { + left: inputLeft, + top: inputTop, + width: inputWidth, + height: inputHeight + } = inputField.getBoundingClientRect(); + let {x: orientX, y: orientY} = config.orientation; + let scrollTop; + let left; + let top; + + if (container === document.body) { + scrollTop = window.scrollY; + left = inputLeft + window.scrollX; + top = inputTop + scrollTop; + } else { + scrollTop = container.scrollTop; + left = inputLeft - containerLeft; + top = inputTop - containerTop + scrollTop; + } + + if (orientX === 'auto') { + if (left < 0) { + // align to the left and move into visible area if input's left edge < window's + orientX = 'left'; + left = 10; + } else if (left + calendarWidth > containerWidth) { + // align to the right if canlendar's right edge > container's + orientX = 'right'; + } else { + orientX = getTextDirection(inputField) === 'rtl' ? 'right' : 'left'; + } + } + if (orientX === 'right') { + left -= calendarWidth - inputWidth; + } + + if (orientY === 'auto') { + orientY = top - calendarHeight < scrollTop ? 'bottom' : 'top'; + } + if (orientY === 'top') { + top -= calendarHeight; + } else { + top += inputHeight; + } + + classList.remove( + 'datepicker-orient-top', + 'datepicker-orient-bottom', + 'datepicker-orient-right', + 'datepicker-orient-left' + ); + classList.add(`datepicker-orient-${orientY}`, `datepicker-orient-${orientX}`); + + style.top = top ? `${top}px` : top; + style.left = left ? `${left}px` : left; + } + + setViewSwitchLabel(labelText) { + this.controls.viewSwitch.textContent = labelText; + } + + setPrevBtnDisabled(disabled) { + this.controls.prevBtn.disabled = disabled; + } + + setNextBtnDisabled(disabled) { + this.controls.nextBtn.disabled = disabled; + } + + changeView(viewId) { + const oldView = this.currentView; + const newView = this.views[viewId]; + if (newView.id !== oldView.id) { + this.currentView = newView; + this._renderMethod = 'render'; + triggerDatepickerEvent(this.datepicker, 'changeView'); + this.main.replaceChild(newView.element, oldView.element); + } + return this; + } + + // Change the focused date (view date) + changeFocus(newViewDate) { + this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus'; + this.views.forEach((view) => { + view.updateFocus(); + }); + return this; + } + + // Apply the change of the selected dates + update() { + const newViewDate = computeResetViewDate(this.datepicker); + this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refresh'; + this.views.forEach((view) => { + view.updateFocus(); + view.updateSelection(); + }); + return this; + } + + // Refresh the picker UI + render(quickRender = true) { + const renderMethod = (quickRender && this._renderMethod) || 'render'; + delete this._renderMethod; + + this.currentView[renderMethod](); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/inputFieldListeners.js + + + + +// Find the closest date that doesn't meet the condition for unavailable date +// Returns undefined if no available date is found +// addFn: function to calculate the next date +// - args: time value, amount +// increase: amount to pass to addFn +// testFn: function to test the unavailablity of the date +// - args: time value; retun: true if unavailable +function findNextAvailableOne(date, addFn, increase, testFn, min, max) { + if (!(0,utils/* isInRange */.mh)(date, min, max)) { + return; + } + if (testFn(date)) { + const newDate = addFn(date, increase); + return findNextAvailableOne(newDate, addFn, increase, testFn, min, max); + } + return date; +} + +// direction: -1 (left/up), 1 (right/down) +// vertical: true for up/down, false for left/right +function moveByArrowKey(datepicker, ev, direction, vertical) { + const picker = datepicker.picker; + const currentView = picker.currentView; + const step = currentView.step || 1; + let viewDate = picker.viewDate; + let addFn; + let testFn; + switch (currentView.id) { + case 0: + if (vertical) { + viewDate = (0,lib_date/* addDays */.E4)(viewDate, direction * 7); + } else if (ev.ctrlKey || ev.metaKey) { + viewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction); + } else { + viewDate = (0,lib_date/* addDays */.E4)(viewDate, direction); + } + addFn = lib_date/* addDays */.E4; + testFn = (date) => currentView.disabled.includes(date); + break; + case 1: + viewDate = (0,lib_date/* addMonths */.zI)(viewDate, vertical ? direction * 4 : direction); + addFn = lib_date/* addMonths */.zI; + testFn = (date) => { + const dt = new Date(date); + const {year, disabled} = currentView; + return dt.getFullYear() === year && disabled.includes(dt.getMonth()); + }; + break; + default: + viewDate = (0,lib_date/* addYears */.Bc)(viewDate, direction * (vertical ? 4 : 1) * step); + addFn = lib_date/* addYears */.Bc; + testFn = date => currentView.disabled.includes((0,lib_date/* startOfYearPeriod */.ak)(date, step)); + } + viewDate = findNextAvailableOne( + viewDate, + addFn, + direction < 0 ? -step : step, + testFn, + currentView.minDate, + currentView.maxDate + ); + if (viewDate !== undefined) { + picker.changeFocus(viewDate).render(); + } +} + +function onKeydown(datepicker, ev) { + if (ev.key === 'Tab') { + unfocus(datepicker); + return; + } + + const picker = datepicker.picker; + const {id, isMinView} = picker.currentView; + if (!picker.active) { + switch (ev.key) { + case 'ArrowDown': + case 'Escape': + picker.show(); + break; + case 'Enter': + datepicker.update(); + break; + default: + return; + } + } else if (datepicker.editMode) { + switch (ev.key) { + case 'Escape': + picker.hide(); + break; + case 'Enter': + datepicker.exitEditMode({update: true, autohide: datepicker.config.autohide}); + break; + default: + return; + } + } else { + switch (ev.key) { + case 'Escape': + picker.hide(); + break; + case 'ArrowLeft': + if (ev.ctrlKey || ev.metaKey) { + goToPrevOrNext(datepicker, -1); + } else if (ev.shiftKey) { + datepicker.enterEditMode(); + return; + } else { + moveByArrowKey(datepicker, ev, -1, false); + } + break; + case 'ArrowRight': + if (ev.ctrlKey || ev.metaKey) { + goToPrevOrNext(datepicker, 1); + } else if (ev.shiftKey) { + datepicker.enterEditMode(); + return; + } else { + moveByArrowKey(datepicker, ev, 1, false); + } + break; + case 'ArrowUp': + if (ev.ctrlKey || ev.metaKey) { + switchView(datepicker); + } else if (ev.shiftKey) { + datepicker.enterEditMode(); + return; + } else { + moveByArrowKey(datepicker, ev, -1, true); + } + break; + case 'ArrowDown': + if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) { + datepicker.enterEditMode(); + return; + } + moveByArrowKey(datepicker, ev, 1, true); + break; + case 'Enter': + if (isMinView) { + datepicker.setDate(picker.viewDate); + } else { + picker.changeView(id - 1).render(); + } + break; + case 'Backspace': + case 'Delete': + datepicker.enterEditMode(); + return; + default: + if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) { + datepicker.enterEditMode(); + } + return; + } + } + ev.preventDefault(); + ev.stopPropagation(); +} + +function onFocus(datepicker) { + if (datepicker.config.showOnFocus && !datepicker._showing) { + datepicker.show(); + } +} + +// for the prevention for entering edit mode while getting focus on click +function onMousedown(datepicker, ev) { + const el = ev.target; + if (datepicker.picker.active || datepicker.config.showOnClick) { + el._active = el === document.activeElement; + el._clicking = setTimeout(() => { + delete el._active; + delete el._clicking; + }, 2000); + } +} + +function onClickInput(datepicker, ev) { + const el = ev.target; + if (!el._clicking) { + return; + } + clearTimeout(el._clicking); + delete el._clicking; + + if (el._active) { + datepicker.enterEditMode(); + } + delete el._active; + + if (datepicker.config.showOnClick) { + datepicker.show(); + } +} + +function onPaste(datepicker, ev) { + if (ev.clipboardData.types.includes('text/plain')) { + datepicker.enterEditMode(); + } +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/events/otherListeners.js + + + +// for the `document` to delegate the events from outside the picker/input field +function onClickOutside(datepicker, ev) { + const element = datepicker.element; + if (element !== document.activeElement) { + return; + } + const pickerElem = datepicker.picker.element; + if ((0,lib_event/* findElementInEventPath */.He)(ev, el => el === element || el === pickerElem)) { + return; + } + unfocus(datepicker); +} + +;// CONCATENATED MODULE: ./node_modules/flowbite-datepicker/js/Datepicker.js + + + + + + + + + + + + +function stringifyDates(dates, config) { + return dates + .map(dt => (0,date_format/* formatDate */.p6)(dt, config.format, config.locale)) + .join(config.dateDelimiter); +} + +// parse input dates and create an array of time values for selection +// returns undefined if there are no valid dates in inputDates +// when origDates (current selection) is passed, the function works to mix +// the input dates into the current selection +function processInputDates(datepicker, inputDates, clear = false) { + const {config, dates: origDates, rangepicker} = datepicker; + if (inputDates.length === 0) { + // empty input is considered valid unless origiDates is passed + return clear ? [] : undefined; + } + + const rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1]; + let newDates = inputDates.reduce((dates, dt) => { + let date = (0,date_format/* parseDate */.sG)(dt, config.format, config.locale); + if (date === undefined) { + return dates; + } + if (config.pickLevel > 0) { + // adjust to 1st of the month/Jan 1st of the year + // or to the last day of the monh/Dec 31st of the year if the datepicker + // is the range-end picker of a rangepicker + const dt = new Date(date); + if (config.pickLevel === 1) { + date = rangeEnd + ? dt.setMonth(dt.getMonth() + 1, 0) + : dt.setDate(1); + } else { + date = rangeEnd + ? dt.setFullYear(dt.getFullYear() + 1, 0, 0) + : dt.setMonth(0, 1); + } + } + if ( + (0,utils/* isInRange */.mh)(date, config.minDate, config.maxDate) + && !dates.includes(date) + && !config.datesDisabled.includes(date) + && !config.daysOfWeekDisabled.includes(new Date(date).getDay()) + ) { + dates.push(date); + } + return dates; + }, []); + if (newDates.length === 0) { + return; + } + if (config.multidate && !clear) { + // get the synmetric difference between origDates and newDates + newDates = newDates.reduce((dates, date) => { + if (!origDates.includes(date)) { + dates.push(date); + } + return dates; + }, origDates.filter(date => !newDates.includes(date))); + } + // do length check always because user can input multiple dates regardless of the mode + return config.maxNumberOfDates && newDates.length > config.maxNumberOfDates + ? newDates.slice(config.maxNumberOfDates * -1) + : newDates; +} + +// refresh the UI elements +// modes: 1: input only, 2, picker only, 3 both +function refreshUI(datepicker, mode = 3, quickRender = true) { + const {config, picker, inputField} = datepicker; + if (mode & 2) { + const newView = picker.active ? config.pickLevel : config.startView; + picker.update().changeView(newView).render(quickRender); + } + if (mode & 1 && inputField) { + inputField.value = stringifyDates(datepicker.dates, config); + } +} + +function setDate(datepicker, inputDates, options) { + let {clear, render, autohide} = options; + if (render === undefined) { + render = true; + } + if (!render) { + autohide = false; + } else if (autohide === undefined) { + autohide = datepicker.config.autohide; + } + + const newDates = processInputDates(datepicker, inputDates, clear); + if (!newDates) { + return; + } + if (newDates.toString() !== datepicker.dates.toString()) { + datepicker.dates = newDates; + refreshUI(datepicker, render ? 3 : 1); + triggerDatepickerEvent(datepicker, 'changeDate'); + } else { + refreshUI(datepicker, 1); + } + if (autohide) { + datepicker.hide(); + } +} + +/** + * Class representing a date picker + */ +class Datepicker { + /** + * Create a date picker + * @param {Element} element - element to bind a date picker + * @param {Object} [options] - config options + * @param {DateRangePicker} [rangepicker] - DateRangePicker instance the + * date picker belongs to. Use this only when creating date picker as a part + * of date range picker + */ + constructor(element, options = {}, rangepicker = undefined) { + element.datepicker = this; + this.element = element; + + // set up config + const config = this.config = Object.assign({ + buttonClass: (options.buttonClass && String(options.buttonClass)) || 'button', + container: document.body, + defaultViewDate: (0,lib_date/* today */.Lg)(), + maxDate: undefined, + minDate: undefined, + }, processOptions(options_defaultOptions, this)); + this._options = options; + Object.assign(config, processOptions(options, this)); + + // configure by type + const inline = this.inline = element.tagName !== 'INPUT'; + let inputField; + let initialDates; + + if (inline) { + config.container = element; + initialDates = (0,utils/* stringToArray */.W7)(element.dataset.date, config.dateDelimiter); + delete element.dataset.date; + } else { + const container = options.container ? document.querySelector(options.container) : null; + if (container) { + config.container = container; + } + inputField = this.inputField = element; + inputField.classList.add('datepicker-input'); + initialDates = (0,utils/* stringToArray */.W7)(inputField.value, config.dateDelimiter); + } + if (rangepicker) { + // check validiry + const index = rangepicker.inputs.indexOf(inputField); + const datepickers = rangepicker.datepickers; + if (index < 0 || index > 1 || !Array.isArray(datepickers)) { + throw Error('Invalid rangepicker object.'); + } + // attach itaelf to the rangepicker here so that processInputDates() can + // determine if this is the range-end picker of the rangepicker while + // setting inital values when pickLevel > 0 + datepickers[index] = this; + // add getter for rangepicker + Object.defineProperty(this, 'rangepicker', { + get() { + return rangepicker; + }, + }); + } + + // set initial dates + this.dates = []; + // process initial value + const inputDateValues = processInputDates(this, initialDates); + if (inputDateValues && inputDateValues.length > 0) { + this.dates = inputDateValues; + } + if (inputField) { + inputField.value = stringifyDates(this.dates, config); + } + + const picker = this.picker = new Picker(this); + + if (inline) { + this.show(); + } else { + // set up event listeners in other modes + const onMousedownDocument = onClickOutside.bind(null, this); + const listeners = [ + [inputField, 'keydown', onKeydown.bind(null, this)], + [inputField, 'focus', onFocus.bind(null, this)], + [inputField, 'mousedown', onMousedown.bind(null, this)], + [inputField, 'click', onClickInput.bind(null, this)], + [inputField, 'paste', onPaste.bind(null, this)], + [document, 'mousedown', onMousedownDocument], + [document, 'touchstart', onMousedownDocument], + [window, 'resize', picker.place.bind(picker)] + ]; + (0,lib_event/* registerListeners */.cF)(this, listeners); + } + } + + /** + * Format Date object or time value in given format and language + * @param {Date|Number} date - date or time value to format + * @param {String|Object} format - format string or object that contains + * toDisplay() custom formatter, whose signature is + * - args: + * - date: {Date} - Date instance of the date passed to the method + * - format: {Object} - the format object passed to the method + * - locale: {Object} - locale for the language specified by `lang` + * - return: + * {String} formatted date + * @param {String} [lang=en] - language code for the locale to use + * @return {String} formatted date + */ + static formatDate(date, format, lang) { + return (0,date_format/* formatDate */.p6)(date, format, lang && locales[lang] || locales.en); + } + + /** + * Parse date string + * @param {String|Date|Number} dateStr - date string, Date object or time + * value to parse + * @param {String|Object} format - format string or object that contains + * toValue() custom parser, whose signature is + * - args: + * - dateStr: {String|Date|Number} - the dateStr passed to the method + * - format: {Object} - the format object passed to the method + * - locale: {Object} - locale for the language specified by `lang` + * - return: + * {Date|Number} parsed date or its time value + * @param {String} [lang=en] - language code for the locale to use + * @return {Number} time value of parsed date + */ + static parseDate(dateStr, format, lang) { + return (0,date_format/* parseDate */.sG)(dateStr, format, lang && locales[lang] || locales.en); + } + + /** + * @type {Object} - Installed locales in `[languageCode]: localeObject` format + * en`:_English (US)_ is pre-installed. + */ + static get locales() { + return locales; + } + + /** + * @type {Boolean} - Whether the picker element is shown. `true` whne shown + */ + get active() { + return !!(this.picker && this.picker.active); + } + + /** + * @type {HTMLDivElement} - DOM object of picker element + */ + get pickerElement() { + return this.picker ? this.picker.element : undefined; + } + + /** + * Set new values to the config options + * @param {Object} options - config options to update + */ + setOptions(options) { + const picker = this.picker; + const newOptions = processOptions(options, this); + Object.assign(this._options, options); + Object.assign(this.config, newOptions); + picker.setOptions(newOptions); + + refreshUI(this, 3); + } + + /** + * Show the picker element + */ + show() { + if (this.inputField) { + if (this.inputField.disabled) { + return; + } + if (this.inputField !== document.activeElement) { + this._showing = true; + this.inputField.focus(); + delete this._showing; + } + } + this.picker.show(); + } + + /** + * Hide the picker element + * Not available on inline picker + */ + hide() { + if (this.inline) { + return; + } + this.picker.hide(); + this.picker.update().changeView(this.config.startView).render(); + } + + /** + * Destroy the Datepicker instance + * @return {Detepicker} - the instance destroyed + */ + destroy() { + this.hide(); + (0,lib_event/* unregisterListeners */.uV)(this); + this.picker.detach(); + if (!this.inline) { + this.inputField.classList.remove('datepicker-input'); + } + delete this.element.datepicker; + return this; + } + + /** + * Get the selected date(s) + * + * The method returns a Date object of selected date by default, and returns + * an array of selected dates in multidate mode. If format string is passed, + * it returns date string(s) formatted in given format. + * + * @param {String} [format] - Format string to stringify the date(s) + * @return {Date|String|Date[]|String[]} - selected date(s), or if none is + * selected, empty array in multidate mode and untitled in sigledate mode + */ + getDate(format = undefined) { + const callback = format + ? date => (0,date_format/* formatDate */.p6)(date, format, this.config.locale) + : date => new Date(date); + + if (this.config.multidate) { + return this.dates.map(callback); + } + if (this.dates.length > 0) { + return callback(this.dates[0]); + } + } + + /** + * Set selected date(s) + * + * In multidate mode, you can pass multiple dates as a series of arguments + * or an array. (Since each date is parsed individually, the type of the + * dates doesn't have to be the same.) + * The given dates are used to toggle the select status of each date. The + * number of selected dates is kept from exceeding the length set to + * maxNumberOfDates. + * + * With clear: true option, the method can be used to clear the selection + * and to replace the selection instead of toggling in multidate mode. + * If the option is passed with no date arguments or an empty dates array, + * it works as "clear" (clear the selection then set nothing), and if the + * option is passed with new dates to select, it works as "replace" (clear + * the selection then set the given dates) + * + * When render: false option is used, the method omits re-rendering the + * picker element. In this case, you need to call refresh() method later in + * order for the picker element to reflect the changes. The input field is + * refreshed always regardless of this option. + * + * When invalid (unparsable, repeated, disabled or out-of-range) dates are + * passed, the method ignores them and applies only valid ones. In the case + * that all the given dates are invalid, which is distinguished from passing + * no dates, the method considers it as an error and leaves the selection + * untouched. + * + * @param {...(Date|Number|String)|Array} [dates] - Date strings, Date + * objects, time values or mix of those for new selection + * @param {Object} [options] - function options + * - clear: {boolean} - Whether to clear the existing selection + * defualt: false + * - render: {boolean} - Whether to re-render the picker element + * default: true + * - autohide: {boolean} - Whether to hide the picker element after re-render + * Ignored when used with render: false + * default: config.autohide + */ + setDate(...args) { + const dates = [...args]; + const opts = {}; + const lastArg = (0,utils/* lastItemOf */.Jm)(args); + if ( + typeof lastArg === 'object' + && !Array.isArray(lastArg) + && !(lastArg instanceof Date) + && lastArg + ) { + Object.assign(opts, dates.pop()); + } + + const inputDates = Array.isArray(dates[0]) ? dates[0] : dates; + setDate(this, inputDates, opts); + } + + /** + * Update the selected date(s) with input field's value + * Not available on inline picker + * + * The input field will be refreshed with properly formatted date string. + * + * @param {Object} [options] - function options + * - autohide: {boolean} - whether to hide the picker element after refresh + * default: false + */ + update(options = undefined) { + if (this.inline) { + return; + } + + const opts = {clear: true, autohide: !!(options && options.autohide)}; + const inputDates = (0,utils/* stringToArray */.W7)(this.inputField.value, this.config.dateDelimiter); + setDate(this, inputDates, opts); + } + + /** + * Refresh the picker element and the associated input field + * @param {String} [target] - target item when refreshing one item only + * 'picker' or 'input' + * @param {Boolean} [forceRender] - whether to re-render the picker element + * regardless of its state instead of optimized refresh + */ + refresh(target = undefined, forceRender = false) { + if (target && typeof target !== 'string') { + forceRender = target; + target = undefined; + } + + let mode; + if (target === 'picker') { + mode = 2; + } else if (target === 'input') { + mode = 1; + } else { + mode = 3; + } + refreshUI(this, mode, !forceRender); + } + + /** + * Enter edit mode + * Not available on inline picker or when the picker element is hidden + */ + enterEditMode() { + if (this.inline || !this.picker.active || this.editMode) { + return; + } + this.editMode = true; + this.inputField.classList.add('in-edit', 'border-blue-700'); + } + + /** + * Exit from edit mode + * Not available on inline picker + * @param {Object} [options] - function options + * - update: {boolean} - whether to call update() after exiting + * If false, input field is revert to the existing selection + * default: false + */ + exitEditMode(options = undefined) { + if (this.inline || !this.editMode) { + return; + } + const opts = Object.assign({update: false}, options); + delete this.editMode; + this.inputField.classList.remove('in-edit', 'border-blue-700'); + if (opts.update) { + this.update(opts); + } + } +} + + +/***/ }), + +/***/ 963: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "CL": function() { return /* binding */ reFormatTokens; }, +/* harmony export */ "p6": function() { return /* binding */ formatDate; }, +/* harmony export */ "sG": function() { return /* binding */ parseDate; } +/* harmony export */ }); +/* unused harmony export reNonDateParts */ +/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(560); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(105); + + + +// pattern for format parts +const reFormatTokens = /dd?|DD?|mm?|MM?|yy?(?:yy)?/; +// pattern for non date parts +const reNonDateParts = /[\s!-/:-@[-`{-~年月日]+/; +// cache for persed formats +let knownFormats = {}; +// parse funtions for date parts +const parseFns = { + y(date, year) { + return new Date(date).setFullYear(parseInt(year, 10)); + }, + m(date, month, locale) { + const newDate = new Date(date); + let monthIndex = parseInt(month, 10) - 1; + + if (isNaN(monthIndex)) { + if (!month) { + return NaN; + } + + const monthName = month.toLowerCase(); + const compareNames = name => name.toLowerCase().startsWith(monthName); + // compare with both short and full names because some locales have periods + // in the short names (not equal to the first X letters of the full names) + monthIndex = locale.monthsShort.findIndex(compareNames); + if (monthIndex < 0) { + monthIndex = locale.months.findIndex(compareNames); + } + if (monthIndex < 0) { + return NaN; + } + } + + newDate.setMonth(monthIndex); + return newDate.getMonth() !== normalizeMonth(monthIndex) + ? newDate.setDate(0) + : newDate.getTime(); + }, + d(date, day) { + return new Date(date).setDate(parseInt(day, 10)); + }, +}; +// format functions for date parts +const formatFns = { + d(date) { + return date.getDate(); + }, + dd(date) { + return padZero(date.getDate(), 2); + }, + D(date, locale) { + return locale.daysShort[date.getDay()]; + }, + DD(date, locale) { + return locale.days[date.getDay()]; + }, + m(date) { + return date.getMonth() + 1; + }, + mm(date) { + return padZero(date.getMonth() + 1, 2); + }, + M(date, locale) { + return locale.monthsShort[date.getMonth()]; + }, + MM(date, locale) { + return locale.months[date.getMonth()]; + }, + y(date) { + return date.getFullYear(); + }, + yy(date) { + return padZero(date.getFullYear(), 2).slice(-2); + }, + yyyy(date) { + return padZero(date.getFullYear(), 4); + }, +}; + +// get month index in normal range (0 - 11) from any number +function normalizeMonth(monthIndex) { + return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12); +} + +function padZero(num, length) { + return num.toString().padStart(length, '0'); +} + +function parseFormatString(format) { + if (typeof format !== 'string') { + throw new Error("Invalid date format."); + } + if (format in knownFormats) { + return knownFormats[format]; + } + + // sprit the format string into parts and seprators + const separators = format.split(reFormatTokens); + const parts = format.match(new RegExp(reFormatTokens, 'g')); + if (separators.length === 0 || !parts) { + throw new Error("Invalid date format."); + } + + // collect format functions used in the format + const partFormatters = parts.map(token => formatFns[token]); + + // collect parse function keys used in the format + // iterate over parseFns' keys in order to keep the order of the keys. + const partParserKeys = Object.keys(parseFns).reduce((keys, key) => { + const token = parts.find(part => part[0] !== 'D' && part[0].toLowerCase() === key); + if (token) { + keys.push(key); + } + return keys; + }, []); + + return knownFormats[format] = { + parser(dateStr, locale) { + const dateParts = dateStr.split(reNonDateParts).reduce((dtParts, part, index) => { + if (part.length > 0 && parts[index]) { + const token = parts[index][0]; + if (token === 'M') { + dtParts.m = part; + } else if (token !== 'D') { + dtParts[token] = part; + } + } + return dtParts; + }, {}); + + // iterate over partParserkeys so that the parsing is made in the oder + // of year, month and day to prevent the day parser from correcting last + // day of month wrongly + return partParserKeys.reduce((origDate, key) => { + const newDate = parseFns[key](origDate, dateParts[key], locale); + // ingnore the part failed to parse + return isNaN(newDate) ? origDate : newDate; + }, (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .today */ .Lg)()); + }, + formatter(date, locale) { + let dateStr = partFormatters.reduce((str, fn, index) => { + return str += `${separators[index]}${fn(date, locale)}`; + }, ''); + // separators' length is always parts' length + 1, + return dateStr += (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__/* .lastItemOf */ .Jm)(separators); + }, + }; +} + +function parseDate(dateStr, format, locale) { + if (dateStr instanceof Date || typeof dateStr === 'number') { + const date = (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .stripTime */ .xR)(dateStr); + return isNaN(date) ? undefined : date; + } + if (!dateStr) { + return undefined; + } + if (dateStr === 'today') { + return (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .today */ .Lg)(); + } + + if (format && format.toValue) { + const date = format.toValue(dateStr, format, locale); + return isNaN(date) ? undefined : (0,_date_js__WEBPACK_IMPORTED_MODULE_0__/* .stripTime */ .xR)(date); + } + + return parseFormatString(format).parser(dateStr, locale); +} + +function formatDate(date, format, locale) { + if (isNaN(date) || (!date && date !== 0)) { + return ''; + } + + const dateObj = typeof date === 'number' ? new Date(date) : date; + + if (format.toDisplay) { + return format.toDisplay(dateObj, format, locale); + } + + return parseFormatString(format).formatter(dateObj, locale); +} + + +/***/ }), + +/***/ 560: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Bc": function() { return /* binding */ addYears; }, +/* harmony export */ "E4": function() { return /* binding */ addDays; }, +/* harmony export */ "Lg": function() { return /* binding */ today; }, +/* harmony export */ "Qk": function() { return /* binding */ getWeek; }, +/* harmony export */ "ak": function() { return /* binding */ startOfYearPeriod; }, +/* harmony export */ "by": function() { return /* binding */ dateValue; }, +/* harmony export */ "fr": function() { return /* binding */ dayOfTheWeekOf; }, +/* harmony export */ "jh": function() { return /* binding */ addWeeks; }, +/* harmony export */ "xR": function() { return /* binding */ stripTime; }, +/* harmony export */ "zI": function() { return /* binding */ addMonths; } +/* harmony export */ }); +function stripTime(timeValue) { + return new Date(timeValue).setHours(0, 0, 0, 0); +} + +function today() { + return new Date().setHours(0, 0, 0, 0); +} + +// Get the time value of the start of given date or year, month and day +function dateValue(...args) { + switch (args.length) { + case 0: + return today(); + case 1: + return stripTime(args[0]); + } + + // use setFullYear() to keep 2-digit year from being mapped to 1900-1999 + const newDate = new Date(0); + newDate.setFullYear(...args); + return newDate.setHours(0, 0, 0, 0); +} + +function addDays(date, amount) { + const newDate = new Date(date); + return newDate.setDate(newDate.getDate() + amount); +} + +function addWeeks(date, amount) { + return addDays(date, amount * 7); +} + +function addMonths(date, amount) { + // If the day of the date is not in the new month, the last day of the new + // month will be returned. e.g. Jan 31 + 1 month → Feb 28 (not Mar 03) + const newDate = new Date(date); + const monthsToSet = newDate.getMonth() + amount; + let expectedMonth = monthsToSet % 12; + if (expectedMonth < 0) { + expectedMonth += 12; + } + + const time = newDate.setMonth(monthsToSet); + return newDate.getMonth() !== expectedMonth ? newDate.setDate(0) : time; +} + +function addYears(date, amount) { + // If the date is Feb 29 and the new year is not a leap year, Feb 28 of the + // new year will be returned. + const newDate = new Date(date); + const expectedMonth = newDate.getMonth(); + const time = newDate.setFullYear(newDate.getFullYear() + amount); + return expectedMonth === 1 && newDate.getMonth() === 2 ? newDate.setDate(0) : time; +} + +// Calculate the distance bettwen 2 days of the week +function dayDiff(day, from) { + return (day - from + 7) % 7; +} + +// Get the date of the specified day of the week of given base date +function dayOfTheWeekOf(baseDate, dayOfWeek, weekStart = 0) { + const baseDay = new Date(baseDate).getDay(); + return addDays(baseDate, dayDiff(dayOfWeek, weekStart) - dayDiff(baseDay, weekStart)); +} + +// Get the ISO week of a date +function getWeek(date) { + // start of ISO week is Monday + const thuOfTheWeek = dayOfTheWeekOf(date, 4, 1); + // 1st week == the week where the 4th of January is in + const firstThu = dayOfTheWeekOf(new Date(thuOfTheWeek).setMonth(0, 4), 4, 1); + return Math.round((thuOfTheWeek - firstThu) / 604800000) + 1; +} + +// Get the start year of the period of years that includes given date +// years: length of the year period +function startOfYearPeriod(date, years) { + /* @see https://en.wikipedia.org/wiki/Year_zero#ISO_8601 */ + const year = new Date(date).getFullYear(); + return Math.floor(year / years) * years; +} + + +/***/ }), + +/***/ 698: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "He": function() { return /* binding */ findElementInEventPath; }, +/* harmony export */ "cF": function() { return /* binding */ registerListeners; }, +/* harmony export */ "uV": function() { return /* binding */ unregisterListeners; } +/* harmony export */ }); +const listenerRegistry = new WeakMap(); +const {addEventListener, removeEventListener} = EventTarget.prototype; + +// Register event listeners to a key object +// listeners: array of listener definitions; +// - each definition must be a flat array of event target and the arguments +// used to call addEventListener() on the target +function registerListeners(keyObj, listeners) { + let registered = listenerRegistry.get(keyObj); + if (!registered) { + registered = []; + listenerRegistry.set(keyObj, registered); + } + listeners.forEach((listener) => { + addEventListener.call(...listener); + registered.push(listener); + }); +} + +function unregisterListeners(keyObj) { + let listeners = listenerRegistry.get(keyObj); + if (!listeners) { + return; + } + listeners.forEach((listener) => { + removeEventListener.call(...listener); + }); + listenerRegistry.delete(keyObj); +} + +// Event.composedPath() polyfill for Edge +// based on https://gist.github.com/kleinfreund/e9787d73776c0e3750dcfcdc89f100ec +if (!Event.prototype.composedPath) { + const getComposedPath = (node, path = []) => { + path.push(node); + + let parent; + if (node.parentNode) { + parent = node.parentNode; + } else if (node.host) { // ShadowRoot + parent = node.host; + } else if (node.defaultView) { // Document + parent = node.defaultView; + } + return parent ? getComposedPath(parent, path) : path; + }; + + Event.prototype.composedPath = function () { + return getComposedPath(this.target); + }; +} + +function findFromPath(path, criteria, currentTarget, index = 0) { + const el = path[index]; + if (criteria(el)) { + return el; + } else if (el === currentTarget || !el.parentElement) { + // stop when reaching currentTarget or + return; + } + return findFromPath(path, criteria, currentTarget, index + 1); +} + +// Search for the actual target of a delegated event +function findElementInEventPath(ev, selector) { + const criteria = typeof selector === 'function' ? selector : el => el.matches(selector); + return findFromPath(ev.composedPath(), criteria, ev.currentTarget); +} + + +/***/ }), + +/***/ 105: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "$C": function() { return /* binding */ pushUnique; }, +/* harmony export */ "Jm": function() { return /* binding */ lastItemOf; }, +/* harmony export */ "W7": function() { return /* binding */ stringToArray; }, +/* harmony export */ "em": function() { return /* binding */ createTagRepeat; }, +/* harmony export */ "jG": function() { return /* binding */ limitToRange; }, +/* harmony export */ "l$": function() { return /* binding */ hasProperty; }, +/* harmony export */ "mh": function() { return /* binding */ isInRange; }, +/* harmony export */ "zh": function() { return /* binding */ optimizeTemplateHTML; } +/* harmony export */ }); +function hasProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +function lastItemOf(arr) { + return arr[arr.length - 1]; +} + +// push only the items not included in the array +function pushUnique(arr, ...items) { + items.forEach((item) => { + if (arr.includes(item)) { + return; + } + arr.push(item); + }); + return arr; +} + +function stringToArray(str, separator) { + // convert empty string to an empty array + return str ? str.split(separator) : []; +} + +function isInRange(testVal, min, max) { + const minOK = min === undefined || testVal >= min; + const maxOK = max === undefined || testVal <= max; + return minOK && maxOK; +} + +function limitToRange(val, min, max) { + if (val < min) { + return min; + } + if (val > max) { + return max; + } + return val; +} + +function createTagRepeat(tagName, repeat, attributes = {}, index = 0, html = '') { + const openTagSrc = Object.keys(attributes).reduce((src, attr) => { + let val = attributes[attr]; + if (typeof val === 'function') { + val = val(index); + } + return `${src} ${attr}="${val}"`; + }, tagName); + html += `<${openTagSrc}>`; + + const next = index + 1; + return next < repeat + ? createTagRepeat(tagName, repeat, attributes, next, html) + : html; +} + +// Remove the spacing surrounding tags for HTML parser not to create text nodes +// before/after elements +function optimizeTemplateHTML(html) { + return html.replace(/>\s+/g, '>').replace(/\s+ {\n const buttons = datepickerEl.hasAttribute('datepicker-buttons');\n const autohide = datepickerEl.hasAttribute('datepicker-autohide');\n const format = datepickerEl.hasAttribute('datepicker-format');\n const orientation = datepickerEl.hasAttribute('datepicker-orientation');\n const title = datepickerEl.hasAttribute('datepicker-title');\n\n const options = {};\n if (buttons) {\n options.todayBtn = true;\n options.clearBtn = true;\n }\n if (autohide) {\n options.autohide = true;\n }\n if (format) {\n options.format = datepickerEl.getAttribute('datepicker-format');\n }\n if (orientation) {\n options.orientation = datepickerEl.getAttribute(\n 'datepicker-orientation'\n );\n }\n if (title) {\n options.title = datepickerEl.getAttribute('datepicker-title');\n }\n\n return options;\n};\n\nexport function initDatepickers() {\n document.querySelectorAll('[datepicker]').forEach(function (datepickerEl) {\n new Datepicker(datepickerEl, getDatepickerOptions(datepickerEl));\n });\n\n document\n .querySelectorAll('[inline-datepicker]')\n .forEach(function (datepickerEl) {\n new Datepicker(datepickerEl, getDatepickerOptions(datepickerEl));\n });\n\n document\n .querySelectorAll('[date-rangepicker]')\n .forEach(function (datepickerEl) {\n new DateRangePicker(\n datepickerEl,\n getDatepickerOptions(datepickerEl)\n );\n });\n}\n\nconst events = new Events('DOMContentLoaded', [initDatepickers]);\nevents.init();\n","import {registerListeners, unregisterListeners} from './lib/event.js';\nimport {formatDate} from './lib/date-format.js';\nimport Datepicker from './Datepicker.js';\n\n// filter out the config options inapproprite to pass to Datepicker\nfunction filterOptions(options) {\n const newOpts = Object.assign({}, options);\n\n delete newOpts.inputs;\n delete newOpts.allowOneSidedRange;\n delete newOpts.maxNumberOfDates; // to ensure each datepicker handles a single date\n\n return newOpts;\n}\n\nfunction setupDatepicker(rangepicker, changeDateListener, el, options) {\n registerListeners(rangepicker, [\n [el, 'changeDate', changeDateListener],\n ]);\n new Datepicker(el, options, rangepicker);\n}\n\nfunction onChangeDate(rangepicker, ev) {\n // to prevent both datepickers trigger the other side's update each other\n if (rangepicker._updating) {\n return;\n }\n rangepicker._updating = true;\n\n const target = ev.target;\n if (target.datepicker === undefined) {\n return;\n }\n\n const datepickers = rangepicker.datepickers;\n const setDateOptions = {render: false};\n const changedSide = rangepicker.inputs.indexOf(target);\n const otherSide = changedSide === 0 ? 1 : 0;\n const changedDate = datepickers[changedSide].dates[0];\n const otherDate = datepickers[otherSide].dates[0];\n\n if (changedDate !== undefined && otherDate !== undefined) {\n // if the start of the range > the end, swap them\n if (changedSide === 0 && changedDate > otherDate) {\n datepickers[0].setDate(otherDate, setDateOptions);\n datepickers[1].setDate(changedDate, setDateOptions);\n } else if (changedSide === 1 && changedDate < otherDate) {\n datepickers[0].setDate(changedDate, setDateOptions);\n datepickers[1].setDate(otherDate, setDateOptions);\n }\n } else if (!rangepicker.allowOneSidedRange) {\n // to prevent the range from becoming one-sided, copy changed side's\n // selection (no matter if it's empty) to the other side\n if (changedDate !== undefined || otherDate !== undefined) {\n setDateOptions.clear = true;\n datepickers[otherSide].setDate(datepickers[changedSide].dates, setDateOptions);\n }\n }\n datepickers[0].picker.update().render();\n datepickers[1].picker.update().render();\n delete rangepicker._updating;\n}\n\n/**\n * Class representing a date range picker\n */\nexport default class DateRangePicker {\n /**\n * Create a date range picker\n * @param {Element} element - element to bind a date range picker\n * @param {Object} [options] - config options\n */\n constructor(element, options = {}) {\n const inputs = Array.isArray(options.inputs)\n ? options.inputs\n : Array.from(element.querySelectorAll('input'));\n if (inputs.length < 2) {\n return;\n }\n\n element.rangepicker = this;\n this.element = element;\n this.inputs = inputs.slice(0, 2);\n this.allowOneSidedRange = !!options.allowOneSidedRange;\n\n const changeDateListener = onChangeDate.bind(null, this);\n const cleanOptions = filterOptions(options);\n // in order for initial date setup to work right when pcicLvel > 0,\n // let Datepicker constructor add the instance to the rangepicker\n const datepickers = [];\n Object.defineProperty(this, 'datepickers', {\n get() {\n return datepickers;\n },\n });\n setupDatepicker(this, changeDateListener, this.inputs[0], cleanOptions);\n setupDatepicker(this, changeDateListener, this.inputs[1], cleanOptions);\n Object.freeze(datepickers);\n // normalize the range if inital dates are given\n if (datepickers[0].dates.length > 0) {\n onChangeDate(this, {target: this.inputs[0]});\n } else if (datepickers[1].dates.length > 0) {\n onChangeDate(this, {target: this.inputs[1]});\n }\n }\n\n /**\n * @type {Array} - selected date of the linked date pickers\n */\n get dates() {\n return this.datepickers.length === 2\n ? [\n this.datepickers[0].dates[0],\n this.datepickers[1].dates[0],\n ]\n : undefined;\n }\n\n /**\n * Set new values to the config options\n * @param {Object} options - config options to update\n */\n setOptions(options) {\n this.allowOneSidedRange = !!options.allowOneSidedRange;\n\n const cleanOptions = filterOptions(options);\n this.datepickers[0].setOptions(cleanOptions);\n this.datepickers[1].setOptions(cleanOptions);\n }\n\n /**\n * Destroy the DateRangePicker instance\n * @return {DateRangePicker} - the instance destroyed\n */\n destroy() {\n this.datepickers[0].destroy();\n this.datepickers[1].destroy();\n unregisterListeners(this);\n delete this.element.rangepicker;\n }\n\n /**\n * Get the start and end dates of the date range\n *\n * The method returns Date objects by default. If format string is passed,\n * it returns date strings formatted in given format.\n * The result array always contains 2 items (start date/end date) and\n * undefined is used for unselected side. (e.g. If none is selected,\n * the result will be [undefined, undefined]. If only the end date is set\n * when allowOneSidedRange config option is true, [undefined, endDate] will\n * be returned.)\n *\n * @param {String} [format] - Format string to stringify the dates\n * @return {Array} - Start and end dates\n */\n getDates(format = undefined) {\n const callback = format\n ? date => formatDate(date, format, this.datepickers[0].config.locale)\n : date => new Date(date);\n\n return this.dates.map(date => date === undefined ? date : callback(date));\n }\n\n /**\n * Set the start and end dates of the date range\n *\n * The method calls datepicker.setDate() internally using each of the\n * arguments in start→end order.\n *\n * When a clear: true option object is passed instead of a date, the method\n * clears the date.\n *\n * If an invalid date, the same date as the current one or an option object\n * without clear: true is passed, the method considers that argument as an\n * \"ineffective\" argument because calling datepicker.setDate() with those\n * values makes no changes to the date selection.\n *\n * When the allowOneSidedRange config option is false, passing {clear: true}\n * to clear the range works only when it is done to the last effective\n * argument (in other words, passed to rangeEnd or to rangeStart along with\n * ineffective rangeEnd). This is because when the date range is changed,\n * it gets normalized based on the last change at the end of the changing\n * process.\n *\n * @param {Date|Number|String|Object} rangeStart - Start date of the range\n * or {clear: true} to clear the date\n * @param {Date|Number|String|Object} rangeEnd - End date of the range\n * or {clear: true} to clear the date\n */\n setDates(rangeStart, rangeEnd) {\n const [datepicker0, datepicker1] = this.datepickers;\n const origDates = this.dates;\n\n // If range normalization runs on every change, we can't set a new range\n // that starts after the end of the current range correctly because the\n // normalization process swaps start↔︎end right after setting the new start\n // date. To prevent this, the normalization process needs to run once after\n // both of the new dates are set.\n this._updating = true;\n datepicker0.setDate(rangeStart);\n datepicker1.setDate(rangeEnd);\n delete this._updating;\n\n if (datepicker1.dates[0] !== origDates[1]) {\n onChangeDate(this, {target: this.inputs[1]});\n } else if (datepicker0.dates[0] !== origDates[0]) {\n onChangeDate(this, {target: this.inputs[0]});\n }\n }\n}\n","// default locales\nexport const locales = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM y\"\n }\n};\n","// config options updatable by setOptions() and their default values\nconst defaultOptions = {\n autohide: false,\n beforeShowDay: null,\n beforeShowDecade: null,\n beforeShowMonth: null,\n beforeShowYear: null,\n calendarWeeks: false,\n clearBtn: false,\n dateDelimiter: ',',\n datesDisabled: [],\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n defaultViewDate: undefined, // placeholder, defaults to today() by the program\n disableTouchKeyboard: false,\n format: 'mm/dd/yyyy',\n language: 'en',\n maxDate: null,\n maxNumberOfDates: 1,\n maxView: 3,\n minDate: null,\n nextArrow: '',\n orientation: 'auto',\n pickLevel: 0,\n prevArrow: '',\n showDaysOfWeek: true,\n showOnClick: true,\n showOnFocus: true,\n startView: 0,\n title: '',\n todayBtn: false,\n todayBtnMode: 0,\n todayHighlight: false,\n updateOnBlur: true,\n weekStart: 0,\n};\n\nexport default defaultOptions;\n","const range = document.createRange();\n\nexport function parseHTML(html) {\n return range.createContextualFragment(html);\n}\n\n// equivalent to jQuery's :visble\nexport function isVisible(el) {\n return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n}\n\nexport function hideElement(el) {\n if (el.style.display === 'none') {\n return;\n }\n // back up the existing display setting in data-style-display\n if (el.style.display) {\n el.dataset.styleDisplay = el.style.display;\n }\n el.style.display = 'none';\n}\n\nexport function showElement(el) {\n if (el.style.display !== 'none') {\n return;\n }\n if (el.dataset.styleDisplay) {\n // restore backed-up dispay property\n el.style.display = el.dataset.styleDisplay;\n delete el.dataset.styleDisplay;\n } else {\n el.style.display = '';\n }\n}\n\nexport function emptyChildNodes(el) {\n if (el.firstChild) {\n el.removeChild(el.firstChild);\n emptyChildNodes(el);\n }\n}\n\nexport function replaceChildNodes(el, newChildNodes) {\n emptyChildNodes(el);\n if (newChildNodes instanceof DocumentFragment) {\n el.appendChild(newChildNodes);\n } else if (typeof newChildNodes === 'string') {\n el.appendChild(parseHTML(newChildNodes));\n } else if (typeof newChildNodes.forEach === 'function') {\n newChildNodes.forEach((node) => {\n el.appendChild(node);\n });\n }\n}\n","import {hasProperty, pushUnique} from '../lib/utils.js';\nimport {dateValue} from '../lib/date.js';\nimport {reFormatTokens, parseDate} from '../lib/date-format.js';\nimport {parseHTML} from '../lib/dom.js';\nimport defaultOptions from './defaultOptions.js';\n\nconst {\n language: defaultLang,\n format: defaultFormat,\n weekStart: defaultWeekStart,\n} = defaultOptions;\n\n// Reducer function to filter out invalid day-of-week from the input\nfunction sanitizeDOW(dow, day) {\n return dow.length < 6 && day >= 0 && day < 7\n ? pushUnique(dow, day)\n : dow;\n}\n\nfunction calcEndOfWeek(startOfWeek) {\n return (startOfWeek + 6) % 7;\n}\n\n// validate input date. if invalid, fallback to the original value\nfunction validateDate(value, format, locale, origValue) {\n const date = parseDate(value, format, locale);\n return date !== undefined ? date : origValue;\n}\n\n// Validate viewId. if invalid, fallback to the original value\nfunction validateViewId(value, origValue, max = 3) {\n const viewId = parseInt(value, 10);\n return viewId >= 0 && viewId <= max ? viewId : origValue;\n}\n\n// Create Datepicker configuration to set\nexport default function processOptions(options, datepicker) {\n const inOpts = Object.assign({}, options);\n const config = {};\n const locales = datepicker.constructor.locales;\n let {\n format,\n language,\n locale,\n maxDate,\n maxView,\n minDate,\n pickLevel,\n startView,\n weekStart,\n } = datepicker.config || {};\n\n if (inOpts.language) {\n let lang;\n if (inOpts.language !== language) {\n if (locales[inOpts.language]) {\n lang = inOpts.language;\n } else {\n // Check if langauge + region tag can fallback to the one without\n // region (e.g. fr-CA → fr)\n lang = inOpts.language.split('-')[0];\n if (locales[lang] === undefined) {\n lang = false;\n }\n }\n }\n delete inOpts.language;\n if (lang) {\n language = config.language = lang;\n\n // update locale as well when updating language\n const origLocale = locale || locales[defaultLang];\n // use default language's properties for the fallback\n locale = Object.assign({\n format: defaultFormat,\n weekStart: defaultWeekStart\n }, locales[defaultLang]);\n if (language !== defaultLang) {\n Object.assign(locale, locales[language]);\n }\n config.locale = locale;\n // if format and/or weekStart are the same as old locale's defaults,\n // update them to new locale's defaults\n if (format === origLocale.format) {\n format = config.format = locale.format;\n }\n if (weekStart === origLocale.weekStart) {\n weekStart = config.weekStart = locale.weekStart;\n config.weekEnd = calcEndOfWeek(locale.weekStart);\n }\n }\n }\n\n if (inOpts.format) {\n const hasToDisplay = typeof inOpts.format.toDisplay === 'function';\n const hasToValue = typeof inOpts.format.toValue === 'function';\n const validFormatString = reFormatTokens.test(inOpts.format);\n if ((hasToDisplay && hasToValue) || validFormatString) {\n format = config.format = inOpts.format;\n }\n delete inOpts.format;\n }\n\n //*** dates ***//\n // while min and maxDate for \"no limit\" in the options are better to be null\n // (especially when updating), the ones in the config have to be undefined\n // because null is treated as 0 (= unix epoch) when comparing with time value\n let minDt = minDate;\n let maxDt = maxDate;\n if (inOpts.minDate !== undefined) {\n minDt = inOpts.minDate === null\n ? dateValue(0, 0, 1) // set 0000-01-01 to prevent negative values for year\n : validateDate(inOpts.minDate, format, locale, minDt);\n delete inOpts.minDate;\n }\n if (inOpts.maxDate !== undefined) {\n maxDt = inOpts.maxDate === null\n ? undefined\n : validateDate(inOpts.maxDate, format, locale, maxDt);\n delete inOpts.maxDate;\n }\n if (maxDt < minDt) {\n minDate = config.minDate = maxDt;\n maxDate = config.maxDate = minDt;\n } else {\n if (minDate !== minDt) {\n minDate = config.minDate = minDt;\n }\n if (maxDate !== maxDt) {\n maxDate = config.maxDate = maxDt;\n }\n }\n\n if (inOpts.datesDisabled) {\n config.datesDisabled = inOpts.datesDisabled.reduce((dates, dt) => {\n const date = parseDate(dt, format, locale);\n return date !== undefined ? pushUnique(dates, date) : dates;\n }, []);\n delete inOpts.datesDisabled;\n }\n if (inOpts.defaultViewDate !== undefined) {\n const viewDate = parseDate(inOpts.defaultViewDate, format, locale);\n if (viewDate !== undefined) {\n config.defaultViewDate = viewDate;\n }\n delete inOpts.defaultViewDate;\n }\n\n //*** days of week ***//\n if (inOpts.weekStart !== undefined) {\n const wkStart = Number(inOpts.weekStart) % 7;\n if (!isNaN(wkStart)) {\n weekStart = config.weekStart = wkStart;\n config.weekEnd = calcEndOfWeek(wkStart);\n }\n delete inOpts.weekStart;\n }\n if (inOpts.daysOfWeekDisabled) {\n config.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekDisabled;\n }\n if (inOpts.daysOfWeekHighlighted) {\n config.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []);\n delete inOpts.daysOfWeekHighlighted;\n }\n\n //*** multi date ***//\n if (inOpts.maxNumberOfDates !== undefined) {\n const maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10);\n if (maxNumberOfDates >= 0) {\n config.maxNumberOfDates = maxNumberOfDates;\n config.multidate = maxNumberOfDates !== 1;\n }\n delete inOpts.maxNumberOfDates;\n }\n if (inOpts.dateDelimiter) {\n config.dateDelimiter = String(inOpts.dateDelimiter);\n delete inOpts.dateDelimiter;\n }\n\n //*** pick level & view ***//\n let newPickLevel = pickLevel;\n if (inOpts.pickLevel !== undefined) {\n newPickLevel = validateViewId(inOpts.pickLevel, 2);\n delete inOpts.pickLevel;\n }\n if (newPickLevel !== pickLevel) {\n pickLevel = config.pickLevel = newPickLevel;\n }\n\n let newMaxView = maxView;\n if (inOpts.maxView !== undefined) {\n newMaxView = validateViewId(inOpts.maxView, maxView);\n delete inOpts.maxView;\n }\n // ensure max view >= pick level\n newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView;\n if (newMaxView !== maxView) {\n maxView = config.maxView = newMaxView;\n }\n\n let newStartView = startView;\n if (inOpts.startView !== undefined) {\n newStartView = validateViewId(inOpts.startView, newStartView);\n delete inOpts.startView;\n }\n // ensure pick level <= start view <= max view\n if (newStartView < pickLevel) {\n newStartView = pickLevel;\n } else if (newStartView > maxView) {\n newStartView = maxView;\n }\n if (newStartView !== startView) {\n config.startView = newStartView;\n }\n\n //*** template ***//\n if (inOpts.prevArrow) {\n const prevArrow = parseHTML(inOpts.prevArrow);\n if (prevArrow.childNodes.length > 0) {\n config.prevArrow = prevArrow.childNodes;\n }\n delete inOpts.prevArrow;\n }\n if (inOpts.nextArrow) {\n const nextArrow = parseHTML(inOpts.nextArrow);\n if (nextArrow.childNodes.length > 0) {\n config.nextArrow = nextArrow.childNodes;\n }\n delete inOpts.nextArrow;\n }\n\n //*** misc ***//\n if (inOpts.disableTouchKeyboard !== undefined) {\n config.disableTouchKeyboard = 'ontouchstart' in document && !!inOpts.disableTouchKeyboard;\n delete inOpts.disableTouchKeyboard;\n }\n if (inOpts.orientation) {\n const orientation = inOpts.orientation.toLowerCase().split(/\\s+/g);\n config.orientation = {\n x: orientation.find(x => (x === 'left' || x === 'right')) || 'auto',\n y: orientation.find(y => (y === 'top' || y === 'bottom')) || 'auto',\n };\n delete inOpts.orientation;\n }\n if (inOpts.todayBtnMode !== undefined) {\n switch(inOpts.todayBtnMode) {\n case 0:\n case 1:\n config.todayBtnMode = inOpts.todayBtnMode;\n }\n delete inOpts.todayBtnMode;\n }\n\n //*** copy the rest ***//\n Object.keys(inOpts).forEach((key) => {\n if (inOpts[key] !== undefined && hasProperty(defaultOptions, key)) {\n config[key] = inOpts[key];\n }\n });\n\n return config;\n}\n","import {optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst pickerTemplate = optimizeTemplateHTML(`
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
`);\n\nexport default pickerTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst daysTemplate = optimizeTemplateHTML(`
\n
${createTagRepeat('span', 7, {class: 'dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
\n
${createTagRepeat('span', 42 , {class: 'block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400'})}
\n
`);\n\nexport default daysTemplate;\n","import {createTagRepeat, optimizeTemplateHTML} from '../../lib/utils.js';\n\nconst calendarWeeksTemplate = optimizeTemplateHTML(`
\n
\n
${createTagRepeat('span', 6, {class: 'week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm'})}
\n
`);\n\nexport default calendarWeeksTemplate;\n","import {pushUnique} from '../../lib/utils.js';\nimport {parseHTML, replaceChildNodes} from '../../lib/dom.js';\n\n// Base class of the view classes\nexport default class View {\n constructor(picker, config) {\n Object.assign(this, config, {\n picker,\n element: parseHTML(`
`).firstChild,\n selected: [],\n });\n this.init(this.picker.datepicker.config);\n }\n\n init(options) {\n if (options.pickLevel !== undefined) {\n this.isMinView = this.id === options.pickLevel;\n }\n this.setOptions(options);\n this.updateFocus();\n this.updateSelection();\n }\n\n // Execute beforeShow() callback and apply the result to the element\n // args:\n // - current - current value on the iteration on view rendering\n // - timeValue - time value of the date to pass to beforeShow()\n performBeforeHook(el, current, timeValue) {\n let result = this.beforeShow(new Date(timeValue));\n switch (typeof result) {\n case 'boolean':\n result = {enabled: result};\n break;\n case 'string':\n result = {classes: result};\n }\n\n if (result) {\n if (result.enabled === false) {\n el.classList.add('disabled');\n pushUnique(this.disabled, current);\n }\n if (result.classes) {\n const extraClasses = result.classes.split(/\\s+/);\n el.classList.add(...extraClasses);\n if (extraClasses.includes('disabled')) {\n pushUnique(this.disabled, current);\n }\n }\n if (result.content) {\n replaceChildNodes(el, result.content);\n }\n }\n }\n}\n","import {hasProperty, pushUnique} from '../../lib/utils.js';\nimport {today, dateValue, addDays, addWeeks, dayOfTheWeekOf, getWeek} from '../../lib/date.js';\nimport {formatDate} from '../../lib/date-format.js';\nimport {parseHTML, showElement, hideElement} from '../../lib/dom.js';\nimport daysTemplate from '../templates/daysTemplate.js';\nimport calendarWeeksTemplate from '../templates/calendarWeeksTemplate.js';\nimport View from './View.js';\n\nexport default class DaysView extends View {\n constructor(picker) {\n super(picker, {\n id: 0,\n name: 'days',\n cellClass: 'day',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n const inner = parseHTML(daysTemplate).firstChild;\n this.dow = inner.firstChild;\n this.grid = inner.lastChild;\n this.element.appendChild(inner);\n }\n super.init(options);\n }\n\n setOptions(options) {\n let updateDOW;\n\n if (hasProperty(options, 'minDate')) {\n this.minDate = options.minDate;\n }\n if (hasProperty(options, 'maxDate')) {\n this.maxDate = options.maxDate;\n }\n if (options.datesDisabled) {\n this.datesDisabled = options.datesDisabled;\n }\n if (options.daysOfWeekDisabled) {\n this.daysOfWeekDisabled = options.daysOfWeekDisabled;\n updateDOW = true;\n }\n if (options.daysOfWeekHighlighted) {\n this.daysOfWeekHighlighted = options.daysOfWeekHighlighted;\n }\n if (options.todayHighlight !== undefined) {\n this.todayHighlight = options.todayHighlight;\n }\n if (options.weekStart !== undefined) {\n this.weekStart = options.weekStart;\n this.weekEnd = options.weekEnd;\n updateDOW = true;\n }\n if (options.locale) {\n const locale = this.locale = options.locale;\n this.dayNames = locale.daysMin;\n this.switchLabelFormat = locale.titleFormat;\n updateDOW = true;\n }\n if (options.beforeShowDay !== undefined) {\n this.beforeShow = typeof options.beforeShowDay === 'function'\n ? options.beforeShowDay\n : undefined;\n }\n\n if (options.calendarWeeks !== undefined) {\n if (options.calendarWeeks && !this.calendarWeeks) {\n const weeksElem = parseHTML(calendarWeeksTemplate).firstChild;\n this.calendarWeeks = {\n element: weeksElem,\n dow: weeksElem.firstChild,\n weeks: weeksElem.lastChild,\n };\n this.element.insertBefore(weeksElem, this.element.firstChild);\n } else if (this.calendarWeeks && !options.calendarWeeks) {\n this.element.removeChild(this.calendarWeeks.element);\n this.calendarWeeks = null;\n }\n }\n if (options.showDaysOfWeek !== undefined) {\n if (options.showDaysOfWeek) {\n showElement(this.dow);\n if (this.calendarWeeks) {\n showElement(this.calendarWeeks.dow);\n }\n } else {\n hideElement(this.dow);\n if (this.calendarWeeks) {\n hideElement(this.calendarWeeks.dow);\n }\n }\n }\n\n // update days-of-week when locale, daysOfweekDisabled or weekStart is changed\n if (updateDOW) {\n Array.from(this.dow.children).forEach((el, index) => {\n const dow = (this.weekStart + index) % 7;\n el.textContent = this.dayNames[dow];\n el.className = this.daysOfWeekDisabled.includes(dow) ? 'dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed' : 'dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400';\n });\n }\n }\n\n // Apply update on the focused date to view's settings\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const viewYear = viewDate.getFullYear();\n const viewMonth = viewDate.getMonth();\n const firstOfMonth = dateValue(viewYear, viewMonth, 1);\n const start = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);\n\n this.first = firstOfMonth;\n this.last = dateValue(viewYear, viewMonth + 1, 0);\n this.start = start;\n this.focused = this.picker.viewDate;\n }\n\n // Apply update on the selected dates to view's settings\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }\n\n // Update the entire view UI\n render() {\n // update today marker on ever render\n this.today = this.todayHighlight ? today() : undefined;\n // refresh disabled dates on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [...this.datesDisabled];\n\n const switchLabel = formatDate(this.focused, this.switchLabelFormat, this.locale);\n this.picker.setViewSwitchLabel(switchLabel);\n this.picker.setPrevBtnDisabled(this.first <= this.minDate);\n this.picker.setNextBtnDisabled(this.last >= this.maxDate);\n\n if (this.calendarWeeks) {\n // start of the UTC week (Monday) of the 1st of the month\n const startOfWeek = dayOfTheWeekOf(this.first, 1, 1);\n Array.from(this.calendarWeeks.weeks.children).forEach((el, index) => {\n el.textContent = getWeek(addWeeks(startOfWeek, index));\n });\n }\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = addDays(this.start, index);\n const date = new Date(current);\n const day = date.getDay();\n\n el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`;\n el.dataset.date = current;\n el.textContent = date.getDate();\n\n if (current < this.first) {\n classList.add('prev', 'text-gray-500', 'dark:text-white');\n } else if (current > this.last) {\n classList.add('next', 'text-gray-500', 'dark:text-white');\n }\n if (this.today === current) {\n classList.add('today', 'bg-gray-100', 'dark:bg-gray-600');\n }\n if (current < this.minDate || current > this.maxDate || this.disabled.includes(current)) {\n classList.add('disabled', 'cursor-not-allowed');\n }\n if (this.daysOfWeekDisabled.includes(day)) {\n classList.add('disabled', 'cursor-not-allowed');\n pushUnique(this.disabled, current);\n }\n if (this.daysOfWeekHighlighted.includes(day)) {\n classList.add('highlighted');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range', 'bg-gray-200', 'dark:bg-gray-600');\n classList.remove('rounded-lg', 'rounded-l-lg', 'rounded-r-lg')\n }\n if (current === rangeStart) {\n classList.add('range-start', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-l-lg');\n classList.remove('rounded-lg', 'rounded-r-lg');\n }\n if (current === rangeEnd) {\n classList.add('range-end', 'bg-gray-100', 'dark:bg-gray-600', 'rounded-r-lg');\n classList.remove('rounded-lg', 'rounded-l-lg');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'text-gray-500', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'dark:bg-gray-600', 'bg-gray-100', 'bg-gray-200');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, current);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused');\n el.classList.add('text-gray-900', 'rounded-lg', 'dark:text-white');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.dataset.date);\n const classList = el.classList;\n classList.remove('bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg', 'rounded-r-lg')\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range', 'bg-gray-200', 'dark:bg-gray-600');\n classList.remove('rounded-lg');\n }\n if (current === rangeStart) {\n classList.add('range-start', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-l-lg');\n classList.remove('rounded-lg', 'rounded-r-lg');\n }\n if (current === rangeEnd) {\n classList.add('range-end', 'bg-gray-200', 'dark:bg-gray-600', 'rounded-r-lg');\n classList.remove('rounded-lg', 'rounded-l-lg');\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600', 'bg-gray-100', 'bg-gray-200', 'dark:bg-gray-600');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / 86400000);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction computeMonthRange(range, thisYear) {\n if (!range || !range[0] || !range[1]) {\n return;\n }\n\n const [[startY, startM], [endY, endM]] = range;\n if (startY > thisYear || endY < thisYear) {\n return;\n }\n return [\n startY === thisYear ? startM : -1,\n endY === thisYear ? endM : 12,\n ];\n}\n\nexport default class MonthsView extends View {\n constructor(picker) {\n super(picker, {\n id: 1,\n name: 'months',\n cellClass: 'month',\n });\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.grid = this.element;\n this.element.classList.add('months', 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12, {'data-month': ix => ix})));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (options.locale) {\n this.monthNames = options.locale.monthsShort;\n }\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minMonth = this.minDate = undefined;\n } else {\n const minDateObj = new Date(options.minDate);\n this.minYear = minDateObj.getFullYear();\n this.minMonth = minDateObj.getMonth();\n this.minDate = minDateObj.setDate(1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxMonth = this.maxDate = undefined;\n } else {\n const maxDateObj = new Date(options.maxDate);\n this.maxYear = maxDateObj.getFullYear();\n this.maxMonth = maxDateObj.getMonth();\n this.maxDate = dateValue(this.maxYear, this.maxMonth + 1, 0);\n }\n }\n if (options.beforeShowMonth !== undefined) {\n this.beforeShow = typeof options.beforeShowMonth === 'function'\n ? options.beforeShowMonth\n : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n this.year = viewDate.getFullYear();\n this.focused = viewDate.getMonth();\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((selected, timeValue) => {\n const date = new Date(timeValue);\n const year = date.getFullYear();\n const month = date.getMonth();\n if (selected[year] === undefined) {\n selected[year] = [month];\n } else {\n pushUnique(selected[year], month);\n }\n return selected;\n }, {});\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n const date = new Date(timeValue);\n return isNaN(date) ? undefined : [date.getFullYear(), date.getMonth()];\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled months on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(this.year);\n this.picker.setPrevBtnDisabled(this.year <= this.minYear);\n this.picker.setNextBtnDisabled(this.year >= this.maxYear);\n\n const selected = this.selected[this.year] || [];\n const yrOutOfRange = this.year < this.minYear || this.year > this.maxYear;\n const isMinYear = this.year === this.minYear;\n const isMaxYear = this.year === this.maxYear;\n const range = computeMonthRange(this.range, this.year);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const date = dateValue(this.year, index, 1);\n\n el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n // reset text on every render to clear the custom content set\n // by beforeShow hook at previous render\n el.textContent = this.monthNames[index];\n\n if (\n yrOutOfRange\n || isMinYear && index < this.minMonth\n || isMaxYear && index > this.maxMonth\n ) {\n classList.add('disabled');\n }\n if (range) {\n const [rangeStart, rangeEnd] = range;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (selected.includes(index)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, index, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const selected = this.selected[this.year] || [];\n const [rangeStart, rangeEnd] = computeMonthRange(this.range, this.year) || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'dark:bg-blue-600', 'dark:text-white', 'text-white', 'focused');\n el.classList.add('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n });\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n if (index > rangeStart && index < rangeEnd) {\n classList.add('range');\n }\n if (index === rangeStart) {\n classList.add('range-start');\n }\n if (index === rangeEnd) {\n classList.add('range-end');\n }\n if (selected.includes(index)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (index === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[this.focused].classList.add('focused');\n }\n}","import {hasProperty, pushUnique, createTagRepeat} from '../../lib/utils.js';\nimport {dateValue, startOfYearPeriod} from '../../lib/date.js';\nimport {parseHTML} from '../../lib/dom.js';\nimport View from './View.js';\n\nfunction toTitleCase(word) {\n return [...word].reduce((str, ch, ix) => str += ix ? ch : ch.toUpperCase(), '');\n}\n\n// Class representing the years and decades view elements\nexport default class YearsView extends View {\n constructor(picker, config) {\n super(picker, config);\n }\n\n init(options, onConstruction = true) {\n if (onConstruction) {\n this.navStep = this.step * 10;\n this.beforeShowOption = `beforeShow${toTitleCase(this.cellClass)}`;\n this.grid = this.element;\n this.element.classList.add(this.name, 'datepicker-grid', 'w-64', 'grid', 'grid-cols-4');\n this.grid.appendChild(parseHTML(createTagRepeat('span', 12)));\n }\n super.init(options);\n }\n\n setOptions(options) {\n if (hasProperty(options, 'minDate')) {\n if (options.minDate === undefined) {\n this.minYear = this.minDate = undefined;\n } else {\n this.minYear = startOfYearPeriod(options.minDate, this.step);\n this.minDate = dateValue(this.minYear, 0, 1);\n }\n }\n if (hasProperty(options, 'maxDate')) {\n if (options.maxDate === undefined) {\n this.maxYear = this.maxDate = undefined;\n } else {\n this.maxYear = startOfYearPeriod(options.maxDate, this.step);\n this.maxDate = dateValue(this.maxYear, 11, 31);\n }\n }\n if (options[this.beforeShowOption] !== undefined) {\n const beforeShow = options[this.beforeShowOption];\n this.beforeShow = typeof beforeShow === 'function' ? beforeShow : undefined;\n }\n }\n\n // Update view's settings to reflect the viewDate set on the picker\n updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }\n\n // Update view's settings to reflect the selected dates\n updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return pushUnique(years, startOfYearPeriod(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return startOfYearPeriod(timeValue, this.step);\n }\n });\n }\n }\n\n // Update the entire view UI\n render() {\n // refresh disabled years on every render in order to clear the ones added\n // by beforeShow hook at previous render\n this.disabled = [];\n\n this.picker.setViewSwitchLabel(`${this.first}-${this.last}`);\n this.picker.setPrevBtnDisabled(this.first <= this.minYear);\n this.picker.setNextBtnDisabled(this.last >= this.maxYear);\n\n Array.from(this.grid.children).forEach((el, index) => {\n const classList = el.classList;\n const current = this.start + (index * this.step);\n const date = dateValue(current, 0, 1);\n\n el.className = `datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`;\n if (this.isMinView) {\n el.dataset.date = date;\n }\n el.textContent = el.dataset.year = current;\n\n if (index === 0) {\n classList.add('prev');\n } else if (index === 11) {\n classList.add('next');\n }\n if (current < this.minYear || current > this.maxYear) {\n classList.add('disabled');\n }\n if (this.range) {\n const [rangeStart, rangeEnd] = this.range;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n\n if (this.beforeShow) {\n this.performBeforeHook(el, current, date);\n }\n });\n }\n\n // Update the view UI by applying the changes of selected and focused items\n refresh() {\n const [rangeStart, rangeEnd] = this.range || [];\n this.grid\n .querySelectorAll('.range, .range-start, .range-end, .selected, .focused')\n .forEach((el) => {\n el.classList.remove('range', 'range-start', 'range-end', 'selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white', 'focused');\n });\n Array.from(this.grid.children).forEach((el) => {\n const current = Number(el.textContent);\n const classList = el.classList;\n if (current > rangeStart && current < rangeEnd) {\n classList.add('range');\n }\n if (current === rangeStart) {\n classList.add('range-start');\n }\n if (current === rangeEnd) {\n classList.add('range-end');\n }\n if (this.selected.includes(current)) {\n classList.add('selected', 'bg-blue-700', 'text-white', 'dark:bg-blue-600', 'dark:text-white');\n classList.remove('text-gray-900', 'hover:bg-gray-100', 'dark:text-white', 'dark:hover:bg-gray-600');\n }\n if (current === this.focused) {\n classList.add('focused');\n }\n });\n }\n\n // Update the view UI by applying the change of focused item\n refreshFocus() {\n const index = Math.round((this.focused - this.start) / this.step);\n this.grid.querySelectorAll('.focused').forEach((el) => {\n el.classList.remove('focused');\n });\n this.grid.children[index].classList.add('focused');\n }\n}\n","import {limitToRange} from '../lib/utils.js';\nimport {addMonths, addYears} from '../lib/date.js';\n\nexport function triggerDatepickerEvent(datepicker, type) {\n const detail = {\n date: datepicker.getDate(),\n viewDate: new Date(datepicker.picker.viewDate),\n viewId: datepicker.picker.currentView.id,\n datepicker,\n };\n datepicker.element.dispatchEvent(new CustomEvent(type, {detail}));\n}\n\n// direction: -1 (to previous), 1 (to next)\nexport function goToPrevOrNext(datepicker, direction) {\n const {minDate, maxDate} = datepicker.config;\n const {currentView, viewDate} = datepicker.picker;\n let newViewDate;\n switch (currentView.id) {\n case 0:\n newViewDate = addMonths(viewDate, direction);\n break;\n case 1:\n newViewDate = addYears(viewDate, direction);\n break;\n default:\n newViewDate = addYears(viewDate, direction * currentView.navStep);\n }\n newViewDate = limitToRange(newViewDate, minDate, maxDate);\n datepicker.picker.changeFocus(newViewDate).render();\n}\n\nexport function switchView(datepicker) {\n const viewId = datepicker.picker.currentView.id;\n if (viewId === datepicker.config.maxView) {\n return;\n }\n datepicker.picker.changeView(viewId + 1).render();\n}\n\nexport function unfocus(datepicker) {\n if (datepicker.config.updateOnBlur) {\n datepicker.update({autohide: true});\n } else {\n datepicker.refresh('input');\n datepicker.hide();\n }\n}\n","import {today, addMonths, addYears} from '../lib/date.js';\nimport {findElementInEventPath} from '../lib/event.js';\nimport {goToPrevOrNext, switchView} from './functions.js';\n\nfunction goToSelectedMonthOrYear(datepicker, selection) {\n const picker = datepicker.picker;\n const viewDate = new Date(picker.viewDate);\n const viewId = picker.currentView.id;\n const newDate = viewId === 1\n ? addMonths(viewDate, selection - viewDate.getMonth())\n : addYears(viewDate, selection - viewDate.getFullYear());\n\n picker.changeFocus(newDate).changeView(viewId - 1).render();\n}\n\nexport function onClickTodayBtn(datepicker) {\n const picker = datepicker.picker;\n const currentDate = today();\n if (datepicker.config.todayBtnMode === 1) {\n if (datepicker.config.autohide) {\n datepicker.setDate(currentDate);\n return;\n }\n datepicker.setDate(currentDate, {render: false});\n picker.update();\n }\n if (picker.viewDate !== currentDate) {\n picker.changeFocus(currentDate);\n }\n picker.changeView(0).render();\n}\n\nexport function onClickClearBtn(datepicker) {\n datepicker.setDate({clear: true});\n}\n\nexport function onClickViewSwitch(datepicker) {\n switchView(datepicker);\n}\n\nexport function onClickPrevBtn(datepicker) {\n goToPrevOrNext(datepicker, -1);\n}\n\nexport function onClickNextBtn(datepicker) {\n goToPrevOrNext(datepicker, 1);\n}\n\n// For the picker's main block to delegete the events from `datepicker-cell`s\nexport function onClickView(datepicker, ev) {\n const target = findElementInEventPath(ev, '.datepicker-cell');\n if (!target || target.classList.contains('disabled')) {\n return;\n }\n\n const {id, isMinView} = datepicker.picker.currentView;\n if (isMinView) {\n datepicker.setDate(Number(target.dataset.date));\n } else if (id === 1) {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.month));\n } else {\n goToSelectedMonthOrYear(datepicker, Number(target.dataset.year));\n }\n}\n\nexport function onClickPicker(datepicker) {\n if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.focus();\n }\n}\n","import {hasProperty, lastItemOf, isInRange, limitToRange} from '../lib/utils.js';\nimport {today} from '../lib/date.js';\nimport {parseHTML, showElement, hideElement, emptyChildNodes} from '../lib/dom.js';\nimport {registerListeners} from '../lib/event.js';\nimport pickerTemplate from './templates/pickerTemplate.js';\nimport DaysView from './views/DaysView.js';\nimport MonthsView from './views/MonthsView.js';\nimport YearsView from './views/YearsView.js';\nimport {triggerDatepickerEvent} from '../events/functions.js';\nimport {\n onClickTodayBtn,\n onClickClearBtn,\n onClickViewSwitch,\n onClickPrevBtn,\n onClickNextBtn,\n onClickView,\n onClickPicker,\n} from '../events/pickerListeners.js';\n\nfunction processPickerOptions(picker, options) {\n if (options.title !== undefined) {\n if (options.title) {\n picker.controls.title.textContent = options.title;\n showElement(picker.controls.title);\n } else {\n picker.controls.title.textContent = '';\n hideElement(picker.controls.title);\n }\n }\n if (options.prevArrow) {\n const prevBtn = picker.controls.prevBtn;\n emptyChildNodes(prevBtn);\n options.prevArrow.forEach((node) => {\n prevBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.nextArrow) {\n const nextBtn = picker.controls.nextBtn;\n emptyChildNodes(nextBtn);\n options.nextArrow.forEach((node) => {\n nextBtn.appendChild(node.cloneNode(true));\n });\n }\n if (options.locale) {\n picker.controls.todayBtn.textContent = options.locale.today;\n picker.controls.clearBtn.textContent = options.locale.clear;\n }\n if (options.todayBtn !== undefined) {\n if (options.todayBtn) {\n showElement(picker.controls.todayBtn);\n } else {\n hideElement(picker.controls.todayBtn);\n }\n }\n if (hasProperty(options, 'minDate') || hasProperty(options, 'maxDate')) {\n const {minDate, maxDate} = picker.datepicker.config;\n picker.controls.todayBtn.disabled = !isInRange(today(), minDate, maxDate);\n }\n if (options.clearBtn !== undefined) {\n if (options.clearBtn) {\n showElement(picker.controls.clearBtn);\n } else {\n hideElement(picker.controls.clearBtn);\n }\n }\n}\n\n// Compute view date to reset, which will be...\n// - the last item of the selected dates or defaultViewDate if no selection\n// - limitted to minDate or maxDate if it exceeds the range\nfunction computeResetViewDate(datepicker) {\n const {dates, config} = datepicker;\n const viewDate = dates.length > 0 ? lastItemOf(dates) : config.defaultViewDate;\n return limitToRange(viewDate, config.minDate, config.maxDate);\n}\n\n// Change current view's view date\nfunction setViewDate(picker, newDate) {\n const oldViewDate = new Date(picker.viewDate);\n const newViewDate = new Date(newDate);\n const {id, year, first, last} = picker.currentView;\n const viewYear = newViewDate.getFullYear();\n\n picker.viewDate = newDate;\n if (viewYear !== oldViewDate.getFullYear()) {\n triggerDatepickerEvent(picker.datepicker, 'changeYear');\n }\n if (newViewDate.getMonth() !== oldViewDate.getMonth()) {\n triggerDatepickerEvent(picker.datepicker, 'changeMonth');\n }\n\n // return whether the new date is in different period on time from the one\n // displayed in the current view\n // when true, the view needs to be re-rendered on the next UI refresh.\n switch (id) {\n case 0:\n return newDate < first || newDate > last;\n case 1:\n return viewYear !== year;\n default:\n return viewYear < first || viewYear > last;\n }\n}\n\nfunction getTextDirection(el) {\n return window.getComputedStyle(el).direction;\n}\n\n// Class representing the picker UI\nexport default class Picker {\n constructor(datepicker) {\n this.datepicker = datepicker;\n\n const template = pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass);\n const element = this.element = parseHTML(template).firstChild;\n const [header, main, footer] = element.firstChild.children;\n const title = header.firstElementChild;\n const [prevBtn, viewSwitch, nextBtn] = header.lastElementChild.children;\n const [todayBtn, clearBtn] = footer.firstChild.children;\n const controls = {\n title,\n prevBtn,\n viewSwitch,\n nextBtn,\n todayBtn,\n clearBtn,\n };\n this.main = main;\n this.controls = controls;\n\n const elementClass = datepicker.inline ? 'inline' : 'dropdown';\n element.classList.add(`datepicker-${elementClass}`);\n elementClass === 'dropdown' ? element.classList.add('dropdown', 'absolute', 'top-0', 'left-0', 'z-50', 'pt-2') : null;\n\n processPickerOptions(this, datepicker.config);\n this.viewDate = computeResetViewDate(datepicker);\n\n // set up event listeners\n registerListeners(datepicker, [\n [element, 'click', onClickPicker.bind(null, datepicker), {capture: true}],\n [main, 'click', onClickView.bind(null, datepicker)],\n [controls.viewSwitch, 'click', onClickViewSwitch.bind(null, datepicker)],\n [controls.prevBtn, 'click', onClickPrevBtn.bind(null, datepicker)],\n [controls.nextBtn, 'click', onClickNextBtn.bind(null, datepicker)],\n [controls.todayBtn, 'click', onClickTodayBtn.bind(null, datepicker)],\n [controls.clearBtn, 'click', onClickClearBtn.bind(null, datepicker)],\n ]);\n\n // set up views\n this.views = [\n new DaysView(this),\n new MonthsView(this),\n new YearsView(this, {id: 2, name: 'years', cellClass: 'year', step: 1}),\n new YearsView(this, {id: 3, name: 'decades', cellClass: 'decade', step: 10}),\n ];\n this.currentView = this.views[datepicker.config.startView];\n\n this.currentView.render();\n this.main.appendChild(this.currentView.element);\n datepicker.config.container.appendChild(this.element);\n }\n\n setOptions(options) {\n processPickerOptions(this, options);\n this.views.forEach((view) => {\n view.init(options, false);\n });\n this.currentView.render();\n }\n\n detach() {\n this.datepicker.config.container.removeChild(this.element);\n }\n\n show() {\n if (this.active) {\n return;\n }\n this.element.classList.add('active', 'block');\n this.element.classList.remove('hidden');\n this.active = true;\n\n const datepicker = this.datepicker;\n if (!datepicker.inline) {\n // ensure picker's direction matches input's\n const inputDirection = getTextDirection(datepicker.inputField);\n if (inputDirection !== getTextDirection(datepicker.config.container)) {\n this.element.dir = inputDirection;\n } else if (this.element.dir) {\n this.element.removeAttribute('dir');\n }\n\n this.place();\n if (datepicker.config.disableTouchKeyboard) {\n datepicker.inputField.blur();\n }\n }\n triggerDatepickerEvent(datepicker, 'show');\n }\n\n hide() {\n if (!this.active) {\n return;\n }\n this.datepicker.exitEditMode();\n this.element.classList.remove('active', 'block');\n this.element.classList.add('active', 'block', 'hidden');\n this.active = false;\n triggerDatepickerEvent(this.datepicker, 'hide');\n }\n\n place() {\n const {classList, style} = this.element;\n const {config, inputField} = this.datepicker;\n const container = config.container;\n const {\n width: calendarWidth,\n height: calendarHeight,\n } = this.element.getBoundingClientRect();\n const {\n left: containerLeft,\n top: containerTop,\n width: containerWidth,\n } = container.getBoundingClientRect();\n const {\n left: inputLeft,\n top: inputTop,\n width: inputWidth,\n height: inputHeight\n } = inputField.getBoundingClientRect();\n let {x: orientX, y: orientY} = config.orientation;\n let scrollTop;\n let left;\n let top;\n\n if (container === document.body) {\n scrollTop = window.scrollY;\n left = inputLeft + window.scrollX;\n top = inputTop + scrollTop;\n } else {\n scrollTop = container.scrollTop;\n left = inputLeft - containerLeft;\n top = inputTop - containerTop + scrollTop;\n }\n\n if (orientX === 'auto') {\n if (left < 0) {\n // align to the left and move into visible area if input's left edge < window's\n orientX = 'left';\n left = 10;\n } else if (left + calendarWidth > containerWidth) {\n // align to the right if canlendar's right edge > container's\n orientX = 'right';\n } else {\n orientX = getTextDirection(inputField) === 'rtl' ? 'right' : 'left';\n }\n }\n if (orientX === 'right') {\n left -= calendarWidth - inputWidth;\n }\n\n if (orientY === 'auto') {\n orientY = top - calendarHeight < scrollTop ? 'bottom' : 'top';\n }\n if (orientY === 'top') {\n top -= calendarHeight;\n } else {\n top += inputHeight;\n }\n\n classList.remove(\n 'datepicker-orient-top',\n 'datepicker-orient-bottom',\n 'datepicker-orient-right',\n 'datepicker-orient-left'\n );\n classList.add(`datepicker-orient-${orientY}`, `datepicker-orient-${orientX}`);\n\n style.top = top ? `${top}px` : top;\n style.left = left ? `${left}px` : left;\n }\n\n setViewSwitchLabel(labelText) {\n this.controls.viewSwitch.textContent = labelText;\n }\n\n setPrevBtnDisabled(disabled) {\n this.controls.prevBtn.disabled = disabled;\n }\n\n setNextBtnDisabled(disabled) {\n this.controls.nextBtn.disabled = disabled;\n }\n\n changeView(viewId) {\n const oldView = this.currentView;\n const newView = this.views[viewId];\n if (newView.id !== oldView.id) {\n this.currentView = newView;\n this._renderMethod = 'render';\n triggerDatepickerEvent(this.datepicker, 'changeView');\n this.main.replaceChild(newView.element, oldView.element);\n }\n return this;\n }\n\n // Change the focused date (view date)\n changeFocus(newViewDate) {\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refreshFocus';\n this.views.forEach((view) => {\n view.updateFocus();\n });\n return this;\n }\n\n // Apply the change of the selected dates\n update() {\n const newViewDate = computeResetViewDate(this.datepicker);\n this._renderMethod = setViewDate(this, newViewDate) ? 'render' : 'refresh';\n this.views.forEach((view) => {\n view.updateFocus();\n view.updateSelection();\n });\n return this;\n }\n\n // Refresh the picker UI\n render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n\n this.currentView[renderMethod]();\n }\n}\n","import {isInRange} from '../lib/utils.js';\nimport {addDays, addMonths, addYears, startOfYearPeriod} from '../lib/date.js';\nimport {goToPrevOrNext, switchView, unfocus} from './functions.js';\n\n// Find the closest date that doesn't meet the condition for unavailable date\n// Returns undefined if no available date is found\n// addFn: function to calculate the next date\n// - args: time value, amount\n// increase: amount to pass to addFn\n// testFn: function to test the unavailablity of the date\n// - args: time value; retun: true if unavailable\nfunction findNextAvailableOne(date, addFn, increase, testFn, min, max) {\n if (!isInRange(date, min, max)) {\n return;\n }\n if (testFn(date)) {\n const newDate = addFn(date, increase);\n return findNextAvailableOne(newDate, addFn, increase, testFn, min, max);\n }\n return date;\n}\n\n// direction: -1 (left/up), 1 (right/down)\n// vertical: true for up/down, false for left/right\nfunction moveByArrowKey(datepicker, ev, direction, vertical) {\n const picker = datepicker.picker;\n const currentView = picker.currentView;\n const step = currentView.step || 1;\n let viewDate = picker.viewDate;\n let addFn;\n let testFn;\n switch (currentView.id) {\n case 0:\n if (vertical) {\n viewDate = addDays(viewDate, direction * 7);\n } else if (ev.ctrlKey || ev.metaKey) {\n viewDate = addYears(viewDate, direction);\n } else {\n viewDate = addDays(viewDate, direction);\n }\n addFn = addDays;\n testFn = (date) => currentView.disabled.includes(date);\n break;\n case 1:\n viewDate = addMonths(viewDate, vertical ? direction * 4 : direction);\n addFn = addMonths;\n testFn = (date) => {\n const dt = new Date(date);\n const {year, disabled} = currentView;\n return dt.getFullYear() === year && disabled.includes(dt.getMonth());\n };\n break;\n default:\n viewDate = addYears(viewDate, direction * (vertical ? 4 : 1) * step);\n addFn = addYears;\n testFn = date => currentView.disabled.includes(startOfYearPeriod(date, step));\n }\n viewDate = findNextAvailableOne(\n viewDate,\n addFn,\n direction < 0 ? -step : step,\n testFn,\n currentView.minDate,\n currentView.maxDate\n );\n if (viewDate !== undefined) {\n picker.changeFocus(viewDate).render();\n }\n}\n\nexport function onKeydown(datepicker, ev) {\n if (ev.key === 'Tab') {\n unfocus(datepicker);\n return;\n }\n\n const picker = datepicker.picker;\n const {id, isMinView} = picker.currentView;\n if (!picker.active) {\n switch (ev.key) {\n case 'ArrowDown':\n case 'Escape':\n picker.show();\n break;\n case 'Enter':\n datepicker.update();\n break;\n default:\n return;\n }\n } else if (datepicker.editMode) {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'Enter':\n datepicker.exitEditMode({update: true, autohide: datepicker.config.autohide});\n break;\n default:\n return;\n }\n } else {\n switch (ev.key) {\n case 'Escape':\n picker.hide();\n break;\n case 'ArrowLeft':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, -1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, false);\n }\n break;\n case 'ArrowRight':\n if (ev.ctrlKey || ev.metaKey) {\n goToPrevOrNext(datepicker, 1);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, 1, false);\n }\n break;\n case 'ArrowUp':\n if (ev.ctrlKey || ev.metaKey) {\n switchView(datepicker);\n } else if (ev.shiftKey) {\n datepicker.enterEditMode();\n return;\n } else {\n moveByArrowKey(datepicker, ev, -1, true);\n }\n break;\n case 'ArrowDown':\n if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n return;\n }\n moveByArrowKey(datepicker, ev, 1, true);\n break;\n case 'Enter':\n if (isMinView) {\n datepicker.setDate(picker.viewDate);\n } else {\n picker.changeView(id - 1).render();\n }\n break;\n case 'Backspace':\n case 'Delete':\n datepicker.enterEditMode();\n return;\n default:\n if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) {\n datepicker.enterEditMode();\n }\n return;\n }\n }\n ev.preventDefault();\n ev.stopPropagation();\n}\n\nexport function onFocus(datepicker) {\n if (datepicker.config.showOnFocus && !datepicker._showing) {\n datepicker.show();\n }\n}\n\n// for the prevention for entering edit mode while getting focus on click\nexport function onMousedown(datepicker, ev) {\n const el = ev.target;\n if (datepicker.picker.active || datepicker.config.showOnClick) {\n el._active = el === document.activeElement;\n el._clicking = setTimeout(() => {\n delete el._active;\n delete el._clicking;\n }, 2000);\n }\n}\n\nexport function onClickInput(datepicker, ev) {\n const el = ev.target;\n if (!el._clicking) {\n return;\n }\n clearTimeout(el._clicking);\n delete el._clicking;\n\n if (el._active) {\n datepicker.enterEditMode();\n }\n delete el._active;\n\n if (datepicker.config.showOnClick) {\n datepicker.show();\n }\n}\n\nexport function onPaste(datepicker, ev) {\n if (ev.clipboardData.types.includes('text/plain')) {\n datepicker.enterEditMode();\n }\n}\n","import {findElementInEventPath} from '../lib/event.js';\nimport {unfocus} from './functions.js';\n\n// for the `document` to delegate the events from outside the picker/input field\nexport function onClickOutside(datepicker, ev) {\n const element = datepicker.element;\n if (element !== document.activeElement) {\n return;\n }\n const pickerElem = datepicker.picker.element;\n if (findElementInEventPath(ev, el => el === element || el === pickerElem)) {\n return;\n }\n unfocus(datepicker);\n}\n","import {lastItemOf, stringToArray, isInRange} from './lib/utils.js';\nimport {today} from './lib/date.js';\nimport {parseDate, formatDate} from './lib/date-format.js';\nimport {registerListeners, unregisterListeners} from './lib/event.js';\nimport {locales} from './i18n/base-locales.js';\nimport defaultOptions from './options/defaultOptions.js';\nimport processOptions from './options/processOptions.js';\nimport Picker from './picker/Picker.js';\nimport {triggerDatepickerEvent} from './events/functions.js';\nimport {onKeydown, onFocus, onMousedown, onClickInput, onPaste} from './events/inputFieldListeners.js';\nimport {onClickOutside} from './events/otherListeners.js';\n\nfunction stringifyDates(dates, config) {\n return dates\n .map(dt => formatDate(dt, config.format, config.locale))\n .join(config.dateDelimiter);\n}\n\n// parse input dates and create an array of time values for selection\n// returns undefined if there are no valid dates in inputDates\n// when origDates (current selection) is passed, the function works to mix\n// the input dates into the current selection\nfunction processInputDates(datepicker, inputDates, clear = false) {\n const {config, dates: origDates, rangepicker} = datepicker;\n if (inputDates.length === 0) {\n // empty input is considered valid unless origiDates is passed\n return clear ? [] : undefined;\n }\n\n const rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1];\n let newDates = inputDates.reduce((dates, dt) => {\n let date = parseDate(dt, config.format, config.locale);\n if (date === undefined) {\n return dates;\n }\n if (config.pickLevel > 0) {\n // adjust to 1st of the month/Jan 1st of the year\n // or to the last day of the monh/Dec 31st of the year if the datepicker\n // is the range-end picker of a rangepicker\n const dt = new Date(date);\n if (config.pickLevel === 1) {\n date = rangeEnd\n ? dt.setMonth(dt.getMonth() + 1, 0)\n : dt.setDate(1);\n } else {\n date = rangeEnd\n ? dt.setFullYear(dt.getFullYear() + 1, 0, 0)\n : dt.setMonth(0, 1);\n }\n }\n if (\n isInRange(date, config.minDate, config.maxDate)\n && !dates.includes(date)\n && !config.datesDisabled.includes(date)\n && !config.daysOfWeekDisabled.includes(new Date(date).getDay())\n ) {\n dates.push(date);\n }\n return dates;\n }, []);\n if (newDates.length === 0) {\n return;\n }\n if (config.multidate && !clear) {\n // get the synmetric difference between origDates and newDates\n newDates = newDates.reduce((dates, date) => {\n if (!origDates.includes(date)) {\n dates.push(date);\n }\n return dates;\n }, origDates.filter(date => !newDates.includes(date)));\n }\n // do length check always because user can input multiple dates regardless of the mode\n return config.maxNumberOfDates && newDates.length > config.maxNumberOfDates\n ? newDates.slice(config.maxNumberOfDates * -1)\n : newDates;\n}\n\n// refresh the UI elements\n// modes: 1: input only, 2, picker only, 3 both\nfunction refreshUI(datepicker, mode = 3, quickRender = true) {\n const {config, picker, inputField} = datepicker;\n if (mode & 2) {\n const newView = picker.active ? config.pickLevel : config.startView;\n picker.update().changeView(newView).render(quickRender);\n }\n if (mode & 1 && inputField) {\n inputField.value = stringifyDates(datepicker.dates, config);\n }\n}\n\nfunction setDate(datepicker, inputDates, options) {\n let {clear, render, autohide} = options;\n if (render === undefined) {\n render = true;\n }\n if (!render) {\n autohide = false;\n } else if (autohide === undefined) {\n autohide = datepicker.config.autohide;\n }\n\n const newDates = processInputDates(datepicker, inputDates, clear);\n if (!newDates) {\n return;\n }\n if (newDates.toString() !== datepicker.dates.toString()) {\n datepicker.dates = newDates;\n refreshUI(datepicker, render ? 3 : 1);\n triggerDatepickerEvent(datepicker, 'changeDate');\n } else {\n refreshUI(datepicker, 1);\n }\n if (autohide) {\n datepicker.hide();\n }\n}\n\n/**\n * Class representing a date picker\n */\nexport default class Datepicker {\n /**\n * Create a date picker\n * @param {Element} element - element to bind a date picker\n * @param {Object} [options] - config options\n * @param {DateRangePicker} [rangepicker] - DateRangePicker instance the\n * date picker belongs to. Use this only when creating date picker as a part\n * of date range picker\n */\n constructor(element, options = {}, rangepicker = undefined) {\n element.datepicker = this;\n this.element = element;\n\n // set up config\n const config = this.config = Object.assign({\n buttonClass: (options.buttonClass && String(options.buttonClass)) || 'button',\n container: document.body,\n defaultViewDate: today(),\n maxDate: undefined,\n minDate: undefined,\n }, processOptions(defaultOptions, this));\n this._options = options;\n Object.assign(config, processOptions(options, this));\n\n // configure by type\n const inline = this.inline = element.tagName !== 'INPUT';\n let inputField;\n let initialDates;\n\n if (inline) {\n config.container = element;\n initialDates = stringToArray(element.dataset.date, config.dateDelimiter);\n delete element.dataset.date;\n } else {\n const container = options.container ? document.querySelector(options.container) : null;\n if (container) {\n config.container = container;\n }\n inputField = this.inputField = element;\n inputField.classList.add('datepicker-input');\n initialDates = stringToArray(inputField.value, config.dateDelimiter);\n }\n if (rangepicker) {\n // check validiry\n const index = rangepicker.inputs.indexOf(inputField);\n const datepickers = rangepicker.datepickers;\n if (index < 0 || index > 1 || !Array.isArray(datepickers)) {\n throw Error('Invalid rangepicker object.');\n }\n // attach itaelf to the rangepicker here so that processInputDates() can\n // determine if this is the range-end picker of the rangepicker while\n // setting inital values when pickLevel > 0\n datepickers[index] = this;\n // add getter for rangepicker\n Object.defineProperty(this, 'rangepicker', {\n get() {\n return rangepicker;\n },\n });\n }\n\n // set initial dates\n this.dates = [];\n // process initial value\n const inputDateValues = processInputDates(this, initialDates);\n if (inputDateValues && inputDateValues.length > 0) {\n this.dates = inputDateValues;\n }\n if (inputField) {\n inputField.value = stringifyDates(this.dates, config);\n }\n\n const picker = this.picker = new Picker(this);\n\n if (inline) {\n this.show();\n } else {\n // set up event listeners in other modes\n const onMousedownDocument = onClickOutside.bind(null, this);\n const listeners = [\n [inputField, 'keydown', onKeydown.bind(null, this)],\n [inputField, 'focus', onFocus.bind(null, this)],\n [inputField, 'mousedown', onMousedown.bind(null, this)],\n [inputField, 'click', onClickInput.bind(null, this)],\n [inputField, 'paste', onPaste.bind(null, this)],\n [document, 'mousedown', onMousedownDocument],\n [document, 'touchstart', onMousedownDocument],\n [window, 'resize', picker.place.bind(picker)]\n ];\n registerListeners(this, listeners);\n }\n }\n\n /**\n * Format Date object or time value in given format and language\n * @param {Date|Number} date - date or time value to format\n * @param {String|Object} format - format string or object that contains\n * toDisplay() custom formatter, whose signature is\n * - args:\n * - date: {Date} - Date instance of the date passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {String} formatted date\n * @param {String} [lang=en] - language code for the locale to use\n * @return {String} formatted date\n */\n static formatDate(date, format, lang) {\n return formatDate(date, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * Parse date string\n * @param {String|Date|Number} dateStr - date string, Date object or time\n * value to parse\n * @param {String|Object} format - format string or object that contains\n * toValue() custom parser, whose signature is\n * - args:\n * - dateStr: {String|Date|Number} - the dateStr passed to the method\n * - format: {Object} - the format object passed to the method\n * - locale: {Object} - locale for the language specified by `lang`\n * - return:\n * {Date|Number} parsed date or its time value\n * @param {String} [lang=en] - language code for the locale to use\n * @return {Number} time value of parsed date\n */\n static parseDate(dateStr, format, lang) {\n return parseDate(dateStr, format, lang && locales[lang] || locales.en);\n }\n\n /**\n * @type {Object} - Installed locales in `[languageCode]: localeObject` format\n * en`:_English (US)_ is pre-installed.\n */\n static get locales() {\n return locales;\n }\n\n /**\n * @type {Boolean} - Whether the picker element is shown. `true` whne shown\n */\n get active() {\n return !!(this.picker && this.picker.active);\n }\n\n /**\n * @type {HTMLDivElement} - DOM object of picker element\n */\n get pickerElement() {\n return this.picker ? this.picker.element : undefined;\n }\n\n /**\n * Set new values to the config options\n * @param {Object} options - config options to update\n */\n setOptions(options) {\n const picker = this.picker;\n const newOptions = processOptions(options, this);\n Object.assign(this._options, options);\n Object.assign(this.config, newOptions);\n picker.setOptions(newOptions);\n\n refreshUI(this, 3);\n }\n\n /**\n * Show the picker element\n */\n show() {\n if (this.inputField) {\n if (this.inputField.disabled) {\n return;\n }\n if (this.inputField !== document.activeElement) {\n this._showing = true;\n this.inputField.focus();\n delete this._showing;\n }\n }\n this.picker.show();\n }\n\n /**\n * Hide the picker element\n * Not available on inline picker\n */\n hide() {\n if (this.inline) {\n return;\n }\n this.picker.hide();\n this.picker.update().changeView(this.config.startView).render();\n }\n\n /**\n * Destroy the Datepicker instance\n * @return {Detepicker} - the instance destroyed\n */\n destroy() {\n this.hide();\n unregisterListeners(this);\n this.picker.detach();\n if (!this.inline) {\n this.inputField.classList.remove('datepicker-input');\n }\n delete this.element.datepicker;\n return this;\n }\n\n /**\n * Get the selected date(s)\n *\n * The method returns a Date object of selected date by default, and returns\n * an array of selected dates in multidate mode. If format string is passed,\n * it returns date string(s) formatted in given format.\n *\n * @param {String} [format] - Format string to stringify the date(s)\n * @return {Date|String|Date[]|String[]} - selected date(s), or if none is\n * selected, empty array in multidate mode and untitled in sigledate mode\n */\n getDate(format = undefined) {\n const callback = format\n ? date => formatDate(date, format, this.config.locale)\n : date => new Date(date);\n\n if (this.config.multidate) {\n return this.dates.map(callback);\n }\n if (this.dates.length > 0) {\n return callback(this.dates[0]);\n }\n }\n\n /**\n * Set selected date(s)\n *\n * In multidate mode, you can pass multiple dates as a series of arguments\n * or an array. (Since each date is parsed individually, the type of the\n * dates doesn't have to be the same.)\n * The given dates are used to toggle the select status of each date. The\n * number of selected dates is kept from exceeding the length set to\n * maxNumberOfDates.\n *\n * With clear: true option, the method can be used to clear the selection\n * and to replace the selection instead of toggling in multidate mode.\n * If the option is passed with no date arguments or an empty dates array,\n * it works as \"clear\" (clear the selection then set nothing), and if the\n * option is passed with new dates to select, it works as \"replace\" (clear\n * the selection then set the given dates)\n *\n * When render: false option is used, the method omits re-rendering the\n * picker element. In this case, you need to call refresh() method later in\n * order for the picker element to reflect the changes. The input field is\n * refreshed always regardless of this option.\n *\n * When invalid (unparsable, repeated, disabled or out-of-range) dates are\n * passed, the method ignores them and applies only valid ones. In the case\n * that all the given dates are invalid, which is distinguished from passing\n * no dates, the method considers it as an error and leaves the selection\n * untouched.\n *\n * @param {...(Date|Number|String)|Array} [dates] - Date strings, Date\n * objects, time values or mix of those for new selection\n * @param {Object} [options] - function options\n * - clear: {boolean} - Whether to clear the existing selection\n * defualt: false\n * - render: {boolean} - Whether to re-render the picker element\n * default: true\n * - autohide: {boolean} - Whether to hide the picker element after re-render\n * Ignored when used with render: false\n * default: config.autohide\n */\n setDate(...args) {\n const dates = [...args];\n const opts = {};\n const lastArg = lastItemOf(args);\n if (\n typeof lastArg === 'object'\n && !Array.isArray(lastArg)\n && !(lastArg instanceof Date)\n && lastArg\n ) {\n Object.assign(opts, dates.pop());\n }\n\n const inputDates = Array.isArray(dates[0]) ? dates[0] : dates;\n setDate(this, inputDates, opts);\n }\n\n /**\n * Update the selected date(s) with input field's value\n * Not available on inline picker\n *\n * The input field will be refreshed with properly formatted date string.\n *\n * @param {Object} [options] - function options\n * - autohide: {boolean} - whether to hide the picker element after refresh\n * default: false\n */\n update(options = undefined) {\n if (this.inline) {\n return;\n }\n\n const opts = {clear: true, autohide: !!(options && options.autohide)};\n const inputDates = stringToArray(this.inputField.value, this.config.dateDelimiter);\n setDate(this, inputDates, opts);\n }\n\n /**\n * Refresh the picker element and the associated input field\n * @param {String} [target] - target item when refreshing one item only\n * 'picker' or 'input'\n * @param {Boolean} [forceRender] - whether to re-render the picker element\n * regardless of its state instead of optimized refresh\n */\n refresh(target = undefined, forceRender = false) {\n if (target && typeof target !== 'string') {\n forceRender = target;\n target = undefined;\n }\n\n let mode;\n if (target === 'picker') {\n mode = 2;\n } else if (target === 'input') {\n mode = 1;\n } else {\n mode = 3;\n }\n refreshUI(this, mode, !forceRender);\n }\n\n /**\n * Enter edit mode\n * Not available on inline picker or when the picker element is hidden\n */\n enterEditMode() {\n if (this.inline || !this.picker.active || this.editMode) {\n return;\n }\n this.editMode = true;\n this.inputField.classList.add('in-edit', 'border-blue-700');\n }\n\n /**\n * Exit from edit mode\n * Not available on inline picker\n * @param {Object} [options] - function options\n * - update: {boolean} - whether to call update() after exiting\n * If false, input field is revert to the existing selection\n * default: false\n */\n exitEditMode(options = undefined) {\n if (this.inline || !this.editMode) {\n return;\n }\n const opts = Object.assign({update: false}, options);\n delete this.editMode;\n this.inputField.classList.remove('in-edit', 'border-blue-700');\n if (opts.update) {\n this.update(opts);\n }\n }\n}\n","import {stripTime, today} from './date.js';\nimport {lastItemOf} from './utils.js';\n\n// pattern for format parts\nexport const reFormatTokens = /dd?|DD?|mm?|MM?|yy?(?:yy)?/;\n// pattern for non date parts\nexport const reNonDateParts = /[\\s!-/:-@[-`{-~年月日]+/;\n// cache for persed formats\nlet knownFormats = {};\n// parse funtions for date parts\nconst parseFns = {\n y(date, year) {\n return new Date(date).setFullYear(parseInt(year, 10));\n },\n m(date, month, locale) {\n const newDate = new Date(date);\n let monthIndex = parseInt(month, 10) - 1;\n\n if (isNaN(monthIndex)) {\n if (!month) {\n return NaN;\n }\n\n const monthName = month.toLowerCase();\n const compareNames = name => name.toLowerCase().startsWith(monthName);\n // compare with both short and full names because some locales have periods\n // in the short names (not equal to the first X letters of the full names)\n monthIndex = locale.monthsShort.findIndex(compareNames);\n if (monthIndex < 0) {\n monthIndex = locale.months.findIndex(compareNames);\n }\n if (monthIndex < 0) {\n return NaN;\n }\n }\n\n newDate.setMonth(monthIndex);\n return newDate.getMonth() !== normalizeMonth(monthIndex)\n ? newDate.setDate(0)\n : newDate.getTime();\n },\n d(date, day) {\n return new Date(date).setDate(parseInt(day, 10));\n },\n};\n// format functions for date parts\nconst formatFns = {\n d(date) {\n return date.getDate();\n },\n dd(date) {\n return padZero(date.getDate(), 2);\n },\n D(date, locale) {\n return locale.daysShort[date.getDay()];\n },\n DD(date, locale) {\n return locale.days[date.getDay()];\n },\n m(date) {\n return date.getMonth() + 1;\n },\n mm(date) {\n return padZero(date.getMonth() + 1, 2);\n },\n M(date, locale) {\n return locale.monthsShort[date.getMonth()];\n },\n MM(date, locale) {\n return locale.months[date.getMonth()];\n },\n y(date) {\n return date.getFullYear();\n },\n yy(date) {\n return padZero(date.getFullYear(), 2).slice(-2);\n },\n yyyy(date) {\n return padZero(date.getFullYear(), 4);\n },\n};\n\n// get month index in normal range (0 - 11) from any number\nfunction normalizeMonth(monthIndex) {\n return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12);\n}\n\nfunction padZero(num, length) {\n return num.toString().padStart(length, '0');\n}\n\nfunction parseFormatString(format) {\n if (typeof format !== 'string') {\n throw new Error(\"Invalid date format.\");\n }\n if (format in knownFormats) {\n return knownFormats[format];\n }\n\n // sprit the format string into parts and seprators\n const separators = format.split(reFormatTokens);\n const parts = format.match(new RegExp(reFormatTokens, 'g'));\n if (separators.length === 0 || !parts) {\n throw new Error(\"Invalid date format.\");\n }\n\n // collect format functions used in the format\n const partFormatters = parts.map(token => formatFns[token]);\n\n // collect parse function keys used in the format\n // iterate over parseFns' keys in order to keep the order of the keys.\n const partParserKeys = Object.keys(parseFns).reduce((keys, key) => {\n const token = parts.find(part => part[0] !== 'D' && part[0].toLowerCase() === key);\n if (token) {\n keys.push(key);\n }\n return keys;\n }, []);\n\n return knownFormats[format] = {\n parser(dateStr, locale) {\n const dateParts = dateStr.split(reNonDateParts).reduce((dtParts, part, index) => {\n if (part.length > 0 && parts[index]) {\n const token = parts[index][0];\n if (token === 'M') {\n dtParts.m = part;\n } else if (token !== 'D') {\n dtParts[token] = part;\n }\n }\n return dtParts;\n }, {});\n\n // iterate over partParserkeys so that the parsing is made in the oder\n // of year, month and day to prevent the day parser from correcting last\n // day of month wrongly\n return partParserKeys.reduce((origDate, key) => {\n const newDate = parseFns[key](origDate, dateParts[key], locale);\n // ingnore the part failed to parse\n return isNaN(newDate) ? origDate : newDate;\n }, today());\n },\n formatter(date, locale) {\n let dateStr = partFormatters.reduce((str, fn, index) => {\n return str += `${separators[index]}${fn(date, locale)}`;\n }, '');\n // separators' length is always parts' length + 1,\n return dateStr += lastItemOf(separators);\n },\n };\n}\n\nexport function parseDate(dateStr, format, locale) {\n if (dateStr instanceof Date || typeof dateStr === 'number') {\n const date = stripTime(dateStr);\n return isNaN(date) ? undefined : date;\n }\n if (!dateStr) {\n return undefined;\n }\n if (dateStr === 'today') {\n return today();\n }\n\n if (format && format.toValue) {\n const date = format.toValue(dateStr, format, locale);\n return isNaN(date) ? undefined : stripTime(date);\n }\n\n return parseFormatString(format).parser(dateStr, locale);\n}\n\nexport function formatDate(date, format, locale) {\n if (isNaN(date) || (!date && date !== 0)) {\n return '';\n }\n\n const dateObj = typeof date === 'number' ? new Date(date) : date;\n\n if (format.toDisplay) {\n return format.toDisplay(dateObj, format, locale);\n }\n\n return parseFormatString(format).formatter(dateObj, locale);\n}\n","export function stripTime(timeValue) {\n return new Date(timeValue).setHours(0, 0, 0, 0);\n}\n\nexport function today() {\n return new Date().setHours(0, 0, 0, 0);\n}\n\n// Get the time value of the start of given date or year, month and day\nexport function dateValue(...args) {\n switch (args.length) {\n case 0:\n return today();\n case 1:\n return stripTime(args[0]);\n }\n\n // use setFullYear() to keep 2-digit year from being mapped to 1900-1999\n const newDate = new Date(0);\n newDate.setFullYear(...args);\n return newDate.setHours(0, 0, 0, 0);\n}\n\nexport function addDays(date, amount) {\n const newDate = new Date(date);\n return newDate.setDate(newDate.getDate() + amount);\n}\n\nexport function addWeeks(date, amount) {\n return addDays(date, amount * 7);\n}\n\nexport function addMonths(date, amount) {\n // If the day of the date is not in the new month, the last day of the new\n // month will be returned. e.g. Jan 31 + 1 month → Feb 28 (not Mar 03)\n const newDate = new Date(date);\n const monthsToSet = newDate.getMonth() + amount;\n let expectedMonth = monthsToSet % 12;\n if (expectedMonth < 0) {\n expectedMonth += 12;\n }\n\n const time = newDate.setMonth(monthsToSet);\n return newDate.getMonth() !== expectedMonth ? newDate.setDate(0) : time;\n}\n\nexport function addYears(date, amount) {\n // If the date is Feb 29 and the new year is not a leap year, Feb 28 of the\n // new year will be returned.\n const newDate = new Date(date);\n const expectedMonth = newDate.getMonth();\n const time = newDate.setFullYear(newDate.getFullYear() + amount);\n return expectedMonth === 1 && newDate.getMonth() === 2 ? newDate.setDate(0) : time;\n}\n\n// Calculate the distance bettwen 2 days of the week\nfunction dayDiff(day, from) {\n return (day - from + 7) % 7;\n}\n\n// Get the date of the specified day of the week of given base date\nexport function dayOfTheWeekOf(baseDate, dayOfWeek, weekStart = 0) {\n const baseDay = new Date(baseDate).getDay();\n return addDays(baseDate, dayDiff(dayOfWeek, weekStart) - dayDiff(baseDay, weekStart));\n}\n\n// Get the ISO week of a date\nexport function getWeek(date) {\n // start of ISO week is Monday\n const thuOfTheWeek = dayOfTheWeekOf(date, 4, 1);\n // 1st week == the week where the 4th of January is in\n const firstThu = dayOfTheWeekOf(new Date(thuOfTheWeek).setMonth(0, 4), 4, 1);\n return Math.round((thuOfTheWeek - firstThu) / 604800000) + 1;\n}\n\n// Get the start year of the period of years that includes given date\n// years: length of the year period\nexport function startOfYearPeriod(date, years) {\n /* @see https://en.wikipedia.org/wiki/Year_zero#ISO_8601 */\n const year = new Date(date).getFullYear();\n return Math.floor(year / years) * years;\n}\n","const listenerRegistry = new WeakMap();\nconst {addEventListener, removeEventListener} = EventTarget.prototype;\n\n// Register event listeners to a key object\n// listeners: array of listener definitions;\n// - each definition must be a flat array of event target and the arguments\n// used to call addEventListener() on the target\nexport function registerListeners(keyObj, listeners) {\n let registered = listenerRegistry.get(keyObj);\n if (!registered) {\n registered = [];\n listenerRegistry.set(keyObj, registered);\n }\n listeners.forEach((listener) => {\n addEventListener.call(...listener);\n registered.push(listener);\n });\n}\n\nexport function unregisterListeners(keyObj) {\n let listeners = listenerRegistry.get(keyObj);\n if (!listeners) {\n return;\n }\n listeners.forEach((listener) => {\n removeEventListener.call(...listener);\n });\n listenerRegistry.delete(keyObj);\n}\n\n// Event.composedPath() polyfill for Edge\n// based on https://gist.github.com/kleinfreund/e9787d73776c0e3750dcfcdc89f100ec\nif (!Event.prototype.composedPath) {\n const getComposedPath = (node, path = []) => {\n path.push(node);\n\n let parent;\n if (node.parentNode) {\n parent = node.parentNode;\n } else if (node.host) { // ShadowRoot\n parent = node.host;\n } else if (node.defaultView) { // Document\n parent = node.defaultView;\n }\n return parent ? getComposedPath(parent, path) : path;\n };\n\n Event.prototype.composedPath = function () {\n return getComposedPath(this.target);\n };\n}\n\nfunction findFromPath(path, criteria, currentTarget, index = 0) {\n const el = path[index];\n if (criteria(el)) {\n return el;\n } else if (el === currentTarget || !el.parentElement) {\n // stop when reaching currentTarget or \n return;\n }\n return findFromPath(path, criteria, currentTarget, index + 1);\n}\n\n// Search for the actual target of a delegated event\nexport function findElementInEventPath(ev, selector) {\n const criteria = typeof selector === 'function' ? selector : el => el.matches(selector);\n return findFromPath(ev.composedPath(), criteria, ev.currentTarget);\n}\n","export function hasProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function lastItemOf(arr) {\n return arr[arr.length - 1];\n}\n\n// push only the items not included in the array\nexport function pushUnique(arr, ...items) {\n items.forEach((item) => {\n if (arr.includes(item)) {\n return;\n }\n arr.push(item);\n });\n return arr;\n}\n\nexport function stringToArray(str, separator) {\n // convert empty string to an empty array\n return str ? str.split(separator) : [];\n}\n\nexport function isInRange(testVal, min, max) {\n const minOK = min === undefined || testVal >= min;\n const maxOK = max === undefined || testVal <= max;\n return minOK && maxOK;\n}\n\nexport function limitToRange(val, min, max) {\n if (val < min) {\n return min;\n }\n if (val > max) {\n return max;\n }\n return val;\n}\n\nexport function createTagRepeat(tagName, repeat, attributes = {}, index = 0, html = '') {\n const openTagSrc = Object.keys(attributes).reduce((src, attr) => {\n let val = attributes[attr];\n if (typeof val === 'function') {\n val = val(index);\n }\n return `${src} ${attr}=\"${val}\"`;\n }, tagName);\n html += `<${openTagSrc}>`;\n\n const next = index + 1;\n return next < repeat\n ? createTagRepeat(tagName, repeat, attributes, next, html)\n : html;\n}\n\n// Remove the spacing surrounding tags for HTML parser not to create text nodes\n// before/after elements\nexport function optimizeTemplateHTML(html) {\n return html.replace(/>\\s+/g, '>').replace(/\\s+ {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { initDatepickers } from './datepicker';\nimport Datepicker from 'flowbite-datepicker/Datepicker';\nimport DateRangePicker from 'flowbite-datepicker/DateRangePicker';\nimport Events from '../dom/events';\n\nconst turboLoadEvents = new Events('turbo:load', [initDatepickers]);\nconst turboFrameLoadEvents = new Events('turbo:frame-load', [initDatepickers]);\n\nturboLoadEvents.init();\nturboFrameLoadEvents.init();\n\nexport default {\n Datepicker,\n DateRangePicker,\n};\n"],"names":["Datepicker","DateRangePicker","Events","getDatepickerOptions","datepickerEl","buttons","hasAttribute","autohide","format","orientation","title","options","todayBtn","clearBtn","getAttribute","initDatepickers","document","querySelectorAll","forEach","events","init","turboLoadEvents","turboFrameLoadEvents"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/datepicker.turbo.min.js b/node_modules/flowbite/dist/datepicker.turbo.min.js new file mode 100644 index 0000000..4f39e7b --- /dev/null +++ b/node_modules/flowbite/dist/datepicker.turbo.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Flowbite",[],t):"object"==typeof exports?exports.Flowbite=t():e.Flowbite=t()}(self,(function(){return function(){"use strict";var e={781:function(e,t,i){i.d(t,{initDatepickers:function(){return o}});var r=i(770),n=i(482),a=i(947),s=function(e){var t=e.hasAttribute("datepicker-buttons"),i=e.hasAttribute("datepicker-autohide"),r=e.hasAttribute("datepicker-format"),n=e.hasAttribute("datepicker-orientation"),a=e.hasAttribute("datepicker-title"),s={};return t&&(s.todayBtn=!0,s.clearBtn=!0),i&&(s.autohide=!0),r&&(s.format=e.getAttribute("datepicker-format")),n&&(s.orientation=e.getAttribute("datepicker-orientation")),a&&(s.title=e.getAttribute("datepicker-title")),s};function o(){document.querySelectorAll("[datepicker]").forEach((function(e){new r.Z(e,s(e))})),document.querySelectorAll("[inline-datepicker]").forEach((function(e){new r.Z(e,s(e))})),document.querySelectorAll("[date-rangepicker]").forEach((function(e){new n.Z(e,s(e))}))}new a.default("DOMContentLoaded",[o]).init()},482:function(e,t,i){i.d(t,{Z:function(){return c}});var r=i(698),n=i(963),a=i(770);function s(e){const t=Object.assign({},e);return delete t.inputs,delete t.allowOneSidedRange,delete t.maxNumberOfDates,t}function o(e,t,i,n){(0,r.cF)(e,[[i,"changeDate",t]]),new a.Z(i,n,e)}function d(e,t){if(e._updating)return;e._updating=!0;const i=t.target;if(void 0===i.datepicker)return;const r=e.datepickers,n={render:!1},a=e.inputs.indexOf(i),s=0===a?1:0,o=r[a].dates[0],d=r[s].dates[0];void 0!==o&&void 0!==d?0===a&&o>d?(r[0].setDate(d,n),r[1].setDate(o,n)):1===a&&o0?d(this,{target:this.inputs[0]}):a[1].dates.length>0&&d(this,{target:this.inputs[1]})}get dates(){return 2===this.datepickers.length?[this.datepickers[0].dates[0],this.datepickers[1].dates[0]]:void 0}setOptions(e){this.allowOneSidedRange=!!e.allowOneSidedRange;const t=s(e);this.datepickers[0].setOptions(t),this.datepickers[1].setOptions(t)}destroy(){this.datepickers[0].destroy(),this.datepickers[1].destroy(),(0,r.uV)(this),delete this.element.rangepicker}getDates(e){const t=e?t=>(0,n.p6)(t,e,this.datepickers[0].config.locale):e=>new Date(e);return this.dates.map((e=>void 0===e?e:t(e)))}setDates(e,t){const[i,r]=this.datepickers,n=this.dates;this._updating=!0,i.setDate(e),r.setDate(t),delete this._updating,r.dates[0]!==n[1]?d(this,{target:this.inputs[1]}):i.dates[0]!==n[0]&&d(this,{target:this.inputs[0]})}}},770:function(e,t,i){i.d(t,{Z:function(){return ae}});var r=i(105),n=i(560),a=i(963),s=i(698);const o={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}};var d={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,calendarWeeks:!1,clearBtn:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:'',orientation:"auto",pickLevel:0,prevArrow:'',showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayBtn:!1,todayBtnMode:0,todayHighlight:!1,updateOnBlur:!0,weekStart:0};const c=document.createRange();function l(e){return c.createContextualFragment(e)}function h(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function u(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function g(e){e.firstChild&&(e.removeChild(e.firstChild),g(e))}const{language:f,format:p,weekStart:m}=d;function b(e,t){return e.length<6&&t>=0&&t<7?(0,r.$C)(e,t):e}function y(e){return(e+6)%7}function w(e,t,i,r){const n=(0,a.sG)(e,t,i);return void 0!==n?n:r}function k(e,t,i=3){const r=parseInt(e,10);return r>=0&&r<=i?r:t}function v(e,t){const i=Object.assign({},e),s={},o=t.constructor.locales;let{format:c,language:h,locale:u,maxDate:g,maxView:v,minDate:D,pickLevel:x,startView:M,weekStart:S}=t.config||{};if(i.language){let e;if(i.language!==h&&(o[i.language]?e=i.language:(e=i.language.split("-")[0],void 0===o[e]&&(e=!1))),delete i.language,e){h=s.language=e;const t=u||o[f];u=Object.assign({format:p,weekStart:m},o[f]),h!==f&&Object.assign(u,o[h]),s.locale=u,c===t.format&&(c=s.format=u.format),S===t.weekStart&&(S=s.weekStart=u.weekStart,s.weekEnd=y(u.weekStart))}}if(i.format){const e="function"==typeof i.format.toDisplay,t="function"==typeof i.format.toValue,r=a.CL.test(i.format);(e&&t||r)&&(c=s.format=i.format),delete i.format}let O=D,C=g;if(void 0!==i.minDate&&(O=null===i.minDate?(0,n.by)(0,0,1):w(i.minDate,c,u,O),delete i.minDate),void 0!==i.maxDate&&(C=null===i.maxDate?void 0:w(i.maxDate,c,u,C),delete i.maxDate),C{const i=(0,a.sG)(t,c,u);return void 0!==i?(0,r.$C)(e,i):e}),[]),delete i.datesDisabled),void 0!==i.defaultViewDate){const e=(0,a.sG)(i.defaultViewDate,c,u);void 0!==e&&(s.defaultViewDate=e),delete i.defaultViewDate}if(void 0!==i.weekStart){const e=Number(i.weekStart)%7;isNaN(e)||(S=s.weekStart=e,s.weekEnd=y(e)),delete i.weekStart}if(i.daysOfWeekDisabled&&(s.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(b,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(s.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(b,[]),delete i.daysOfWeekHighlighted),void 0!==i.maxNumberOfDates){const e=parseInt(i.maxNumberOfDates,10);e>=0&&(s.maxNumberOfDates=e,s.multidate=1!==e),delete i.maxNumberOfDates}i.dateDelimiter&&(s.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let E=x;void 0!==i.pickLevel&&(E=k(i.pickLevel,2),delete i.pickLevel),E!==x&&(x=s.pickLevel=E);let F=v;void 0!==i.maxView&&(F=k(i.maxView,v),delete i.maxView),F=x>F?x:F,F!==v&&(v=s.maxView=F);let L=M;if(void 0!==i.startView&&(L=k(i.startView,L),delete i.startView),Lv&&(L=v),L!==M&&(s.startView=L),i.prevArrow){const e=l(i.prevArrow);e.childNodes.length>0&&(s.prevArrow=e.childNodes),delete i.prevArrow}if(i.nextArrow){const e=l(i.nextArrow);e.childNodes.length>0&&(s.nextArrow=e.childNodes),delete i.nextArrow}if(void 0!==i.disableTouchKeyboard&&(s.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const e=i.orientation.toLowerCase().split(/\s+/g);s.orientation={x:e.find((e=>"left"===e||"right"===e))||"auto",y:e.find((e=>"top"===e||"bottom"===e))||"auto"},delete i.orientation}if(void 0!==i.todayBtnMode){switch(i.todayBtnMode){case 0:case 1:s.todayBtnMode=i.todayBtnMode}delete i.todayBtnMode}return Object.keys(i).forEach((e=>{void 0!==i[e]&&(0,r.l$)(d,e)&&(s[e]=i[e])})),s}var D=(0,r.zh)('');var x=(0,r.zh)(`
\n
${(0,r.em)("span",7,{class:"dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm"})}
\n
${(0,r.em)("span",42,{class:"block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400"})}
\n
`);var M=(0,r.zh)(`
\n
\n
${(0,r.em)("span",6,{class:"week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm"})}
\n
`);class S{constructor(e,t){Object.assign(this,t,{picker:e,element:l('
').firstChild,selected:[]}),this.init(this.picker.datepicker.config)}init(e){void 0!==e.pickLevel&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}performBeforeHook(e,t,i){let n=this.beforeShow(new Date(i));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){if(!1===n.enabled&&(e.classList.add("disabled"),(0,r.$C)(this.disabled,t)),n.classes){const i=n.classes.split(/\s+/);e.classList.add(...i),i.includes("disabled")&&(0,r.$C)(this.disabled,t)}n.content&&function(e,t){g(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(l(t)):"function"==typeof t.forEach&&t.forEach((t=>{e.appendChild(t)}))}(e,n.content)}}}class O extends S{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=l(x).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if((0,r.l$)(e,"minDate")&&(this.minDate=e.minDate),(0,r.l$)(e,"maxDate")&&(this.maxDate=e.maxDate),e.datesDisabled&&(this.datesDisabled=e.datesDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),void 0!==e.todayHighlight&&(this.todayHighlight=e.todayHighlight),void 0!==e.weekStart&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const i=this.locale=e.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,t=!0}if(void 0!==e.beforeShowDay&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),void 0!==e.calendarWeeks)if(e.calendarWeeks&&!this.calendarWeeks){const e=l(M).firstChild;this.calendarWeeks={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.calendarWeeks&&!e.calendarWeeks&&(this.element.removeChild(this.calendarWeeks.element),this.calendarWeeks=null);void 0!==e.showDaysOfWeek&&(e.showDaysOfWeek?(u(this.dow),this.calendarWeeks&&u(this.calendarWeeks.dow)):(h(this.dow),this.calendarWeeks&&h(this.calendarWeeks.dow))),t&&Array.from(this.dow.children).forEach(((e,t)=>{const i=(this.weekStart+t)%7;e.textContent=this.dayNames[i],e.className=this.daysOfWeekDisabled.includes(i)?"dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed":"dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400"}))}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),i=e.getMonth(),r=(0,n.by)(t,i,1),a=(0,n.fr)(r,this.weekStart,this.weekStart);this.first=r,this.last=(0,n.by)(t,i+1,0),this.start=a,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){this.today=this.todayHighlight?(0,n.Lg)():void 0,this.disabled=[...this.datesDisabled];const e=(0,a.p6)(this.focused,this.switchLabelFormat,this.locale);if(this.picker.setViewSwitchLabel(e),this.picker.setPrevBtnDisabled(this.first<=this.minDate),this.picker.setNextBtnDisabled(this.last>=this.maxDate),this.calendarWeeks){const e=(0,n.fr)(this.first,1,1);Array.from(this.calendarWeeks.weeks.children).forEach(((t,i)=>{t.textContent=(0,n.Qk)((0,n.jh)(e,i))}))}Array.from(this.grid.children).forEach(((e,t)=>{const i=e.classList,a=(0,n.E4)(this.start,t),s=new Date(a),o=s.getDay();if(e.className=`datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`,e.dataset.date=a,e.textContent=s.getDate(),athis.last&&i.add("next","text-gray-500","dark:text-white"),this.today===a&&i.add("today","bg-gray-100","dark:bg-gray-600"),(athis.maxDate||this.disabled.includes(a))&&i.add("disabled","cursor-not-allowed"),this.daysOfWeekDisabled.includes(o)&&(i.add("disabled","cursor-not-allowed"),(0,r.$C)(this.disabled,a)),this.daysOfWeekHighlighted.includes(o)&&i.add("highlighted"),this.range){const[e,t]=this.range;a>e&&a{e.classList.remove("range","range-start","range-end","selected","bg-blue-700","text-white","dark:bg-blue-600","dark:text-white","focused"),e.classList.add("text-gray-900","rounded-lg","dark:text-white")})),Array.from(this.grid.children).forEach((i=>{const r=Number(i.dataset.date),n=i.classList;n.remove("bg-gray-200","dark:bg-gray-600","rounded-l-lg","rounded-r-lg"),r>e&&r{e.classList.remove("focused")})),this.grid.children[e].classList.add("focused")}}function C(e,t){if(!e||!e[0]||!e[1])return;const[[i,r],[n,a]]=e;return i>t||ne})))),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),(0,r.l$)(e,"minDate"))if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if((0,r.l$)(e,"maxDate"))if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=(0,n.by)(this.maxYear,this.maxMonth+1,0)}void 0!==e.beforeShowMonth&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce(((e,t)=>{const i=new Date(t),n=i.getFullYear(),a=i.getMonth();return void 0===e[n]?e[n]=[a]:(0,r.$C)(e[n],a),e}),{}),t&&t.dates&&(this.range=t.dates.map((e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]})))}render(){this.disabled=[],this.picker.setViewSwitchLabel(this.year),this.picker.setPrevBtnDisabled(this.year<=this.minYear),this.picker.setNextBtnDisabled(this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.yearthis.maxYear,i=this.year===this.minYear,r=this.year===this.maxYear,a=C(this.range,this.year);Array.from(this.grid.children).forEach(((s,o)=>{const d=s.classList,c=(0,n.by)(this.year,o,1);if(s.className=`datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`,this.isMinView&&(s.dataset.date=c),s.textContent=this.monthNames[o],(t||i&&othis.maxMonth)&&d.add("disabled"),a){const[e,t]=a;o>e&&o{e.classList.remove("range","range-start","range-end","selected","bg-blue-700","dark:bg-blue-600","dark:text-white","text-white","focused"),e.classList.add("text-gray-900","hover:bg-gray-100","dark:text-white","dark:hover:bg-gray-600")})),Array.from(this.grid.children).forEach(((r,n)=>{const a=r.classList;n>t&&n{e.classList.remove("focused")})),this.grid.children[this.focused].classList.add("focused")}}class F extends S{constructor(e,t){super(e,t)}init(e,t=!0){var i;t&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce(((e,t,i)=>e+(i?t:t.toUpperCase())),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid","w-64","grid","grid-cols-4"),this.grid.appendChild(l((0,r.em)("span",12)))),super.init(e)}setOptions(e){if((0,r.l$)(e,"minDate")&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=(0,n.ak)(e.minDate,this.step),this.minDate=(0,n.by)(this.minYear,0,1))),(0,r.l$)(e,"maxDate")&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=(0,n.ak)(e.maxDate,this.step),this.maxDate=(0,n.by)(this.maxYear,11,31))),void 0!==e[this.beforeShowOption]){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=(0,n.ak)(e,this.navStep),i=t+9*this.step;this.first=t,this.last=i,this.start=t-this.step,this.focused=(0,n.ak)(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce(((e,t)=>(0,r.$C)(e,(0,n.ak)(t,this.step))),[]),t&&t.dates&&(this.range=t.dates.map((e=>{if(void 0!==e)return(0,n.ak)(e,this.step)})))}render(){this.disabled=[],this.picker.setViewSwitchLabel(`${this.first}-${this.last}`),this.picker.setPrevBtnDisabled(this.first<=this.minYear),this.picker.setNextBtnDisabled(this.last>=this.maxYear),Array.from(this.grid.children).forEach(((e,t)=>{const i=e.classList,r=this.start+t*this.step,a=(0,n.by)(r,0,1);if(e.className=`datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ${this.cellClass}`,this.isMinView&&(e.dataset.date=a),e.textContent=e.dataset.year=r,0===t?i.add("prev"):11===t&&i.add("next"),(rthis.maxYear)&&i.add("disabled"),this.range){const[e,t]=this.range;r>e&&r{e.classList.remove("range","range-start","range-end","selected","bg-blue-700","text-white","dark:bg-blue-600","dark:text-white","focused")})),Array.from(this.grid.children).forEach((i=>{const r=Number(i.textContent),n=i.classList;r>e&&r{e.classList.remove("focused")})),this.grid.children[e].classList.add("focused")}}function L(e,t){const i={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:i}))}function V(e,t){const{minDate:i,maxDate:a}=e.config,{currentView:s,viewDate:o}=e.picker;let d;switch(s.id){case 0:d=(0,n.zI)(o,t);break;case 1:d=(0,n.Bc)(o,t);break;default:d=(0,n.Bc)(o,t*s.navStep)}d=(0,r.jG)(d,i,a),e.picker.changeFocus(d).render()}function B(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function A(e){e.config.updateOnBlur?e.update({autohide:!0}):(e.refresh("input"),e.hide())}function N(e,t){const i=e.picker,r=new Date(i.viewDate),a=i.currentView.id,s=1===a?(0,n.zI)(r,t-r.getMonth()):(0,n.Bc)(r,t-r.getFullYear());i.changeFocus(s).changeView(a-1).render()}function W(e){const t=e.picker,i=(0,n.Lg)();if(1===e.config.todayBtnMode){if(e.config.autohide)return void e.setDate(i);e.setDate(i,{render:!1}),t.update()}t.viewDate!==i&&t.changeFocus(i),t.changeView(0).render()}function Y(e){e.setDate({clear:!0})}function $(e){B(e)}function j(e){V(e,-1)}function _(e){V(e,1)}function H(e,t){const i=(0,s.He)(t,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:r,isMinView:n}=e.picker.currentView;n?e.setDate(Number(i.dataset.date)):N(e,Number(1===r?i.dataset.month:i.dataset.year))}function T(e){e.inline||e.config.disableTouchKeyboard||e.inputField.focus()}function K(e,t){if(void 0!==t.title&&(t.title?(e.controls.title.textContent=t.title,u(e.controls.title)):(e.controls.title.textContent="",h(e.controls.title))),t.prevArrow){const i=e.controls.prevBtn;g(i),t.prevArrow.forEach((e=>{i.appendChild(e.cloneNode(!0))}))}if(t.nextArrow){const i=e.controls.nextBtn;g(i),t.nextArrow.forEach((e=>{i.appendChild(e.cloneNode(!0))}))}if(t.locale&&(e.controls.todayBtn.textContent=t.locale.today,e.controls.clearBtn.textContent=t.locale.clear),void 0!==t.todayBtn&&(t.todayBtn?u(e.controls.todayBtn):h(e.controls.todayBtn)),(0,r.l$)(t,"minDate")||(0,r.l$)(t,"maxDate")){const{minDate:t,maxDate:i}=e.datepicker.config;e.controls.todayBtn.disabled=!(0,r.mh)((0,n.Lg)(),t,i)}void 0!==t.clearBtn&&(t.clearBtn?u(e.controls.clearBtn):h(e.controls.clearBtn))}function I(e){const{dates:t,config:i}=e,n=t.length>0?(0,r.Jm)(t):i.defaultViewDate;return(0,r.jG)(n,i.minDate,i.maxDate)}function P(e,t){const i=new Date(e.viewDate),r=new Date(t),{id:n,year:a,first:s,last:o}=e.currentView,d=r.getFullYear();switch(e.viewDate=t,d!==i.getFullYear()&&L(e.datepicker,"changeYear"),r.getMonth()!==i.getMonth()&&L(e.datepicker,"changeMonth"),n){case 0:return to;case 1:return d!==a;default:return do}}function R(e){return window.getComputedStyle(e).direction}class z{constructor(e){this.datepicker=e;const t=D.replace(/%buttonClass%/g,e.config.buttonClass),i=this.element=l(t).firstChild,[r,n,a]=i.firstChild.children,o=r.firstElementChild,[d,c,h]=r.lastElementChild.children,[u,g]=a.firstChild.children,f={title:o,prevBtn:d,viewSwitch:c,nextBtn:h,todayBtn:u,clearBtn:g};this.main=n,this.controls=f;const p=e.inline?"inline":"dropdown";i.classList.add(`datepicker-${p}`),"dropdown"===p&&i.classList.add("dropdown","absolute","top-0","left-0","z-50","pt-2"),K(this,e.config),this.viewDate=I(e),(0,s.cF)(e,[[i,"click",T.bind(null,e),{capture:!0}],[n,"click",H.bind(null,e)],[f.viewSwitch,"click",$.bind(null,e)],[f.prevBtn,"click",j.bind(null,e)],[f.nextBtn,"click",_.bind(null,e)],[f.todayBtn,"click",W.bind(null,e)],[f.clearBtn,"click",Y.bind(null,e)]]),this.views=[new O(this),new E(this),new F(this,{id:2,name:"years",cellClass:"year",step:1}),new F(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[e.config.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),e.config.container.appendChild(this.element)}setOptions(e){K(this,e),this.views.forEach((t=>{t.init(e,!1)})),this.currentView.render()}detach(){this.datepicker.config.container.removeChild(this.element)}show(){if(this.active)return;this.element.classList.add("active","block"),this.element.classList.remove("hidden"),this.active=!0;const e=this.datepicker;if(!e.inline){const t=R(e.inputField);t!==R(e.config.container)?this.element.dir=t:this.element.dir&&this.element.removeAttribute("dir"),this.place(),e.config.disableTouchKeyboard&&e.inputField.blur()}L(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active","block"),this.element.classList.add("active","block","hidden"),this.active=!1,L(this.datepicker,"hide"))}place(){const{classList:e,style:t}=this.element,{config:i,inputField:r}=this.datepicker,n=i.container,{width:a,height:s}=this.element.getBoundingClientRect(),{left:o,top:d,width:c}=n.getBoundingClientRect(),{left:l,top:h,width:u,height:g}=r.getBoundingClientRect();let f,p,m,{x:b,y:y}=i.orientation;n===document.body?(f=window.scrollY,p=l+window.scrollX,m=h+f):(f=n.scrollTop,p=l-o,m=h-d+f),"auto"===b&&(p<0?(b="left",p=10):b=p+a>c||"rtl"===R(r)?"right":"left"),"right"===b&&(p-=a-u),"auto"===y&&(y=m-s{e.updateFocus()})),this}update(){const e=I(this.datepicker);return this._renderMethod=P(this,e)?"render":"refresh",this.views.forEach((e=>{e.updateFocus(),e.updateSelection()})),this}render(e=!0){const t=e&&this._renderMethod||"render";delete this._renderMethod,this.currentView[t]()}}function q(e,t,i,n,a,s){if((0,r.mh)(e,a,s)){if(n(e)){return q(t(e,i),t,i,n,a,s)}return e}}function J(e,t,i,r){const a=e.picker,s=a.currentView,o=s.step||1;let d,c,l=a.viewDate;switch(s.id){case 0:l=r?(0,n.E4)(l,7*i):t.ctrlKey||t.metaKey?(0,n.Bc)(l,i):(0,n.E4)(l,i),d=n.E4,c=e=>s.disabled.includes(e);break;case 1:l=(0,n.zI)(l,r?4*i:i),d=n.zI,c=e=>{const t=new Date(e),{year:i,disabled:r}=s;return t.getFullYear()===i&&r.includes(t.getMonth())};break;default:l=(0,n.Bc)(l,i*(r?4:1)*o),d=n.Bc,c=e=>s.disabled.includes((0,n.ak)(e,o))}l=q(l,d,i<0?-o:o,c,s.minDate,s.maxDate),void 0!==l&&a.changeFocus(l).render()}function G(e,t){if("Tab"===t.key)return void A(e);const i=e.picker,{id:r,isMinView:n}=i.currentView;if(i.active)if(e.editMode)switch(t.key){case"Escape":i.hide();break;case"Enter":e.exitEditMode({update:!0,autohide:e.config.autohide});break;default:return}else switch(t.key){case"Escape":i.hide();break;case"ArrowLeft":if(t.ctrlKey||t.metaKey)V(e,-1);else{if(t.shiftKey)return void e.enterEditMode();J(e,t,-1,!1)}break;case"ArrowRight":if(t.ctrlKey||t.metaKey)V(e,1);else{if(t.shiftKey)return void e.enterEditMode();J(e,t,1,!1)}break;case"ArrowUp":if(t.ctrlKey||t.metaKey)B(e);else{if(t.shiftKey)return void e.enterEditMode();J(e,t,-1,!0)}break;case"ArrowDown":if(t.shiftKey&&!t.ctrlKey&&!t.metaKey)return void e.enterEditMode();J(e,t,1,!0);break;case"Enter":n?e.setDate(i.viewDate):i.changeView(r-1).render();break;case"Backspace":case"Delete":return void e.enterEditMode();default:return void(1!==t.key.length||t.ctrlKey||t.metaKey||e.enterEditMode())}else switch(t.key){case"ArrowDown":case"Escape":i.show();break;case"Enter":e.update();break;default:return}t.preventDefault(),t.stopPropagation()}function Z(e){e.config.showOnFocus&&!e._showing&&e.show()}function U(e,t){const i=t.target;(e.picker.active||e.config.showOnClick)&&(i._active=i===document.activeElement,i._clicking=setTimeout((()=>{delete i._active,delete i._clicking}),2e3))}function Q(e,t){const i=t.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&e.enterEditMode(),delete i._active,e.config.showOnClick&&e.show())}function X(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function ee(e,t){const i=e.element;if(i!==document.activeElement)return;const r=e.picker.element;(0,s.He)(t,(e=>e===i||e===r))||A(e)}function te(e,t){return e.map((e=>(0,a.p6)(e,t.format,t.locale))).join(t.dateDelimiter)}function ie(e,t,i=!1){const{config:n,dates:s,rangepicker:o}=e;if(0===t.length)return i?[]:void 0;const d=o&&e===o.datepickers[1];let c=t.reduce(((e,t)=>{let i=(0,a.sG)(t,n.format,n.locale);if(void 0===i)return e;if(n.pickLevel>0){const e=new Date(i);i=1===n.pickLevel?d?e.setMonth(e.getMonth()+1,0):e.setDate(1):d?e.setFullYear(e.getFullYear()+1,0,0):e.setMonth(0,1)}return!(0,r.mh)(i,n.minDate,n.maxDate)||e.includes(i)||n.datesDisabled.includes(i)||n.daysOfWeekDisabled.includes(new Date(i).getDay())||e.push(i),e}),[]);return 0!==c.length?(n.multidate&&!i&&(c=c.reduce(((e,t)=>(s.includes(t)||e.push(t),e)),s.filter((e=>!c.includes(e))))),n.maxNumberOfDates&&c.length>n.maxNumberOfDates?c.slice(-1*n.maxNumberOfDates):c):void 0}function re(e,t=3,i=!0){const{config:r,picker:n,inputField:a}=e;if(2&t){const e=n.active?r.pickLevel:r.startView;n.update().changeView(e).render(i)}1&t&&a&&(a.value=te(e.dates,r))}function ne(e,t,i){let{clear:r,render:n,autohide:a}=i;void 0===n&&(n=!0),n?void 0===a&&(a=e.config.autohide):a=!1;const s=ie(e,t,r);s&&(s.toString()!==e.dates.toString()?(e.dates=s,re(e,n?3:1),L(e,"changeDate")):re(e,1),a&&e.hide())}class ae{constructor(e,t={},i){e.datepicker=this,this.element=e;const a=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:document.body,defaultViewDate:(0,n.Lg)(),maxDate:void 0,minDate:void 0},v(d,this));this._options=t,Object.assign(a,v(t,this));const o=this.inline="INPUT"!==e.tagName;let c,l;if(o)a.container=e,l=(0,r.W7)(e.dataset.date,a.dateDelimiter),delete e.dataset.date;else{const i=t.container?document.querySelector(t.container):null;i&&(a.container=i),c=this.inputField=e,c.classList.add("datepicker-input"),l=(0,r.W7)(c.value,a.dateDelimiter)}if(i){const e=i.inputs.indexOf(c),t=i.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,Object.defineProperty(this,"rangepicker",{get(){return i}})}this.dates=[];const h=ie(this,l);h&&h.length>0&&(this.dates=h),c&&(c.value=te(this.dates,a));const u=this.picker=new z(this);if(o)this.show();else{const e=ee.bind(null,this),t=[[c,"keydown",G.bind(null,this)],[c,"focus",Z.bind(null,this)],[c,"mousedown",U.bind(null,this)],[c,"click",Q.bind(null,this)],[c,"paste",X.bind(null,this)],[document,"mousedown",e],[document,"touchstart",e],[window,"resize",u.place.bind(u)]];(0,s.cF)(this,t)}}static formatDate(e,t,i){return(0,a.p6)(e,t,i&&o[i]||o.en)}static parseDate(e,t,i){return(0,a.sG)(e,t,i&&o[i]||o.en)}static get locales(){return o}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=this.picker,i=v(e,this);Object.assign(this._options,e),Object.assign(this.config,i),t.setOptions(i),re(this,3)}show(){if(this.inputField){if(this.inputField.disabled)return;this.inputField!==document.activeElement&&(this._showing=!0,this.inputField.focus(),delete this._showing)}this.picker.show()}hide(){this.inline||(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}destroy(){return this.hide(),(0,s.uV)(this),this.picker.detach(),this.inline||this.inputField.classList.remove("datepicker-input"),delete this.element.datepicker,this}getDate(e){const t=e?t=>(0,a.p6)(t,e,this.config.locale):e=>new Date(e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],i={},n=(0,r.Jm)(e);"object"!=typeof n||Array.isArray(n)||n instanceof Date||!n||Object.assign(i,t.pop());ne(this,Array.isArray(t[0])?t[0]:t,i)}update(e){if(this.inline)return;const t={clear:!0,autohide:!(!e||!e.autohide)};ne(this,(0,r.W7)(this.inputField.value,this.config.dateDelimiter),t)}refresh(e,t=!1){let i;e&&"string"!=typeof e&&(t=e,e=void 0),i="picker"===e?2:"input"===e?1:3,re(this,i,!t)}enterEditMode(){this.inline||!this.picker.active||this.editMode||(this.editMode=!0,this.inputField.classList.add("in-edit","border-blue-700"))}exitEditMode(e){if(this.inline||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit","border-blue-700"),t.update&&this.update(t)}}},963:function(e,t,i){i.d(t,{CL:function(){return a},p6:function(){return f},sG:function(){return g}});var r=i(560),n=i(105);const a=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,s=/[\s!-/:-@[-`{-~年月日]+/;let o={};const d={y(e,t){return new Date(e).setFullYear(parseInt(t,10))},m(e,t,i){const r=new Date(e);let n=parseInt(t,10)-1;if(isNaN(n)){if(!t)return NaN;const e=t.toLowerCase(),r=t=>t.toLowerCase().startsWith(e);if(n=i.monthsShort.findIndex(r),n<0&&(n=i.months.findIndex(r)),n<0)return NaN}return r.setMonth(n),r.getMonth()!==l(n)?r.setDate(0):r.getTime()},d(e,t){return new Date(e).setDate(parseInt(t,10))}},c={d(e){return e.getDate()},dd(e){return h(e.getDate(),2)},D(e,t){return t.daysShort[e.getDay()]},DD(e,t){return t.days[e.getDay()]},m(e){return e.getMonth()+1},mm(e){return h(e.getMonth()+1,2)},M(e,t){return t.monthsShort[e.getMonth()]},MM(e,t){return t.months[e.getMonth()]},y(e){return e.getFullYear()},yy(e){return h(e.getFullYear(),2).slice(-2)},yyyy(e){return h(e.getFullYear(),4)}};function l(e){return e>-1?e%12:l(e+12)}function h(e,t){return e.toString().padStart(t,"0")}function u(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in o)return o[e];const t=e.split(a),i=e.match(new RegExp(a,"g"));if(0===t.length||!i)throw new Error("Invalid date format.");const l=i.map((e=>c[e])),h=Object.keys(d).reduce(((e,t)=>(i.find((e=>"D"!==e[0]&&e[0].toLowerCase()===t))&&e.push(t),e)),[]);return o[e]={parser(e,t){const n=e.split(s).reduce(((e,t,r)=>{if(t.length>0&&i[r]){const n=i[r][0];"M"===n?e.m=t:"D"!==n&&(e[n]=t)}return e}),{});return h.reduce(((e,i)=>{const r=d[i](e,n[i],t);return isNaN(r)?e:r}),(0,r.Lg)())},formatter(e,i){return l.reduce(((r,n,a)=>r+`${t[a]}${n(e,i)}`),"")+(0,n.Jm)(t)}}}function g(e,t,i){if(e instanceof Date||"number"==typeof e){const t=(0,r.xR)(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return(0,r.Lg)();if(t&&t.toValue){const n=t.toValue(e,t,i);return isNaN(n)?void 0:(0,r.xR)(n)}return u(t).parser(e,i)}}function f(e,t,i){if(isNaN(e)||!e&&0!==e)return"";const r="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(r,t,i):u(t).formatter(r,i)}},560:function(e,t,i){function r(e){return new Date(e).setHours(0,0,0,0)}function n(){return(new Date).setHours(0,0,0,0)}function a(...e){switch(e.length){case 0:return n();case 1:return r(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function s(e,t){const i=new Date(e);return i.setDate(i.getDate()+t)}function o(e,t){return s(e,7*t)}function d(e,t){const i=new Date(e),r=i.getMonth()+t;let n=r%12;n<0&&(n+=12);const a=i.setMonth(r);return i.getMonth()!==n?i.setDate(0):a}function c(e,t){const i=new Date(e),r=i.getMonth(),n=i.setFullYear(i.getFullYear()+t);return 1===r&&2===i.getMonth()?i.setDate(0):n}function l(e,t){return(e-t+7)%7}function h(e,t,i=0){const r=new Date(e).getDay();return s(e,l(t,i)-l(r,i))}function u(e){const t=h(e,4,1),i=h(new Date(t).setMonth(0,4),4,1);return Math.round((t-i)/6048e5)+1}function g(e,t){const i=new Date(e).getFullYear();return Math.floor(i/t)*t}i.d(t,{Bc:function(){return c},E4:function(){return s},Lg:function(){return n},Qk:function(){return u},ak:function(){return g},by:function(){return a},fr:function(){return h},jh:function(){return o},xR:function(){return r},zI:function(){return d}})},698:function(e,t,i){i.d(t,{He:function(){return c},cF:function(){return s},uV:function(){return o}});const r=new WeakMap,{addEventListener:n,removeEventListener:a}=EventTarget.prototype;function s(e,t){let i=r.get(e);i||(i=[],r.set(e,i)),t.forEach((e=>{n.call(...e),i.push(e)}))}function o(e){let t=r.get(e);t&&(t.forEach((e=>{a.call(...e)})),r.delete(e))}if(!Event.prototype.composedPath){const e=(t,i=[])=>{let r;return i.push(t),t.parentNode?r=t.parentNode:t.host?r=t.host:t.defaultView&&(r=t.defaultView),r?e(r,i):i};Event.prototype.composedPath=function(){return e(this.target)}}function d(e,t,i,r=0){const n=e[r];return t(n)?n:n!==i&&n.parentElement?d(e,t,i,r+1):void 0}function c(e,t){const i="function"==typeof t?t:e=>e.matches(t);return d(e.composedPath(),i,e.currentTarget)}},105:function(e,t,i){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return e[e.length-1]}function a(e,...t){return t.forEach((t=>{e.includes(t)||e.push(t)})),e}function s(e,t){return e?e.split(t):[]}function o(e,t,i){return(void 0===t||e>=t)&&(void 0===i||e<=i)}function d(e,t,i){return ei?i:e}function c(e,t,i={},r=0,n=""){n+=`<${Object.keys(i).reduce(((e,t)=>{let n=i[t];return"function"==typeof n&&(n=n(r)),`${e} ${t}="${n}"`}),e)}>`;const a=r+1;return a\s+/g,">").replace(/\s+ .tooltip-arrow:before { + border-style: solid; + border-color: #e5e7eb; +} + +[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='top'] > .tooltip-arrow:before { + border-bottom-width: 1px; + border-right-width: 1px; +} + +[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='right'] > .tooltip-arrow:before { + border-bottom-width: 1px; + border-left-width: 1px; +} + +[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='bottom'] > .tooltip-arrow:before { + border-top-width: 1px; + border-left-width: 1px; +} + +[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='left'] > .tooltip-arrow:before { + border-top-width: 1px; + border-right-width: 1px; +} + +.tooltip[data-popper-placement^='top'] > .tooltip-arrow { + bottom: -4px; +} + +.tooltip[data-popper-placement^='bottom'] > .tooltip-arrow { + top: -4px; +} + +.tooltip[data-popper-placement^='left'] > .tooltip-arrow { + right: -4px; +} + +.tooltip[data-popper-placement^='right'] > .tooltip-arrow { + left: -4px; +} + +.tooltip.invisible > .tooltip-arrow:before { + visibility: hidden; +} + +[data-popper-arrow],[data-popper-arrow]:before { + position: absolute; + width: 8px; + height: 8px; + background: inherit; +} + +[data-popper-arrow] { + visibility: hidden; +} + +[data-popper-arrow]:before { + content: ""; + visibility: visible; + transform: rotate(45deg); +} + +[data-popper-arrow]:after { + content: ""; + visibility: visible; + transform: rotate(45deg); + position: absolute; + width: 9px; + height: 9px; + background: inherit; +} + +[role="tooltip"] > [data-popper-arrow]:before { + border-style: solid; + border-color: #e5e7eb; +} + +.dark [role="tooltip"] > [data-popper-arrow]:before { + border-style: solid; + border-color: #4b5563; +} + +[role="tooltip"] > [data-popper-arrow]:after { + border-style: solid; + border-color: #e5e7eb; +} + +.dark [role="tooltip"] > [data-popper-arrow]:after { + border-style: solid; + border-color: #4b5563; +} + +[data-popover][role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]:before { + border-bottom-width: 1px; + border-right-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]:after { + border-bottom-width: 1px; + border-right-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]:before { + border-bottom-width: 1px; + border-left-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]:after { + border-bottom-width: 1px; + border-left-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]:before { + border-top-width: 1px; + border-left-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]:after { + border-top-width: 1px; + border-left-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]:before { + border-top-width: 1px; + border-right-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]:after { + border-top-width: 1px; + border-right-width: 1px; +} + +[data-popover][role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow] { + bottom: -5px; +} + +[data-popover][role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow] { + top: -5px; +} + +[data-popover][role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow] { + right: -5px; +} + +[data-popover][role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow] { + left: -5px; +} + +[role="tooltip"].invisible > [data-popper-arrow]:before { + visibility: hidden; +} + +[role="tooltip"].invisible > [data-popper-arrow]:after { + visibility: hidden; +} + +[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #6B7280; + border-width: 1px; + border-radius: 0px; + padding-top: 0.5rem; + padding-right: 0.75rem; + padding-bottom: 0.5rem; + padding-left: 0.75rem; + font-size: 1rem; + line-height: 1.5rem; + --tw-shadow: 0 0 #0000; +} + +[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus { + outline: 2px solid transparent; + outline-offset: 2px; + --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: #1C64F2; + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + border-color: #1C64F2; +} + +input::-moz-placeholder, textarea::-moz-placeholder { + color: #6B7280; + opacity: 1; +} + +input::placeholder,textarea::placeholder { + color: #6B7280; + opacity: 1; +} + +::-webkit-datetime-edit-fields-wrapper { + padding: 0; +} + +::-webkit-date-and-time-value { + min-height: 1.5em; +} + +select:not([size]) { + background-image: url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 10 6'%3e %3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 4 4 4-4'/%3e %3c/svg%3e"); + background-position: right 0.75rem center; + background-repeat: no-repeat; + background-size: 0.75em 0.75em; + padding-right: 2.5rem; + -webkit-print-color-adjust: exact; + print-color-adjust: exact; +} + +[multiple] { + background-image: initial; + background-position: initial; + background-repeat: unset; + background-size: initial; + padding-right: 0.75rem; + -webkit-print-color-adjust: unset; + print-color-adjust: unset; +} + +[type='checkbox'],[type='radio'] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + padding: 0; + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + display: inline-block; + vertical-align: middle; + background-origin: border-box; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + flex-shrink: 0; + height: 1rem; + width: 1rem; + color: #1C64F2; + background-color: #fff; + border-color: #6B7280; + border-width: 1px; + --tw-shadow: 0 0 #0000; +} + +[type='checkbox'] { + border-radius: 0px; +} + +[type='radio'] { + border-radius: 100%; +} + +[type='checkbox']:focus,[type='radio']:focus { + outline: 2px solid transparent; + outline-offset: 2px; + --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); + --tw-ring-offset-width: 2px; + --tw-ring-offset-color: #fff; + --tw-ring-color: #1C64F2; + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); +} + +[type='checkbox']:checked,[type='radio']:checked,.dark [type='checkbox']:checked,.dark [type='radio']:checked { + border-color: transparent; + background-color: currentColor; + background-size: 0.55em 0.55em; + background-position: center; + background-repeat: no-repeat; +} + +[type='checkbox']:checked { + background-image: url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e"); + background-repeat: no-repeat; + background-size: 0.55em 0.55em; + -webkit-print-color-adjust: exact; + print-color-adjust: exact; +} + +[type='radio']:checked { + background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); + background-size: 1em 1em; +} + +.dark [type='radio']:checked { + background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); + background-size: 1em 1em; +} + +[type='checkbox']:indeterminate { + background-image: url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e"); + background-color: currentColor; + border-color: transparent; + background-position: center; + background-repeat: no-repeat; + background-size: 0.55em 0.55em; + -webkit-print-color-adjust: exact; + print-color-adjust: exact; +} + +[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus { + border-color: transparent; + background-color: currentColor; +} + +[type='file'] { + background: unset; + border-color: inherit; + border-width: 0; + border-radius: 0; + padding: 0; + font-size: unset; + line-height: inherit; +} + +[type='file']:focus { + outline: 1px auto inherit; +} + +input[type=file]::file-selector-button { + color: white; + background: #1F2937; + border: 0; + font-weight: 500; + font-size: 0.875rem; + cursor: pointer; + padding-top: 0.625rem; + padding-bottom: 0.625rem; + padding-left: 2rem; + padding-right: 1rem; + -webkit-margin-start: -1rem; + margin-inline-start: -1rem; + -webkit-margin-end: 1rem; + margin-inline-end: 1rem; +} + +input[type=file]::file-selector-button:hover { + background: #374151; +} + +.dark input[type=file]::file-selector-button { + color: white; + background: #4B5563; +} + +.dark input[type=file]::file-selector-button:hover { + background: #6B7280; +} + +input[type="range"]::-webkit-slider-thumb { + height: 1.25rem; + width: 1.25rem; + background: #1C64F2; + border-radius: 9999px; + border: 0; + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + cursor: pointer; +} + +input[type="range"]:disabled::-webkit-slider-thumb { + background: #9CA3AF; +} + +.dark input[type="range"]:disabled::-webkit-slider-thumb { + background: #6B7280; +} + +input[type="range"]:focus::-webkit-slider-thumb { + outline: 2px solid transparent; + outline-offset: 2px; + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); + --tw-ring-opacity: 1px; + --tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity)); +} + +input[type="range"]::-moz-range-thumb { + height: 1.25rem; + width: 1.25rem; + background: #1C64F2; + border-radius: 9999px; + border: 0; + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + cursor: pointer; +} + +input[type="range"]:disabled::-moz-range-thumb { + background: #9CA3AF; +} + +.dark input[type="range"]:disabled::-moz-range-thumb { + background: #6B7280; +} + +input[type="range"]::-moz-range-progress { + background: #3F83F8; +} + +input[type="range"]::-ms-fill-lower { + background: #3F83F8; +} + +input[type="range"].range-sm::-webkit-slider-thumb { + height: 1rem; + width: 1rem; +} + +input[type="range"].range-lg::-webkit-slider-thumb { + height: 1.5rem; + width: 1.5rem; +} + +input[type="range"].range-sm::-moz-range-thumb { + height: 1rem; + width: 1rem; +} + +input[type="range"].range-lg::-moz-range-thumb { + height: 1.5rem; + width: 1.5rem; +} + +.toggle-bg:after { + content: ""; + position: absolute; + top: 0.125rem; + left: 0.125rem; + background: white; + border-color: #D1D5DB; + border-width: 1px; + border-radius: 9999px; + height: 1.25rem; + width: 1.25rem; + transition-property: background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter; + transition-duration: .15s; + box-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color); +} + +input:checked + .toggle-bg:after { + transform: translateX(100%);; + border-color: white; +} + +input:checked + .toggle-bg { + background: #1C64F2; + border-color: #1C64F2; +} + +*, ::before, ::after { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(63 131 248 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} + +::backdrop { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(63 131 248 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} +.container { + width: 100%; +} +@media (min-width: 640px) { + + .container { + max-width: 640px; + } +} +@media (min-width: 768px) { + + .container { + max-width: 768px; + } +} +@media (min-width: 1024px) { + + .container { + max-width: 1024px; + } +} +@media (min-width: 1280px) { + + .container { + max-width: 1280px; + } +} +@media (min-width: 1536px) { + + .container { + max-width: 1536px; + } +} +.apexcharts-canvas .apexcharts-tooltip { + background-color: white; + color: #6B7280; + border: 0 !important; + border-radius: 0.25rem; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); +} +.dark .apexcharts-canvas .apexcharts-tooltip { + background-color: #374151; + color: #9CA3AF; + border-color: transparent; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); +} +.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + padding-right: 0.75rem; + padding-left: 0.75rem; + margin-bottom: 0.75rem; + background-color: #F3F4F6; + border-bottom-color: #E5E7EB; + font-size: 0.875rem !important; + font-weight: 400; + color: #6B7280; +} +.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title { + background-color: #4B5563; + border-color: #6B7280; + color: #9CA3AF; +} +.apexcharts-canvas .apexcharts-xaxistooltip { + color: #6B7280; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + padding-right: 0.75rem; + padding-left: 0.75rem; + border-color: transparent; + background-color: white; + border-radius: 0.25rem; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); +} +.dark .apexcharts-canvas .apexcharts-xaxistooltip { + color: #9CA3AF; + background-color: #374151; +} +.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label { + color: #6B7280; + font-size: 0.875rem; +} +.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label { + color: #9CA3AF; +} +.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value { + color: #111827; + font-size: 0.875rem; +} +.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value { + color: white; +} +.apexcharts-canvas .apexcharts-xaxistooltip-text { + font-weight: 400; + font-size: 0.875rem !important; +} +.apexcharts-canvas .apexcharts-xaxistooltip:after, .apexcharts-canvas .apexcharts-xaxistooltip:before { + border-bottom-color: white; +} +.apexcharts-canvas .apexcharts-xaxistooltip:after { + border-width: 8px; + margin-left: -8px; +} +.apexcharts-canvas .apexcharts-xaxistooltip:before { + border-width: 10px; + margin-left: -10px; +} +.dark .apexcharts-canvas .apexcharts-xaxistooltip:after, .dark .apexcharts-canvas .apexcharts-xaxistooltip:before { + border-bottom-color: #374151; +} +.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-y-group { + padding: 0; +} +.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active { + padding-left: 0.75rem; + padding-right: 0.75rem; + padding-bottom: 0.75rem; + background-color: white !important; + color: #6B7280 !important; +} +.dark .apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active { + background-color: #374151 !important; + color: #9CA3AF !important; +} +.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active:first-of-type { + padding-top: 0.75rem; +} +.apexcharts-canvas .apexcharts-legend { + padding: 0 !important; +} +.apexcharts-canvas .apexcharts-legend-text { + font-size: 0.75rem; + font-weight: 500 !important; + padding-left: 1.25rem; + color: #6B7280 !important; +} +.apexcharts-canvas .apexcharts-legend-text:not(.apexcharts-inactive-legend):hover { + color: #111827 !important; +} +.dark .apexcharts-canvas .apexcharts-legend-text { + color: #9CA3AF !important; +} +.dark .apexcharts-canvas .apexcharts-legend-text:not(.apexcharts-inactive-legend):hover { + color: white !important; +} +.apexcharts-canvas .apexcharts-legend-series { + margin-left: 0.5rem; + margin-right: 0.5rem; + margin-bottom: 0.25rem !important; + display: flex; + align-items: center; +} +.apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-value { + fill: #111827 !important; + font-size: 1.875rem; + font-weight: 700; +} +.dark .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-value { + fill: white !important; +} +.apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-label { + fill: #6B7280 !important; + font-size: 1rem; + font-weight: 400; +} +.dark .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-label { + fill: #9CA3AF !important; +} +.apexcharts-canvas .apexcharts-datalabels .apexcharts-text.apexcharts-pie-label { + font-size: 0.75rem !important; + font-weight: 600 !important; + text-shadow: none !important; + filter: none !important; +} +.apexcharts-gridline, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs { + stroke: #E5E7EB !important; +} +.dark .apexcharts-gridline, .dark .apexcharts-xcrosshairs, .dark .apexcharts-ycrosshairs { + stroke: #374151 !important; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} +.pointer-events-none { + pointer-events: none; +} +.visible { + visibility: visible; +} +.invisible { + visibility: hidden; +} +.collapse { + visibility: collapse; +} +.static { + position: static; +} +.fixed { + position: fixed; +} +.absolute { + position: absolute; +} +.relative { + position: relative; +} +.sticky { + position: sticky; +} +.inset-0 { + inset: 0px; +} +.inset-y-0 { + top: 0px; + bottom: 0px; +} +.-left-1 { + left: -0.25rem; +} +.-left-1\.5 { + left: -0.375rem; +} +.-left-14 { + left: -3.5rem; +} +.-left-3 { + left: -0.75rem; +} +.-left-4 { + left: -1rem; +} +.-left-\[17px\] { + left: -17px; +} +.-right-2 { + right: -0.5rem; +} +.-right-\[16px\] { + right: -16px; +} +.-right-\[17px\] { + right: -17px; +} +.-top-2 { + top: -0.5rem; +} +.-top-\[140px\] { + top: -140px; +} +.bottom-0 { + bottom: 0px; +} +.bottom-2 { + bottom: 0.5rem; +} +.bottom-2\.5 { + bottom: 0.625rem; +} +.bottom-4 { + bottom: 1rem; +} +.bottom-5 { + bottom: 1.25rem; +} +.bottom-6 { + bottom: 1.5rem; +} +.bottom-\[\*px\] { + bottom: *px; +} +.bottom-\[60px\] { + bottom: 60px; +} +.left-0 { + left: 0px; +} +.left-1 { + left: 0.25rem; +} +.left-1\/2 { + left: 50%; +} +.left-2 { + left: 0.5rem; +} +.left-2\.5 { + left: 0.625rem; +} +.left-5 { + left: 1.25rem; +} +.left-6 { + left: 1.5rem; +} +.left-7 { + left: 1.75rem; +} +.left-8 { + left: 2rem; +} +.left-auto { + left: auto; +} +.right-0 { + right: 0px; +} +.right-1\/2 { + right: 50%; +} +.right-2 { + right: 0.5rem; +} +.right-2\.5 { + right: 0.625rem; +} +.right-24 { + right: 6rem; +} +.right-3 { + right: 0.75rem; +} +.right-5 { + right: 1.25rem; +} +.right-6 { + right: 1.5rem; +} +.right-auto { + right: auto; +} +.top-0 { + top: 0px; +} +.top-1 { + top: 0.25rem; +} +.top-1\/2 { + top: 50%; +} +.top-2 { + top: 0.5rem; +} +.top-2\.5 { + top: 0.625rem; +} +.top-2\/4 { + top: 50%; +} +.top-28 { + top: 7rem; +} +.top-3 { + top: 0.75rem; +} +.top-4 { + top: 1rem; +} +.top-5 { + top: 1.25rem; +} +.top-6 { + top: 1.5rem; +} +.top-\[124px\] { + top: 124px; +} +.top-\[142px\] { + top: 142px; +} +.top-\[178px\] { + top: 178px; +} +.top-\[40px\] { + top: 40px; +} +.top-\[72px\] { + top: 72px; +} +.top-\[88px\] { + top: 88px; +} +.-z-10 { + z-index: -10; +} +.z-0 { + z-index: 0; +} +.z-10 { + z-index: 10; +} +.z-20 { + z-index: 20; +} +.z-30 { + z-index: 30; +} +.z-40 { + z-index: 40; +} +.z-50 { + z-index: 50; +} +.col-span-1 { + grid-column: span 1 / span 1; +} +.col-span-2 { + grid-column: span 2 / span 2; +} +.col-span-3 { + grid-column: span 3 / span 3; +} +.col-span-6 { + grid-column: span 6 / span 6; +} +.m-2 { + margin: 0.5rem; +} +.m-2\.5 { + margin: 0.625rem; +} +.m-4 { + margin: 1rem; +} +.-mx-1 { + margin-left: -0.25rem; + margin-right: -0.25rem; +} +.-mx-1\.5 { + margin-left: -0.375rem; + margin-right: -0.375rem; +} +.-my-1 { + margin-top: -0.25rem; + margin-bottom: -0.25rem; +} +.-my-1\.5 { + margin-top: -0.375rem; + margin-bottom: -0.375rem; +} +.mx-1 { + margin-left: 0.25rem; + margin-right: 0.25rem; +} +.mx-1\.5 { + margin-left: 0.375rem; + margin-right: 0.375rem; +} +.mx-2 { + margin-left: 0.5rem; + margin-right: 0.5rem; +} +.mx-3 { + margin-left: 0.75rem; + margin-right: 0.75rem; +} +.mx-4 { + margin-left: 1rem; + margin-right: 1rem; +} +.mx-auto { + margin-left: auto; + margin-right: auto; +} +.my-10 { + margin-top: 2.5rem; + margin-bottom: 2.5rem; +} +.my-12 { + margin-top: 3rem; + margin-bottom: 3rem; +} +.my-2 { + margin-top: 0.5rem; + margin-bottom: 0.5rem; +} +.my-3 { + margin-top: 0.75rem; + margin-bottom: 0.75rem; +} +.my-4 { + margin-top: 1rem; + margin-bottom: 1rem; +} +.my-6 { + margin-top: 1.5rem; + margin-bottom: 1.5rem; +} +.my-7 { + margin-top: 1.75rem; + margin-bottom: 1.75rem; +} +.my-8 { + margin-top: 2rem; + margin-bottom: 2rem; +} +.-mb-5 { + margin-bottom: -1.25rem; +} +.-mb-px { + margin-bottom: -1px; +} +.-ml-0 { + margin-left: -0px; +} +.-ml-0\.5 { + margin-left: -0.125rem; +} +.-ml-1 { + margin-left: -0.25rem; +} +.-mr-0 { + margin-right: -0px; +} +.-mr-0\.5 { + margin-right: -0.125rem; +} +.-mr-1 { + margin-right: -0.25rem; +} +.-mt-1 { + margin-top: -0.25rem; +} +.-mt-5 { + margin-top: -1.25rem; +} +.mb-0 { + margin-bottom: 0px; +} +.mb-1 { + margin-bottom: 0.25rem; +} +.mb-1\.5 { + margin-bottom: 0.375rem; +} +.mb-10 { + margin-bottom: 2.5rem; +} +.mb-2 { + margin-bottom: 0.5rem; +} +.mb-2\.5 { + margin-bottom: 0.625rem; +} +.mb-3 { + margin-bottom: 0.75rem; +} +.mb-4 { + margin-bottom: 1rem; +} +.mb-5 { + margin-bottom: 1.25rem; +} +.mb-6 { + margin-bottom: 1.5rem; +} +.mb-7 { + margin-bottom: 1.75rem; +} +.mb-8 { + margin-bottom: 2rem; +} +.mb-px { + margin-bottom: 1px; +} +.ml-0 { + margin-left: 0px; +} +.ml-1 { + margin-left: 0.25rem; +} +.ml-1\.5 { + margin-left: 0.375rem; +} +.ml-2 { + margin-left: 0.5rem; +} +.ml-2\.5 { + margin-left: 0.625rem; +} +.ml-3 { + margin-left: 0.75rem; +} +.ml-4 { + margin-left: 1rem; +} +.ml-6 { + margin-left: 1.5rem; +} +.ml-auto { + margin-left: auto; +} +.mr-1 { + margin-right: 0.25rem; +} +.mr-1\.5 { + margin-right: 0.375rem; +} +.mr-2 { + margin-right: 0.5rem; +} +.mr-2\.5 { + margin-right: 0.625rem; +} +.mr-3 { + margin-right: 0.75rem; +} +.mr-4 { + margin-right: 1rem; +} +.mr-5 { + margin-right: 1.25rem; +} +.mr-6 { + margin-right: 1.5rem; +} +.mr-8 { + margin-right: 2rem; +} +.mr-auto { + margin-right: auto; +} +.mt-0 { + margin-top: 0px; +} +.mt-1 { + margin-top: 0.25rem; +} +.mt-1\.5 { + margin-top: 0.375rem; +} +.mt-10 { + margin-top: 2.5rem; +} +.mt-14 { + margin-top: 3.5rem; +} +.mt-2 { + margin-top: 0.5rem; +} +.mt-2\.5 { + margin-top: 0.625rem; +} +.mt-3 { + margin-top: 0.75rem; +} +.mt-4 { + margin-top: 1rem; +} +.mt-5 { + margin-top: 1.25rem; +} +.mt-6 { + margin-top: 1.5rem; +} +.mt-7 { + margin-top: 1.75rem; +} +.mt-8 { + margin-top: 2rem; +} +.mt-\[2px\] { + margin-top: 2px; +} +.block { + display: block; +} +.inline-block { + display: inline-block; +} +.inline { + display: inline; +} +.flex { + display: flex; +} +.inline-flex { + display: inline-flex; +} +.table { + display: table; +} +.flow-root { + display: flow-root; +} +.grid { + display: grid; +} +.contents { + display: contents; +} +.hidden { + display: none; +} +.h-0 { + height: 0px; +} +.h-0\.5 { + height: 0.125rem; +} +.h-1 { + height: 0.25rem; +} +.h-1\.5 { + height: 0.375rem; +} +.h-10 { + height: 2.5rem; +} +.h-11 { + height: 2.75rem; +} +.h-12 { + height: 3rem; +} +.h-14 { + height: 3.5rem; +} +.h-16 { + height: 4rem; +} +.h-2 { + height: 0.5rem; +} +.h-2\.5 { + height: 0.625rem; +} +.h-20 { + height: 5rem; +} +.h-24 { + height: 6rem; +} +.h-28 { + height: 7rem; +} +.h-3 { + height: 0.75rem; +} +.h-3\.5 { + height: 0.875rem; +} +.h-36 { + height: 9rem; +} +.h-4 { + height: 1rem; +} +.h-48 { + height: 12rem; +} +.h-5 { + height: 1.25rem; +} +.h-56 { + height: 14rem; +} +.h-6 { + height: 1.5rem; +} +.h-64 { + height: 16rem; +} +.h-7 { + height: 1.75rem; +} +.h-72 { + height: 18rem; +} +.h-8 { + height: 2rem; +} +.h-80 { + height: 20rem; +} +.h-9 { + height: 2.25rem; +} +.h-96 { + height: 24rem; +} +.h-\[1\.1rem\] { + height: 1.1rem; +} +.h-\[140px\] { + height: 140px; +} +.h-\[156px\] { + height: 156px; +} +.h-\[172px\] { + height: 172px; +} +.h-\[17px\] { + height: 17px; +} +.h-\[18px\] { + height: 18px; +} +.h-\[193px\] { + height: 193px; +} +.h-\[213px\] { + height: 213px; +} +.h-\[24px\] { + height: 24px; +} +.h-\[32px\] { + height: 32px; +} +.h-\[41px\] { + height: 41px; +} +.h-\[426px\] { + height: 426px; +} +.h-\[454px\] { + height: 454px; +} +.h-\[46px\] { + height: 46px; +} +.h-\[48px\] { + height: 48px; +} +.h-\[52px\] { + height: 52px; +} +.h-\[55px\] { + height: 55px; +} +.h-\[56px\] { + height: 56px; +} +.h-\[572px\] { + height: 572px; +} +.h-\[5px\] { + height: 5px; +} +.h-\[600px\] { + height: 600px; +} +.h-\[63px\] { + height: 63px; +} +.h-\[64px\] { + height: 64px; +} +.h-\[78px\] { + height: 78px; +} +.h-\[calc\(100\%-1rem\)\] { + height: calc(100% - 1rem); +} +.h-\[calc\(100vh-5rem\)\] { + height: calc(100vh - 5rem); +} +.h-auto { + height: auto; +} +.h-full { + height: 100%; +} +.h-px { + height: 1px; +} +.h-screen { + height: 100vh; +} +.max-h-72 { + max-height: 18rem; +} +.max-h-\[48px\] { + max-height: 48px; +} +.max-h-full { + max-height: 100%; +} +.w-1 { + width: 0.25rem; +} +.w-1\/2 { + width: 50%; +} +.w-10 { + width: 2.5rem; +} +.w-11 { + width: 2.75rem; +} +.w-12 { + width: 3rem; +} +.w-14 { + width: 3.5rem; +} +.w-2 { + width: 0.5rem; +} +.w-2\.5 { + width: 0.625rem; +} +.w-2\/4 { + width: 50%; +} +.w-20 { + width: 5rem; +} +.w-24 { + width: 6rem; +} +.w-3 { + width: 0.75rem; +} +.w-3\.5 { + width: 0.875rem; +} +.w-32 { + width: 8rem; +} +.w-36 { + width: 9rem; +} +.w-4 { + width: 1rem; +} +.w-44 { + width: 11rem; +} +.w-48 { + width: 12rem; +} +.w-5 { + width: 1.25rem; +} +.w-52 { + width: 13rem; +} +.w-56 { + width: 14rem; +} +.w-6 { + width: 1.5rem; +} +.w-60 { + width: 15rem; +} +.w-64 { + width: 16rem; +} +.w-7 { + width: 1.75rem; +} +.w-72 { + width: 18rem; +} +.w-8 { + width: 2rem; +} +.w-80 { + width: 20rem; +} +.w-9 { + width: 2.25rem; +} +.w-96 { + width: 24rem; +} +.w-\[1\.1rem\] { + width: 1.1rem; +} +.w-\[148px\] { + width: 148px; +} +.w-\[188px\] { + width: 188px; +} +.w-\[208px\] { + width: 208px; +} +.w-\[272px\] { + width: 272px; +} +.w-\[300px\] { + width: 300px; +} +.w-\[3px\] { + width: 3px; +} +.w-\[48px\] { + width: 48px; +} +.w-\[52px\] { + width: 52px; +} +.w-\[56px\] { + width: 56px; +} +.w-\[6px\] { + width: 6px; +} +.w-\[calc\(100\%-2rem\)\] { + width: calc(100% - 2rem); +} +.w-auto { + width: auto; +} +.w-full { + width: 100%; +} +.min-w-0 { + min-width: 0px; +} +.min-w-max { + min-width: -moz-max-content; + min-width: max-content; +} +.max-w-2xl { + max-width: 42rem; +} +.max-w-2xs { + max-width: 16rem; +} +.max-w-4xl { + max-width: 56rem; +} +.max-w-7xl { + max-width: 80rem; +} +.max-w-8xl { + max-width: 90rem; +} +.max-w-\[128px\] { + max-width: 128px; +} +.max-w-\[133px\] { + max-width: 133px; +} +.max-w-\[300px\] { + max-width: 300px; +} +.max-w-\[301px\] { + max-width: 301px; +} +.max-w-\[330px\] { + max-width: 330px; +} +.max-w-\[341px\] { + max-width: 341px; +} +.max-w-\[351px\] { + max-width: 351px; +} +.max-w-\[360px\] { + max-width: 360px; +} +.max-w-\[380px\] { + max-width: 380px; +} +.max-w-\[400px\] { + max-width: 400px; +} +.max-w-\[440px\] { + max-width: 440px; +} +.max-w-\[450px\] { + max-width: 450px; +} +.max-w-\[460px\] { + max-width: 460px; +} +.max-w-\[480px\] { + max-width: 480px; +} +.max-w-\[48px\] { + max-width: 48px; +} +.max-w-\[500px\] { + max-width: 500px; +} +.max-w-\[540px\] { + max-width: 540px; +} +.max-w-\[640px\] { + max-width: 640px; +} +.max-w-\[83px\] { + max-width: 83px; +} +.max-w-full { + max-width: 100%; +} +.max-w-lg { + max-width: 32rem; +} +.max-w-md { + max-width: 28rem; +} +.max-w-none { + max-width: none; +} +.max-w-screen-md { + max-width: 768px; +} +.max-w-screen-xl { + max-width: 1280px; +} +.max-w-sm { + max-width: 24rem; +} +.max-w-xl { + max-width: 36rem; +} +.max-w-xs { + max-width: 20rem; +} +.flex-1 { + flex: 1 1 0%; +} +.flex-auto { + flex: 1 1 auto; +} +.flex-none { + flex: none; +} +.flex-shrink-0 { + flex-shrink: 0; +} +.shrink-0 { + flex-shrink: 0; +} +.grow { + flex-grow: 1; +} +.origin-\[0\] { + transform-origin: 0; +} +.-translate-x-1\/2 { + --tw-translate-x: -50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.-translate-x-full { + --tw-translate-x: -100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.-translate-y-1\/2 { + --tw-translate-y: -50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.-translate-y-3 { + --tw-translate-y: -0.75rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.-translate-y-4 { + --tw-translate-y: -1rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.-translate-y-6 { + --tw-translate-y: -1.5rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.-translate-y-full { + --tw-translate-y: -100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.translate-x-0 { + --tw-translate-x: 0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.translate-x-1\/2 { + --tw-translate-x: 50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.translate-x-full { + --tw-translate-x: 100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.translate-y-1\/2 { + --tw-translate-y: 50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.translate-y-1\/4 { + --tw-translate-y: 25%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.translate-y-full { + --tw-translate-y: 100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.rotate-180 { + --tw-rotate: 180deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.rotate-45 { + --tw-rotate: 45deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.rotate-90 { + --tw-rotate: 90deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.scale-75 { + --tw-scale-x: .75; + --tw-scale-y: .75; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.transform { + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} +.transform-none { + transform: none; +} +@keyframes pulse { + + 50% { + opacity: .5; + } +} +.animate-pulse { + animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; +} +@keyframes spin { + + to { + transform: rotate(360deg); + } +} +.animate-spin { + animation: spin 1s linear infinite; +} +.cursor-not-allowed { + cursor: not-allowed; +} +.cursor-pointer { + cursor: pointer; +} +.list-inside { + list-style-position: inside; +} +.list-decimal { + list-style-type: decimal; +} +.list-disc { + list-style-type: disc; +} +.list-none { + list-style-type: none; +} +.appearance-none { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} +.grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)); +} +.grid-cols-10 { + grid-template-columns: repeat(10, minmax(0, 1fr)); +} +.grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} +.grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); +} +.grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); +} +.grid-cols-5 { + grid-template-columns: repeat(5, minmax(0, 1fr)); +} +.grid-cols-6 { + grid-template-columns: repeat(6, minmax(0, 1fr)); +} +.grid-cols-7 { + grid-template-columns: repeat(7, minmax(0, 1fr)); +} +.flex-row { + flex-direction: row; +} +.flex-col { + flex-direction: column; +} +.flex-wrap { + flex-wrap: wrap; +} +.items-start { + align-items: flex-start; +} +.items-end { + align-items: flex-end; +} +.items-center { + align-items: center; +} +.items-baseline { + align-items: baseline; +} +.justify-start { + justify-content: flex-start; +} +.justify-end { + justify-content: flex-end; +} +.justify-center { + justify-content: center; +} +.justify-between { + justify-content: space-between; +} +.gap-1 { + gap: 0.25rem; +} +.gap-12 { + gap: 3rem; +} +.gap-16 { + gap: 4rem; +} +.gap-2 { + gap: 0.5rem; +} +.gap-3 { + gap: 0.75rem; +} +.gap-4 { + gap: 1rem; +} +.gap-5 { + gap: 1.25rem; +} +.gap-6 { + gap: 1.5rem; +} +.gap-8 { + gap: 2rem; +} +.gap-x-16 { + -moz-column-gap: 4rem; + column-gap: 4rem; +} +.gap-x-4 { + -moz-column-gap: 1rem; + column-gap: 1rem; +} +.gap-y-3 { + row-gap: 0.75rem; +} +.-space-x-3 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(-0.75rem * var(--tw-space-x-reverse)); + margin-left: calc(-0.75rem * calc(1 - var(--tw-space-x-reverse))); +} +.-space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(-1rem * var(--tw-space-x-reverse)); + margin-left: calc(-1rem * calc(1 - var(--tw-space-x-reverse))); +} +.-space-x-px > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(-1px * var(--tw-space-x-reverse)); + margin-left: calc(-1px * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-1 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.25rem * var(--tw-space-x-reverse)); + margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-2 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.5rem * var(--tw-space-x-reverse)); + margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-2\.5 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.625rem * var(--tw-space-x-reverse)); + margin-left: calc(0.625rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-3 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.75rem * var(--tw-space-x-reverse)); + margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1rem * var(--tw-space-x-reverse)); + margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-5 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1.25rem * var(--tw-space-x-reverse)); + margin-left: calc(1.25rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-6 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1.5rem * var(--tw-space-x-reverse)); + margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-x-8 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(2rem * var(--tw-space-x-reverse)); + margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))); +} +.space-y-0 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0px * var(--tw-space-y-reverse)); +} +.space-y-0\.5 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.125rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.125rem * var(--tw-space-y-reverse)); +} +.space-y-1 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); +} +.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.375rem * var(--tw-space-y-reverse)); +} +.space-y-2 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)); +} +.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.625rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.625rem * var(--tw-space-y-reverse)); +} +.space-y-3 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.75rem * var(--tw-space-y-reverse)); +} +.space-y-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(1rem * var(--tw-space-y-reverse)); +} +.space-y-5 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(1.25rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(1.25rem * var(--tw-space-y-reverse)); +} +.space-y-6 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(1.5rem * var(--tw-space-y-reverse)); +} +.space-y-8 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(2rem * var(--tw-space-y-reverse)); +} +.divide-x > :not([hidden]) ~ :not([hidden]) { + --tw-divide-x-reverse: 0; + border-right-width: calc(1px * var(--tw-divide-x-reverse)); + border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))); +} +.divide-x-2 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-x-reverse: 0; + border-right-width: calc(2px * var(--tw-divide-x-reverse)); + border-left-width: calc(2px * calc(1 - var(--tw-divide-x-reverse))); +} +.divide-y > :not([hidden]) ~ :not([hidden]) { + --tw-divide-y-reverse: 0; + border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse))); + border-bottom-width: calc(1px * var(--tw-divide-y-reverse)); +} +.divide-gray-100 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(243 244 246 / var(--tw-divide-opacity)); +} +.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-divide-opacity)); +} +.divide-gray-300 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-divide-opacity)); +} +.divide-gray-500 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-divide-opacity)); +} +.place-self-center { + place-self: center; +} +.self-center { + align-self: center; +} +.overflow-hidden { + overflow: hidden; +} +.overflow-x-auto { + overflow-x: auto; +} +.overflow-y-auto { + overflow-y: auto; +} +.overflow-x-hidden { + overflow-x: hidden; +} +.overflow-y-scroll { + overflow-y: scroll; +} +.truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.whitespace-normal { + white-space: normal; +} +.whitespace-nowrap { + white-space: nowrap; +} +.whitespace-pre-line { + white-space: pre-line; +} +.rounded { + border-radius: 0.25rem; +} +.rounded-\[2\.5rem\] { + border-radius: 2.5rem; +} +.rounded-\[2rem\] { + border-radius: 2rem; +} +.rounded-full { + border-radius: 9999px; +} +.rounded-lg { + border-radius: 0.5rem; +} +.rounded-md { + border-radius: 0.375rem; +} +.rounded-none { + border-radius: 0px; +} +.rounded-sm { + border-radius: 0.125rem; +} +.rounded-xl { + border-radius: 0.75rem; +} +.rounded-b { + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} +.rounded-b-\[1rem\] { + border-bottom-right-radius: 1rem; + border-bottom-left-radius: 1rem; +} +.rounded-b-\[2\.5rem\] { + border-bottom-right-radius: 2.5rem; + border-bottom-left-radius: 2.5rem; +} +.rounded-b-lg { + border-bottom-right-radius: 0.5rem; + border-bottom-left-radius: 0.5rem; +} +.rounded-b-xl { + border-bottom-right-radius: 0.75rem; + border-bottom-left-radius: 0.75rem; +} +.rounded-l { + border-top-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} +.rounded-l-full { + border-top-left-radius: 9999px; + border-bottom-left-radius: 9999px; +} +.rounded-l-lg { + border-top-left-radius: 0.5rem; + border-bottom-left-radius: 0.5rem; +} +.rounded-l-md { + border-top-left-radius: 0.375rem; + border-bottom-left-radius: 0.375rem; +} +.rounded-r { + border-top-right-radius: 0.25rem; + border-bottom-right-radius: 0.25rem; +} +.rounded-r-full { + border-top-right-radius: 9999px; + border-bottom-right-radius: 9999px; +} +.rounded-r-lg { + border-top-right-radius: 0.5rem; + border-bottom-right-radius: 0.5rem; +} +.rounded-r-md { + border-top-right-radius: 0.375rem; + border-bottom-right-radius: 0.375rem; +} +.rounded-t { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} +.rounded-t-\[2\.5rem\] { + border-top-left-radius: 2.5rem; + border-top-right-radius: 2.5rem; +} +.rounded-t-lg { + border-top-left-radius: 0.5rem; + border-top-right-radius: 0.5rem; +} +.rounded-t-md { + border-top-left-radius: 0.375rem; + border-top-right-radius: 0.375rem; +} +.rounded-t-sm { + border-top-left-radius: 0.125rem; + border-top-right-radius: 0.125rem; +} +.rounded-t-xl { + border-top-left-radius: 0.75rem; + border-top-right-radius: 0.75rem; +} +.rounded-bl-lg { + border-bottom-left-radius: 0.5rem; +} +.rounded-tl-lg { + border-top-left-radius: 0.5rem; +} +.rounded-tr-lg { + border-top-right-radius: 0.5rem; +} +.border { + border-width: 1px; +} +.border-0 { + border-width: 0px; +} +.border-2 { + border-width: 2px; +} +.border-\[10px\] { + border-width: 10px; +} +.border-\[14px\] { + border-width: 14px; +} +.border-\[16px\] { + border-width: 16px; +} +.border-\[8px\] { + border-width: 8px; +} +.border-x { + border-left-width: 1px; + border-right-width: 1px; +} +.border-y { + border-top-width: 1px; + border-bottom-width: 1px; +} +.border-b { + border-bottom-width: 1px; +} +.border-b-0 { + border-bottom-width: 0px; +} +.border-b-2 { + border-bottom-width: 2px; +} +.border-l { + border-left-width: 1px; +} +.border-l-2 { + border-left-width: 2px; +} +.border-l-4 { + border-left-width: 4px; +} +.border-r { + border-right-width: 1px; +} +.border-r-0 { + border-right-width: 0px; +} +.border-t { + border-top-width: 1px; +} +.border-t-0 { + border-top-width: 0px; +} +.border-t-4 { + border-top-width: 4px; +} +.border-dashed { + border-style: dashed; +} +.\!border-blue-700 { + --tw-border-opacity: 1 !important; + border-color: rgb(26 86 219 / var(--tw-border-opacity)) !important; +} +.border-blue-100 { + --tw-border-opacity: 1; + border-color: rgb(225 239 254 / var(--tw-border-opacity)); +} +.border-blue-300 { + --tw-border-opacity: 1; + border-color: rgb(164 202 254 / var(--tw-border-opacity)); +} +.border-blue-400 { + --tw-border-opacity: 1; + border-color: rgb(118 169 250 / var(--tw-border-opacity)); +} +.border-blue-600 { + --tw-border-opacity: 1; + border-color: rgb(28 100 242 / var(--tw-border-opacity)); +} +.border-blue-700 { + --tw-border-opacity: 1; + border-color: rgb(26 86 219 / var(--tw-border-opacity)); +} +.border-blue-800 { + --tw-border-opacity: 1; + border-color: rgb(30 66 159 / var(--tw-border-opacity)); +} +.border-gray-100 { + --tw-border-opacity: 1; + border-color: rgb(243 244 246 / var(--tw-border-opacity)); +} +.border-gray-200 { + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); +} +.border-gray-300 { + --tw-border-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-border-opacity)); +} +.border-gray-500 { + --tw-border-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-border-opacity)); +} +.border-gray-700 { + --tw-border-opacity: 1; + border-color: rgb(55 65 81 / var(--tw-border-opacity)); +} +.border-gray-800 { + --tw-border-opacity: 1; + border-color: rgb(31 41 55 / var(--tw-border-opacity)); +} +.border-gray-900 { + --tw-border-opacity: 1; + border-color: rgb(17 24 39 / var(--tw-border-opacity)); +} +.border-green-300 { + --tw-border-opacity: 1; + border-color: rgb(132 225 188 / var(--tw-border-opacity)); +} +.border-green-400 { + --tw-border-opacity: 1; + border-color: rgb(49 196 141 / var(--tw-border-opacity)); +} +.border-green-500 { + --tw-border-opacity: 1; + border-color: rgb(14 159 110 / var(--tw-border-opacity)); +} +.border-green-600 { + --tw-border-opacity: 1; + border-color: rgb(5 122 85 / var(--tw-border-opacity)); +} +.border-green-700 { + --tw-border-opacity: 1; + border-color: rgb(4 108 78 / var(--tw-border-opacity)); +} +.border-green-800 { + --tw-border-opacity: 1; + border-color: rgb(3 84 63 / var(--tw-border-opacity)); +} +.border-indigo-400 { + --tw-border-opacity: 1; + border-color: rgb(141 162 251 / var(--tw-border-opacity)); +} +.border-pink-400 { + --tw-border-opacity: 1; + border-color: rgb(241 126 184 / var(--tw-border-opacity)); +} +.border-purple-400 { + --tw-border-opacity: 1; + border-color: rgb(172 148 250 / var(--tw-border-opacity)); +} +.border-purple-700 { + --tw-border-opacity: 1; + border-color: rgb(108 43 217 / var(--tw-border-opacity)); +} +.border-red-300 { + --tw-border-opacity: 1; + border-color: rgb(248 180 180 / var(--tw-border-opacity)); +} +.border-red-400 { + --tw-border-opacity: 1; + border-color: rgb(249 128 128 / var(--tw-border-opacity)); +} +.border-red-500 { + --tw-border-opacity: 1; + border-color: rgb(240 82 82 / var(--tw-border-opacity)); +} +.border-red-600 { + --tw-border-opacity: 1; + border-color: rgb(224 36 36 / var(--tw-border-opacity)); +} +.border-red-700 { + --tw-border-opacity: 1; + border-color: rgb(200 30 30 / var(--tw-border-opacity)); +} +.border-red-800 { + --tw-border-opacity: 1; + border-color: rgb(155 28 28 / var(--tw-border-opacity)); +} +.border-transparent { + border-color: transparent; +} +.border-white { + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} +.border-yellow-300 { + --tw-border-opacity: 1; + border-color: rgb(250 202 21 / var(--tw-border-opacity)); +} +.border-yellow-400 { + --tw-border-opacity: 1; + border-color: rgb(227 160 8 / var(--tw-border-opacity)); +} +.border-yellow-800 { + --tw-border-opacity: 1; + border-color: rgb(114 59 19 / var(--tw-border-opacity)); +} +.border-l-gray-100 { + --tw-border-opacity: 1; + border-left-color: rgb(243 244 246 / var(--tw-border-opacity)); +} +.border-l-gray-50 { + --tw-border-opacity: 1; + border-left-color: rgb(249 250 251 / var(--tw-border-opacity)); +} +.bg-\[\#050708\] { + --tw-bg-opacity: 1; + background-color: rgb(5 7 8 / var(--tw-bg-opacity)); +} +.bg-\[\#1da1f2\] { + --tw-bg-opacity: 1; + background-color: rgb(29 161 242 / var(--tw-bg-opacity)); +} +.bg-\[\#24292F\] { + --tw-bg-opacity: 1; + background-color: rgb(36 41 47 / var(--tw-bg-opacity)); +} +.bg-\[\#2557D6\] { + --tw-bg-opacity: 1; + background-color: rgb(37 87 214 / var(--tw-bg-opacity)); +} +.bg-\[\#3b5998\] { + --tw-bg-opacity: 1; + background-color: rgb(59 89 152 / var(--tw-bg-opacity)); +} +.bg-\[\#4285F4\] { + --tw-bg-opacity: 1; + background-color: rgb(66 133 244 / var(--tw-bg-opacity)); +} +.bg-\[\#F7BE38\] { + --tw-bg-opacity: 1; + background-color: rgb(247 190 56 / var(--tw-bg-opacity)); +} +.bg-\[\#FF9119\] { + --tw-bg-opacity: 1; + background-color: rgb(255 145 25 / var(--tw-bg-opacity)); +} +.bg-\[\#hex\] { + background-color: #hex; +} +.bg-blue-100 { + --tw-bg-opacity: 1; + background-color: rgb(225 239 254 / var(--tw-bg-opacity)); +} +.bg-blue-200 { + --tw-bg-opacity: 1; + background-color: rgb(195 221 253 / var(--tw-bg-opacity)); +} +.bg-blue-300 { + --tw-bg-opacity: 1; + background-color: rgb(164 202 254 / var(--tw-bg-opacity)); +} +.bg-blue-400 { + --tw-bg-opacity: 1; + background-color: rgb(118 169 250 / var(--tw-bg-opacity)); +} +.bg-blue-50 { + --tw-bg-opacity: 1; + background-color: rgb(235 245 255 / var(--tw-bg-opacity)); +} +.bg-blue-500 { + --tw-bg-opacity: 1; + background-color: rgb(63 131 248 / var(--tw-bg-opacity)); +} +.bg-blue-600 { + --tw-bg-opacity: 1; + background-color: rgb(28 100 242 / var(--tw-bg-opacity)); +} +.bg-blue-700 { + --tw-bg-opacity: 1; + background-color: rgb(26 86 219 / var(--tw-bg-opacity)); +} +.bg-blue-800 { + --tw-bg-opacity: 1; + background-color: rgb(30 66 159 / var(--tw-bg-opacity)); +} +.bg-blue-900 { + --tw-bg-opacity: 1; + background-color: rgb(35 56 118 / var(--tw-bg-opacity)); +} +.bg-gray-100 { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} +.bg-gray-200 { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} +.bg-gray-300 { + --tw-bg-opacity: 1; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)); +} +.bg-gray-400 { + --tw-bg-opacity: 1; + background-color: rgb(156 163 175 / var(--tw-bg-opacity)); +} +.bg-gray-50 { + --tw-bg-opacity: 1; + background-color: rgb(249 250 251 / var(--tw-bg-opacity)); +} +.bg-gray-500 { + --tw-bg-opacity: 1; + background-color: rgb(107 114 128 / var(--tw-bg-opacity)); +} +.bg-gray-600 { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} +.bg-gray-700 { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} +.bg-gray-800 { + --tw-bg-opacity: 1; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)); +} +.bg-gray-900 { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); +} +.bg-gray-900\/50 { + background-color: rgb(17 24 39 / 0.5); +} +.bg-green-100 { + --tw-bg-opacity: 1; + background-color: rgb(222 247 236 / var(--tw-bg-opacity)); +} +.bg-green-200 { + --tw-bg-opacity: 1; + background-color: rgb(188 240 218 / var(--tw-bg-opacity)); +} +.bg-green-300 { + --tw-bg-opacity: 1; + background-color: rgb(132 225 188 / var(--tw-bg-opacity)); +} +.bg-green-400 { + --tw-bg-opacity: 1; + background-color: rgb(49 196 141 / var(--tw-bg-opacity)); +} +.bg-green-50 { + --tw-bg-opacity: 1; + background-color: rgb(243 250 247 / var(--tw-bg-opacity)); +} +.bg-green-500 { + --tw-bg-opacity: 1; + background-color: rgb(14 159 110 / var(--tw-bg-opacity)); +} +.bg-green-600 { + --tw-bg-opacity: 1; + background-color: rgb(5 122 85 / var(--tw-bg-opacity)); +} +.bg-green-700 { + --tw-bg-opacity: 1; + background-color: rgb(4 108 78 / var(--tw-bg-opacity)); +} +.bg-green-800 { + --tw-bg-opacity: 1; + background-color: rgb(3 84 63 / var(--tw-bg-opacity)); +} +.bg-green-900 { + --tw-bg-opacity: 1; + background-color: rgb(1 71 55 / var(--tw-bg-opacity)); +} +.bg-indigo-100 { + --tw-bg-opacity: 1; + background-color: rgb(229 237 255 / var(--tw-bg-opacity)); +} +.bg-indigo-200 { + --tw-bg-opacity: 1; + background-color: rgb(205 219 254 / var(--tw-bg-opacity)); +} +.bg-indigo-300 { + --tw-bg-opacity: 1; + background-color: rgb(180 198 252 / var(--tw-bg-opacity)); +} +.bg-indigo-400 { + --tw-bg-opacity: 1; + background-color: rgb(141 162 251 / var(--tw-bg-opacity)); +} +.bg-indigo-50 { + --tw-bg-opacity: 1; + background-color: rgb(240 245 255 / var(--tw-bg-opacity)); +} +.bg-indigo-500 { + --tw-bg-opacity: 1; + background-color: rgb(104 117 245 / var(--tw-bg-opacity)); +} +.bg-indigo-600 { + --tw-bg-opacity: 1; + background-color: rgb(88 80 236 / var(--tw-bg-opacity)); +} +.bg-indigo-700 { + --tw-bg-opacity: 1; + background-color: rgb(81 69 205 / var(--tw-bg-opacity)); +} +.bg-indigo-800 { + --tw-bg-opacity: 1; + background-color: rgb(66 56 157 / var(--tw-bg-opacity)); +} +.bg-indigo-900 { + --tw-bg-opacity: 1; + background-color: rgb(54 47 120 / var(--tw-bg-opacity)); +} +.bg-orange-100 { + --tw-bg-opacity: 1; + background-color: rgb(254 236 220 / var(--tw-bg-opacity)); +} +.bg-orange-300 { + --tw-bg-opacity: 1; + background-color: rgb(253 186 140 / var(--tw-bg-opacity)); +} +.bg-orange-50 { + --tw-bg-opacity: 1; + background-color: rgb(255 248 241 / var(--tw-bg-opacity)); +} +.bg-pink-100 { + --tw-bg-opacity: 1; + background-color: rgb(252 232 243 / var(--tw-bg-opacity)); +} +.bg-pink-200 { + --tw-bg-opacity: 1; + background-color: rgb(250 209 232 / var(--tw-bg-opacity)); +} +.bg-pink-300 { + --tw-bg-opacity: 1; + background-color: rgb(248 180 217 / var(--tw-bg-opacity)); +} +.bg-pink-400 { + --tw-bg-opacity: 1; + background-color: rgb(241 126 184 / var(--tw-bg-opacity)); +} +.bg-pink-50 { + --tw-bg-opacity: 1; + background-color: rgb(253 242 248 / var(--tw-bg-opacity)); +} +.bg-pink-500 { + --tw-bg-opacity: 1; + background-color: rgb(231 70 148 / var(--tw-bg-opacity)); +} +.bg-pink-600 { + --tw-bg-opacity: 1; + background-color: rgb(214 31 105 / var(--tw-bg-opacity)); +} +.bg-pink-700 { + --tw-bg-opacity: 1; + background-color: rgb(191 18 93 / var(--tw-bg-opacity)); +} +.bg-pink-800 { + --tw-bg-opacity: 1; + background-color: rgb(153 21 75 / var(--tw-bg-opacity)); +} +.bg-pink-900 { + --tw-bg-opacity: 1; + background-color: rgb(117 26 61 / var(--tw-bg-opacity)); +} +.bg-purple-100 { + --tw-bg-opacity: 1; + background-color: rgb(237 235 254 / var(--tw-bg-opacity)); +} +.bg-purple-200 { + --tw-bg-opacity: 1; + background-color: rgb(220 215 254 / var(--tw-bg-opacity)); +} +.bg-purple-300 { + --tw-bg-opacity: 1; + background-color: rgb(202 191 253 / var(--tw-bg-opacity)); +} +.bg-purple-400 { + --tw-bg-opacity: 1; + background-color: rgb(172 148 250 / var(--tw-bg-opacity)); +} +.bg-purple-50 { + --tw-bg-opacity: 1; + background-color: rgb(246 245 255 / var(--tw-bg-opacity)); +} +.bg-purple-500 { + --tw-bg-opacity: 1; + background-color: rgb(144 97 249 / var(--tw-bg-opacity)); +} +.bg-purple-600 { + --tw-bg-opacity: 1; + background-color: rgb(126 58 242 / var(--tw-bg-opacity)); +} +.bg-purple-700 { + --tw-bg-opacity: 1; + background-color: rgb(108 43 217 / var(--tw-bg-opacity)); +} +.bg-purple-800 { + --tw-bg-opacity: 1; + background-color: rgb(85 33 181 / var(--tw-bg-opacity)); +} +.bg-purple-900 { + --tw-bg-opacity: 1; + background-color: rgb(74 29 150 / var(--tw-bg-opacity)); +} +.bg-red-100 { + --tw-bg-opacity: 1; + background-color: rgb(253 232 232 / var(--tw-bg-opacity)); +} +.bg-red-200 { + --tw-bg-opacity: 1; + background-color: rgb(251 213 213 / var(--tw-bg-opacity)); +} +.bg-red-300 { + --tw-bg-opacity: 1; + background-color: rgb(248 180 180 / var(--tw-bg-opacity)); +} +.bg-red-400 { + --tw-bg-opacity: 1; + background-color: rgb(249 128 128 / var(--tw-bg-opacity)); +} +.bg-red-50 { + --tw-bg-opacity: 1; + background-color: rgb(253 242 242 / var(--tw-bg-opacity)); +} +.bg-red-500 { + --tw-bg-opacity: 1; + background-color: rgb(240 82 82 / var(--tw-bg-opacity)); +} +.bg-red-600 { + --tw-bg-opacity: 1; + background-color: rgb(224 36 36 / var(--tw-bg-opacity)); +} +.bg-red-700 { + --tw-bg-opacity: 1; + background-color: rgb(200 30 30 / var(--tw-bg-opacity)); +} +.bg-red-800 { + --tw-bg-opacity: 1; + background-color: rgb(155 28 28 / var(--tw-bg-opacity)); +} +.bg-red-900 { + --tw-bg-opacity: 1; + background-color: rgb(119 29 29 / var(--tw-bg-opacity)); +} +.bg-teal-100 { + --tw-bg-opacity: 1; + background-color: rgb(213 245 246 / var(--tw-bg-opacity)); +} +.bg-teal-50 { + --tw-bg-opacity: 1; + background-color: rgb(237 250 250 / var(--tw-bg-opacity)); +} +.bg-teal-500 { + --tw-bg-opacity: 1; + background-color: rgb(6 148 162 / var(--tw-bg-opacity)); +} +.bg-transparent { + background-color: transparent; +} +.bg-white { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} +.bg-white\/30 { + background-color: rgb(255 255 255 / 0.3); +} +.bg-white\/50 { + background-color: rgb(255 255 255 / 0.5); +} +.bg-yellow-100 { + --tw-bg-opacity: 1; + background-color: rgb(253 246 178 / var(--tw-bg-opacity)); +} +.bg-yellow-200 { + --tw-bg-opacity: 1; + background-color: rgb(252 233 106 / var(--tw-bg-opacity)); +} +.bg-yellow-300 { + --tw-bg-opacity: 1; + background-color: rgb(250 202 21 / var(--tw-bg-opacity)); +} +.bg-yellow-400 { + --tw-bg-opacity: 1; + background-color: rgb(227 160 8 / var(--tw-bg-opacity)); +} +.bg-yellow-50 { + --tw-bg-opacity: 1; + background-color: rgb(253 253 234 / var(--tw-bg-opacity)); +} +.bg-yellow-500 { + --tw-bg-opacity: 1; + background-color: rgb(194 120 3 / var(--tw-bg-opacity)); +} +.bg-yellow-600 { + --tw-bg-opacity: 1; + background-color: rgb(159 88 10 / var(--tw-bg-opacity)); +} +.bg-yellow-700 { + --tw-bg-opacity: 1; + background-color: rgb(142 75 16 / var(--tw-bg-opacity)); +} +.bg-yellow-800 { + --tw-bg-opacity: 1; + background-color: rgb(114 59 19 / var(--tw-bg-opacity)); +} +.bg-yellow-900 { + --tw-bg-opacity: 1; + background-color: rgb(99 49 18 / var(--tw-bg-opacity)); +} +.bg-opacity-50 { + --tw-bg-opacity: 0.5; +} +.bg-\[url\(\'https\:\/\/flowbite\.s3\.amazonaws\.com\/docs\/jumbotron\/conference\.jpg\'\)\] { + background-image: url('https://flowbite.s3.amazonaws.com/docs/jumbotron/conference.jpg'); +} +.bg-\[url\(\'https\:\/\/flowbite\.s3\.amazonaws\.com\/docs\/jumbotron\/hero-pattern\.svg\'\)\] { + background-image: url('https://flowbite.s3.amazonaws.com/docs/jumbotron/hero-pattern.svg'); +} +.bg-gradient-to-b { + background-image: linear-gradient(to bottom, var(--tw-gradient-stops)); +} +.bg-gradient-to-br { + background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); +} +.bg-gradient-to-r { + background-image: linear-gradient(to right, var(--tw-gradient-stops)); +} +.from-blue-50 { + --tw-gradient-from: #EBF5FF var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(235 245 255 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-blue-500 { + --tw-gradient-from: #3F83F8 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-cyan-400 { + --tw-gradient-from: #22d3ee var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(34 211 238 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-cyan-500 { + --tw-gradient-from: #06b6d4 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-green-400 { + --tw-gradient-from: #31C48D var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-lime-200 { + --tw-gradient-from: #d9f99d var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(217 249 157 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-pink-400 { + --tw-gradient-from: #F17EB8 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(241 126 184 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-pink-500 { + --tw-gradient-from: #E74694 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-purple-500 { + --tw-gradient-from: #9061F9 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-purple-600 { + --tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-red-200 { + --tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-red-400 { + --tw-gradient-from: #F98080 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(249 128 128 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-sky-400 { + --tw-gradient-from: #38bdf8 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(56 189 248 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-teal-200 { + --tw-gradient-from: #AFECEF var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-teal-300 { + --tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.from-teal-400 { + --tw-gradient-from: #16BDCA var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(22 189 202 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} +.via-blue-600 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(28 100 242 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #1C64F2 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-cyan-500 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #06b6d4 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-green-500 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(14 159 110 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #0E9F6E var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-lime-400 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(163 230 53 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #a3e635 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-pink-500 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #E74694 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-purple-600 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #7E3AF2 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-red-300 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-red-500 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(240 82 82 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #F05252 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.via-teal-500 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(6 148 162 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #0694A2 var(--tw-gradient-via-position), var(--tw-gradient-to); +} +.to-blue-500 { + --tw-gradient-to: #3F83F8 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-blue-600 { + --tw-gradient-to: #1C64F2 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-blue-700 { + --tw-gradient-to: #1A56DB var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-cyan-600 { + --tw-gradient-to: #0891b2 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-emerald-600 { + --tw-gradient-to: #059669 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-green-600 { + --tw-gradient-to: #057A55 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-lime-200 { + --tw-gradient-to: #d9f99d var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-lime-300 { + --tw-gradient-to: #bef264 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-lime-500 { + --tw-gradient-to: #84cc16 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-orange-400 { + --tw-gradient-to: #FF8A4C var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-pink-500 { + --tw-gradient-to: #E74694 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-pink-600 { + --tw-gradient-to: #D61F69 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-purple-700 { + --tw-gradient-to: #6C2BD9 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-red-600 { + --tw-gradient-to: #E02424 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-teal-600 { + --tw-gradient-to: #047481 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-transparent { + --tw-gradient-to: transparent var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.to-yellow-200 { + --tw-gradient-to: #FCE96A var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} +.bg-cover { + background-size: cover; +} +.bg-local { + background-attachment: local; +} +.bg-clip-text { + -webkit-background-clip: text; + background-clip: text; +} +.bg-center { + background-position: center; +} +.bg-no-repeat { + background-repeat: no-repeat; +} +.fill-blue-600 { + fill: #1C64F2; +} +.fill-gray-500 { + fill: #6B7280; +} +.fill-gray-600 { + fill: #4B5563; +} +.fill-green-500 { + fill: #0E9F6E; +} +.fill-pink-600 { + fill: #D61F69; +} +.fill-purple-600 { + fill: #7E3AF2; +} +.fill-red-600 { + fill: #E02424; +} +.fill-yellow-400 { + fill: #E3A008; +} +.object-cover { + -o-object-fit: cover; + object-fit: cover; +} +.\!p-0 { + padding: 0px !important; +} +.p-0 { + padding: 0px; +} +.p-0\.5 { + padding: 0.125rem; +} +.p-1 { + padding: 0.25rem; +} +.p-1\.5 { + padding: 0.375rem; +} +.p-2 { + padding: 0.5rem; +} +.p-2\.5 { + padding: 0.625rem; +} +.p-3 { + padding: 0.75rem; +} +.p-4 { + padding: 1rem; +} +.p-5 { + padding: 1.25rem; +} +.p-6 { + padding: 1.5rem; +} +.p-8 { + padding: 2rem; +} +.px-0 { + padding-left: 0px; + padding-right: 0px; +} +.px-0\.5 { + padding-left: 0.125rem; + padding-right: 0.125rem; +} +.px-1 { + padding-left: 0.25rem; + padding-right: 0.25rem; +} +.px-1\.5 { + padding-left: 0.375rem; + padding-right: 0.375rem; +} +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} +.px-2\.5 { + padding-left: 0.625rem; + padding-right: 0.625rem; +} +.px-3 { + padding-left: 0.75rem; + padding-right: 0.75rem; +} +.px-4 { + padding-left: 1rem; + padding-right: 1rem; +} +.px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; +} +.px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; +} +.px-8 { + padding-left: 2rem; + padding-right: 2rem; +} +.py-0 { + padding-top: 0px; + padding-bottom: 0px; +} +.py-0\.5 { + padding-top: 0.125rem; + padding-bottom: 0.125rem; +} +.py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} +.py-1\.5 { + padding-top: 0.375rem; + padding-bottom: 0.375rem; +} +.py-12 { + padding-top: 3rem; + padding-bottom: 3rem; +} +.py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} +.py-2\.5 { + padding-top: 0.625rem; + padding-bottom: 0.625rem; +} +.py-24 { + padding-top: 6rem; + padding-bottom: 6rem; +} +.py-3 { + padding-top: 0.75rem; + padding-bottom: 0.75rem; +} +.py-3\.5 { + padding-top: 0.875rem; + padding-bottom: 0.875rem; +} +.py-4 { + padding-top: 1rem; + padding-bottom: 1rem; +} +.py-48 { + padding-top: 12rem; + padding-bottom: 12rem; +} +.py-5 { + padding-top: 1.25rem; + padding-bottom: 1.25rem; +} +.py-6 { + padding-top: 1.5rem; + padding-bottom: 1.5rem; +} +.py-8 { + padding-top: 2rem; + padding-bottom: 2rem; +} +.py-px { + padding-top: 1px; + padding-bottom: 1px; +} +.pb-0 { + padding-bottom: 0px; +} +.pb-1 { + padding-bottom: 0.25rem; +} +.pb-1\.5 { + padding-bottom: 0.375rem; +} +.pb-10 { + padding-bottom: 2.5rem; +} +.pb-16 { + padding-bottom: 4rem; +} +.pb-2 { + padding-bottom: 0.5rem; +} +.pb-2\.5 { + padding-bottom: 0.625rem; +} +.pb-3 { + padding-bottom: 0.75rem; +} +.pb-4 { + padding-bottom: 1rem; +} +.pb-48 { + padding-bottom: 12rem; +} +.pb-5 { + padding-bottom: 1.25rem; +} +.pb-6 { + padding-bottom: 1.5rem; +} +.pb-8 { + padding-bottom: 2rem; +} +.pb-96 { + padding-bottom: 24rem; +} +.pl-0 { + padding-left: 0px; +} +.pl-10 { + padding-left: 2.5rem; +} +.pl-11 { + padding-left: 2.75rem; +} +.pl-2 { + padding-left: 0.5rem; +} +.pl-2\.5 { + padding-left: 0.625rem; +} +.pl-3 { + padding-left: 0.75rem; +} +.pl-3\.5 { + padding-left: 0.875rem; +} +.pl-4 { + padding-left: 1rem; +} +.pl-5 { + padding-left: 1.25rem; +} +.pl-8 { + padding-left: 2rem; +} +.pr-1 { + padding-right: 0.25rem; +} +.pr-3 { + padding-right: 0.75rem; +} +.pr-4 { + padding-right: 1rem; +} +.pt-0 { + padding-top: 0px; +} +.pt-10 { + padding-top: 2.5rem; +} +.pt-16 { + padding-top: 4rem; +} +.pt-2 { + padding-top: 0.5rem; +} +.pt-20 { + padding-top: 5rem; +} +.pt-24 { + padding-top: 6rem; +} +.pt-3 { + padding-top: 0.75rem; +} +.pt-32 { + padding-top: 8rem; +} +.pt-36 { + padding-top: 9rem; +} +.pt-4 { + padding-top: 1rem; +} +.pt-5 { + padding-top: 1.25rem; +} +.pt-52 { + padding-top: 13rem; +} +.pt-6 { + padding-top: 1.5rem; +} +.pt-60 { + padding-top: 15rem; +} +.pt-64 { + padding-top: 16rem; +} +.pt-8 { + padding-top: 2rem; +} +.pt-80 { + padding-top: 20rem; +} +.text-left { + text-align: left; +} +.text-center { + text-align: center; +} +.text-right { + text-align: right; +} +.text-justify { + text-align: justify; +} +.font-sans { + font-family: Inter, ui-sans-serif, system-ui, -apple-system, system-ui, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; +} +.text-2xl { + font-size: 1.5rem; + line-height: 2rem; +} +.text-2xs { + font-size: 0.625rem; +} +.text-3xl { + font-size: 1.875rem; + line-height: 2.25rem; +} +.text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; +} +.text-5xl { + font-size: 3rem; + line-height: 1; +} +.text-6xl { + font-size: 3.75rem; + line-height: 1; +} +.text-7xl { + font-size: 4.5rem; + line-height: 1; +} +.text-8xl { + font-size: 6rem; + line-height: 1; +} +.text-9xl { + font-size: 8rem; + line-height: 1; +} +.text-base { + font-size: 1rem; + line-height: 1.5rem; +} +.text-lg { + font-size: 1.125rem; + line-height: 1.75rem; +} +.text-sm { + font-size: 0.875rem; + line-height: 1.25rem; +} +.text-xl { + font-size: 1.25rem; + line-height: 1.75rem; +} +.text-xs { + font-size: 0.75rem; + line-height: 1rem; +} +.font-black { + font-weight: 900; +} +.font-bold { + font-weight: 700; +} +.font-extrabold { + font-weight: 800; +} +.font-extralight { + font-weight: 200; +} +.font-medium { + font-weight: 500; +} +.font-normal { + font-weight: 400; +} +.font-semibold { + font-weight: 600; +} +.font-thin { + font-weight: 100; +} +.uppercase { + text-transform: uppercase; +} +.lowercase { + text-transform: lowercase; +} +.italic { + font-style: italic; +} +.leading-6 { + line-height: 1.5rem; +} +.leading-9 { + line-height: 2.25rem; +} +.leading-loose { + line-height: 2; +} +.leading-none { + line-height: 1; +} +.leading-normal { + line-height: 1.5; +} +.leading-relaxed { + line-height: 1.625; +} +.leading-tight { + line-height: 1.25; +} +.tracking-normal { + letter-spacing: 0em; +} +.tracking-tight { + letter-spacing: -0.025em; +} +.tracking-tighter { + letter-spacing: -0.05em; +} +.tracking-wide { + letter-spacing: 0.025em; +} +.tracking-wider { + letter-spacing: 0.05em; +} +.tracking-widest { + letter-spacing: 0.1em; +} +.\!text-blue-700 { + --tw-text-opacity: 1 !important; + color: rgb(26 86 219 / var(--tw-text-opacity)) !important; +} +.text-\[\#626890\] { + --tw-text-opacity: 1; + color: rgb(98 104 144 / var(--tw-text-opacity)); +} +.text-\[\#ff2d20\] { + --tw-text-opacity: 1; + color: rgb(255 45 32 / var(--tw-text-opacity)); +} +.text-blue-100 { + --tw-text-opacity: 1; + color: rgb(225 239 254 / var(--tw-text-opacity)); +} +.text-blue-400 { + --tw-text-opacity: 1; + color: rgb(118 169 250 / var(--tw-text-opacity)); +} +.text-blue-50 { + --tw-text-opacity: 1; + color: rgb(235 245 255 / var(--tw-text-opacity)); +} +.text-blue-500 { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); +} +.text-blue-600 { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} +.text-blue-600\/100 { + color: rgb(28 100 242 / 1); +} +.text-blue-600\/25 { + color: rgb(28 100 242 / 0.25); +} +.text-blue-600\/50 { + color: rgb(28 100 242 / 0.5); +} +.text-blue-600\/75 { + color: rgb(28 100 242 / 0.75); +} +.text-blue-700 { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); +} +.text-blue-800 { + --tw-text-opacity: 1; + color: rgb(30 66 159 / var(--tw-text-opacity)); +} +.text-blue-900 { + --tw-text-opacity: 1; + color: rgb(35 56 118 / var(--tw-text-opacity)); +} +.text-gray-200 { + --tw-text-opacity: 1; + color: rgb(229 231 235 / var(--tw-text-opacity)); +} +.text-gray-300 { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} +.text-gray-400 { + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} +.text-gray-500 { + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} +.text-gray-600 { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} +.text-gray-700 { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} +.text-gray-800 { + --tw-text-opacity: 1; + color: rgb(31 41 55 / var(--tw-text-opacity)); +} +.text-gray-900 { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} +.text-green-400 { + --tw-text-opacity: 1; + color: rgb(49 196 141 / var(--tw-text-opacity)); +} +.text-green-500 { + --tw-text-opacity: 1; + color: rgb(14 159 110 / var(--tw-text-opacity)); +} +.text-green-600 { + --tw-text-opacity: 1; + color: rgb(5 122 85 / var(--tw-text-opacity)); +} +.text-green-700 { + --tw-text-opacity: 1; + color: rgb(4 108 78 / var(--tw-text-opacity)); +} +.text-green-800 { + --tw-text-opacity: 1; + color: rgb(3 84 63 / var(--tw-text-opacity)); +} +.text-green-900 { + --tw-text-opacity: 1; + color: rgb(1 71 55 / var(--tw-text-opacity)); +} +.text-indigo-400 { + --tw-text-opacity: 1; + color: rgb(141 162 251 / var(--tw-text-opacity)); +} +.text-indigo-700 { + --tw-text-opacity: 1; + color: rgb(81 69 205 / var(--tw-text-opacity)); +} +.text-indigo-800 { + --tw-text-opacity: 1; + color: rgb(66 56 157 / var(--tw-text-opacity)); +} +.text-orange-500 { + --tw-text-opacity: 1; + color: rgb(255 90 31 / var(--tw-text-opacity)); +} +.text-orange-600 { + --tw-text-opacity: 1; + color: rgb(208 56 1 / var(--tw-text-opacity)); +} +.text-orange-800 { + --tw-text-opacity: 1; + color: rgb(138 44 13 / var(--tw-text-opacity)); +} +.text-pink-400 { + --tw-text-opacity: 1; + color: rgb(241 126 184 / var(--tw-text-opacity)); +} +.text-pink-800 { + --tw-text-opacity: 1; + color: rgb(153 21 75 / var(--tw-text-opacity)); +} +.text-purple-400 { + --tw-text-opacity: 1; + color: rgb(172 148 250 / var(--tw-text-opacity)); +} +.text-purple-600 { + --tw-text-opacity: 1; + color: rgb(126 58 242 / var(--tw-text-opacity)); +} +.text-purple-700 { + --tw-text-opacity: 1; + color: rgb(108 43 217 / var(--tw-text-opacity)); +} +.text-purple-800 { + --tw-text-opacity: 1; + color: rgb(85 33 181 / var(--tw-text-opacity)); +} +.text-red-400 { + --tw-text-opacity: 1; + color: rgb(249 128 128 / var(--tw-text-opacity)); +} +.text-red-500 { + --tw-text-opacity: 1; + color: rgb(240 82 82 / var(--tw-text-opacity)); +} +.text-red-600 { + --tw-text-opacity: 1; + color: rgb(224 36 36 / var(--tw-text-opacity)); +} +.text-red-700 { + --tw-text-opacity: 1; + color: rgb(200 30 30 / var(--tw-text-opacity)); +} +.text-red-800 { + --tw-text-opacity: 1; + color: rgb(155 28 28 / var(--tw-text-opacity)); +} +.text-red-900 { + --tw-text-opacity: 1; + color: rgb(119 29 29 / var(--tw-text-opacity)); +} +.text-sky-500 { + --tw-text-opacity: 1; + color: rgb(14 165 233 / var(--tw-text-opacity)); +} +.text-teal-600 { + --tw-text-opacity: 1; + color: rgb(4 116 129 / var(--tw-text-opacity)); +} +.text-transparent { + color: transparent; +} +.text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} +.text-yellow-300 { + --tw-text-opacity: 1; + color: rgb(250 202 21 / var(--tw-text-opacity)); +} +.text-yellow-400 { + --tw-text-opacity: 1; + color: rgb(227 160 8 / var(--tw-text-opacity)); +} +.text-yellow-500 { + --tw-text-opacity: 1; + color: rgb(194 120 3 / var(--tw-text-opacity)); +} +.text-yellow-700 { + --tw-text-opacity: 1; + color: rgb(142 75 16 / var(--tw-text-opacity)); +} +.text-yellow-800 { + --tw-text-opacity: 1; + color: rgb(114 59 19 / var(--tw-text-opacity)); +} +.underline { + text-decoration-line: underline; +} +.line-through { + text-decoration-line: line-through; +} +.no-underline { + text-decoration-line: none; +} +.decoration-blue-400 { + text-decoration-color: #76A9FA; +} +.decoration-blue-500 { + text-decoration-color: #3F83F8; +} +.decoration-gray-500 { + text-decoration-color: #6B7280; +} +.decoration-green-500 { + text-decoration-color: #0E9F6E; +} +.decoration-indigo-500 { + text-decoration-color: #6875F5; +} +.decoration-red-500 { + text-decoration-color: #F05252; +} +.decoration-sky-500 { + text-decoration-color: #0ea5e9; +} +.decoration-solid { + text-decoration-style: solid; +} +.decoration-double { + text-decoration-style: double; +} +.decoration-dotted { + text-decoration-style: dotted; +} +.decoration-dashed { + text-decoration-style: dashed; +} +.decoration-wavy { + text-decoration-style: wavy; +} +.decoration-8 { + text-decoration-thickness: 8px; +} +.underline-offset-2 { + text-underline-offset: 2px; +} +.antialiased { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.placeholder-green-700::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(4 108 78 / var(--tw-placeholder-opacity)); +} +.placeholder-green-700::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(4 108 78 / var(--tw-placeholder-opacity)); +} +.placeholder-red-700::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(200 30 30 / var(--tw-placeholder-opacity)); +} +.placeholder-red-700::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(200 30 30 / var(--tw-placeholder-opacity)); +} +.opacity-0 { + opacity: 0; +} +.opacity-100 { + opacity: 1; +} +.opacity-20 { + opacity: 0.2; +} +.bg-blend-multiply { + background-blend-mode: multiply; +} +.shadow { + --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} +.shadow-lg { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} +.shadow-md { + --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} +.shadow-sm { + --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} +.shadow-xl { + --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} +.shadow-blue-500\/50 { + --tw-shadow-color: rgb(63 131 248 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-cyan-500\/50 { + --tw-shadow-color: rgb(6 182 212 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-green-500\/50 { + --tw-shadow-color: rgb(14 159 110 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-lime-500\/50 { + --tw-shadow-color: rgb(132 204 22 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-pink-500\/50 { + --tw-shadow-color: rgb(231 70 148 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-purple-500\/50 { + --tw-shadow-color: rgb(144 97 249 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-red-500\/50 { + --tw-shadow-color: rgb(240 82 82 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.shadow-teal-500\/50 { + --tw-shadow-color: rgb(6 148 162 / 0.5); + --tw-shadow: var(--tw-shadow-colored); +} +.outline { + outline-style: solid; +} +.ring-0 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} +.ring-1 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} +.ring-2 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} +.ring-4 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} +.ring-8 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} +.ring-inset { + --tw-ring-inset: inset; +} +.ring-black { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity)); +} +.ring-gray-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity)); +} +.ring-white { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity)); +} +.ring-opacity-0 { + --tw-ring-opacity: 0; +} +.blur { + --tw-blur: blur(8px); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} +.blur-sm { + --tw-blur: blur(4px); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} +.grayscale { + --tw-grayscale: grayscale(100%); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} +.invert { + --tw-invert: invert(100%); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} +.filter { + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} +.transition { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +.transition-all { + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +.transition-colors { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +.transition-opacity { + transition-property: opacity; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +.transition-transform { + transition-property: transform; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +.duration-200 { + transition-duration: 200ms; +} +.duration-300 { + transition-duration: 300ms; +} +.duration-700 { + transition-duration: 700ms; +} +.duration-75 { + transition-duration: 75ms; +} +.ease-in { + transition-timing-function: cubic-bezier(0.4, 0, 1, 1); +} +.ease-in-out { + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); +} +.ease-linear { + transition-timing-function: linear; +} +.ease-out { + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); +} + +/* +“Have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.” +― Steve Jobs +*/ + +.first-letter\:float-left::first-letter { + float: left; +} + +.first-letter\:mr-3::first-letter { + margin-right: 0.75rem; +} + +.first-letter\:text-7xl::first-letter { + font-size: 4.5rem; + line-height: 1; +} + +.first-letter\:font-bold::first-letter { + font-weight: 700; +} + +.first-letter\:text-gray-900::first-letter { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +.first-line\:uppercase::first-line { + text-transform: uppercase; +} + +.first-line\:tracking-widest::first-line { + letter-spacing: 0.1em; +} + +.after\:absolute::after { + content: var(--tw-content); + position: absolute; +} + +.after\:left-\[2px\]::after { + content: var(--tw-content); + left: 2px; +} + +.after\:left-\[4px\]::after { + content: var(--tw-content); + left: 4px; +} + +.after\:top-0::after { + content: var(--tw-content); + top: 0px; +} + +.after\:top-0\.5::after { + content: var(--tw-content); + top: 0.125rem; +} + +.after\:top-\[2px\]::after { + content: var(--tw-content); + top: 2px; +} + +.after\:mx-2::after { + content: var(--tw-content); + margin-left: 0.5rem; + margin-right: 0.5rem; +} + +.after\:mx-6::after { + content: var(--tw-content); + margin-left: 1.5rem; + margin-right: 1.5rem; +} + +.after\:inline-block::after { + content: var(--tw-content); + display: inline-block; +} + +.after\:hidden::after { + content: var(--tw-content); + display: none; +} + +.after\:h-1::after { + content: var(--tw-content); + height: 0.25rem; +} + +.after\:h-4::after { + content: var(--tw-content); + height: 1rem; +} + +.after\:h-5::after { + content: var(--tw-content); + height: 1.25rem; +} + +.after\:h-6::after { + content: var(--tw-content); + height: 1.5rem; +} + +.after\:w-4::after { + content: var(--tw-content); + width: 1rem; +} + +.after\:w-5::after { + content: var(--tw-content); + width: 1.25rem; +} + +.after\:w-6::after { + content: var(--tw-content); + width: 1.5rem; +} + +.after\:w-full::after { + content: var(--tw-content); + width: 100%; +} + +.after\:rounded-full::after { + content: var(--tw-content); + border-radius: 9999px; +} + +.after\:border::after { + content: var(--tw-content); + border-width: 1px; +} + +.after\:border-4::after { + content: var(--tw-content); + border-width: 4px; +} + +.after\:border-b::after { + content: var(--tw-content); + border-bottom-width: 1px; +} + +.after\:border-blue-100::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(225 239 254 / var(--tw-border-opacity)); +} + +.after\:border-gray-100::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(243 244 246 / var(--tw-border-opacity)); +} + +.after\:border-gray-200::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); +} + +.after\:border-gray-300::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-border-opacity)); +} + +.after\:bg-white::after { + content: var(--tw-content); + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.after\:text-gray-200::after { + content: var(--tw-content); + --tw-text-opacity: 1; + color: rgb(229 231 235 / var(--tw-text-opacity)); +} + +.after\:transition-all::after { + content: var(--tw-content); + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.after\:content-\[\'\'\]::after { + --tw-content: ''; + content: var(--tw-content); +} + +.after\:content-\[\'\/\'\]::after { + --tw-content: '/'; + content: var(--tw-content); +} + +.hover\:border-gray-200:hover { + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); +} + +.hover\:border-gray-300:hover { + --tw-border-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-border-opacity)); +} + +.hover\:bg-\[\#050708\]\/80:hover { + background-color: rgb(5 7 8 / 0.8); +} + +.hover\:bg-\[\#050708\]\/90:hover { + background-color: rgb(5 7 8 / 0.9); +} + +.hover\:bg-\[\#1da1f2\]\/90:hover { + background-color: rgb(29 161 242 / 0.9); +} + +.hover\:bg-\[\#24292F\]\/90:hover { + background-color: rgb(36 41 47 / 0.9); +} + +.hover\:bg-\[\#2557D6\]\/90:hover { + background-color: rgb(37 87 214 / 0.9); +} + +.hover\:bg-\[\#3b5998\]\/90:hover { + background-color: rgb(59 89 152 / 0.9); +} + +.hover\:bg-\[\#4285F4\]\/90:hover { + background-color: rgb(66 133 244 / 0.9); +} + +.hover\:bg-\[\#F7BE38\]\/90:hover { + background-color: rgb(247 190 56 / 0.9); +} + +.hover\:bg-\[\#FF9119\]\/80:hover { + background-color: rgb(255 145 25 / 0.8); +} + +.hover\:bg-blue-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(225 239 254 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(195 221 253 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(63 131 248 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(26 86 219 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(30 66 159 / var(--tw-bg-opacity)); +} + +.hover\:bg-blue-900:hover { + --tw-bg-opacity: 1; + background-color: rgb(35 56 118 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-300:hover { + --tw-bg-opacity: 1; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-50:hover { + --tw-bg-opacity: 1; + background-color: rgb(249 250 251 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(107 114 128 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-600:hover { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-900:hover { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); +} + +.hover\:bg-green-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(188 240 218 / var(--tw-bg-opacity)); +} + +.hover\:bg-green-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(3 84 63 / var(--tw-bg-opacity)); +} + +.hover\:bg-green-900:hover { + --tw-bg-opacity: 1; + background-color: rgb(1 71 55 / var(--tw-bg-opacity)); +} + +.hover\:bg-indigo-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(205 219 254 / var(--tw-bg-opacity)); +} + +.hover\:bg-pink-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(250 209 232 / var(--tw-bg-opacity)); +} + +.hover\:bg-purple-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(220 215 254 / var(--tw-bg-opacity)); +} + +.hover\:bg-purple-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(85 33 181 / var(--tw-bg-opacity)); +} + +.hover\:bg-red-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(251 213 213 / var(--tw-bg-opacity)); +} + +.hover\:bg-red-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(155 28 28 / var(--tw-bg-opacity)); +} + +.hover\:bg-red-900:hover { + --tw-bg-opacity: 1; + background-color: rgb(119 29 29 / var(--tw-bg-opacity)); +} + +.hover\:bg-white:hover { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.hover\:bg-yellow-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(252 233 106 / var(--tw-bg-opacity)); +} + +.hover\:bg-yellow-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(194 120 3 / var(--tw-bg-opacity)); +} + +.hover\:bg-yellow-900:hover { + --tw-bg-opacity: 1; + background-color: rgb(99 49 18 / var(--tw-bg-opacity)); +} + +.hover\:bg-gradient-to-bl:hover { + background-image: linear-gradient(to bottom left, var(--tw-gradient-stops)); +} + +.hover\:bg-gradient-to-br:hover { + background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); +} + +.hover\:bg-gradient-to-l:hover { + background-image: linear-gradient(to left, var(--tw-gradient-stops)); +} + +.hover\:from-teal-200:hover { + --tw-gradient-from: #AFECEF var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.hover\:to-lime-200:hover { + --tw-gradient-to: #d9f99d var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.hover\:\!text-blue-700:hover { + --tw-text-opacity: 1 !important; + color: rgb(26 86 219 / var(--tw-text-opacity)) !important; +} + +.hover\:text-blue-600:hover { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} + +.hover\:text-blue-700:hover { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); +} + +.hover\:text-blue-800:hover { + --tw-text-opacity: 1; + color: rgb(30 66 159 / var(--tw-text-opacity)); +} + +.hover\:text-blue-900:hover { + --tw-text-opacity: 1; + color: rgb(35 56 118 / var(--tw-text-opacity)); +} + +.hover\:text-gray-500:hover { + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} + +.hover\:text-gray-600:hover { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} + +.hover\:text-gray-700:hover { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} + +.hover\:text-gray-800:hover { + --tw-text-opacity: 1; + color: rgb(31 41 55 / var(--tw-text-opacity)); +} + +.hover\:text-gray-900:hover { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +.hover\:text-green-900:hover { + --tw-text-opacity: 1; + color: rgb(1 71 55 / var(--tw-text-opacity)); +} + +.hover\:text-indigo-900:hover { + --tw-text-opacity: 1; + color: rgb(54 47 120 / var(--tw-text-opacity)); +} + +.hover\:text-pink-900:hover { + --tw-text-opacity: 1; + color: rgb(117 26 61 / var(--tw-text-opacity)); +} + +.hover\:text-purple-900:hover { + --tw-text-opacity: 1; + color: rgb(74 29 150 / var(--tw-text-opacity)); +} + +.hover\:text-red-900:hover { + --tw-text-opacity: 1; + color: rgb(119 29 29 / var(--tw-text-opacity)); +} + +.hover\:text-white:hover { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.hover\:text-yellow-900:hover { + --tw-text-opacity: 1; + color: rgb(99 49 18 / var(--tw-text-opacity)); +} + +.hover\:underline:hover { + text-decoration-line: underline; +} + +.hover\:no-underline:hover { + text-decoration-line: none; +} + +.hover\:bg-blend-soft-light:hover { + background-blend-mode: soft-light; +} + +.hover\:shadow:hover { + --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.hover\:blur-none:hover { + --tw-blur: blur(0); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.hover\:grayscale-0:hover { + --tw-grayscale: grayscale(0); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.focus\:z-10:focus { + z-index: 10; +} + +.focus\:border-blue-500:focus { + --tw-border-opacity: 1; + border-color: rgb(63 131 248 / var(--tw-border-opacity)); +} + +.focus\:border-blue-600:focus { + --tw-border-opacity: 1; + border-color: rgb(28 100 242 / var(--tw-border-opacity)); +} + +.focus\:border-gray-200:focus { + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); +} + +.focus\:border-green-500:focus { + --tw-border-opacity: 1; + border-color: rgb(14 159 110 / var(--tw-border-opacity)); +} + +.focus\:border-green-600:focus { + --tw-border-opacity: 1; + border-color: rgb(5 122 85 / var(--tw-border-opacity)); +} + +.focus\:border-red-500:focus { + --tw-border-opacity: 1; + border-color: rgb(240 82 82 / var(--tw-border-opacity)); +} + +.focus\:border-red-600:focus { + --tw-border-opacity: 1; + border-color: rgb(224 36 36 / var(--tw-border-opacity)); +} + +.focus\:bg-gray-100:focus { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + +.focus\:bg-gray-900:focus { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); +} + +.focus\:text-blue-700:focus { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); +} + +.focus\:text-white:focus { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.focus\:outline-none:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.focus\:ring-0:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\:ring-2:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\:ring-4:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\:ring-\[\#050708\]\/50:focus { + --tw-ring-color: rgb(5 7 8 / 0.5); +} + +.focus\:ring-\[\#1da1f2\]\/50:focus { + --tw-ring-color: rgb(29 161 242 / 0.5); +} + +.focus\:ring-\[\#24292F\]\/50:focus { + --tw-ring-color: rgb(36 41 47 / 0.5); +} + +.focus\:ring-\[\#2557D6\]\/50:focus { + --tw-ring-color: rgb(37 87 214 / 0.5); +} + +.focus\:ring-\[\#3b5998\]\/50:focus { + --tw-ring-color: rgb(59 89 152 / 0.5); +} + +.focus\:ring-\[\#4285F4\]\/50:focus { + --tw-ring-color: rgb(66 133 244 / 0.5); +} + +.focus\:ring-\[\#F7BE38\]\/50:focus { + --tw-ring-color: rgb(247 190 56 / 0.5); +} + +.focus\:ring-\[\#FF9119\]\/50:focus { + --tw-ring-color: rgb(255 145 25 / 0.5); +} + +.focus\:ring-blue-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity)); +} + +.focus\:ring-blue-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity)); +} + +.focus\:ring-blue-400:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity)); +} + +.focus\:ring-blue-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity)); +} + +.focus\:ring-blue-600:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity)); +} + +.focus\:ring-blue-700:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(26 86 219 / var(--tw-ring-opacity)); +} + +.focus\:ring-cyan-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(165 243 252 / var(--tw-ring-opacity)); +} + +.focus\:ring-cyan-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(103 232 249 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-100:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(243 244 246 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-400:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-50:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(249 250 251 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity)); +} + +.focus\:ring-gray-700:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity)); +} + +.focus\:ring-green-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(188 240 218 / var(--tw-ring-opacity)); +} + +.focus\:ring-green-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(132 225 188 / var(--tw-ring-opacity)); +} + +.focus\:ring-green-400:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(49 196 141 / var(--tw-ring-opacity)); +} + +.focus\:ring-green-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(14 159 110 / var(--tw-ring-opacity)); +} + +.focus\:ring-lime-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(217 249 157 / var(--tw-ring-opacity)); +} + +.focus\:ring-lime-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(190 242 100 / var(--tw-ring-opacity)); +} + +.focus\:ring-orange-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(255 90 31 / var(--tw-ring-opacity)); +} + +.focus\:ring-pink-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(250 209 232 / var(--tw-ring-opacity)); +} + +.focus\:ring-pink-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(248 180 217 / var(--tw-ring-opacity)); +} + +.focus\:ring-purple-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(220 215 254 / var(--tw-ring-opacity)); +} + +.focus\:ring-purple-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(202 191 253 / var(--tw-ring-opacity)); +} + +.focus\:ring-purple-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(144 97 249 / var(--tw-ring-opacity)); +} + +.focus\:ring-red-100:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(253 232 232 / var(--tw-ring-opacity)); +} + +.focus\:ring-red-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(248 180 180 / var(--tw-ring-opacity)); +} + +.focus\:ring-red-400:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity)); +} + +.focus\:ring-red-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity)); +} + +.focus\:ring-teal-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(126 220 226 / var(--tw-ring-opacity)); +} + +.focus\:ring-teal-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(6 148 162 / var(--tw-ring-opacity)); +} + +.focus\:ring-yellow-300:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(250 202 21 / var(--tw-ring-opacity)); +} + +.focus\:ring-yellow-400:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(227 160 8 / var(--tw-ring-opacity)); +} + +.focus\:ring-yellow-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(194 120 3 / var(--tw-ring-opacity)); +} + +.group:hover .group-hover\:rotate-45 { + --tw-rotate: 45deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.group:hover .group-hover\:bg-white\/50 { + background-color: rgb(255 255 255 / 0.5); +} + +.group:hover .group-hover\:bg-opacity-0 { + --tw-bg-opacity: 0; +} + +.group:hover .group-hover\:from-cyan-500 { + --tw-gradient-from: #06b6d4 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:from-green-400 { + --tw-gradient-from: #31C48D var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:from-pink-500 { + --tw-gradient-from: #E74694 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:from-purple-500 { + --tw-gradient-from: #9061F9 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:from-purple-600 { + --tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:from-red-200 { + --tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:from-teal-300 { + --tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.group:hover .group-hover\:via-red-300 { + --tw-gradient-via-position: ; + --tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to); +} + +.group:hover .group-hover\:to-blue-500 { + --tw-gradient-to: #3F83F8 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.group:hover .group-hover\:to-blue-600 { + --tw-gradient-to: #1C64F2 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.group:hover .group-hover\:to-lime-300 { + --tw-gradient-to: #bef264 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.group:hover .group-hover\:to-orange-400 { + --tw-gradient-to: #FF8A4C var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.group:hover .group-hover\:to-pink-500 { + --tw-gradient-to: #E74694 var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.group:hover .group-hover\:to-yellow-200 { + --tw-gradient-to: #FCE96A var(--tw-gradient-to-position); + --tw-gradient-to-position: ; +} + +.group:hover .group-hover\:text-blue-600 { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} + +.group:hover .group-hover\:text-gray-500 { + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} + +.group:hover .group-hover\:text-gray-900 { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +.group:hover .group-hover\:opacity-100 { + opacity: 1; +} + +.group:focus .group-focus\:text-gray-900 { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +.group:focus .group-focus\:outline-none { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.group:focus .group-focus\:ring-4 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.group:focus .group-focus\:ring-white { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity)); +} + +.peer:checked ~ .peer-checked\:border-blue-600 { + --tw-border-opacity: 1; + border-color: rgb(28 100 242 / var(--tw-border-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-blue-600 { + --tw-bg-opacity: 1; + background-color: rgb(28 100 242 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-green-600 { + --tw-bg-opacity: 1; + background-color: rgb(5 122 85 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-orange-500 { + --tw-bg-opacity: 1; + background-color: rgb(255 90 31 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-purple-600 { + --tw-bg-opacity: 1; + background-color: rgb(126 58 242 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-red-600 { + --tw-bg-opacity: 1; + background-color: rgb(224 36 36 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-teal-600 { + --tw-bg-opacity: 1; + background-color: rgb(4 116 129 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:bg-yellow-400 { + --tw-bg-opacity: 1; + background-color: rgb(227 160 8 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:text-blue-600 { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} + +.peer:checked ~ .peer-checked\:text-gray-600 { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} + +.peer:checked ~ .peer-checked\:after\:translate-x-full::after { + content: var(--tw-content); + --tw-translate-x: 100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:checked ~ .peer-checked\:after\:border-white::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} + +.peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:top-1\/2 { + top: 50%; +} + +.peer:placeholder-shown ~ .peer-placeholder-shown\:top-1\/2 { + top: 50%; +} + +.peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:-translate-y-1\/2 { + --tw-translate-y: -50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:placeholder-shown ~ .peer-placeholder-shown\:-translate-y-1\/2 { + --tw-translate-y: -50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:translate-y-0 { + --tw-translate-y: 0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:placeholder-shown ~ .peer-placeholder-shown\:translate-y-0 { + --tw-translate-y: 0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:scale-100 { + --tw-scale-x: 1; + --tw-scale-y: 1; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:placeholder-shown ~ .peer-placeholder-shown\:scale-100 { + --tw-scale-x: 1; + --tw-scale-y: 1; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:focus ~ .peer-focus\:left-0 { + left: 0px; +} + +.peer:focus ~ .peer-focus\:top-1 { + top: 0.25rem; +} + +.peer:focus ~ .peer-focus\:top-2 { + top: 0.5rem; +} + +.peer:focus ~ .peer-focus\:-translate-y-3 { + --tw-translate-y: -0.75rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:focus ~ .peer-focus\:-translate-y-4 { + --tw-translate-y: -1rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:focus ~ .peer-focus\:-translate-y-6 { + --tw-translate-y: -1.5rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:focus ~ .peer-focus\:scale-75 { + --tw-scale-x: .75; + --tw-scale-y: .75; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:focus ~ .peer-focus\:px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.peer:focus ~ .peer-focus\:font-medium { + font-weight: 500; +} + +.peer:focus ~ .peer-focus\:text-blue-600 { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} + +.peer:focus ~ .peer-focus\:outline-none { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.peer:focus ~ .peer-focus\:ring-4 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.peer:focus ~ .peer-focus\:ring-blue-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity)); +} + +.peer:focus ~ .peer-focus\:ring-green-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(132 225 188 / var(--tw-ring-opacity)); +} + +.peer:focus ~ .peer-focus\:ring-orange-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(253 186 140 / var(--tw-ring-opacity)); +} + +.peer:focus ~ .peer-focus\:ring-purple-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(202 191 253 / var(--tw-ring-opacity)); +} + +.peer:focus ~ .peer-focus\:ring-red-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(248 180 180 / var(--tw-ring-opacity)); +} + +.peer:focus ~ .peer-focus\:ring-teal-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(126 220 226 / var(--tw-ring-opacity)); +} + +.peer:focus ~ .peer-focus\:ring-yellow-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(250 202 21 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:block) { + display: block; +} + +:is(.dark .dark\:inline-block) { + display: inline-block; +} + +:is(.dark .dark\:hidden) { + display: none; +} + +:is(.dark .dark\:divide-gray-600) > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(75 85 99 / var(--tw-divide-opacity)); +} + +:is(.dark .dark\:divide-gray-700) > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(55 65 81 / var(--tw-divide-opacity)); +} + +:is(.dark .dark\:\!border-blue-500) { + --tw-border-opacity: 1 !important; + border-color: rgb(63 131 248 / var(--tw-border-opacity)) !important; +} + +:is(.dark .dark\:border-blue-400) { + --tw-border-opacity: 1; + border-color: rgb(118 169 250 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-blue-500) { + --tw-border-opacity: 1; + border-color: rgb(63 131 248 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-blue-600) { + --tw-border-opacity: 1; + border-color: rgb(28 100 242 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-blue-800) { + --tw-border-opacity: 1; + border-color: rgb(30 66 159 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-gray-400) { + --tw-border-opacity: 1; + border-color: rgb(156 163 175 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-gray-500) { + --tw-border-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-gray-600) { + --tw-border-opacity: 1; + border-color: rgb(75 85 99 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-gray-700) { + --tw-border-opacity: 1; + border-color: rgb(55 65 81 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-gray-800) { + --tw-border-opacity: 1; + border-color: rgb(31 41 55 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-gray-900) { + --tw-border-opacity: 1; + border-color: rgb(17 24 39 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-green-400) { + --tw-border-opacity: 1; + border-color: rgb(49 196 141 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-green-500) { + --tw-border-opacity: 1; + border-color: rgb(14 159 110 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-green-600) { + --tw-border-opacity: 1; + border-color: rgb(5 122 85 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-green-800) { + --tw-border-opacity: 1; + border-color: rgb(3 84 63 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-purple-400) { + --tw-border-opacity: 1; + border-color: rgb(172 148 250 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-red-400) { + --tw-border-opacity: 1; + border-color: rgb(249 128 128 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-red-500) { + --tw-border-opacity: 1; + border-color: rgb(240 82 82 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-red-600) { + --tw-border-opacity: 1; + border-color: rgb(224 36 36 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-red-800) { + --tw-border-opacity: 1; + border-color: rgb(155 28 28 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-transparent) { + border-color: transparent; +} + +:is(.dark .dark\:border-white) { + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-yellow-300) { + --tw-border-opacity: 1; + border-color: rgb(250 202 21 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-yellow-800) { + --tw-border-opacity: 1; + border-color: rgb(114 59 19 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:border-l-gray-700) { + --tw-border-opacity: 1; + border-left-color: rgb(55 65 81 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:bg-blue-200) { + --tw-bg-opacity: 1; + background-color: rgb(195 221 253 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-blue-400) { + --tw-bg-opacity: 1; + background-color: rgb(118 169 250 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-blue-500) { + --tw-bg-opacity: 1; + background-color: rgb(63 131 248 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-blue-600) { + --tw-bg-opacity: 1; + background-color: rgb(28 100 242 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-blue-800) { + --tw-bg-opacity: 1; + background-color: rgb(30 66 159 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-blue-900) { + --tw-bg-opacity: 1; + background-color: rgb(35 56 118 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-300) { + --tw-bg-opacity: 1; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-400) { + --tw-bg-opacity: 1; + background-color: rgb(156 163 175 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-500) { + --tw-bg-opacity: 1; + background-color: rgb(107 114 128 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-600) { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-700) { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-800) { + --tw-bg-opacity: 1; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-800\/30) { + background-color: rgb(31 41 55 / 0.3); +} + +:is(.dark .dark\:bg-gray-800\/50) { + background-color: rgb(31 41 55 / 0.5); +} + +:is(.dark .dark\:bg-gray-900) { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-gray-900\/60) { + background-color: rgb(17 24 39 / 0.6); +} + +:is(.dark .dark\:bg-green-100) { + --tw-bg-opacity: 1; + background-color: rgb(222 247 236 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-green-500) { + --tw-bg-opacity: 1; + background-color: rgb(14 159 110 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-green-600) { + --tw-bg-opacity: 1; + background-color: rgb(5 122 85 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-green-800) { + --tw-bg-opacity: 1; + background-color: rgb(3 84 63 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-green-900) { + --tw-bg-opacity: 1; + background-color: rgb(1 71 55 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-indigo-500) { + --tw-bg-opacity: 1; + background-color: rgb(104 117 245 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-indigo-900) { + --tw-bg-opacity: 1; + background-color: rgb(54 47 120 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-orange-200) { + --tw-bg-opacity: 1; + background-color: rgb(252 217 189 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-orange-400) { + --tw-bg-opacity: 1; + background-color: rgb(255 138 76 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-orange-700) { + --tw-bg-opacity: 1; + background-color: rgb(180 52 3 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-pink-900) { + --tw-bg-opacity: 1; + background-color: rgb(117 26 61 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-purple-500) { + --tw-bg-opacity: 1; + background-color: rgb(144 97 249 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-purple-600) { + --tw-bg-opacity: 1; + background-color: rgb(126 58 242 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-purple-900) { + --tw-bg-opacity: 1; + background-color: rgb(74 29 150 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-red-100) { + --tw-bg-opacity: 1; + background-color: rgb(253 232 232 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-red-500) { + --tw-bg-opacity: 1; + background-color: rgb(240 82 82 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-red-600) { + --tw-bg-opacity: 1; + background-color: rgb(224 36 36 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-red-800) { + --tw-bg-opacity: 1; + background-color: rgb(155 28 28 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-red-900) { + --tw-bg-opacity: 1; + background-color: rgb(119 29 29 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-white) { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-yellow-300) { + --tw-bg-opacity: 1; + background-color: rgb(250 202 21 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-yellow-900) { + --tw-bg-opacity: 1; + background-color: rgb(99 49 18 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:bg-opacity-80) { + --tw-bg-opacity: 0.8; +} + +:is(.dark .dark\:bg-\[url\(\'https\:\/\/flowbite\.s3\.amazonaws\.com\/docs\/jumbotron\/hero-pattern-dark\.svg\'\)\]) { + background-image: url('https://flowbite.s3.amazonaws.com/docs/jumbotron/hero-pattern-dark.svg'); +} + +:is(.dark .dark\:from-blue-900) { + --tw-gradient-from: #233876 var(--tw-gradient-from-position); + --tw-gradient-from-position: ; + --tw-gradient-to: rgb(35 56 118 / 0) var(--tw-gradient-from-position); + --tw-gradient-to-position: ; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +:is(.dark .dark\:fill-gray-300) { + fill: #D1D5DB; +} + +:is(.dark .dark\:fill-gray-400) { + fill: #9CA3AF; +} + +:is(.dark .dark\:\!text-blue-500) { + --tw-text-opacity: 1 !important; + color: rgb(63 131 248 / var(--tw-text-opacity)) !important; +} + +:is(.dark .dark\:text-blue-100) { + --tw-text-opacity: 1; + color: rgb(225 239 254 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-blue-200) { + --tw-text-opacity: 1; + color: rgb(195 221 253 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-blue-300) { + --tw-text-opacity: 1; + color: rgb(164 202 254 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-blue-400) { + --tw-text-opacity: 1; + color: rgb(118 169 250 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-blue-500) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-blue-500\/100) { + color: rgb(63 131 248 / 1); +} + +:is(.dark .dark\:text-blue-500\/25) { + color: rgb(63 131 248 / 0.25); +} + +:is(.dark .dark\:text-blue-500\/50) { + color: rgb(63 131 248 / 0.5); +} + +:is(.dark .dark\:text-blue-500\/75) { + color: rgb(63 131 248 / 0.75); +} + +:is(.dark .dark\:text-blue-600) { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-blue-800) { + --tw-text-opacity: 1; + color: rgb(30 66 159 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-100) { + --tw-text-opacity: 1; + color: rgb(243 244 246 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-200) { + --tw-text-opacity: 1; + color: rgb(229 231 235 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-300) { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-400) { + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-500) { + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-600) { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-700) { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-800) { + --tw-text-opacity: 1; + color: rgb(31 41 55 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-gray-900) { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-green-200) { + --tw-text-opacity: 1; + color: rgb(188 240 218 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-green-300) { + --tw-text-opacity: 1; + color: rgb(132 225 188 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-green-400) { + --tw-text-opacity: 1; + color: rgb(49 196 141 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-green-500) { + --tw-text-opacity: 1; + color: rgb(14 159 110 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-green-600) { + --tw-text-opacity: 1; + color: rgb(5 122 85 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-indigo-300) { + --tw-text-opacity: 1; + color: rgb(180 198 252 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-indigo-400) { + --tw-text-opacity: 1; + color: rgb(141 162 251 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-indigo-500) { + --tw-text-opacity: 1; + color: rgb(104 117 245 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-orange-200) { + --tw-text-opacity: 1; + color: rgb(252 217 189 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-orange-300) { + --tw-text-opacity: 1; + color: rgb(253 186 140 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-orange-900) { + --tw-text-opacity: 1; + color: rgb(119 29 29 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-pink-300) { + --tw-text-opacity: 1; + color: rgb(248 180 217 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-pink-400) { + --tw-text-opacity: 1; + color: rgb(241 126 184 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-purple-300) { + --tw-text-opacity: 1; + color: rgb(202 191 253 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-purple-400) { + --tw-text-opacity: 1; + color: rgb(172 148 250 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-purple-500) { + --tw-text-opacity: 1; + color: rgb(144 97 249 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-red-200) { + --tw-text-opacity: 1; + color: rgb(251 213 213 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-red-300) { + --tw-text-opacity: 1; + color: rgb(248 180 180 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-red-400) { + --tw-text-opacity: 1; + color: rgb(249 128 128 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-red-500) { + --tw-text-opacity: 1; + color: rgb(240 82 82 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-teal-300) { + --tw-text-opacity: 1; + color: rgb(126 220 226 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-white) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-yellow-300) { + --tw-text-opacity: 1; + color: rgb(250 202 21 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:text-yellow-500) { + --tw-text-opacity: 1; + color: rgb(194 120 3 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:decoration-blue-600) { + text-decoration-color: #1C64F2; +} + +:is(.dark .dark\:placeholder-gray-400)::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(156 163 175 / var(--tw-placeholder-opacity)); +} + +:is(.dark .dark\:placeholder-gray-400)::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(156 163 175 / var(--tw-placeholder-opacity)); +} + +:is(.dark .dark\:placeholder-green-500)::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(14 159 110 / var(--tw-placeholder-opacity)); +} + +:is(.dark .dark\:placeholder-green-500)::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(14 159 110 / var(--tw-placeholder-opacity)); +} + +:is(.dark .dark\:placeholder-red-500)::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(240 82 82 / var(--tw-placeholder-opacity)); +} + +:is(.dark .dark\:placeholder-red-500)::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(240 82 82 / var(--tw-placeholder-opacity)); +} + +:is(.dark .dark\:shadow-lg) { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +:is(.dark .dark\:shadow-sm-light) { + --tw-shadow: 0 2px 5px 0px rgba(255, 255, 255, 0.08); + --tw-shadow-colored: 0 2px 5px 0px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +:is(.dark .dark\:shadow-blue-800\/80) { + --tw-shadow-color: rgb(30 66 159 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-cyan-800\/80) { + --tw-shadow-color: rgb(21 94 117 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-gray-800) { + --tw-shadow-color: #1F2937; + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-green-800\/80) { + --tw-shadow-color: rgb(3 84 63 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-lime-800\/80) { + --tw-shadow-color: rgb(63 98 18 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-pink-800\/80) { + --tw-shadow-color: rgb(153 21 75 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-purple-800\/80) { + --tw-shadow-color: rgb(85 33 181 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-red-800\/80) { + --tw-shadow-color: rgb(155 28 28 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:shadow-teal-800\/80) { + --tw-shadow-color: rgb(5 80 92 / 0.8); + --tw-shadow: var(--tw-shadow-colored); +} + +:is(.dark .dark\:ring-gray-500) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:ring-gray-900) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(17 24 39 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:ring-offset-gray-700) { + --tw-ring-offset-color: #374151; +} + +:is(.dark .dark\:ring-offset-gray-800) { + --tw-ring-offset-color: #1F2937; +} + +:is(.dark .dark\:first-letter\:text-gray-100)::first-letter { + --tw-text-opacity: 1; + color: rgb(243 244 246 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:after\:border-blue-800)::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(30 66 159 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:after\:border-gray-700)::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(55 65 81 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:after\:text-gray-500)::after { + content: var(--tw-content); + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:border-gray-500:hover) { + --tw-border-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:hover\:border-gray-600:hover) { + --tw-border-opacity: 1; + border-color: rgb(75 85 99 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:hover\:border-gray-700:hover) { + --tw-border-opacity: 1; + border-color: rgb(55 65 81 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:hover\:bg-\[\#050708\]\/30:hover) { + background-color: rgb(5 7 8 / 0.3); +} + +:is(.dark .dark\:hover\:bg-\[\#050708\]\/40:hover) { + background-color: rgb(5 7 8 / 0.4); +} + +:is(.dark .dark\:hover\:bg-\[\#FF9119\]\/80:hover) { + background-color: rgb(255 145 25 / 0.8); +} + +:is(.dark .dark\:hover\:bg-blue-500:hover) { + --tw-bg-opacity: 1; + background-color: rgb(63 131 248 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-blue-600:hover) { + --tw-bg-opacity: 1; + background-color: rgb(28 100 242 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-blue-700:hover) { + --tw-bg-opacity: 1; + background-color: rgb(26 86 219 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-blue-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(30 66 159 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-gray-200:hover) { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-gray-500:hover) { + --tw-bg-opacity: 1; + background-color: rgb(107 114 128 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-gray-600:hover) { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-gray-700:hover) { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-gray-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-green-600:hover) { + --tw-bg-opacity: 1; + background-color: rgb(5 122 85 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-green-700:hover) { + --tw-bg-opacity: 1; + background-color: rgb(4 108 78 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-green-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(3 84 63 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-indigo-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(66 56 157 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-pink-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(153 21 75 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-purple-500:hover) { + --tw-bg-opacity: 1; + background-color: rgb(144 97 249 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-purple-700:hover) { + --tw-bg-opacity: 1; + background-color: rgb(108 43 217 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-purple-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(85 33 181 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-red-600:hover) { + --tw-bg-opacity: 1; + background-color: rgb(224 36 36 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-red-700:hover) { + --tw-bg-opacity: 1; + background-color: rgb(200 30 30 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-red-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(155 28 28 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-yellow-300:hover) { + --tw-bg-opacity: 1; + background-color: rgb(250 202 21 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-yellow-400:hover) { + --tw-bg-opacity: 1; + background-color: rgb(227 160 8 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:bg-yellow-800:hover) { + --tw-bg-opacity: 1; + background-color: rgb(114 59 19 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:hover\:\!text-blue-500:hover) { + --tw-text-opacity: 1 !important; + color: rgb(63 131 248 / var(--tw-text-opacity)) !important; +} + +:is(.dark .dark\:hover\:text-blue-300:hover) { + --tw-text-opacity: 1; + color: rgb(164 202 254 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-blue-400:hover) { + --tw-text-opacity: 1; + color: rgb(118 169 250 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-blue-500:hover) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-blue-600:hover) { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-blue-700:hover) { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-gray-300:hover) { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-gray-400:hover) { + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-gray-800:hover) { + --tw-text-opacity: 1; + color: rgb(31 41 55 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-gray-900:hover) { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-green-300:hover) { + --tw-text-opacity: 1; + color: rgb(132 225 188 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-indigo-300:hover) { + --tw-text-opacity: 1; + color: rgb(180 198 252 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-pink-300:hover) { + --tw-text-opacity: 1; + color: rgb(248 180 217 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-purple-300:hover) { + --tw-text-opacity: 1; + color: rgb(202 191 253 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-red-300:hover) { + --tw-text-opacity: 1; + color: rgb(248 180 180 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-white:hover) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:text-yellow-300:hover) { + --tw-text-opacity: 1; + color: rgb(250 202 21 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:hover\:bg-blend-darken:hover) { + background-blend-mode: darken; +} + +:is(.dark .dark\:focus\:border-blue-500:focus) { + --tw-border-opacity: 1; + border-color: rgb(63 131 248 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:focus\:border-green-500:focus) { + --tw-border-opacity: 1; + border-color: rgb(14 159 110 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:focus\:border-red-500:focus) { + --tw-border-opacity: 1; + border-color: rgb(240 82 82 / var(--tw-border-opacity)); +} + +:is(.dark .dark\:focus\:bg-blue-600:focus) { + --tw-bg-opacity: 1; + background-color: rgb(28 100 242 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:focus\:bg-gray-700:focus) { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +:is(.dark .dark\:focus\:text-white:focus) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +:is(.dark .dark\:focus\:ring-\[\#050708\]\/50:focus) { + --tw-ring-color: rgb(5 7 8 / 0.5); +} + +:is(.dark .dark\:focus\:ring-\[\#2557D6\]\/50:focus) { + --tw-ring-color: rgb(37 87 214 / 0.5); +} + +:is(.dark .dark\:focus\:ring-\[\#F7BE38\]\/50:focus) { + --tw-ring-color: rgb(247 190 56 / 0.5); +} + +:is(.dark .dark\:focus\:ring-\[\#FF9119\]\/40:focus) { + --tw-ring-color: rgb(255 145 25 / 0.4); +} + +:is(.dark .dark\:focus\:ring-blue-500:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-blue-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-blue-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-blue-900:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(35 56 118 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-cyan-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-gray-400:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-gray-500:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-gray-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-gray-700:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-gray-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-green-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(5 122 85 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-green-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-lime-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-orange-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(208 56 1 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-pink-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-purple-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(126 58 242 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-purple-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-purple-900:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-red-400:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-red-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(224 36 36 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-red-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-red-900:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-teal-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(4 116 129 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-teal-700:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-teal-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-yellow-600:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(159 88 10 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-yellow-800:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(114 59 19 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-yellow-900:focus) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity)); +} + +:is(.dark .dark\:focus\:ring-offset-gray-700:focus) { + --tw-ring-offset-color: #374151; +} + +:is(.dark .dark\:focus\:ring-offset-gray-800:focus) { + --tw-ring-offset-color: #1F2937; +} + +:is(.dark .group:hover .dark\:group-hover\:bg-gray-800\/60) { + background-color: rgb(31 41 55 / 0.6); +} + +:is(.dark .group:hover .dark\:group-hover\:text-blue-500) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); +} + +:is(.dark .group:hover .dark\:group-hover\:text-gray-300) { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} + +:is(.dark .group:hover .dark\:group-hover\:text-white) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +:is(.dark .group:focus .dark\:group-focus\:text-white) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +:is(.dark .group:focus .dark\:group-focus\:ring-gray-800\/70) { + --tw-ring-color: rgb(31 41 55 / 0.7); +} + +:is(.dark .peer:checked ~ .dark\:peer-checked\:text-blue-500) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); +} + +:is(.dark .peer:checked ~ .dark\:peer-checked\:text-gray-300) { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} + +.peer:focus ~ :is(.dark .peer-focus\:dark\:text-blue-500) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-blue-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-green-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-orange-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(138 44 13 / var(--tw-ring-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-purple-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-red-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-teal-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity)); +} + +:is(.dark .peer:focus ~ .dark\:peer-focus\:ring-yellow-800) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(114 59 19 / var(--tw-ring-opacity)); +} + +@media (min-width: 640px) { + + .sm\:order-last { + order: 9999; + } + + .sm\:col-span-1 { + grid-column: span 1 / span 1; + } + + .sm\:col-span-3 { + grid-column: span 3 / span 3; + } + + .sm\:mx-auto { + margin-left: auto; + margin-right: auto; + } + + .sm\:mb-0 { + margin-bottom: 0px; + } + + .sm\:mb-4 { + margin-bottom: 1rem; + } + + .sm\:mb-5 { + margin-bottom: 1.25rem; + } + + .sm\:ml-2 { + margin-left: 0.5rem; + } + + .sm\:ml-4 { + margin-left: 1rem; + } + + .sm\:ml-64 { + margin-left: 16rem; + } + + .sm\:ml-auto { + margin-left: auto; + } + + .sm\:mt-0 { + margin-top: 0px; + } + + .sm\:block { + display: block; + } + + .sm\:flex { + display: flex; + } + + .sm\:inline-flex { + display: inline-flex; + } + + .sm\:grid { + display: grid; + } + + .sm\:hidden { + display: none; + } + + .sm\:h-4 { + height: 1rem; + } + + .sm\:h-64 { + height: 16rem; + } + + .sm\:h-7 { + height: 1.75rem; + } + + .sm\:h-9 { + height: 2.25rem; + } + + .sm\:h-96 { + height: 24rem; + } + + .sm\:w-4 { + width: 1rem; + } + + .sm\:w-96 { + width: 24rem; + } + + .sm\:w-auto { + width: auto; + } + + .sm\:translate-x-0 { + --tw-translate-x: 0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); + } + + .sm\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .sm\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + + .sm\:flex-row { + flex-direction: row; + } + + .sm\:items-center { + align-items: center; + } + + .sm\:justify-center { + justify-content: center; + } + + .sm\:justify-between { + justify-content: space-between; + } + + .sm\:gap-6 { + gap: 1.5rem; + } + + .sm\:space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1rem * var(--tw-space-x-reverse)); + margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); + } + + .sm\:space-x-8 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(2rem * var(--tw-space-x-reverse)); + margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))); + } + + .sm\:space-y-0 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0px * var(--tw-space-y-reverse)); + } + + .sm\:divide-x > :not([hidden]) ~ :not([hidden]) { + --tw-divide-x-reverse: 0; + border-right-width: calc(1px * var(--tw-divide-x-reverse)); + border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))); + } + + .sm\:rounded-lg { + border-radius: 0.5rem; + } + + .sm\:border-b-0 { + border-bottom-width: 0px; + } + + .sm\:border-r { + border-right-width: 1px; + } + + .sm\:p-4 { + padding: 1rem; + } + + .sm\:p-6 { + padding: 1.5rem; + } + + .sm\:p-8 { + padding: 2rem; + } + + .sm\:px-16 { + padding-left: 4rem; + padding-right: 4rem; + } + + .sm\:px-4 { + padding-left: 1rem; + padding-right: 1rem; + } + + .sm\:px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; + } + + .sm\:py-16 { + padding-top: 4rem; + padding-bottom: 4rem; + } + + .sm\:py-4 { + padding-top: 1rem; + padding-bottom: 1rem; + } + + .sm\:pb-4 { + padding-bottom: 1rem; + } + + .sm\:pl-2 { + padding-left: 0.5rem; + } + + .sm\:pl-4 { + padding-left: 1rem; + } + + .sm\:pr-4 { + padding-right: 1rem; + } + + .sm\:pr-8 { + padding-right: 2rem; + } + + .sm\:pt-4 { + padding-top: 1rem; + } + + .sm\:text-center { + text-align: center; + } + + .sm\:text-2xl { + font-size: 1.5rem; + line-height: 2rem; + } + + .sm\:text-base { + font-size: 1rem; + line-height: 1.5rem; + } + + .sm\:text-lg { + font-size: 1.125rem; + line-height: 1.75rem; + } + + .sm\:text-xl { + font-size: 1.25rem; + line-height: 1.75rem; + } + + .sm\:text-xs { + font-size: 0.75rem; + line-height: 1rem; + } + + .sm\:ring-8 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); + } + + .sm\:after\:inline-block::after { + content: var(--tw-content); + display: inline-block; + } + + .sm\:after\:hidden::after { + content: var(--tw-content); + display: none; + } + + .sm\:after\:content-\[\'\'\]::after { + --tw-content: ''; + content: var(--tw-content); + } +} + +@media (min-width: 768px) { + + .md\:relative { + position: relative; + } + + .md\:inset-0 { + inset: 0px; + } + + .md\:right-auto { + right: auto; + } + + .md\:top-auto { + top: auto; + } + + .md\:order-1 { + order: 1; + } + + .md\:order-2 { + order: 2; + } + + .md\:m-0 { + margin: 0px; + } + + .md\:mx-2 { + margin-left: 0.5rem; + margin-right: 0.5rem; + } + + .md\:my-0 { + margin-top: 0px; + margin-bottom: 0px; + } + + .md\:my-10 { + margin-top: 2.5rem; + margin-bottom: 2.5rem; + } + + .md\:my-12 { + margin-top: 3rem; + margin-bottom: 3rem; + } + + .md\:mb-0 { + margin-bottom: 0px; + } + + .md\:mb-12 { + margin-bottom: 3rem; + } + + .md\:ml-1 { + margin-left: 0.25rem; + } + + .md\:ml-2 { + margin-left: 0.5rem; + } + + .md\:mr-0 { + margin-right: 0px; + } + + .md\:mr-2 { + margin-right: 0.5rem; + } + + .md\:mr-24 { + margin-right: 6rem; + } + + .md\:mr-4 { + margin-right: 1rem; + } + + .md\:mr-6 { + margin-right: 1.5rem; + } + + .md\:mt-0 { + margin-top: 0px; + } + + .md\:mt-6 { + margin-top: 1.5rem; + } + + .md\:block { + display: block; + } + + .md\:inline { + display: inline; + } + + .md\:flex { + display: flex; + } + + .md\:inline-flex { + display: inline-flex; + } + + .md\:grid { + display: grid; + } + + .md\:hidden { + display: none; + } + + .md\:h-96 { + height: 24rem; + } + + .md\:h-\[21px\] { + height: 21px; + } + + .md\:h-\[262px\] { + height: 262px; + } + + .md\:h-\[278px\] { + height: 278px; + } + + .md\:h-\[294px\] { + height: 294px; + } + + .md\:h-\[42px\] { + height: 42px; + } + + .md\:h-\[654px\] { + height: 654px; + } + + .md\:h-\[682px\] { + height: 682px; + } + + .md\:h-\[8px\] { + height: 8px; + } + + .md\:h-\[95px\] { + height: 95px; + } + + .md\:h-auto { + height: auto; + } + + .md\:w-48 { + width: 12rem; + } + + .md\:w-64 { + width: 16rem; + } + + .md\:w-\[96px\] { + width: 96px; + } + + .md\:w-auto { + width: auto; + } + + .md\:w-full { + width: 100%; + } + + .md\:max-w-\[142px\] { + max-width: 142px; + } + + .md\:max-w-\[512px\] { + max-width: 512px; + } + + .md\:max-w-\[597px\] { + max-width: 597px; + } + + .md\:max-w-screen-md { + max-width: 768px; + } + + .md\:max-w-xl { + max-width: 36rem; + } + + .md\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .md\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + + .md\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + + .md\:flex-row { + flex-direction: row; + } + + .md\:items-center { + align-items: center; + } + + .md\:justify-between { + justify-content: space-between; + } + + .md\:gap-12 { + gap: 3rem; + } + + .md\:gap-6 { + gap: 1.5rem; + } + + .md\:gap-8 { + gap: 2rem; + } + + .md\:space-x-2 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.5rem * var(--tw-space-x-reverse)); + margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))); + } + + .md\:space-x-3 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.75rem * var(--tw-space-x-reverse)); + margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse))); + } + + .md\:space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1rem * var(--tw-space-x-reverse)); + margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); + } + + .md\:space-x-8 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(2rem * var(--tw-space-x-reverse)); + margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))); + } + + .md\:space-y-0 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0px * var(--tw-space-y-reverse)); + } + + .md\:rounded-none { + border-radius: 0px; + } + + .md\:rounded-l-lg { + border-top-left-radius: 0.5rem; + border-bottom-left-radius: 0.5rem; + } + + .md\:rounded-t-none { + border-top-left-radius: 0px; + border-top-right-radius: 0px; + } + + .md\:rounded-br-lg { + border-bottom-right-radius: 0.5rem; + } + + .md\:rounded-tl-lg { + border-top-left-radius: 0.5rem; + } + + .md\:border-0 { + border-width: 0px; + } + + .md\:border-b-0 { + border-bottom-width: 0px; + } + + .md\:border-r { + border-right-width: 1px; + } + + .md\:bg-transparent { + background-color: transparent; + } + + .md\:bg-white { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + } + + .md\:p-0 { + padding: 0px; + } + + .md\:p-12 { + padding: 3rem; + } + + .md\:p-6 { + padding: 1.5rem; + } + + .md\:p-8 { + padding: 2rem; + } + + .md\:px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; + } + + .md\:px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; + } + + .md\:py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + } + + .md\:py-2\.5 { + padding-top: 0.625rem; + padding-bottom: 0.625rem; + } + + .md\:py-8 { + padding-top: 2rem; + padding-bottom: 2rem; + } + + .md\:pb-0 { + padding-bottom: 0px; + } + + .md\:pb-4 { + padding-bottom: 1rem; + } + + .md\:pr-4 { + padding-right: 1rem; + } + + .md\:pt-0 { + padding-top: 0px; + } + + .md\:text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; + } + + .md\:text-5xl { + font-size: 3rem; + line-height: 1; + } + + .md\:text-lg { + font-size: 1.125rem; + line-height: 1.75rem; + } + + .md\:text-sm { + font-size: 0.875rem; + line-height: 1.25rem; + } + + .md\:text-xl { + font-size: 1.25rem; + line-height: 1.75rem; + } + + .md\:font-medium { + font-weight: 500; + } + + .md\:text-blue-700 { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); + } + + .md\:text-green-700 { + --tw-text-opacity: 1; + color: rgb(4 108 78 / var(--tw-text-opacity)); + } + + .md\:hover\:bg-transparent:hover { + background-color: transparent; + } + + .md\:hover\:text-blue-600:hover { + --tw-text-opacity: 1; + color: rgb(28 100 242 / var(--tw-text-opacity)); + } + + .md\:hover\:text-blue-700:hover { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); + } + + .md\:hover\:text-green-700:hover { + --tw-text-opacity: 1; + color: rgb(4 108 78 / var(--tw-text-opacity)); + } + + :is(.dark .md\:dark\:bg-gray-900) { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); + } + + :is(.dark .md\:dark\:bg-transparent) { + background-color: transparent; + } + + :is(.dark .md\:dark\:text-blue-500) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); + } + + :is(.dark .md\:dark\:text-white) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); + } + + :is(.dark .md\:dark\:hover\:bg-transparent:hover) { + background-color: transparent; + } + + :is(.dark .md\:dark\:hover\:text-blue-500:hover) { + --tw-text-opacity: 1; + color: rgb(63 131 248 / var(--tw-text-opacity)); + } + + :is(.dark .md\:dark\:hover\:text-white:hover) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); + } +} + +@media (min-width: 1024px) { + + .lg\:static { + position: static; + } + + .lg\:sticky { + position: sticky; + } + + .lg\:top-28 { + top: 7rem; + } + + .lg\:order-1 { + order: 1; + } + + .lg\:order-2 { + order: 2; + } + + .lg\:col-span-5 { + grid-column: span 5 / span 5; + } + + .lg\:col-span-7 { + grid-column: span 7 / span 7; + } + + .lg\:my-12 { + margin-top: 3rem; + margin-bottom: 3rem; + } + + .lg\:my-8 { + margin-top: 2rem; + margin-bottom: 2rem; + } + + .lg\:mb-0 { + margin-bottom: 0px; + } + + .lg\:mb-16 { + margin-bottom: 4rem; + } + + .lg\:mb-8 { + margin-bottom: 2rem; + } + + .lg\:mr-0 { + margin-right: 0px; + } + + .lg\:mt-0 { + margin-top: 0px; + } + + .lg\:mt-10 { + margin-top: 2.5rem; + } + + .lg\:block { + display: block; + } + + .lg\:flex { + display: flex; + } + + .lg\:grid { + display: grid; + } + + .lg\:hidden { + display: none; + } + + .lg\:h-12 { + height: 3rem; + } + + .lg\:h-4 { + height: 1rem; + } + + .lg\:h-5 { + height: 1.25rem; + } + + .lg\:h-6 { + height: 1.5rem; + } + + .lg\:h-\[calc\(100vh-3rem\)\] { + height: calc(100vh - 3rem); + } + + .lg\:h-auto { + height: auto; + } + + .lg\:max-h-full { + max-height: 100%; + } + + .lg\:w-12 { + width: 3rem; + } + + .lg\:w-4 { + width: 1rem; + } + + .lg\:w-48 { + width: 12rem; + } + + .lg\:w-5 { + width: 1.25rem; + } + + .lg\:w-6 { + width: 1.5rem; + } + + .lg\:w-96 { + width: 24rem; + } + + .lg\:w-auto { + width: auto; + } + + .lg\:max-w-7xl { + max-width: 80rem; + } + + .lg\:max-w-screen-lg { + max-width: 1024px; + } + + .lg\:max-w-xl { + max-width: 36rem; + } + + .lg\:grid-cols-12 { + grid-template-columns: repeat(12, minmax(0, 1fr)); + } + + .lg\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .lg\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + + .lg\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + + .lg\:flex-row { + flex-direction: row; + } + + .lg\:gap-16 { + gap: 4rem; + } + + .lg\:gap-8 { + gap: 2rem; + } + + .lg\:space-x-8 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(2rem * var(--tw-space-x-reverse)); + margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))); + } + + .lg\:self-center { + align-self: center; + } + + .lg\:overflow-visible { + overflow: visible; + } + + .lg\:overflow-y-visible { + overflow-y: visible; + } + + .lg\:border-0 { + border-width: 0px; + } + + .lg\:bg-transparent { + background-color: transparent; + } + + .lg\:p-0 { + padding: 0px; + } + + .lg\:p-8 { + padding: 2rem; + } + + .lg\:px-12 { + padding-left: 3rem; + padding-right: 3rem; + } + + .lg\:px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; + } + + .lg\:px-36 { + padding-left: 9rem; + padding-right: 9rem; + } + + .lg\:px-4 { + padding-left: 1rem; + padding-right: 1rem; + } + + .lg\:px-48 { + padding-left: 12rem; + padding-right: 12rem; + } + + .lg\:px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; + } + + .lg\:px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; + } + + .lg\:px-8 { + padding-left: 2rem; + padding-right: 2rem; + } + + .lg\:py-0 { + padding-top: 0px; + padding-bottom: 0px; + } + + .lg\:py-16 { + padding-top: 4rem; + padding-bottom: 4rem; + } + + .lg\:py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + } + + .lg\:py-2\.5 { + padding-top: 0.625rem; + padding-bottom: 0.625rem; + } + + .lg\:py-4 { + padding-top: 1rem; + padding-bottom: 1rem; + } + + .lg\:py-56 { + padding-top: 14rem; + padding-bottom: 14rem; + } + + .lg\:py-8 { + padding-top: 2rem; + padding-bottom: 2rem; + } + + .lg\:pb-16 { + padding-bottom: 4rem; + } + + .lg\:pb-20 { + padding-bottom: 5rem; + } + + .lg\:pl-0 { + padding-left: 0px; + } + + .lg\:pl-3 { + padding-left: 0.75rem; + } + + .lg\:pt-0 { + padding-top: 0px; + } + + .lg\:pt-2 { + padding-top: 0.5rem; + } + + .lg\:pt-8 { + padding-top: 2rem; + } + + .lg\:text-2xl { + font-size: 1.5rem; + line-height: 2rem; + } + + .lg\:text-6xl { + font-size: 3.75rem; + line-height: 1; + } + + .lg\:text-sm { + font-size: 0.875rem; + line-height: 1.25rem; + } + + .lg\:text-xl { + font-size: 1.25rem; + line-height: 1.75rem; + } + + .lg\:text-xs { + font-size: 0.75rem; + line-height: 1rem; + } + + .lg\:text-blue-700 { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); + } + + .lg\:hover\:bg-transparent:hover { + background-color: transparent; + } + + .lg\:hover\:text-blue-700:hover { + --tw-text-opacity: 1; + color: rgb(26 86 219 / var(--tw-text-opacity)); + } + + :is(.dark .lg\:dark\:hover\:bg-transparent:hover) { + background-color: transparent; + } + + :is(.dark .lg\:dark\:hover\:text-white:hover) { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); + } +} + +@media (min-width: 1280px) { + + .xl\:ml-16 { + margin-left: 4rem; + } + + .xl\:block { + display: block; + } + + .xl\:inline-flex { + display: inline-flex; + } + + .xl\:hidden { + display: none; + } + + .xl\:h-80 { + height: 20rem; + } + + .xl\:grid-cols-6 { + grid-template-columns: repeat(6, minmax(0, 1fr)); + } + + .xl\:gap-0 { + gap: 0px; + } + + .xl\:gap-16 { + gap: 4rem; + } + + .xl\:gap-24 { + gap: 6rem; + } + + .xl\:px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; + } + + .xl\:px-48 { + padding-left: 12rem; + padding-right: 12rem; + } + + .xl\:pb-24 { + padding-bottom: 6rem; + } + + .xl\:pl-4 { + padding-left: 1rem; + } + + .xl\:pt-24 { + padding-top: 6rem; + } + + .xl\:text-6xl { + font-size: 3.75rem; + line-height: 1; + } + + .xl\:text-sm { + font-size: 0.875rem; + line-height: 1.25rem; + } + + .xl\:after\:mx-10::after { + content: var(--tw-content); + margin-left: 2.5rem; + margin-right: 2.5rem; + } +} + +@media (min-width: 1536px) { + + .\32xl\:block { + display: block; + } + + .\32xl\:h-96 { + height: 24rem; + } + + .\32xl\:grid-cols-10 { + grid-template-columns: repeat(10, minmax(0, 1fr)); + } + + .\32xl\:gap-x-2 { + -moz-column-gap: 0.5rem; + column-gap: 0.5rem; + } + + .\32xl\:space-x-0 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0px * var(--tw-space-x-reverse)); + margin-left: calc(0px * calc(1 - var(--tw-space-x-reverse))); + } +} + +.\[\&\>div\]\:mx-auto>div { + margin-left: auto; + margin-right: auto; +} diff --git a/node_modules/flowbite/dist/flowbite.js b/node_modules/flowbite/dist/flowbite.js new file mode 100644 index 0000000..e127c7a --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.js @@ -0,0 +1,4434 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("Flowbite", [], factory); + else if(typeof exports === 'object') + exports["Flowbite"] = factory(); + else + root["Flowbite"] = factory(); +})(self, function() { +return /******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ 647: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ 853: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "afterMain": function() { return /* reexport */ afterMain; }, + "afterRead": function() { return /* reexport */ afterRead; }, + "afterWrite": function() { return /* reexport */ afterWrite; }, + "applyStyles": function() { return /* reexport */ modifiers_applyStyles; }, + "arrow": function() { return /* reexport */ modifiers_arrow; }, + "auto": function() { return /* reexport */ auto; }, + "basePlacements": function() { return /* reexport */ basePlacements; }, + "beforeMain": function() { return /* reexport */ beforeMain; }, + "beforeRead": function() { return /* reexport */ beforeRead; }, + "beforeWrite": function() { return /* reexport */ beforeWrite; }, + "bottom": function() { return /* reexport */ bottom; }, + "clippingParents": function() { return /* reexport */ clippingParents; }, + "computeStyles": function() { return /* reexport */ modifiers_computeStyles; }, + "createPopper": function() { return /* reexport */ popper_createPopper; }, + "createPopperBase": function() { return /* reexport */ createPopper; }, + "createPopperLite": function() { return /* reexport */ popper_lite_createPopper; }, + "detectOverflow": function() { return /* reexport */ detectOverflow; }, + "end": function() { return /* reexport */ end; }, + "eventListeners": function() { return /* reexport */ eventListeners; }, + "flip": function() { return /* reexport */ modifiers_flip; }, + "hide": function() { return /* reexport */ modifiers_hide; }, + "left": function() { return /* reexport */ left; }, + "main": function() { return /* reexport */ main; }, + "modifierPhases": function() { return /* reexport */ modifierPhases; }, + "offset": function() { return /* reexport */ modifiers_offset; }, + "placements": function() { return /* reexport */ enums_placements; }, + "popper": function() { return /* reexport */ popper; }, + "popperGenerator": function() { return /* reexport */ popperGenerator; }, + "popperOffsets": function() { return /* reexport */ modifiers_popperOffsets; }, + "preventOverflow": function() { return /* reexport */ modifiers_preventOverflow; }, + "read": function() { return /* reexport */ read; }, + "reference": function() { return /* reexport */ reference; }, + "right": function() { return /* reexport */ right; }, + "start": function() { return /* reexport */ start; }, + "top": function() { return /* reexport */ enums_top; }, + "variationPlacements": function() { return /* reexport */ variationPlacements; }, + "viewport": function() { return /* reexport */ viewport; }, + "write": function() { return /* reexport */ write; } +}); + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js +var enums_top = 'top'; +var bottom = 'bottom'; +var right = 'right'; +var left = 'left'; +var auto = 'auto'; +var basePlacements = [enums_top, bottom, right, left]; +var start = 'start'; +var end = 'end'; +var clippingParents = 'clippingParents'; +var viewport = 'viewport'; +var popper = 'popper'; +var reference = 'reference'; +var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); +}, []); +var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +}, []); // modifiers that need to read the DOM + +var beforeRead = 'beforeRead'; +var read = 'read'; +var afterRead = 'afterRead'; // pure-logic modifiers + +var beforeMain = 'beforeMain'; +var main = 'main'; +var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) + +var beforeWrite = 'beforeWrite'; +var write = 'write'; +var afterWrite = 'afterWrite'; +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +function getNodeName(element) { + return element ? (element.nodeName || '').toLowerCase() : null; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js +function getWindow(node) { + if (node == null) { + return window; + } + + if (node.toString() !== '[object Window]') { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + + return node; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js + + +function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; +} + +function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; +} + +function isShadowRoot(node) { + // IE 11 has no ShadowRoot + if (typeof ShadowRoot === 'undefined') { + return false; + } + + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js + + // This modifier takes the styles prepared by the `computeStyles` modifier +// and applies them to the HTMLElements such as popper and arrow + +function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function (name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } // Flow doesn't support to extend this property, but it's the most + // effective way to apply styles to an HTMLElement + // $FlowFixMe[cannot-write] + + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (name) { + var value = attributes[name]; + + if (value === false) { + element.removeAttribute(name); + } else { + element.setAttribute(name, value === true ? '' : value); + } + }); + }); +} + +function effect(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: '0', + top: '0', + margin: '0' + }, + arrow: { + position: 'absolute' + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + + return function () { + Object.keys(state.elements).forEach(function (name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them + + var style = styleProperties.reduce(function (style, property) { + style[property] = ''; + return style; + }, {}); // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (attribute) { + element.removeAttribute(attribute); + }); + }); + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_applyStyles = ({ + name: 'applyStyles', + enabled: true, + phase: 'write', + fn: applyStyles, + effect: effect, + requires: ['computeStyles'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js + +function getBasePlacement(placement) { + return placement.split('-')[0]; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js +var math_max = Math.max; +var math_min = Math.min; +var round = Math.round; +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/userAgent.js +function getUAString() { + var uaData = navigator.userAgentData; + + if (uaData != null && uaData.brands) { + return uaData.brands.map(function (item) { + return item.brand + "/" + item.version; + }).join(' '); + } + + return navigator.userAgent; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js + +function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js + + + + +function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; + } + + var _ref = isElement(element) ? getWindow(element) : window, + visualViewport = _ref.visualViewport; + + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width: width, + height: height, + top: y, + right: x + width, + bottom: y + height, + left: x, + x: x, + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js + // Returns the layout rect of an element relative to its offsetParent. Layout +// means it doesn't take into account transforms. + +function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. + // Fixes https://github.com/popperjs/popper-core/issues/1223 + + var width = element.offsetWidth; + var height = element.offsetHeight; + + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + + return { + x: element.offsetLeft, + y: element.offsetTop, + width: width, + height: height + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js + +function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method + + if (parent.contains(child)) { + return true; + } // then fallback to custom implementation with Shadow DOM support + else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + + + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false + + + return false; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js + +function getComputedStyle(element) { + return getWindow(element).getComputedStyle(element); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js + +function isTableElement(element) { + return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js + +function getDocumentElement(element) { + // $FlowFixMe[incompatible-return]: assume body is always available + return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] + element.document) || window.document).documentElement; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js + + + +function getParentNode(element) { + if (getNodeName(element) === 'html') { + return element; + } + + return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || ( // DOM Element detected + isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) // fallback + + ); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js + + + + + + + + +function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle(element).position === 'fixed') { + return null; + } + + return element.offsetParent; +} // `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block + + +function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + + if (isIE && isHTMLElement(element)) { + // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport + var elementCss = getComputedStyle(element); + + if (elementCss.position === 'fixed') { + return null; + } + } + + var currentNode = getParentNode(element); + + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + + while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that + // create a containing block. + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + + if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + + return null; +} // Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. + + +function getOffsetParent(element) { + var window = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { + offsetParent = getTrueOffsetParent(offsetParent); + } + + if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { + return window; + } + + return offsetParent || getContainingBlock(element) || window; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +function getMainAxisFromPlacement(placement) { + return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js + +function within(min, value, max) { + return math_max(min, math_min(value, max)); +} +function withinMaxClamp(min, value, max) { + var v = within(min, value, max); + return v > max ? max : v; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js + +function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js +function expandToHashMap(value, keys) { + return keys.reduce(function (hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js + + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var toPaddingObject = function toPaddingObject(padding, state) { + padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +}; + +function arrow(_ref) { + var _state$modifiersData$; + + var state = _ref.state, + name = _ref.name, + options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? 'height' : 'width'; + + if (!arrowElement || !popperOffsets) { + return; + } + + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === 'y' ? enums_top : left; + var maxProp = axis === 'y' ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; + var startDiff = popperOffsets[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is + // outside of the popper bounds + + var min = paddingObject[minProp]; + var max = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset = within(min, center, max); // Prevents breaking syntax highlighting... + + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); +} + +function arrow_effect(_ref2) { + var state = _ref2.state, + options = _ref2.options; + var _options$element = options.element, + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + + if (arrowElement == null) { + return; + } // CSS selector + + + if (typeof arrowElement === 'string') { + arrowElement = state.elements.popper.querySelector(arrowElement); + + if (!arrowElement) { + return; + } + } + + if (false) {} + + if (!contains(state.elements.popper, arrowElement)) { + if (false) {} + + return; + } + + state.elements.arrow = arrowElement; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_arrow = ({ + name: 'arrow', + enabled: true, + phase: 'main', + fn: arrow, + effect: arrow_effect, + requires: ['popperOffsets'], + requiresIfExists: ['preventOverflow'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js +function getVariation(placement) { + return placement.split('-')[1]; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var unsetSides = { + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto' +}; // Round the offsets to the nearest suitable subpixel based on the DPR. +// Zooming can change the DPR, but it seems to report a value that will +// cleanly divide the values into the appropriate subpixels. + +function roundOffsetsByDPR(_ref) { + var x = _ref.x, + y = _ref.y; + var win = window; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x * dpr) / dpr || 0, + y: round(y * dpr) / dpr || 0 + }; +} + +function mapToStyles(_ref2) { + var _Object$assign2; + + var popper = _ref2.popper, + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets, + isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, + x = _offsets$x === void 0 ? 0 : _offsets$x, + _offsets$y = offsets.y, + y = _offsets$y === void 0 ? 0 : _offsets$y; + + var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty('x'); + var hasY = offsets.hasOwnProperty('y'); + var sideX = left; + var sideY = enums_top; + var win = window; + + if (adaptive) { + var offsetParent = getOffsetParent(popper); + var heightProp = 'clientHeight'; + var widthProp = 'clientWidth'; + + if (offsetParent === getWindow(popper)) { + offsetParent = getDocumentElement(popper); + + if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { + heightProp = 'scrollHeight'; + widthProp = 'scrollWidth'; + } + } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it + + + offsetParent = offsetParent; + + if (placement === enums_top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] + offsetParent[heightProp]; + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + + if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] + offsetParent[widthProp]; + x -= offsetX - popperRect.width; + x *= gpuAcceleration ? 1 : -1; + } + } + + var commonStyles = Object.assign({ + position: position + }, adaptive && unsetSides); + + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref4.x; + y = _ref4.y; + + if (gpuAcceleration) { + var _Object$assign; + + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + } + + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +} + +function computeStyles(_ref5) { + var state = _ref5.state, + options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + + if (false) { var transitionProperty; } + + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration: gpuAcceleration, + isFixed: state.options.strategy === 'fixed' + }; + + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive: adaptive, + roundOffsets: roundOffsets + }))); + } + + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: 'absolute', + adaptive: false, + roundOffsets: roundOffsets + }))); + } + + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-placement': state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_computeStyles = ({ + name: 'computeStyles', + enabled: true, + phase: 'beforeWrite', + fn: computeStyles, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js + // eslint-disable-next-line import/no-unused-modules + +var passive = { + passive: true +}; + +function eventListeners_effect(_ref) { + var state = _ref.state, + instance = _ref.instance, + options = _ref.options; + var _options$scroll = options.scroll, + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; + var window = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.addEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.addEventListener('resize', instance.update, passive); + } + + return function () { + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.removeEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.removeEventListener('resize', instance.update, passive); + } + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var eventListeners = ({ + name: 'eventListeners', + enabled: true, + phase: 'write', + fn: function fn() {}, + effect: eventListeners_effect, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +var hash = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +var getOppositeVariationPlacement_hash = { + start: 'end', + end: 'start' +}; +function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function (matched) { + return getOppositeVariationPlacement_hash[matched]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js + +function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft: scrollLeft, + scrollTop: scrollTop + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js + + + +function getWindowScrollBarX(element) { + // If has a CSS width greater than the viewport, then this will be + // incorrect for RTL. + // Popper 1 is broken in this case and never had a bug report so let's assume + // it's not an issue. I don't think anyone ever specifies width on + // anyway. + // Browsers where the left scrollbar doesn't cause an issue report `0` for + // this (e.g. Edge 2019, IE11, Safari) + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js + + + + +function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x = 0; + var y = 0; + + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + + if (layoutViewport || !layoutViewport && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + + return { + width: width, + height: height, + x: x + getWindowScrollBarX(element), + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js + + + + + // Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable + +function getDocumentRect(element) { + var _element$ownerDocumen; + + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y = -winScroll.scrollTop; + + if (getComputedStyle(body || html).direction === 'rtl') { + x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + + return { + width: width, + height: height, + x: x, + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js + +function isScrollParent(element) { + // Firefox wants us to check `-x` and `-y` variations as well + var _getComputedStyle = getComputedStyle(element), + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; + + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js + + + + +function getScrollParent(node) { + if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { + // $FlowFixMe[incompatible-return]: assume body is always available + return node.ownerDocument.body; + } + + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + + return getScrollParent(getParentNode(node)); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js + + + + +/* +given a DOM element, return the list of all scroll parents, up the list of ancesors +until we get to the top window object. This list is what we attach scroll listeners +to, because if any of these parent elements scroll, we'll need to re-calculate the +reference element's position. +*/ + +function listScrollParents(element, list) { + var _element$ownerDocumen; + + if (list === void 0) { + list = []; + } + + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js +function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js + + + + + + + + + + + + + + + +function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === 'fixed'); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; +} + +function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +} // A "clipping parent" is an overflowable container with the characteristic of +// clipping (or hiding) overflowing elements with a position different from +// `initial` + + +function getClippingParents(element) { + var clippingParents = listScrollParents(getParentNode(element)); + var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + + if (!isElement(clipperElement)) { + return []; + } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 + + + return clippingParents.filter(function (clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; + }); +} // Gets the maximum area that the element is visible in due to any number of +// clipping parents + + +function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); + var clippingParents = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents[0]; + var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = math_max(rect.top, accRect.top); + accRect.right = math_min(rect.right, accRect.right); + accRect.bottom = math_min(rect.bottom, accRect.bottom); + accRect.left = math_max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js + + + + +function computeOffsets(_ref) { + var reference = _ref.reference, + element = _ref.element, + placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference.x + reference.width / 2 - element.width / 2; + var commonY = reference.y + reference.height / 2 - element.height / 2; + var offsets; + + switch (basePlacement) { + case enums_top: + offsets = { + x: commonX, + y: reference.y - element.height + }; + break; + + case bottom: + offsets = { + x: commonX, + y: reference.y + reference.height + }; + break; + + case right: + offsets = { + x: reference.x + reference.width, + y: commonY + }; + break; + + case left: + offsets = { + x: reference.x - element.width, + y: commonY + }; + break; + + default: + offsets = { + x: reference.x, + y: reference.y + }; + } + + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + + if (mainAxis != null) { + var len = mainAxis === 'y' ? 'height' : 'width'; + + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); + break; + + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); + break; + + default: + } + } + + return offsets; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + _options$placement = _options.placement, + placement = _options$placement === void 0 ? state.placement : _options$placement, + _options$strategy = _options.strategy, + strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, + _options$boundary = _options.boundary, + boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: 'absolute', + placement: placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect + // 0 or negative = within the clipping rect + + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element + + if (elementContext === popper && offsetData) { + var offset = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function (key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; + overflowOffsets[key] += offset[axis] * multiply; + }); + } + + return overflowOffsets; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js + + + + +function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { + return getVariation(placement) === variation; + }) : basePlacements; + var allowedPlacements = placements.filter(function (placement) { + return allowedAutoPlacements.indexOf(placement) >= 0; + }); + + if (allowedPlacements.length === 0) { + allowedPlacements = placements; + + if (false) {} + } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... + + + var overflows = allowedPlacements.reduce(function (acc, placement) { + acc[placement] = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding + })[getBasePlacement(placement)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function (a, b) { + return overflows[a] - overflows[b]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; +} + +function flip(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + + if (state.modifiersData[name]._skip) { + return; + } + + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { + return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + flipVariations: flipVariations, + allowedAutoPlacements: allowedAutoPlacements + }) : placement); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements[0]; + + for (var i = 0; i < placements.length; i++) { + var placement = placements[i]; + + var _basePlacement = getBasePlacement(placement); + + var isStartVariation = getVariation(placement) === start; + var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? 'width' : 'height'; + var overflow = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + altBoundary: altBoundary, + padding: padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; + + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + + if (checks.every(function (check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + + checksMap.set(placement, checks); + } + + if (makeFallbackChecks) { + // `2` may be desired in some cases – research later + var numberOfChecks = flipVariations ? 3 : 1; + + var _loop = function _loop(_i) { + var fittingPlacement = placements.find(function (placement) { + var checks = checksMap.get(placement); + + if (checks) { + return checks.slice(0, _i).every(function (check) { + return check; + }); + } + }); + + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + + if (_ret === "break") break; + } + } + + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_flip = ({ + name: 'flip', + enabled: true, + phase: 'main', + fn: flip, + requiresIfExists: ['offset'], + data: { + _skip: false + } +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js + + + +function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; +} + +function isAnySideFullyClipped(overflow) { + return [enums_top, right, bottom, left].some(function (side) { + return overflow[side] >= 0; + }); +} + +function hide(_ref) { + var state = _ref.state, + name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: 'reference' + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets: referenceClippingOffsets, + popperEscapeOffsets: popperEscapeOffsets, + isReferenceHidden: isReferenceHidden, + hasPopperEscaped: hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-reference-hidden': isReferenceHidden, + 'data-popper-escaped': hasPopperEscaped + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_hide = ({ + name: 'hide', + enabled: true, + phase: 'main', + requiresIfExists: ['preventOverflow'], + fn: hide +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js + + // eslint-disable-next-line import/no-unused-modules + +function distanceAndSkiddingToXY(placement, rects, offset) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; + + var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { + placement: placement + })) : offset, + skidding = _ref[0], + distance = _ref[1]; + + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; +} + +function offset(_ref2) { + var state = _ref2.state, + options = _ref2.options, + name = _ref2.name; + var _options$offset = options.offset, + offset = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = enums_placements.reduce(function (acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); + return acc; + }, {}); + var _data$state$placement = data[state.placement], + x = _data$state$placement.x, + y = _data$state$placement.y; + + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x; + state.modifiersData.popperOffsets.y += y; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_offset = ({ + name: 'offset', + enabled: true, + phase: 'main', + requires: ['popperOffsets'], + fn: offset +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js + + +function popperOffsets(_ref) { + var state = _ref.state, + name = _ref.name; + // Offsets are the actual position the popper needs to have to be + // properly positioned near its reference element + // This is the most basic placement, and will be adjusted by + // the modifiers in the next step + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: 'absolute', + placement: state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_popperOffsets = ({ + name: 'popperOffsets', + enabled: true, + phase: 'read', + fn: popperOffsets, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js +function getAltAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js + + + + + + + + + + + + +function preventOverflow(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + altBoundary: altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + + if (!popperOffsets) { + return; + } + + if (checkMainAxis) { + var _offsetModifierState$; + + var mainSide = mainAxis === 'y' ? enums_top : left; + var altSide = mainAxis === 'y' ? bottom : right; + var len = mainAxis === 'y' ? 'height' : 'width'; + var offset = popperOffsets[mainAxis]; + var min = offset + overflow[mainSide]; + var max = offset - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go + // outside the reference bounds + + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want + // to include its full size in the calculation. If the reference is small + // and near the edge of a boundary, the popper can overflow even if the + // reference is not overflowing as well (e.g. virtual elements with no + // width or height) + + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); + popperOffsets[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset; + } + + if (checkAltAxis) { + var _offsetModifierState$2; + + var _mainSide = mainAxis === 'x' ? enums_top : left; + + var _altSide = mainAxis === 'x' ? bottom : right; + + var _offset = popperOffsets[altAxis]; + + var _len = altAxis === 'y' ? 'height' : 'width'; + + var _min = _offset + overflow[_mainSide]; + + var _max = _offset - overflow[_altSide]; + + var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; + + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + + popperOffsets[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_preventOverflow = ({ + name: 'preventOverflow', + enabled: true, + phase: 'main', + fn: preventOverflow, + requiresIfExists: ['offset'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/index.js + + + + + + + + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js + + + + +function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js + + + + + + + + + +function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; +} // Returns the composite rect of an element relative to its offsetParent. +// Composite means it takes into account transforms as well as layout. + + +function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js + // source: https://stackoverflow.com/questions/49875255 + +function order(modifiers) { + var map = new Map(); + var visited = new Set(); + var result = []; + modifiers.forEach(function (modifier) { + map.set(modifier.name, modifier); + }); // On visiting object, check for its dependencies and visit them recursively + + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function (dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + + modifiers.forEach(function (modifier) { + if (!visited.has(modifier.name)) { + // check for visited object + sort(modifier); + } + }); + return result; +} + +function orderModifiers(modifiers) { + // order based on dependencies + var orderedModifiers = order(modifiers); // order based on phase + + return modifierPhases.reduce(function (acc, phase) { + return acc.concat(orderedModifiers.filter(function (modifier) { + return modifier.phase === phase; + })); + }, []); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js +function debounce(fn) { + var pending; + return function () { + if (!pending) { + pending = new Promise(function (resolve) { + Promise.resolve().then(function () { + pending = undefined; + resolve(fn()); + }); + }); + } + + return pending; + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js +function mergeByName(modifiers) { + var merged = modifiers.reduce(function (merged, current) { + var existing = merged[current.name]; + merged[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged; + }, {}); // IE11 does not support Object.values + + return Object.keys(merged).map(function (key) { + return merged[key]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js + + + + + + + + + + + + + + +var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +var DEFAULT_OPTIONS = { + placement: 'bottom', + modifiers: [], + strategy: 'absolute' +}; + +function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return !args.some(function (element) { + return !(element && typeof element.getBoundingClientRect === 'function'); + }); +} + +function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + + var _generatorOptions = generatorOptions, + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper(reference, popper, options) { + if (options === void 0) { + options = defaultOptions; + } + + var state = { + placement: 'bottom', + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference, + popper: popper + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state: state, + setOptions: function setOptions(setOptionsAction) { + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options); + state.scrollParents = { + reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], + popper: listScrollParents(popper) + }; // Orders the modifiers based on their dependencies and `phase` + // properties + + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers + + state.orderedModifiers = orderedModifiers.filter(function (m) { + return m.enabled; + }); // Validate the provided modifiers so that the consumer will get warned + // if one of the modifiers is invalid for any reason + + if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } + + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + + var _state$elements = state.elements, + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + // anymore + + if (!areValidElements(reference, popper)) { + if (false) {} + + return; + } // Store the reference and popper rects to be read by modifiers + + + state.rects = { + reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), + popper: getLayoutRect(popper) + }; // Modifiers have the ability to reset the current update cycle. The + // most common use case for this is the `flip` modifier changing the + // placement, which then needs to re-run all the modifiers, because the + // logic was previously ran for the previous placement and is therefore + // stale/incorrect + + state.reset = false; + state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier + // is filled with the initial data specified by the modifier. This means + // it doesn't persist and is fresh on each update. + // To ensure persistent data, use `${name}#persistent` + + state.orderedModifiers.forEach(function (modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + var __debug_loops__ = 0; + + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (false) {} + + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + + var _state$orderedModifie = state.orderedModifiers[index], + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; + + if (typeof fn === 'function') { + state = fn({ + state: state, + options: _options, + name: name, + instance: instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function () { + return new Promise(function (resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + + if (!areValidElements(reference, popper)) { + if (false) {} + + return instance; + } + + instance.setOptions(options).then(function (state) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state); + } + }); // Modifiers have the ability to execute arbitrary code before the first + // update cycle runs. They will be executed in the same order as the update + // cycle. This is useful when a modifier adds some persistent data that + // other modifiers need to use, but the modifier is run after the dependent + // one. + + function runModifierEffects() { + state.orderedModifiers.forEach(function (_ref3) { + var name = _ref3.name, + _ref3$options = _ref3.options, + options = _ref3$options === void 0 ? {} : _ref3$options, + effect = _ref3.effect; + + if (typeof effect === 'function') { + var cleanupFn = effect({ + state: state, + name: name, + instance: instance, + options: options + }); + + var noopFn = function noopFn() {}; + + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + + function cleanupModifierEffects() { + effectCleanupFns.forEach(function (fn) { + return fn(); + }); + effectCleanupFns = []; + } + + return instance; + }; +} +var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js + + + + + + + + + + +var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; +var popper_createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper-lite.js + + + + + +var popper_lite_defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles]; +var popper_lite_createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: popper_lite_defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/index.js + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + + +/***/ }), + +/***/ 902: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initAccordions = void 0; +var Default = { + alwaysOpen: false, + activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white', + inactiveClasses: 'text-gray-500 dark:text-gray-400', + onOpen: function () { }, + onClose: function () { }, + onToggle: function () { }, +}; +var Accordion = /** @class */ (function () { + function Accordion(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Accordion.prototype._init = function () { + var _this = this; + if (this._items.length) { + // show accordion item based on click + this._items.map(function (item) { + if (item.active) { + _this.open(item.id); + } + item.triggerEl.addEventListener('click', function () { + _this.toggle(item.id); + }); + }); + } + }; + Accordion.prototype.getItem = function (id) { + return this._items.filter(function (item) { return item.id === id; })[0]; + }; + Accordion.prototype.open = function (id) { + var _a, _b; + var _this = this; + var item = this.getItem(id); + // don't hide other accordions if always open + if (!this._options.alwaysOpen) { + this._items.map(function (i) { + var _a, _b; + if (i !== item) { + (_a = i.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = i.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + i.targetEl.classList.add('hidden'); + i.triggerEl.setAttribute('aria-expanded', 'false'); + i.active = false; + // rotate icon if set + if (i.iconEl) { + i.iconEl.classList.remove('rotate-180'); + } + } + }); + } + // show active item + (_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + item.triggerEl.setAttribute('aria-expanded', 'true'); + item.targetEl.classList.remove('hidden'); + item.active = true; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.add('rotate-180'); + } + // callback function + this._options.onOpen(this, item); + }; + Accordion.prototype.toggle = function (id) { + var item = this.getItem(id); + if (item.active) { + this.close(id); + } + else { + this.open(id); + } + // callback function + this._options.onToggle(this, item); + }; + Accordion.prototype.close = function (id) { + var _a, _b; + var item = this.getItem(id); + (_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(' ')); + item.targetEl.classList.add('hidden'); + item.triggerEl.setAttribute('aria-expanded', 'false'); + item.active = false; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.remove('rotate-180'); + } + // callback function + this._options.onClose(this, item); + }; + return Accordion; +}()); +function initAccordions() { + document.querySelectorAll('[data-accordion]').forEach(function ($accordionEl) { + var alwaysOpen = $accordionEl.getAttribute('data-accordion'); + var activeClasses = $accordionEl.getAttribute('data-active-classes'); + var inactiveClasses = $accordionEl.getAttribute('data-inactive-classes'); + var items = []; + $accordionEl + .querySelectorAll('[data-accordion-target]') + .forEach(function ($triggerEl) { + // Consider only items that directly belong to $accordionEl + // (to make nested accordions work). + if ($triggerEl.closest('[data-accordion]') === $accordionEl) { + var item = { + id: $triggerEl.getAttribute('data-accordion-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-accordion-target')), + iconEl: $triggerEl.querySelector('[data-accordion-icon]'), + active: $triggerEl.getAttribute('aria-expanded') === 'true' + ? true + : false, + }; + items.push(item); + } + }); + new Accordion(items, { + alwaysOpen: alwaysOpen === 'open' ? true : false, + activeClasses: activeClasses + ? activeClasses + : Default.activeClasses, + inactiveClasses: inactiveClasses + ? inactiveClasses + : Default.inactiveClasses, + }); + }); +} +exports.initAccordions = initAccordions; +if (typeof window !== 'undefined') { + window.Accordion = Accordion; + window.initAccordions = initAccordions; +} +exports["default"] = Accordion; + + +/***/ }), + +/***/ 33: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initCarousels = void 0; +var Default = { + defaultPosition: 0, + indicators: { + items: [], + activeClasses: 'bg-white dark:bg-gray-800', + inactiveClasses: 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800', + }, + interval: 3000, + onNext: function () { }, + onPrev: function () { }, + onChange: function () { }, +}; +var Carousel = /** @class */ (function () { + function Carousel(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign(__assign({}, Default), options), { indicators: __assign(__assign({}, Default.indicators), options.indicators) }); + this._activeItem = this.getItem(this._options.defaultPosition); + this._indicators = this._options.indicators.items; + this._intervalDuration = this._options.interval; + this._intervalInstance = null; + this._init(); + } + /** + * initialize carousel and items based on active one + */ + Carousel.prototype._init = function () { + var _this = this; + this._items.map(function (item) { + item.el.classList.add('absolute', 'inset-0', 'transition-transform', 'transform'); + }); + // if no active item is set then first position is default + if (this._getActiveItem()) { + this.slideTo(this._getActiveItem().position); + } + else { + this.slideTo(0); + } + this._indicators.map(function (indicator, position) { + indicator.el.addEventListener('click', function () { + _this.slideTo(position); + }); + }); + }; + Carousel.prototype.getItem = function (position) { + return this._items[position]; + }; + /** + * Slide to the element based on id + * @param {*} position + */ + Carousel.prototype.slideTo = function (position) { + var nextItem = this._items[position]; + var rotationItems = { + left: nextItem.position === 0 + ? this._items[this._items.length - 1] + : this._items[nextItem.position - 1], + middle: nextItem, + right: nextItem.position === this._items.length - 1 + ? this._items[0] + : this._items[nextItem.position + 1], + }; + this._rotate(rotationItems); + this._setActiveItem(nextItem); + if (this._intervalInstance) { + this.pause(); + this.cycle(); + } + this._options.onChange(this); + }; + /** + * Based on the currently active item it will go to the next position + */ + Carousel.prototype.next = function () { + var activeItem = this._getActiveItem(); + var nextItem = null; + // check if last item + if (activeItem.position === this._items.length - 1) { + nextItem = this._items[0]; + } + else { + nextItem = this._items[activeItem.position + 1]; + } + this.slideTo(nextItem.position); + // callback function + this._options.onNext(this); + }; + /** + * Based on the currently active item it will go to the previous position + */ + Carousel.prototype.prev = function () { + var activeItem = this._getActiveItem(); + var prevItem = null; + // check if first item + if (activeItem.position === 0) { + prevItem = this._items[this._items.length - 1]; + } + else { + prevItem = this._items[activeItem.position - 1]; + } + this.slideTo(prevItem.position); + // callback function + this._options.onPrev(this); + }; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + Carousel.prototype._rotate = function (rotationItems) { + // reset + this._items.map(function (item) { + item.el.classList.add('hidden'); + }); + // left item (previously active) + rotationItems.left.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.left.el.classList.add('-translate-x-full', 'z-10'); + // currently active item + rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10'); + rotationItems.middle.el.classList.add('translate-x-0', 'z-20'); + // right item (upcoming active) + rotationItems.right.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.right.el.classList.add('translate-x-full', 'z-10'); + }; + /** + * Set an interval to cycle through the carousel items + */ + Carousel.prototype.cycle = function () { + var _this = this; + if (typeof window !== 'undefined') { + this._intervalInstance = window.setInterval(function () { + _this.next(); + }, this._intervalDuration); + } + }; + /** + * Clears the cycling interval + */ + Carousel.prototype.pause = function () { + clearInterval(this._intervalInstance); + }; + /** + * Get the currently active item + */ + Carousel.prototype._getActiveItem = function () { + return this._activeItem; + }; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + Carousel.prototype._setActiveItem = function (item) { + var _a, _b; + var _this = this; + this._activeItem = item; + var position = item.position; + // update the indicators if available + if (this._indicators.length) { + this._indicators.map(function (indicator) { + var _a, _b; + indicator.el.setAttribute('aria-current', 'false'); + (_a = indicator.el.classList).remove.apply(_a, _this._options.indicators.activeClasses.split(' ')); + (_b = indicator.el.classList).add.apply(_b, _this._options.indicators.inactiveClasses.split(' ')); + }); + (_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(' ')); + (_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(' ')); + this._indicators[position].el.setAttribute('aria-current', 'true'); + } + }; + return Carousel; +}()); +function initCarousels() { + document.querySelectorAll('[data-carousel]').forEach(function ($carouselEl) { + var interval = $carouselEl.getAttribute('data-carousel-interval'); + var slide = $carouselEl.getAttribute('data-carousel') === 'slide' + ? true + : false; + var items = []; + var defaultPosition = 0; + if ($carouselEl.querySelectorAll('[data-carousel-item]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-item]')).map(function ($carouselItemEl, position) { + items.push({ + position: position, + el: $carouselItemEl, + }); + if ($carouselItemEl.getAttribute('data-carousel-item') === + 'active') { + defaultPosition = position; + } + }); + } + var indicators = []; + if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-slide-to]')).map(function ($indicatorEl) { + indicators.push({ + position: parseInt($indicatorEl.getAttribute('data-carousel-slide-to')), + el: $indicatorEl, + }); + }); + } + var carousel = new Carousel(items, { + defaultPosition: defaultPosition, + indicators: { + items: indicators, + }, + interval: interval ? interval : Default.interval, + }); + if (slide) { + carousel.cycle(); + } + // check for controls + var carouselNextEl = $carouselEl.querySelector('[data-carousel-next]'); + var carouselPrevEl = $carouselEl.querySelector('[data-carousel-prev]'); + if (carouselNextEl) { + carouselNextEl.addEventListener('click', function () { + carousel.next(); + }); + } + if (carouselPrevEl) { + carouselPrevEl.addEventListener('click', function () { + carousel.prev(); + }); + } + }); +} +exports.initCarousels = initCarousels; +if (typeof window !== 'undefined') { + window.Carousel = Carousel; + window.initCarousels = initCarousels; +} +exports["default"] = Carousel; + + +/***/ }), + +/***/ 922: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initCollapses = void 0; +var Default = { + onCollapse: function () { }, + onExpand: function () { }, + onToggle: function () { }, +}; +var Collapse = /** @class */ (function () { + function Collapse(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Collapse.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + if (this._triggerEl.hasAttribute('aria-expanded')) { + this._visible = + this._triggerEl.getAttribute('aria-expanded') === 'true'; + } + else { + // fix until v2 not to break previous single collapses which became dismiss + this._visible = !this._targetEl.classList.contains('hidden'); + } + this._triggerEl.addEventListener('click', function () { + _this.toggle(); + }); + } + }; + Collapse.prototype.collapse = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onCollapse(this); + }; + Collapse.prototype.expand = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onExpand(this); + }; + Collapse.prototype.toggle = function () { + if (this._visible) { + this.collapse(); + } + else { + this.expand(); + } + // callback function + this._options.onToggle(this); + }; + return Collapse; +}()); +function initCollapses() { + document + .querySelectorAll('[data-collapse-toggle]') + .forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-collapse-toggle'); + var $targetEl = document.getElementById(targetId); + // check if the target element exists + if ($targetEl) { + new Collapse($targetEl, $triggerEl); + } + else { + console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-collapse-toggle attribute.")); + } + }); +} +exports.initCollapses = initCollapses; +if (typeof window !== 'undefined') { + window.Collapse = Collapse; + window.initCollapses = initCollapses; +} +exports["default"] = Collapse; + + +/***/ }), + +/***/ 556: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDials = void 0; +var Default = { + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dial = /** @class */ (function () { + function Dial(parentEl, triggerEl, targetEl, options) { + if (parentEl === void 0) { parentEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._parentEl = parentEl; + this._triggerEl = triggerEl; + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Dial.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType); + triggerEventTypes.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEventTypes.hideEvents.forEach(function (ev) { + _this._parentEl.addEventListener(ev, function () { + if (!_this._parentEl.matches(':hover')) { + _this.hide(); + } + }); + }); + } + }; + Dial.prototype.hide = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Dial.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dial.prototype.toggle = function () { + if (this._visible) { + this.hide(); + } + else { + this.show(); + } + }; + Dial.prototype.isHidden = function () { + return !this._visible; + }; + Dial.prototype.isVisible = function () { + return this._visible; + }; + Dial.prototype._getTriggerEventTypes = function (triggerType) { + switch (triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + return Dial; +}()); +function initDials() { + document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) { + var $triggerEl = $parentEl.querySelector('[data-dial-toggle]'); + if ($triggerEl) { + var dialId = $triggerEl.getAttribute('data-dial-toggle'); + var $dialEl = document.getElementById(dialId); + if ($dialEl) { + var triggerType = $triggerEl.getAttribute('data-dial-trigger'); + new Dial($parentEl, $triggerEl, $dialEl, { + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?")); + } + } + else { + console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?")); + } + }); +} +exports.initDials = initDials; +if (typeof window !== 'undefined') { + window.Dial = Dial; + window.initDials = initDials; +} +exports["default"] = Dial; + + +/***/ }), + +/***/ 791: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDismisses = void 0; +var Default = { + transition: 'transition-opacity', + duration: 300, + timing: 'ease-out', + onHide: function () { }, +}; +var Dismiss = /** @class */ (function () { + function Dismiss(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Dismiss.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + this._triggerEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Dismiss.prototype.hide = function () { + var _this = this; + this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, 'opacity-0'); + setTimeout(function () { + _this._targetEl.classList.add('hidden'); + }, this._options.duration); + // callback function + this._options.onHide(this, this._targetEl); + }; + return Dismiss; +}()); +function initDismisses() { + document.querySelectorAll('[data-dismiss-target]').forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-dismiss-target'); + var $dismissEl = document.querySelector(targetId); + if ($dismissEl) { + new Dismiss($dismissEl, $triggerEl); + } + else { + console.error("The dismiss element with id \"".concat(targetId, "\" does not exist. Please check the data-dismiss-target attribute.")); + } + }); +} +exports.initDismisses = initDismisses; +if (typeof window !== 'undefined') { + window.Dismiss = Dismiss; + window.initDismisses = initDismisses; +} +exports["default"] = Dismiss; + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDrawers = void 0; +var Default = { + placement: 'left', + bodyScrolling: false, + backdrop: true, + edge: false, + edgeOffset: 'bottom-[60px]', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Drawer = /** @class */ (function () { + function Drawer(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Drawer.prototype._init = function () { + var _this = this; + // set initial accessibility attributes + if (this._targetEl) { + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.classList.add('transition-transform'); + } + // set base placement classes + this._getPlacementClasses(this._options.placement).base.map(function (c) { + _this._targetEl.classList.add(c); + }); + // add keyboard event listener to document + document.addEventListener('keydown', function (event) { + if (event.key === 'Escape') { + // if 'Escape' key is pressed + if (_this.isVisible()) { + // if the Drawer is visible + _this.hide(); // hide the Drawer + } + } + }); + }; + Drawer.prototype.hide = function () { + var _this = this; + // based on the edge option show placement classes + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + // enable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.remove('overflow-hidden'); + } + // destroy backdrop + if (this._options.backdrop) { + this._destroyBackdropEl(); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Drawer.prototype.show = function () { + var _this = this; + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + // disable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.add('overflow-hidden'); + } + // show backdrop + if (this._options.backdrop) { + this._createBackdrop(); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Drawer.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Drawer.prototype._createBackdrop = function () { + var _a; + var _this = this; + if (!this._visible) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('drawer-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + backdropEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Drawer.prototype._destroyBackdropEl = function () { + if (this._visible) { + document.querySelector('[drawer-backdrop]').remove(); + } + }; + Drawer.prototype._getPlacementClasses = function (placement) { + switch (placement) { + case 'top': + return { + base: ['top-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['-translate-y-full'], + }; + case 'right': + return { + base: ['right-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-x-full'], + }; + case 'bottom': + return { + base: ['bottom-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['translate-y-full'], + }; + case 'left': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + case 'bottom-edge': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-y-full', this._options.edgeOffset], + }; + default: + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + } + }; + Drawer.prototype.isHidden = function () { + return !this._visible; + }; + Drawer.prototype.isVisible = function () { + return this._visible; + }; + return Drawer; +}()); +var getDrawerInstance = function (id, instances) { + if (instances.some(function (drawerInstance) { return drawerInstance.id === id; })) { + return instances.find(function (drawerInstance) { return drawerInstance.id === id; }); + } +}; +function initDrawers() { + var drawerInstances = []; + document.querySelectorAll('[data-drawer-target]').forEach(function ($triggerEl) { + // mandatory + var drawerId = $triggerEl.getAttribute('data-drawer-target'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + // optional + var placement = $triggerEl.getAttribute('data-drawer-placement'); + var bodyScrolling = $triggerEl.getAttribute('data-drawer-body-scrolling'); + var backdrop = $triggerEl.getAttribute('data-drawer-backdrop'); + var edge = $triggerEl.getAttribute('data-drawer-edge'); + var edgeOffset = $triggerEl.getAttribute('data-drawer-edge-offset'); + if (!getDrawerInstance(drawerId, drawerInstances)) { + drawerInstances.push({ + id: drawerId, + object: new Drawer($drawerEl, { + placement: placement ? placement : Default.placement, + bodyScrolling: bodyScrolling + ? bodyScrolling === 'true' + ? true + : false + : Default.bodyScrolling, + backdrop: backdrop + ? backdrop === 'true' + ? true + : false + : Default.backdrop, + edge: edge + ? edge === 'true' + ? true + : false + : Default.edge, + edgeOffset: edgeOffset + ? edgeOffset + : Default.edgeOffset, + }), + }); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document.querySelectorAll('[data-drawer-toggle]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-toggle'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_1 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_1) { + $triggerEl.addEventListener('click', function () { + drawer_1.object.toggle(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document + .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]') + .forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-dismiss') + ? $triggerEl.getAttribute('data-drawer-dismiss') + : $triggerEl.getAttribute('data-drawer-hide'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_2 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_2) { + $triggerEl.addEventListener('click', function () { + drawer_2.object.hide(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id")); + } + }); + document.querySelectorAll('[data-drawer-show]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-show'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_3 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_3) { + $triggerEl.addEventListener('click', function () { + drawer_3.object.show(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); +} +exports.initDrawers = initDrawers; +if (typeof window !== 'undefined') { + window.Drawer = Drawer; + window.initDrawers = initDrawers; +} +exports["default"] = Drawer; + + +/***/ }), + +/***/ 316: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDropdowns = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'bottom', + triggerType: 'click', + offsetSkidding: 0, + offsetDistance: 10, + delay: 300, + ignoreClickOutsideClass: false, + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dropdown = /** @class */ (function () { + function Dropdown(targetElement, triggerElement, options) { + if (targetElement === void 0) { targetElement = null; } + if (triggerElement === void 0) { triggerElement = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetElement; + this._triggerEl = triggerElement; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Dropdown.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Dropdown.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + // click event handling for trigger element + if (this._options.triggerType === 'click') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.toggle(); + }); + }); + } + // hover event handling for trigger element + if (this._options.triggerType === 'hover') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + if (ev === 'click') { + _this.toggle(); + } + else { + setTimeout(function () { + _this.show(); + }, _this._options.delay); + } + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + }); + } + }; + Dropdown.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [ + this._options.offsetSkidding, + this._options.offsetDistance, + ], + }, + }, + ], + }); + }; + Dropdown.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + // Ignore clicks on the trigger element (ie. a datepicker input) + var ignoreClickOutsideClass = this._options.ignoreClickOutsideClass; + var isIgnored = false; + if (ignoreClickOutsideClass) { + var ignoredClickOutsideEls = document.querySelectorAll(".".concat(ignoreClickOutsideClass)); + ignoredClickOutsideEls.forEach(function (el) { + if (el.contains(clickedEl)) { + isIgnored = true; + return; + } + }); + } + // Ignore clicks on the target element (ie. dropdown itself) + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + !isIgnored && + this.isVisible()) { + this.hide(); + } + }; + Dropdown.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'click'], + hideEvents: ['mouseleave'], + }; + case 'click': + return { + showEvents: ['click'], + hideEvents: [], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['click'], + hideEvents: [], + }; + } + }; + Dropdown.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Dropdown.prototype.isVisible = function () { + return this._visible; + }; + Dropdown.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + this._targetEl.classList.add('block'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + this._setupClickOutsideListener(); + // Update its position + this._popperInstance.update(); + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dropdown.prototype.hide = function () { + this._targetEl.classList.remove('block'); + this._targetEl.classList.add('hidden'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + this._visible = false; + this._removeClickOutsideListener(); + // callback function + this._options.onHide(this); + }; + return Dropdown; +}()); +function initDropdowns() { + document + .querySelectorAll('[data-dropdown-toggle]') + .forEach(function ($triggerEl) { + var dropdownId = $triggerEl.getAttribute('data-dropdown-toggle'); + var $dropdownEl = document.getElementById(dropdownId); + if ($dropdownEl) { + var placement = $triggerEl.getAttribute('data-dropdown-placement'); + var offsetSkidding = $triggerEl.getAttribute('data-dropdown-offset-skidding'); + var offsetDistance = $triggerEl.getAttribute('data-dropdown-offset-distance'); + var triggerType = $triggerEl.getAttribute('data-dropdown-trigger'); + var delay = $triggerEl.getAttribute('data-dropdown-delay'); + var ignoreClickOutsideClass = $triggerEl.getAttribute('data-dropdown-ignore-click-outside-class'); + new Dropdown($dropdownEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + offsetSkidding: offsetSkidding + ? parseInt(offsetSkidding) + : Default.offsetSkidding, + offsetDistance: offsetDistance + ? parseInt(offsetDistance) + : Default.offsetDistance, + delay: delay ? parseInt(delay) : Default.delay, + ignoreClickOutsideClass: ignoreClickOutsideClass + ? ignoreClickOutsideClass + : Default.ignoreClickOutsideClass, + }); + } + else { + console.error("The dropdown element with id \"".concat(dropdownId, "\" does not exist. Please check the data-dropdown-toggle attribute.")); + } + }); +} +exports.initDropdowns = initDropdowns; +if (typeof window !== 'undefined') { + window.Dropdown = Dropdown; + window.initDropdowns = initDropdowns; +} +exports["default"] = Dropdown; + + +/***/ }), + +/***/ 311: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initFlowbite = void 0; +var accordion_1 = __webpack_require__(902); +var carousel_1 = __webpack_require__(33); +var collapse_1 = __webpack_require__(922); +var dial_1 = __webpack_require__(556); +var dismiss_1 = __webpack_require__(791); +var drawer_1 = __webpack_require__(340); +var dropdown_1 = __webpack_require__(316); +var modal_1 = __webpack_require__(16); +var popover_1 = __webpack_require__(903); +var tabs_1 = __webpack_require__(247); +var tooltip_1 = __webpack_require__(671); +function initFlowbite() { + (0, accordion_1.initAccordions)(); + (0, collapse_1.initCollapses)(); + (0, carousel_1.initCarousels)(); + (0, dismiss_1.initDismisses)(); + (0, dropdown_1.initDropdowns)(); + (0, modal_1.initModals)(); + (0, drawer_1.initDrawers)(); + (0, tabs_1.initTabs)(); + (0, tooltip_1.initTooltips)(); + (0, popover_1.initPopovers)(); + (0, dial_1.initDials)(); +} +exports.initFlowbite = initFlowbite; +if (typeof window !== 'undefined') { + window.initFlowbite = initFlowbite; +} + + +/***/ }), + +/***/ 16: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initModals = void 0; +var Default = { + placement: 'center', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', + backdrop: 'dynamic', + closable: true, + onHide: function () { }, + onShow: function () { }, + onToggle: function () { }, +}; +var Modal = /** @class */ (function () { + function Modal(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._isHidden = true; + this._backdropEl = null; + this._init(); + } + Modal.prototype._init = function () { + var _this = this; + if (this._targetEl) { + this._getPlacementClasses().map(function (c) { + _this._targetEl.classList.add(c); + }); + } + }; + Modal.prototype._createBackdrop = function () { + var _a; + if (this._isHidden) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('modal-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + this._backdropEl = backdropEl; + } + }; + Modal.prototype._destroyBackdropEl = function () { + if (!this._isHidden) { + document.querySelector('[modal-backdrop]').remove(); + } + }; + Modal.prototype._setupModalCloseEventListeners = function () { + var _this = this; + if (this._options.backdrop === 'dynamic') { + this._clickOutsideEventListener = function (ev) { + _this._handleOutsideClick(ev.target); + }; + this._targetEl.addEventListener('click', this._clickOutsideEventListener, true); + } + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._removeModalCloseEventListeners = function () { + if (this._options.backdrop === 'dynamic') { + this._targetEl.removeEventListener('click', this._clickOutsideEventListener, true); + } + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._handleOutsideClick = function (target) { + if (target === this._targetEl || + (target === this._backdropEl && this.isVisible())) { + this.hide(); + } + }; + Modal.prototype._getPlacementClasses = function () { + switch (this._options.placement) { + // top + case 'top-left': + return ['justify-start', 'items-start']; + case 'top-center': + return ['justify-center', 'items-start']; + case 'top-right': + return ['justify-end', 'items-start']; + // center + case 'center-left': + return ['justify-start', 'items-center']; + case 'center': + return ['justify-center', 'items-center']; + case 'center-right': + return ['justify-end', 'items-center']; + // bottom + case 'bottom-left': + return ['justify-start', 'items-end']; + case 'bottom-center': + return ['justify-center', 'items-end']; + case 'bottom-right': + return ['justify-end', 'items-end']; + default: + return ['justify-center', 'items-center']; + } + }; + Modal.prototype.toggle = function () { + if (this._isHidden) { + this.show(); + } + else { + this.hide(); + } + // callback function + this._options.onToggle(this); + }; + Modal.prototype.show = function () { + if (this.isHidden) { + this._targetEl.classList.add('flex'); + this._targetEl.classList.remove('hidden'); + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + this._createBackdrop(); + this._isHidden = false; + // prevent body scroll + document.body.classList.add('overflow-hidden'); + // Add keyboard event listener to the document + if (this._options.closable) { + this._setupModalCloseEventListeners(); + } + // callback function + this._options.onShow(this); + } + }; + Modal.prototype.hide = function () { + if (this.isVisible) { + this._targetEl.classList.add('hidden'); + this._targetEl.classList.remove('flex'); + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + this._destroyBackdropEl(); + this._isHidden = true; + // re-apply body scroll + document.body.classList.remove('overflow-hidden'); + if (this._options.closable) { + this._removeModalCloseEventListeners(); + } + // callback function + this._options.onHide(this); + } + }; + Modal.prototype.isVisible = function () { + return !this._isHidden; + }; + Modal.prototype.isHidden = function () { + return this._isHidden; + }; + return Modal; +}()); +var getModalInstance = function (id, instances) { + if (instances.some(function (modalInstance) { return modalInstance.id === id; })) { + return instances.find(function (modalInstance) { return modalInstance.id === id; }); + } + return null; +}; +function initModals() { + var modalInstances = []; + // initiate modal based on data-modal-target + document.querySelectorAll('[data-modal-target]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-target'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + if (!getModalInstance(modalId, modalInstances)) { + modalInstances.push({ + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.")); + } + }); + // support pre v1.6.0 data-modal-toggle initialization + document.querySelectorAll('[data-modal-toggle]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-toggle'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + var modal_1 = getModalInstance(modalId, modalInstances); + if (!modal_1) { + modal_1 = { + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }; + modalInstances.push(modal_1); + } + $triggerEl.addEventListener('click', function () { + modal_1.object.toggle(); + }); + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?")); + } + }); + // show modal on click if exists based on id + document.querySelectorAll('[data-modal-show]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-show'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_2 = getModalInstance(modalId, modalInstances); + if (modal_2) { + $triggerEl.addEventListener('click', function () { + if (modal_2.object.isHidden) { + modal_2.object.show(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?")); + } + }); + // hide modal on click if exists based on id + document.querySelectorAll('[data-modal-hide]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-hide'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_3 = getModalInstance(modalId, modalInstances); + if (modal_3) { + $triggerEl.addEventListener('click', function () { + if (modal_3.object.isVisible) { + modal_3.object.hide(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?")); + } + }); +} +exports.initModals = initModals; +if (typeof window !== 'undefined') { + window.Modal = Modal; + window.initModals = initModals; +} +exports["default"] = Modal; + + +/***/ }), + +/***/ 903: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initPopovers = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'top', + offset: 10, + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Popover = /** @class */ (function () { + function Popover(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Popover.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Popover.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + }); + }; + Popover.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, this._options.offset], + }, + }, + ], + }); + }; + Popover.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Popover.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Popover.prototype.isVisible = function () { + return this._visible; + }; + Popover.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Popover.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility to true + this._visible = true; + // callback function + this._options.onShow(this); + }; + Popover.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility to false + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Popover; +}()); +function initPopovers() { + document.querySelectorAll('[data-popover-target]').forEach(function ($triggerEl) { + var popoverID = $triggerEl.getAttribute('data-popover-target'); + var $popoverEl = document.getElementById(popoverID); + if ($popoverEl) { + var triggerType = $triggerEl.getAttribute('data-popover-trigger'); + var placement = $triggerEl.getAttribute('data-popover-placement'); + var offset = $triggerEl.getAttribute('data-popover-offset'); + new Popover($popoverEl, $triggerEl, { + placement: placement ? placement : Default.placement, + offset: offset ? parseInt(offset) : Default.offset, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The popover element with id \"".concat(popoverID, "\" does not exist. Please check the data-popover-target attribute.")); + } + }); +} +exports.initPopovers = initPopovers; +if (typeof window !== 'undefined') { + window.Popover = Popover; + window.initPopovers = initPopovers; +} +exports["default"] = Popover; + + +/***/ }), + +/***/ 247: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initTabs = void 0; +var Default = { + defaultTabId: null, + activeClasses: 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500', + inactiveClasses: 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300', + onShow: function () { }, +}; +var Tabs = /** @class */ (function () { + function Tabs(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._activeTab = options ? this.getTab(options.defaultTabId) : null; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Tabs.prototype._init = function () { + var _this = this; + if (this._items.length) { + // set the first tab as active if not set by explicitly + if (!this._activeTab) { + this._setActiveTab(this._items[0]); + } + // force show the first default tab + this.show(this._activeTab.id, true); + // show tab content based on click + this._items.map(function (tab) { + tab.triggerEl.addEventListener('click', function () { + _this.show(tab.id); + }); + }); + } + }; + Tabs.prototype.getActiveTab = function () { + return this._activeTab; + }; + Tabs.prototype._setActiveTab = function (tab) { + this._activeTab = tab; + }; + Tabs.prototype.getTab = function (id) { + return this._items.filter(function (t) { return t.id === id; })[0]; + }; + Tabs.prototype.show = function (id, forceShow) { + var _a, _b; + var _this = this; + if (forceShow === void 0) { forceShow = false; } + var tab = this.getTab(id); + // don't do anything if already active + if (tab === this._activeTab && !forceShow) { + return; + } + // hide other tabs + this._items.map(function (t) { + var _a, _b; + if (t !== tab) { + (_a = t.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = t.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + t.targetEl.classList.add('hidden'); + t.triggerEl.setAttribute('aria-selected', 'false'); + } + }); + // show active tab + (_a = tab.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = tab.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + tab.triggerEl.setAttribute('aria-selected', 'true'); + tab.targetEl.classList.remove('hidden'); + this._setActiveTab(tab); + // callback function + this._options.onShow(this, tab); + }; + return Tabs; +}()); +function initTabs() { + document.querySelectorAll('[data-tabs-toggle]').forEach(function ($triggerEl) { + var tabItems = []; + var defaultTabId = null; + $triggerEl + .querySelectorAll('[role="tab"]') + .forEach(function ($triggerEl) { + var isActive = $triggerEl.getAttribute('aria-selected') === 'true'; + var tab = { + id: $triggerEl.getAttribute('data-tabs-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-tabs-target')), + }; + tabItems.push(tab); + if (isActive) { + defaultTabId = tab.id; + } + }); + new Tabs(tabItems, { + defaultTabId: defaultTabId, + }); + }); +} +exports.initTabs = initTabs; +if (typeof window !== 'undefined') { + window.Tabs = Tabs; + window.initTabs = initTabs; +} +exports["default"] = Tabs; + + +/***/ }), + +/***/ 671: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initTooltips = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'top', + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Tooltip = /** @class */ (function () { + function Tooltip(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Tooltip.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Tooltip.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.hide(); + }); + }); + }; + Tooltip.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, 8], + }, + }, + ], + }); + }; + Tooltip.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Tooltip.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Tooltip.prototype.isVisible = function () { + return this._visible; + }; + Tooltip.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Tooltip.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility + this._visible = true; + // callback function + this._options.onShow(this); + }; + Tooltip.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Tooltip; +}()); +function initTooltips() { + document.querySelectorAll('[data-tooltip-target]').forEach(function ($triggerEl) { + var tooltipId = $triggerEl.getAttribute('data-tooltip-target'); + var $tooltipEl = document.getElementById(tooltipId); + if ($tooltipEl) { + var triggerType = $triggerEl.getAttribute('data-tooltip-trigger'); + var placement = $triggerEl.getAttribute('data-tooltip-placement'); + new Tooltip($tooltipEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The tooltip element with id \"".concat(tooltipId, "\" does not exist. Please check the data-tooltip-target attribute.")); + } + }); +} +exports.initTooltips = initTooltips; +if (typeof window !== 'undefined') { + window.Tooltip = Tooltip; + window.initTooltips = initTooltips; +} +exports["default"] = Tooltip; + + +/***/ }), + +/***/ 947: +/***/ (function(__unused_webpack_module, exports) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Events = /** @class */ (function () { + function Events(eventType, eventFunctions) { + if (eventFunctions === void 0) { eventFunctions = []; } + this._eventType = eventType; + this._eventFunctions = eventFunctions; + } + Events.prototype.init = function () { + var _this = this; + this._eventFunctions.forEach(function (eventFunction) { + if (typeof window !== 'undefined') { + window.addEventListener(_this._eventType, eventFunction); + } + }); + }; + return Events; +}()); +exports["default"] = Events; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +!function() { +var exports = __webpack_exports__; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +__webpack_require__(647); +// core components +var accordion_1 = __webpack_require__(902); +var carousel_1 = __webpack_require__(33); +var collapse_1 = __webpack_require__(922); +var dial_1 = __webpack_require__(556); +var dismiss_1 = __webpack_require__(791); +var drawer_1 = __webpack_require__(340); +var dropdown_1 = __webpack_require__(316); +var modal_1 = __webpack_require__(16); +var popover_1 = __webpack_require__(903); +var tabs_1 = __webpack_require__(247); +var tooltip_1 = __webpack_require__(671); +__webpack_require__(311); +var events_1 = __webpack_require__(947); +var events = new events_1.default('load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +events.init(); +exports["default"] = { + Accordion: accordion_1.default, + Carousel: carousel_1.default, + Collapse: collapse_1.default, + Dial: dial_1.default, + Drawer: drawer_1.default, + Dismiss: dismiss_1.default, + Dropdown: dropdown_1.default, + Modal: modal_1.default, + Popover: popover_1.default, + Tabs: tabs_1.default, + Tooltip: tooltip_1.default, + Events: events_1.default, +}; + +}(); +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=flowbite.js.map \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.js.map b/node_modules/flowbite/dist/flowbite.js.map new file mode 100644 index 0000000..478cc98 --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.js.map @@ -0,0 +1 @@ +{"version":3,"file":"flowbite.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;ACVA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAO,IAAI,SAAG;AACP;AACA;AACA;AACA;AACA,sBAAsB,SAAG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA,CAAC;AACM,IAAI,gBAAU;AACrB;AACA,CAAC,OAAO;;AAED;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;;AC9BQ;AACf;AACA;;ACFe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;ACXuC;;AAEvC;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;;;ACpBsD;AACK,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC,SAAS,aAAa,cAAc,WAAW;AAC/C;AACA,MAAM;AACN;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uHAAuH;;AAEvH;AACA;AACA;AACA,OAAO,IAAI,GAAG;;AAEd,WAAW,aAAa,cAAc,WAAW;AACjD;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,EAAE;;;AAGF,0DAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;ACnFkC;AACpB;AACf;AACA;;ACHO,IAAI,QAAG;AACP,IAAI,QAAG;AACP;;ACFQ;AACf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DAAe;AACf;AACA;AACA;AACA;AACA,UAAU,YAAM;AAChB;AACA;AACA,CAAC;;ACpGc;AACf;AACA;;ACF4D;AACE;AACZ;AACkB;AACJ;AACJ;AACR;AACX,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAK;AACZ,OAAO,KAAK;AACZ;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,IAAI;AAClB,cAAc,SAAG;AACjB;;AAEA;AACA,uBAAuB,eAAe;AACtC;AACA;;AAEA,yBAAyB,SAAS;AAClC,qBAAqB,kBAAkB;;AAEvC,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA,MAAM;;;AAGN;;AAEA,sBAAsB,SAAG,mBAAmB,IAAI,kBAAkB,KAAK,mBAAmB,GAAG;AAC7F,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,IAAI,mBAAmB,SAAG,kBAAkB,MAAM,mBAAmB,GAAG;AAC9F,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,2BAA2B,oCAAoC;AAC/D;;AAEA,yBAAyB,qCAAqC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAM,KAAqC,EAAE,2BAQ1C;;AAEH;AACA,eAAe,gBAAgB;AAC/B,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,mDAAmD;AAC7F;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,yCAAyC,kDAAkD;AAC3F;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,4CAA4C;AAC5C;AACA,GAAG;AACH,EAAE;;;AAGF,4DAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACpLiD,CAAC;;AAEnD;AACA;AACA;;AAEA,SAAS,qBAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA,sBAAsB;AACtB,UAAU,qBAAM;AAChB;AACA,CAAC;;AChDD;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,GAAG;AACH;;ACVA,IAAI,kCAAI;AACR;AACA;AACA;AACe;AACf;AACA,WAAW,kCAAI;AACf,GAAG;AACH;;ACRuC;AACxB;AACf,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;ACT+D;AACN;AACN;AACpC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,kBAAkB,kBAAkB,eAAe;AAClF;;ACZuC;AACkB;AACE;AACN;AACtC;AACf,YAAY,SAAS;AACrB,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,gBAAgB;;AAEzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;AACA;;AC9ByD;AACJ;AACM;AACR;AACZ,CAAC;AACxC;;AAEe;AACf;;AAEA,aAAa,kBAAkB;AAC/B,kBAAkB,eAAe;AACjC;AACA,cAAc,QAAG;AACjB,eAAe,QAAG;AAClB,kCAAkC,mBAAmB;AACrD;;AAEA,MAAM,gBAAgB;AACtB,SAAS,QAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BqD;AACtC;AACf;AACA,0BAA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ACA;AACA;AACA;AACA;AACA,CAAC;;AClJsD;AACC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,SAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI;AAClC;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA,GAAG;AACH,0BAA0B,cAAc;AACxC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,GAAG;AACH,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;AC5D2D;AACD,CAAC;;AAErD;AACP,sBAAsB,gBAAgB;AACtC,wBAAwB,IAAI,EAAE,SAAG;;AAEjC,mEAAmE;AACnE;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,UAAU,IAAI,EAAE,KAAK;AACrB;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAiB;AAC9B;AACA;AACA,GAAG,IAAI;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;;AAGF,qDAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACrDuD;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;;AAGF,4DAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACxBc;AACf;AACA;;ACF8D;AACF;AACgB;AAC5B;AACY;AACF;AACI;AACN;AACJ;AACY;AACE;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA,GAAG;AACH,sBAAsB,gBAAgB;AACt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;AAEA,gCAAgC,aAAa;AAC7C,6BAA6B,aAAa;AAC1C,wBAAwB,kBAAkB;AAC1C,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,WAAW;AACnB,IAAI,cAAc;AAClB,eAAe,aAAa;AAC5B;;AAEA,QAAQ,aAAa;AACrB,gBAAgB,qBAAqB;AACrC;AACA;AACA,MAAM;AACN,kBAAkB,mBAAmB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzD6C,CAAC;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG;;AAEN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEe;AACf;AACA,2CAA2C;;AAE3C,SAAS,qBAAqB;AAC9B;AACA;AACA,KAAK;AACL,GAAG;AACH;;AC3Ce;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;;ACde;AACf;AACA;AACA,sDAAsD;AACtD,+BAA+B;AAC/B,4BAA4B;AAC5B,KAAK;AACL;AACA,GAAG,IAAI,GAAG;;AAEV;AACA;AACA,GAAG;AACH;;ACb+D;AACN;AACQ;AACJ;AACE;AACR;AACZ;AACkB;AAClB;AACgB;AACV;AACM;AACD;AACpB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE,aAAa;AACnF;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B,uBAAuB;AACvB;AACA;AACA;AACA,OAAO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,qBAAqB,SAAS,cAAc,iBAAiB,yCAAyC,iBAAiB;AACvH,kBAAkB,iBAAiB;AACnC,WAAW;AACX;;AAEA,+BAA+B,cAAc,CAAC,WAAW,yDAAyD;;AAElH;AACA;AACA,SAAS,GAAG;AACZ;;AAEA,YAAY,KAAqC,EAAE,qGA+B1C;;AAET;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA,cAAc,KAAqC,EAAE,EAE1C;;AAEX;AACA,UAAU;;;AAGV;AACA,qBAAqB,gBAAgB,YAAY,eAAe;AAChE,kBAAkB,aAAa;AAC/B,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA;AACA,6CAA6C,KAAK;;AAElD;AACA,sEAAsE;AACtE,SAAS;AACT;;AAEA,4BAA4B,uCAAuC;AACnE,cAAc,KAAqC,EAAE,EAO1C;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gEAAgE;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,KAAqC,EAAE,EAE1C;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACO,mDAAmD;;;;AChQU;AACT;AACF;AACA;AACJ;AACV;AACJ;AACsB;AACpB;AACF;AACvC,wBAAwB,cAAc,EAAE,uBAAa,EAAE,uBAAa,EAAE,qBAAW,EAAE,gBAAM,EAAE,cAAI,EAA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,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;IACL,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;CACT,CAAC","sources":["webpack:///webpack/universalModuleDefinition","webpack:///./src/flowbite.css?5b3c","webpack:///./node_modules/@popperjs/core/lib/enums.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack:///./node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/math.js","webpack:///./node_modules/@popperjs/core/lib/utils/userAgent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack:///./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/within.js","webpack:///./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack:///./node_modules/@popperjs/core/lib/utils/getVariation.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack:///./node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/flip.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/hide.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/offset.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/index.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack:///./node_modules/@popperjs/core/lib/utils/debounce.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack:///./node_modules/@popperjs/core/lib/createPopper.js","webpack:///./node_modules/@popperjs/core/lib/popper.js","webpack:///./node_modules/@popperjs/core/lib/popper-lite.js","webpack:///./node_modules/@popperjs/core/lib/index.js","webpack:///./src/components/accordion/index.ts","webpack:///./src/components/carousel/index.ts","webpack:///./src/components/collapse/index.ts","webpack:///./src/components/dial/index.ts","webpack:///./src/components/dismiss/index.ts","webpack:///./src/components/drawer/index.ts","webpack:///./src/components/dropdown/index.ts","webpack:///./src/components/index.ts","webpack:///./src/components/modal/index.ts","webpack:///./src/components/popover/index.ts","webpack:///./src/components/tabs/index.ts","webpack:///./src/components/tooltip/index.ts","webpack:///./src/dom/events.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/index.umd.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Flowbite\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Flowbite\"] = factory();\n\telse\n\t\troot[\"Flowbite\"] = factory();\n})(self, function() {\nreturn ","// extracted by mini-css-extract-plugin\nexport {};","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export { default as applyStyles } from \"./applyStyles.js\";\nexport { default as arrow } from \"./arrow.js\";\nexport { default as computeStyles } from \"./computeStyles.js\";\nexport { default as eventListeners } from \"./eventListeners.js\";\nexport { default as flip } from \"./flip.js\";\nexport { default as hide } from \"./hide.js\";\nexport { default as offset } from \"./offset.js\";\nexport { default as popperOffsets } from \"./popperOffsets.js\";\nexport { default as preventOverflow } from \"./preventOverflow.js\";","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","export * from \"./enums.js\";\nexport * from \"./modifiers/index.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { popperGenerator, detectOverflow, createPopper as createPopperBase } from \"./createPopper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper } from \"./popper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\";","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { AccordionItem, AccordionOptions } from './types';\nimport { AccordionInterface } from './interface';\n\nconst Default: AccordionOptions = {\n alwaysOpen: false,\n activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',\n inactiveClasses: 'text-gray-500 dark:text-gray-400',\n onOpen: () => {},\n onClose: () => {},\n onToggle: () => {},\n};\n\nclass Accordion implements AccordionInterface {\n _items: AccordionItem[];\n _options: AccordionOptions;\n\n constructor(\n items: AccordionItem[] = [],\n options: AccordionOptions = Default\n ) {\n this._items = items;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n private _init() {\n if (this._items.length) {\n // show accordion item based on click\n this._items.map((item) => {\n if (item.active) {\n this.open(item.id);\n }\n\n item.triggerEl.addEventListener('click', () => {\n this.toggle(item.id);\n });\n });\n }\n }\n\n getItem(id: string) {\n return this._items.filter((item) => item.id === id)[0];\n }\n\n open(id: string) {\n const item = this.getItem(id);\n\n // don't hide other accordions if always open\n if (!this._options.alwaysOpen) {\n this._items.map((i) => {\n if (i !== item) {\n i.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n i.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n i.targetEl.classList.add('hidden');\n i.triggerEl.setAttribute('aria-expanded', 'false');\n i.active = false;\n\n // rotate icon if set\n if (i.iconEl) {\n i.iconEl.classList.remove('rotate-180');\n }\n }\n });\n }\n\n // show active item\n item.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n item.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n item.triggerEl.setAttribute('aria-expanded', 'true');\n item.targetEl.classList.remove('hidden');\n item.active = true;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.add('rotate-180');\n }\n\n // callback function\n this._options.onOpen(this, item);\n }\n\n toggle(id: string) {\n const item = this.getItem(id);\n\n if (item.active) {\n this.close(id);\n } else {\n this.open(id);\n }\n\n // callback function\n this._options.onToggle(this, item);\n }\n\n close(id: string) {\n const item = this.getItem(id);\n\n item.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n item.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n item.targetEl.classList.add('hidden');\n item.triggerEl.setAttribute('aria-expanded', 'false');\n item.active = false;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.remove('rotate-180');\n }\n\n // callback function\n this._options.onClose(this, item);\n }\n}\n\nexport function initAccordions() {\n document.querySelectorAll('[data-accordion]').forEach(($accordionEl) => {\n const alwaysOpen = $accordionEl.getAttribute('data-accordion');\n const activeClasses = $accordionEl.getAttribute('data-active-classes');\n const inactiveClasses = $accordionEl.getAttribute(\n 'data-inactive-classes'\n );\n\n const items = [] as AccordionItem[];\n $accordionEl\n .querySelectorAll('[data-accordion-target]')\n .forEach(($triggerEl) => {\n // Consider only items that directly belong to $accordionEl\n // (to make nested accordions work).\n if ($triggerEl.closest('[data-accordion]') === $accordionEl) {\n const item = {\n id: $triggerEl.getAttribute('data-accordion-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-accordion-target')\n ),\n iconEl: $triggerEl.querySelector(\n '[data-accordion-icon]'\n ),\n active:\n $triggerEl.getAttribute('aria-expanded') === 'true'\n ? true\n : false,\n } as AccordionItem;\n items.push(item);\n }\n });\n\n new Accordion(items, {\n alwaysOpen: alwaysOpen === 'open' ? true : false,\n activeClasses: activeClasses\n ? activeClasses\n : Default.activeClasses,\n inactiveClasses: inactiveClasses\n ? inactiveClasses\n : Default.inactiveClasses,\n } as AccordionOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Accordion = Accordion;\n window.initAccordions = initAccordions;\n}\n\nexport default Accordion;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {\n CarouselOptions,\n CarouselItem,\n IndicatorItem,\n RotationItems,\n} from './types';\nimport { CarouselInterface } from './interface';\n\nconst Default: CarouselOptions = {\n defaultPosition: 0,\n indicators: {\n items: [],\n activeClasses: 'bg-white dark:bg-gray-800',\n inactiveClasses:\n 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',\n },\n interval: 3000,\n onNext: () => {},\n onPrev: () => {},\n onChange: () => {},\n};\n\nclass Carousel implements CarouselInterface {\n _items: CarouselItem[];\n _indicators: IndicatorItem[];\n _activeItem: CarouselItem;\n _intervalDuration: number;\n _intervalInstance: number;\n _options: CarouselOptions;\n\n constructor(\n items: CarouselItem[] = [],\n options: CarouselOptions = Default\n ) {\n this._items = items;\n this._options = {\n ...Default,\n ...options,\n indicators: { ...Default.indicators, ...options.indicators },\n };\n this._activeItem = this.getItem(this._options.defaultPosition);\n this._indicators = this._options.indicators.items;\n this._intervalDuration = this._options.interval;\n this._intervalInstance = null;\n this._init();\n }\n\n /**\n * initialize carousel and items based on active one\n */\n _init() {\n this._items.map((item: CarouselItem) => {\n item.el.classList.add(\n 'absolute',\n 'inset-0',\n 'transition-transform',\n 'transform'\n );\n });\n\n // if no active item is set then first position is default\n if (this._getActiveItem()) {\n this.slideTo(this._getActiveItem().position);\n } else {\n this.slideTo(0);\n }\n\n this._indicators.map((indicator, position) => {\n indicator.el.addEventListener('click', () => {\n this.slideTo(position);\n });\n });\n }\n\n getItem(position: number) {\n return this._items[position];\n }\n\n /**\n * Slide to the element based on id\n * @param {*} position\n */\n slideTo(position: number) {\n const nextItem: CarouselItem = this._items[position];\n const rotationItems: RotationItems = {\n left:\n nextItem.position === 0\n ? this._items[this._items.length - 1]\n : this._items[nextItem.position - 1],\n middle: nextItem,\n right:\n nextItem.position === this._items.length - 1\n ? this._items[0]\n : this._items[nextItem.position + 1],\n };\n this._rotate(rotationItems);\n this._setActiveItem(nextItem);\n if (this._intervalInstance) {\n this.pause();\n this.cycle();\n }\n\n this._options.onChange(this);\n }\n\n /**\n * Based on the currently active item it will go to the next position\n */\n next() {\n const activeItem = this._getActiveItem();\n let nextItem = null;\n\n // check if last item\n if (activeItem.position === this._items.length - 1) {\n nextItem = this._items[0];\n } else {\n nextItem = this._items[activeItem.position + 1];\n }\n\n this.slideTo(nextItem.position);\n\n // callback function\n this._options.onNext(this);\n }\n\n /**\n * Based on the currently active item it will go to the previous position\n */\n prev() {\n const activeItem = this._getActiveItem();\n let prevItem = null;\n\n // check if first item\n if (activeItem.position === 0) {\n prevItem = this._items[this._items.length - 1];\n } else {\n prevItem = this._items[activeItem.position - 1];\n }\n\n this.slideTo(prevItem.position);\n\n // callback function\n this._options.onPrev(this);\n }\n\n /**\n * This method applies the transform classes based on the left, middle, and right rotation carousel items\n * @param {*} rotationItems\n */\n _rotate(rotationItems: RotationItems) {\n // reset\n this._items.map((item: CarouselItem) => {\n item.el.classList.add('hidden');\n });\n\n // left item (previously active)\n rotationItems.left.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.left.el.classList.add('-translate-x-full', 'z-10');\n\n // currently active item\n rotationItems.middle.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-10'\n );\n rotationItems.middle.el.classList.add('translate-x-0', 'z-20');\n\n // right item (upcoming active)\n rotationItems.right.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.right.el.classList.add('translate-x-full', 'z-10');\n }\n\n /**\n * Set an interval to cycle through the carousel items\n */\n cycle() {\n if (typeof window !== 'undefined') {\n this._intervalInstance = window.setInterval(() => {\n this.next();\n }, this._intervalDuration);\n }\n }\n\n /**\n * Clears the cycling interval\n */\n pause() {\n clearInterval(this._intervalInstance);\n }\n\n /**\n * Get the currently active item\n */\n _getActiveItem() {\n return this._activeItem;\n }\n\n /**\n * Set the currently active item and data attribute\n * @param {*} position\n */\n _setActiveItem(item: CarouselItem) {\n this._activeItem = item;\n const position = item.position;\n\n // update the indicators if available\n if (this._indicators.length) {\n this._indicators.map((indicator) => {\n indicator.el.setAttribute('aria-current', 'false');\n indicator.el.classList.remove(\n ...this._options.indicators.activeClasses.split(' ')\n );\n indicator.el.classList.add(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n });\n this._indicators[position].el.classList.add(\n ...this._options.indicators.activeClasses.split(' ')\n );\n this._indicators[position].el.classList.remove(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n this._indicators[position].el.setAttribute('aria-current', 'true');\n }\n }\n}\n\nexport function initCarousels() {\n document.querySelectorAll('[data-carousel]').forEach(($carouselEl) => {\n const interval = $carouselEl.getAttribute('data-carousel-interval');\n const slide =\n $carouselEl.getAttribute('data-carousel') === 'slide'\n ? true\n : false;\n\n const items: CarouselItem[] = [];\n let defaultPosition = 0;\n if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-item]')\n ).map(($carouselItemEl: HTMLElement, position: number) => {\n items.push({\n position: position,\n el: $carouselItemEl,\n });\n\n if (\n $carouselItemEl.getAttribute('data-carousel-item') ===\n 'active'\n ) {\n defaultPosition = position;\n }\n });\n }\n\n const indicators: IndicatorItem[] = [];\n if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-slide-to]')\n ).map(($indicatorEl: HTMLElement) => {\n indicators.push({\n position: parseInt(\n $indicatorEl.getAttribute('data-carousel-slide-to')\n ),\n el: $indicatorEl,\n });\n });\n }\n\n const carousel = new Carousel(items, {\n defaultPosition: defaultPosition,\n indicators: {\n items: indicators,\n },\n interval: interval ? interval : Default.interval,\n } as CarouselOptions);\n\n if (slide) {\n carousel.cycle();\n }\n\n // check for controls\n const carouselNextEl = $carouselEl.querySelector(\n '[data-carousel-next]'\n );\n const carouselPrevEl = $carouselEl.querySelector(\n '[data-carousel-prev]'\n );\n\n if (carouselNextEl) {\n carouselNextEl.addEventListener('click', () => {\n carousel.next();\n });\n }\n\n if (carouselPrevEl) {\n carouselPrevEl.addEventListener('click', () => {\n carousel.prev();\n });\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Carousel = Carousel;\n window.initCarousels = initCarousels;\n}\n\nexport default Carousel;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { CollapseOptions } from './types';\nimport { CollapseInterface } from './interface';\n\nconst Default: CollapseOptions = {\n onCollapse: () => {},\n onExpand: () => {},\n onToggle: () => {},\n};\n\nclass Collapse implements CollapseInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: CollapseOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: CollapseOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n if (this._triggerEl.hasAttribute('aria-expanded')) {\n this._visible =\n this._triggerEl.getAttribute('aria-expanded') === 'true';\n } else {\n // fix until v2 not to break previous single collapses which became dismiss\n this._visible = !this._targetEl.classList.contains('hidden');\n }\n\n this._triggerEl.addEventListener('click', () => {\n this.toggle();\n });\n }\n }\n\n collapse() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onCollapse(this);\n }\n\n expand() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onExpand(this);\n }\n\n toggle() {\n if (this._visible) {\n this.collapse();\n } else {\n this.expand();\n }\n // callback function\n this._options.onToggle(this);\n }\n}\n\nexport function initCollapses() {\n document\n .querySelectorAll('[data-collapse-toggle]')\n .forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-collapse-toggle');\n const $targetEl = document.getElementById(targetId);\n\n // check if the target element exists\n if ($targetEl) {\n new Collapse(\n $targetEl as HTMLElement,\n $triggerEl as HTMLElement\n );\n } else {\n console.error(\n `The target element with id \"${targetId}\" does not exist. Please check the data-collapse-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Collapse = Collapse;\n window.initCollapses = initCollapses;\n}\n\nexport default Collapse;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DialOptions, DialTriggerType } from './types';\nimport { DialInterface } from './interface';\n\nconst Default: DialOptions = {\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dial implements DialInterface {\n _parentEl: HTMLElement;\n _triggerEl: HTMLElement;\n _targetEl: HTMLElement;\n _options: DialOptions;\n _visible: boolean;\n\n constructor(\n parentEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n targetEl: HTMLElement | null = null,\n options: DialOptions = Default\n ) {\n this._parentEl = parentEl;\n this._triggerEl = triggerEl;\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n const triggerEventTypes = this._getTriggerEventTypes(\n this._options.triggerType\n );\n triggerEventTypes.showEvents.forEach((ev: string) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEventTypes.hideEvents.forEach((ev: string) => {\n this._parentEl.addEventListener(ev, () => {\n if (!this._parentEl.matches(':hover')) {\n this.hide();\n }\n });\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n\n _getTriggerEventTypes(triggerType: DialTriggerType) {\n switch (triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n}\n\nexport function initDials() {\n document.querySelectorAll('[data-dial-init]').forEach(($parentEl) => {\n const $triggerEl = $parentEl.querySelector('[data-dial-toggle]');\n\n if ($triggerEl) {\n const dialId = $triggerEl.getAttribute('data-dial-toggle');\n const $dialEl = document.getElementById(dialId);\n\n if ($dialEl) {\n const triggerType =\n $triggerEl.getAttribute('data-dial-trigger');\n new Dial(\n $parentEl as HTMLElement,\n $triggerEl as HTMLElement,\n $dialEl as HTMLElement,\n {\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as DialOptions\n );\n } else {\n console.error(\n `Dial with id ${dialId} does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?`\n );\n }\n } else {\n console.error(\n `Dial with id ${$parentEl.id} does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dial = Dial;\n window.initDials = initDials;\n}\n\nexport default Dial;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DismissOptions } from './types';\nimport { DismissInterface } from './interface';\n\nconst Default: DismissOptions = {\n transition: 'transition-opacity',\n duration: 300,\n timing: 'ease-out',\n onHide: () => {},\n};\n\nclass Dismiss implements DismissInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: DismissOptions;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: DismissOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._triggerEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add(\n this._options.transition,\n `duration-${this._options.duration}`,\n this._options.timing,\n 'opacity-0'\n );\n setTimeout(() => {\n this._targetEl.classList.add('hidden');\n }, this._options.duration);\n\n // callback function\n this._options.onHide(this, this._targetEl);\n }\n}\n\nexport function initDismisses() {\n document.querySelectorAll('[data-dismiss-target]').forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-dismiss-target');\n const $dismissEl = document.querySelector(targetId);\n\n if ($dismissEl) {\n new Dismiss($dismissEl as HTMLElement, $triggerEl as HTMLElement);\n } else {\n console.error(\n `The dismiss element with id \"${targetId}\" does not exist. Please check the data-dismiss-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dismiss = Dismiss;\n window.initDismisses = initDismisses;\n}\n\nexport default Dismiss;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DrawerInstance, DrawerOptions, PlacementClasses } from './types';\nimport { DrawerInterface } from './interface';\n\nconst Default: DrawerOptions = {\n placement: 'left',\n bodyScrolling: false,\n backdrop: true,\n edge: false,\n edgeOffset: 'bottom-[60px]',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Drawer implements DrawerInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DrawerOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: DrawerOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n // set initial accessibility attributes\n if (this._targetEl) {\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.classList.add('transition-transform');\n }\n\n // set base placement classes\n this._getPlacementClasses(this._options.placement).base.map((c) => {\n this._targetEl.classList.add(c);\n });\n\n // add keyboard event listener to document\n document.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n // if 'Escape' key is pressed\n if (this.isVisible()) {\n // if the Drawer is visible\n this.hide(); // hide the Drawer\n }\n }\n });\n }\n\n hide() {\n // based on the edge option show placement classes\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.remove(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.add(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n\n // enable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.remove('overflow-hidden');\n }\n\n // destroy backdrop\n if (this._options.backdrop) {\n this._destroyBackdropEl();\n }\n\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.add(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.remove(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n\n // disable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.add('overflow-hidden');\n }\n\n // show backdrop\n if (this._options.backdrop) {\n this._createBackdrop();\n }\n\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _createBackdrop() {\n if (!this._visible) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('drawer-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n backdropEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n _destroyBackdropEl() {\n if (this._visible) {\n document.querySelector('[drawer-backdrop]').remove();\n }\n }\n\n _getPlacementClasses(placement: string): PlacementClasses {\n switch (placement) {\n case 'top':\n return {\n base: ['top-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['-translate-y-full'],\n };\n case 'right':\n return {\n base: ['right-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-x-full'],\n };\n case 'bottom':\n return {\n base: ['bottom-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full'],\n };\n case 'left':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n case 'bottom-edge':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full', this._options.edgeOffset],\n };\n default:\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n}\n\nconst getDrawerInstance = (id: string, instances: DrawerInstance[]) => {\n if (instances.some((drawerInstance) => drawerInstance.id === id)) {\n return instances.find((drawerInstance) => drawerInstance.id === id);\n }\n};\n\nexport function initDrawers() {\n const drawerInstances = [] as DrawerInstance[];\n document.querySelectorAll('[data-drawer-target]').forEach(($triggerEl) => {\n // mandatory\n const drawerId = $triggerEl.getAttribute('data-drawer-target');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n // optional\n const placement = $triggerEl.getAttribute('data-drawer-placement');\n const bodyScrolling = $triggerEl.getAttribute(\n 'data-drawer-body-scrolling'\n );\n const backdrop = $triggerEl.getAttribute('data-drawer-backdrop');\n const edge = $triggerEl.getAttribute('data-drawer-edge');\n const edgeOffset = $triggerEl.getAttribute(\n 'data-drawer-edge-offset'\n );\n\n if (!getDrawerInstance(drawerId, drawerInstances)) {\n drawerInstances.push({\n id: drawerId,\n object: new Drawer($drawerEl, {\n placement: placement ? placement : Default.placement,\n bodyScrolling: bodyScrolling\n ? bodyScrolling === 'true'\n ? true\n : false\n : Default.bodyScrolling,\n backdrop: backdrop\n ? backdrop === 'true'\n ? true\n : false\n : Default.backdrop,\n edge: edge\n ? edge === 'true'\n ? true\n : false\n : Default.edge,\n edgeOffset: edgeOffset\n ? edgeOffset\n : Default.edgeOffset,\n } as DrawerOptions),\n });\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-toggle]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-toggle');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer: DrawerInstance = getDrawerInstance(\n drawerId,\n drawerInstances\n );\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.toggle();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document\n .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]')\n .forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-dismiss')\n ? $triggerEl.getAttribute('data-drawer-dismiss')\n : $triggerEl.getAttribute('data-drawer-hide');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.hide();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-show]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-show');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.show();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Drawer = Drawer;\n window.initDrawers = initDrawers;\n}\n\nexport default Drawer;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { DropdownOptions } from './types';\nimport { DropdownInterface } from './interface';\n\nconst Default: DropdownOptions = {\n placement: 'bottom',\n triggerType: 'click',\n offsetSkidding: 0,\n offsetDistance: 10,\n delay: 300,\n ignoreClickOutsideClass: false,\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dropdown implements DropdownInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DropdownOptions;\n _visible: boolean;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetElement: HTMLElement | null = null,\n triggerElement: HTMLElement | null = null,\n options: DropdownOptions = Default\n ) {\n this._targetEl = targetElement;\n this._triggerEl = triggerElement;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n // click event handling for trigger element\n if (this._options.triggerType === 'click') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.toggle();\n });\n });\n }\n\n // hover event handling for trigger element\n if (this._options.triggerType === 'hover') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n if (ev === 'click') {\n this.toggle();\n } else {\n setTimeout(() => {\n this.show();\n }, this._options.delay);\n }\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n });\n }\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [\n this._options.offsetSkidding,\n this._options.offsetDistance,\n ],\n },\n },\n ],\n });\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n\n // Ignore clicks on the trigger element (ie. a datepicker input)\n const ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;\n\n let isIgnored = false;\n if (ignoreClickOutsideClass) {\n const ignoredClickOutsideEls = document.querySelectorAll(\n `.${ignoreClickOutsideClass}`\n );\n ignoredClickOutsideEls.forEach((el) => {\n if (el.contains(clickedEl)) {\n isIgnored = true;\n return;\n }\n });\n }\n\n // Ignore clicks on the target element (ie. dropdown itself)\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n !isIgnored &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'click'],\n hideEvents: ['mouseleave'],\n };\n case 'click':\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n }\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n isVisible() {\n return this._visible;\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n this._targetEl.classList.add('block');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n this._setupClickOutsideListener();\n\n // Update its position\n this._popperInstance.update();\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('block');\n this._targetEl.classList.add('hidden');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n this._visible = false;\n\n this._removeClickOutsideListener();\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initDropdowns() {\n document\n .querySelectorAll('[data-dropdown-toggle]')\n .forEach(($triggerEl) => {\n const dropdownId = $triggerEl.getAttribute('data-dropdown-toggle');\n const $dropdownEl = document.getElementById(dropdownId);\n\n if ($dropdownEl) {\n const placement = $triggerEl.getAttribute(\n 'data-dropdown-placement'\n );\n const offsetSkidding = $triggerEl.getAttribute(\n 'data-dropdown-offset-skidding'\n );\n const offsetDistance = $triggerEl.getAttribute(\n 'data-dropdown-offset-distance'\n );\n const triggerType = $triggerEl.getAttribute(\n 'data-dropdown-trigger'\n );\n const delay = $triggerEl.getAttribute('data-dropdown-delay');\n const ignoreClickOutsideClass = $triggerEl.getAttribute(\n 'data-dropdown-ignore-click-outside-class'\n );\n\n new Dropdown(\n $dropdownEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n offsetSkidding: offsetSkidding\n ? parseInt(offsetSkidding)\n : Default.offsetSkidding,\n offsetDistance: offsetDistance\n ? parseInt(offsetDistance)\n : Default.offsetDistance,\n delay: delay ? parseInt(delay) : Default.delay,\n ignoreClickOutsideClass: ignoreClickOutsideClass\n ? ignoreClickOutsideClass\n : Default.ignoreClickOutsideClass,\n } as DropdownOptions\n );\n } else {\n console.error(\n `The dropdown element with id \"${dropdownId}\" does not exist. Please check the data-dropdown-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dropdown = Dropdown;\n window.initDropdowns = initDropdowns;\n}\n\nexport default Dropdown;\n","import { initAccordions } from './accordion';\nimport { initCarousels } from './carousel';\nimport { initCollapses } from './collapse';\nimport { initDials } from './dial';\nimport { initDismisses } from './dismiss';\nimport { initDrawers } from './drawer';\nimport { initDropdowns } from './dropdown';\nimport { initModals } from './modal';\nimport { initPopovers } from './popover';\nimport { initTabs } from './tabs';\nimport { initTooltips } from './tooltip';\n\nexport function initFlowbite() {\n initAccordions();\n initCollapses();\n initCarousels();\n initDismisses();\n initDropdowns();\n initModals();\n initDrawers();\n initTabs();\n initTooltips();\n initPopovers();\n initDials();\n}\n\nif (typeof window !== 'undefined') {\n window.initFlowbite = initFlowbite;\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ModalInstance, ModalOptions } from './types';\nimport { ModalInterface } from './interface';\n\nconst Default: ModalOptions = {\n placement: 'center',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',\n backdrop: 'dynamic',\n closable: true,\n onHide: () => {},\n onShow: () => {},\n onToggle: () => {},\n};\n\nclass Modal implements ModalInterface {\n _targetEl: HTMLElement | null;\n _options: ModalOptions;\n _isHidden: boolean;\n _backdropEl: HTMLElement | null;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: ModalOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._isHidden = true;\n this._backdropEl = null;\n this._init();\n }\n\n _init() {\n if (this._targetEl) {\n this._getPlacementClasses().map((c) => {\n this._targetEl.classList.add(c);\n });\n }\n }\n\n _createBackdrop() {\n if (this._isHidden) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('modal-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n this._backdropEl = backdropEl;\n }\n }\n\n _destroyBackdropEl() {\n if (!this._isHidden) {\n document.querySelector('[modal-backdrop]').remove();\n }\n }\n\n _setupModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleOutsideClick(ev.target);\n };\n this._targetEl.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._targetEl.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _handleOutsideClick(target: EventTarget) {\n if (\n target === this._targetEl ||\n (target === this._backdropEl && this.isVisible())\n ) {\n this.hide();\n }\n }\n\n _getPlacementClasses() {\n switch (this._options.placement) {\n // top\n case 'top-left':\n return ['justify-start', 'items-start'];\n case 'top-center':\n return ['justify-center', 'items-start'];\n case 'top-right':\n return ['justify-end', 'items-start'];\n\n // center\n case 'center-left':\n return ['justify-start', 'items-center'];\n case 'center':\n return ['justify-center', 'items-center'];\n case 'center-right':\n return ['justify-end', 'items-center'];\n\n // bottom\n case 'bottom-left':\n return ['justify-start', 'items-end'];\n case 'bottom-center':\n return ['justify-center', 'items-end'];\n case 'bottom-right':\n return ['justify-end', 'items-end'];\n\n default:\n return ['justify-center', 'items-center'];\n }\n }\n\n toggle() {\n if (this._isHidden) {\n this.show();\n } else {\n this.hide();\n }\n\n // callback function\n this._options.onToggle(this);\n }\n\n show() {\n if (this.isHidden) {\n this._targetEl.classList.add('flex');\n this._targetEl.classList.remove('hidden');\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n this._createBackdrop();\n this._isHidden = false;\n\n // prevent body scroll\n document.body.classList.add('overflow-hidden');\n\n // Add keyboard event listener to the document\n if (this._options.closable) {\n this._setupModalCloseEventListeners();\n }\n\n // callback function\n this._options.onShow(this);\n }\n }\n\n hide() {\n if (this.isVisible) {\n this._targetEl.classList.add('hidden');\n this._targetEl.classList.remove('flex');\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n this._destroyBackdropEl();\n this._isHidden = true;\n\n // re-apply body scroll\n document.body.classList.remove('overflow-hidden');\n\n if (this._options.closable) {\n this._removeModalCloseEventListeners();\n }\n\n // callback function\n this._options.onHide(this);\n }\n }\n\n isVisible() {\n return !this._isHidden;\n }\n\n isHidden() {\n return this._isHidden;\n }\n}\n\nconst getModalInstance = (id: string, instances: ModalInstance[]) => {\n if (instances.some((modalInstance) => modalInstance.id === id)) {\n return instances.find((modalInstance) => modalInstance.id === id);\n }\n return null;\n};\n\nexport function initModals() {\n const modalInstances = [] as ModalInstance[];\n\n // initiate modal based on data-modal-target\n document.querySelectorAll('[data-modal-target]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-target');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n if (!getModalInstance(modalId, modalInstances)) {\n modalInstances.push({\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n });\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.`\n );\n }\n });\n\n // support pre v1.6.0 data-modal-toggle initialization\n document.querySelectorAll('[data-modal-toggle]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-toggle');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n let modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (!modal) {\n modal = {\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n };\n modalInstances.push(modal);\n }\n\n $triggerEl.addEventListener('click', () => {\n modal.object.toggle();\n });\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?`\n );\n }\n });\n\n // show modal on click if exists based on id\n document.querySelectorAll('[data-modal-show]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-show');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isHidden) {\n modal.object.show();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?`\n );\n }\n });\n\n // hide modal on click if exists based on id\n document.querySelectorAll('[data-modal-hide]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-hide');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isVisible) {\n modal.object.hide();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Modal = Modal;\n window.initModals = initModals;\n}\n\nexport default Modal;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { PopoverOptions } from './types';\nimport { PopoverInterface } from './interface';\n\nconst Default: PopoverOptions = {\n placement: 'top',\n offset: 10,\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Popover implements PopoverInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: PopoverOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: PopoverOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, this._options.offset],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility to true\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility to false\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initPopovers() {\n document.querySelectorAll('[data-popover-target]').forEach(($triggerEl) => {\n const popoverID = $triggerEl.getAttribute('data-popover-target');\n const $popoverEl = document.getElementById(popoverID);\n\n if ($popoverEl) {\n const triggerType = $triggerEl.getAttribute('data-popover-trigger');\n const placement = $triggerEl.getAttribute('data-popover-placement');\n const offset = $triggerEl.getAttribute('data-popover-offset');\n\n new Popover(\n $popoverEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n offset: offset ? parseInt(offset) : Default.offset,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as PopoverOptions\n );\n } else {\n console.error(\n `The popover element with id \"${popoverID}\" does not exist. Please check the data-popover-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Popover = Popover;\n window.initPopovers = initPopovers;\n}\n\nexport default Popover;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { TabItem, TabsOptions } from './types';\nimport { TabsInterface } from './interface';\n\nconst Default: TabsOptions = {\n defaultTabId: null,\n activeClasses:\n 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500',\n inactiveClasses:\n 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300',\n onShow: () => {},\n};\n\nclass Tabs implements TabsInterface {\n _items: TabItem[];\n _activeTab: TabItem;\n _options: TabsOptions;\n\n constructor(items: TabItem[] = [], options: TabsOptions = Default) {\n this._items = items;\n this._activeTab = options ? this.getTab(options.defaultTabId) : null;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._items.length) {\n // set the first tab as active if not set by explicitly\n if (!this._activeTab) {\n this._setActiveTab(this._items[0]);\n }\n\n // force show the first default tab\n this.show(this._activeTab.id, true);\n\n // show tab content based on click\n this._items.map((tab) => {\n tab.triggerEl.addEventListener('click', () => {\n this.show(tab.id);\n });\n });\n }\n }\n\n getActiveTab() {\n return this._activeTab;\n }\n\n _setActiveTab(tab: TabItem) {\n this._activeTab = tab;\n }\n\n getTab(id: string) {\n return this._items.filter((t) => t.id === id)[0];\n }\n\n show(id: string, forceShow = false) {\n const tab = this.getTab(id);\n\n // don't do anything if already active\n if (tab === this._activeTab && !forceShow) {\n return;\n }\n\n // hide other tabs\n this._items.map((t: TabItem) => {\n if (t !== tab) {\n t.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n t.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n t.targetEl.classList.add('hidden');\n t.triggerEl.setAttribute('aria-selected', 'false');\n }\n });\n\n // show active tab\n tab.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n tab.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n tab.triggerEl.setAttribute('aria-selected', 'true');\n tab.targetEl.classList.remove('hidden');\n\n this._setActiveTab(tab);\n\n // callback function\n this._options.onShow(this, tab);\n }\n}\n\nexport function initTabs() {\n document.querySelectorAll('[data-tabs-toggle]').forEach(($triggerEl) => {\n const tabItems: TabItem[] = [];\n let defaultTabId = null;\n $triggerEl\n .querySelectorAll('[role=\"tab\"]')\n .forEach(($triggerEl: HTMLElement) => {\n const isActive =\n $triggerEl.getAttribute('aria-selected') === 'true';\n const tab: TabItem = {\n id: $triggerEl.getAttribute('data-tabs-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-tabs-target')\n ),\n };\n tabItems.push(tab);\n\n if (isActive) {\n defaultTabId = tab.id;\n }\n });\n new Tabs(tabItems, {\n defaultTabId: defaultTabId,\n } as TabsOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tabs = Tabs;\n window.initTabs = initTabs;\n}\n\nexport default Tabs;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { TooltipOptions } from './types';\nimport { TooltipInterface } from './interface';\n\nconst Default: TooltipOptions = {\n placement: 'top',\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Tooltip implements TooltipInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: TooltipOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: TooltipOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.hide();\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initTooltips() {\n document.querySelectorAll('[data-tooltip-target]').forEach(($triggerEl) => {\n const tooltipId = $triggerEl.getAttribute('data-tooltip-target');\n const $tooltipEl = document.getElementById(tooltipId);\n\n if ($tooltipEl) {\n const triggerType = $triggerEl.getAttribute('data-tooltip-trigger');\n const placement = $triggerEl.getAttribute('data-tooltip-placement');\n\n new Tooltip(\n $tooltipEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as TooltipOptions\n );\n } else {\n console.error(\n `The tooltip element with id \"${tooltipId}\" does not exist. Please check the data-tooltip-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tooltip = Tooltip;\n window.initTooltips = initTooltips;\n}\n\nexport default Tooltip;\n","class Events {\n private _eventType: string;\n private _eventFunctions: EventListener[];\n\n constructor(eventType: string, eventFunctions: EventListener[] = []) {\n this._eventType = eventType;\n this._eventFunctions = eventFunctions;\n }\n\n init() {\n this._eventFunctions.forEach((eventFunction) => {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import './flowbite.css';\n\n// core components\nimport Accordion, { initAccordions } from './components/accordion';\nimport Carousel, { initCarousels } from './components/carousel';\nimport Collapse, { initCollapses } from './components/collapse';\nimport Dial, { initDials } from './components/dial';\nimport Dismiss, { initDismisses } from './components/dismiss';\nimport Drawer, { initDrawers } from './components/drawer';\nimport Dropdown, { initDropdowns } from './components/dropdown';\nimport Modal, { initModals } from './components/modal';\nimport Popover, { initPopovers } from './components/popover';\nimport Tabs, { initTabs } from './components/tabs';\nimport Tooltip, { initTooltips } from './components/tooltip';\nimport './components/index';\nimport Events from './dom/events';\n\nconst events = new Events('load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nevents.init();\n\nexport default {\n Accordion,\n Carousel,\n Collapse,\n Dial,\n Drawer,\n Dismiss,\n Dropdown,\n Modal,\n Popover,\n Tabs,\n Tooltip,\n Events,\n};\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.min.css b/node_modules/flowbite/dist/flowbite.min.css new file mode 100644 index 0000000..591f2b0 --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.min.css @@ -0,0 +1 @@ +/*! tailwindcss v3.3.0 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}.tooltip-arrow,.tooltip-arrow:before{background:inherit;height:8px;position:absolute;width:8px}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{content:"";transform:rotate(45deg);visibility:visible}[data-tooltip-style^=light]+.tooltip>.tooltip-arrow:before{border-color:#e5e7eb;border-style:solid}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=top]>.tooltip-arrow:before{border-bottom-width:1px;border-right-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=right]>.tooltip-arrow:before{border-bottom-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=bottom]>.tooltip-arrow:before{border-left-width:1px;border-top-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=left]>.tooltip-arrow:before{border-right-width:1px;border-top-width:1px}.tooltip[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.tooltip[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.tooltip[data-popper-placement^=right]>.tooltip-arrow{left:-4px}.tooltip.invisible>.tooltip-arrow:before{visibility:hidden}[data-popper-arrow],[data-popper-arrow]:before{background:inherit;height:8px;position:absolute;width:8px}[data-popper-arrow]{visibility:hidden}[data-popper-arrow]:after,[data-popper-arrow]:before{content:"";transform:rotate(45deg);visibility:visible}[data-popper-arrow]:after{background:inherit;height:9px;position:absolute;width:9px}[role=tooltip]>[data-popper-arrow]:before{border-color:#e5e7eb;border-style:solid}.dark [role=tooltip]>[data-popper-arrow]:before{border-color:#4b5563;border-style:solid}[role=tooltip]>[data-popper-arrow]:after{border-color:#e5e7eb;border-style:solid}.dark [role=tooltip]>[data-popper-arrow]:after{border-color:#4b5563;border-style:solid}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:after,[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:before{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:after,[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:before{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:after,[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:before{border-left-width:1px;border-top-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:after,[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:before{border-right-width:1px;border-top-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]{bottom:-5px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]{top:-5px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]{right:-5px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]{left:-5px}[role=tooltip].invisible>[data-popper-arrow]:after,[role=tooltip].invisible>[data-popper-arrow]:before{visibility:hidden}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#1c64f2;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#1c64f2;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select:not([size]){background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 10 6'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 4 4 4-4'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;background-size:.75em .75em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#1c64f2;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#1c64f2;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.dark [type=checkbox]:checked,.dark [type=radio]:checked,[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:.55em .55em;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}.dark [type=radio]:checked,[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E");background-size:1em 1em}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:.55em .55em;border-color:transparent;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px auto inherit}input[type=file]::file-selector-button{-webkit-margin-start:-1rem;-webkit-margin-end:1rem;background:#1f2937;border:0;color:#fff;cursor:pointer;font-size:.875rem;font-weight:500;margin-inline-end:1rem;margin-inline-start:-1rem;padding:.625rem 1rem .625rem 2rem}input[type=file]::file-selector-button:hover{background:#374151}.dark input[type=file]::file-selector-button{background:#4b5563;color:#fff}.dark input[type=file]::file-selector-button:hover{background:#6b7280}input[type=range]::-webkit-slider-thumb{appearance:none;-moz-appearance:none;-webkit-appearance:none;background:#1c64f2;border:0;border-radius:9999px;cursor:pointer;height:1.25rem;width:1.25rem}input[type=range]:disabled::-webkit-slider-thumb{background:#9ca3af}.dark input[type=range]:disabled::-webkit-slider-thumb{background:#6b7280}input[type=range]:focus::-webkit-slider-thumb{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1px;--tw-ring-color:rgb(164 202 254/var(--tw-ring-opacity));box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);outline:2px solid transparent;outline-offset:2px}input[type=range]::-moz-range-thumb{appearance:none;-moz-appearance:none;-webkit-appearance:none;background:#1c64f2;border:0;border-radius:9999px;cursor:pointer;height:1.25rem;width:1.25rem}input[type=range]:disabled::-moz-range-thumb{background:#9ca3af}.dark input[type=range]:disabled::-moz-range-thumb{background:#6b7280}input[type=range]::-moz-range-progress{background:#3f83f8}input[type=range]::-ms-fill-lower{background:#3f83f8}input[type=range].range-sm::-webkit-slider-thumb{height:1rem;width:1rem}input[type=range].range-lg::-webkit-slider-thumb{height:1.5rem;width:1.5rem}input[type=range].range-sm::-moz-range-thumb{height:1rem;width:1rem}input[type=range].range-lg::-moz-range-thumb{height:1.5rem;width:1.5rem}.toggle-bg:after{background:#fff;border-color:#d1d5db;border-radius:9999px;border-width:1px;box-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);content:"";height:1.25rem;left:.125rem;position:absolute;top:.125rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;width:1.25rem}input:checked+.toggle-bg:after{border-color:#fff;transform:translateX(100%);}input:checked+.toggle-bg{background:#1c64f2;border-color:#1c64f2}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(63,131,248,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(63,131,248,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.apexcharts-canvas .apexcharts-tooltip{background-color:#fff;border:0!important;border-radius:.25rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);color:#6b7280}.dark .apexcharts-canvas .apexcharts-tooltip{background-color:#374151;border-color:transparent;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);color:#9ca3af}.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title{background-color:#f3f4f6;border-bottom-color:#e5e7eb;color:#6b7280;font-size:.875rem!important;font-weight:400;margin-bottom:.75rem;padding:.5rem .75rem}.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title{background-color:#4b5563;border-color:#6b7280;color:#9ca3af}.apexcharts-canvas .apexcharts-xaxistooltip{background-color:#fff;border-color:transparent;border-radius:.25rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);color:#6b7280;padding:.5rem .75rem}.dark .apexcharts-canvas .apexcharts-xaxistooltip{background-color:#374151;color:#9ca3af}.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label{color:#6b7280;font-size:.875rem}.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label{color:#9ca3af}.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value{color:#111827;font-size:.875rem}.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value{color:#fff}.apexcharts-canvas .apexcharts-xaxistooltip-text{font-size:.875rem!important;font-weight:400}.apexcharts-canvas .apexcharts-xaxistooltip:after,.apexcharts-canvas .apexcharts-xaxistooltip:before{border-bottom-color:#fff}.apexcharts-canvas .apexcharts-xaxistooltip:after{border-width:8px;margin-left:-8px}.apexcharts-canvas .apexcharts-xaxistooltip:before{border-width:10px;margin-left:-10px}.dark .apexcharts-canvas .apexcharts-xaxistooltip:after,.dark .apexcharts-canvas .apexcharts-xaxistooltip:before{border-bottom-color:#374151}.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-y-group{padding:0}.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active{background-color:#fff!important;color:#6b7280!important;padding-bottom:.75rem;padding-left:.75rem;padding-right:.75rem}.dark .apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active{background-color:#374151!important;color:#9ca3af!important}.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active:first-of-type{padding-top:.75rem}.apexcharts-canvas .apexcharts-legend{padding:0!important}.apexcharts-canvas .apexcharts-legend-text{color:#6b7280!important;font-size:.75rem;font-weight:500!important;padding-left:1.25rem}.apexcharts-canvas .apexcharts-legend-text:not(.apexcharts-inactive-legend):hover{color:#111827!important}.dark .apexcharts-canvas .apexcharts-legend-text{color:#9ca3af!important}.dark .apexcharts-canvas .apexcharts-legend-text:not(.apexcharts-inactive-legend):hover{color:#fff!important}.apexcharts-canvas .apexcharts-legend-series{align-items:center;display:flex;margin-bottom:.25rem!important;margin-left:.5rem;margin-right:.5rem}.apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-value{fill:#111827!important;font-size:1.875rem;font-weight:700}.dark .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-value{fill:#fff!important}.apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-label{fill:#6b7280!important;font-size:1rem;font-weight:400}.dark .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-label{fill:#9ca3af!important}.apexcharts-canvas .apexcharts-datalabels .apexcharts-text.apexcharts-pie-label{filter:none!important;font-size:.75rem!important;font-weight:600!important;text-shadow:none!important}.apexcharts-gridline,.apexcharts-xcrosshairs,.apexcharts-ycrosshairs{stroke:#e5e7eb!important}.dark .apexcharts-gridline,.dark .apexcharts-xcrosshairs,.dark .apexcharts-ycrosshairs{stroke:#374151!important}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-y-0{bottom:0;top:0}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-left-14{left:-3.5rem}.-left-3{left:-.75rem}.-left-4{left:-1rem}.-left-\[17px\]{left:-17px}.-right-2{right:-.5rem}.-right-\[16px\]{right:-16px}.-right-\[17px\]{right:-17px}.-top-2{top:-.5rem}.-top-\[140px\]{top:-140px}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[\*px\]{bottom:*px}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-5{left:1.25rem}.left-6{left:1.5rem}.left-7{left:1.75rem}.left-8{left:2rem}.left-auto{left:auto}.right-0{right:0}.right-1\/2{right:50%}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-24{right:6rem}.right-3{right:.75rem}.right-5{right:1.25rem}.right-6{right:1.5rem}.right-auto{right:auto}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-2\/4{top:50%}.top-28{top:7rem}.top-3{top:.75rem}.top-4{top:1rem}.top-5{top:1.25rem}.top-6{top:1.5rem}.top-\[124px\]{top:124px}.top-\[142px\]{top:142px}.top-\[178px\]{top:178px}.top-\[40px\]{top:40px}.top-\[72px\]{top:72px}.top-\[88px\]{top:88px}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-6{grid-column:span 6/span 6}.m-2{margin:.5rem}.m-2\.5{margin:.625rem}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-my-1{margin-bottom:-.25rem;margin-top:-.25rem}.-my-1\.5{margin-bottom:-.375rem;margin-top:-.375rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-1\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-bottom:2.5rem;margin-top:2.5rem}.my-12{margin-bottom:3rem;margin-top:3rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-4{margin-bottom:1rem;margin-top:1rem}.my-6{margin-bottom:1.5rem;margin-top:1.5rem}.my-7{margin-bottom:1.75rem;margin-top:1.75rem}.my-8{margin-bottom:2rem;margin-top:2rem}.-mb-5{margin-bottom:-1.25rem}.-mb-px{margin-bottom:-1px}.-ml-0{margin-left:0}.-ml-0\.5{margin-left:-.125rem}.-ml-1{margin-left:-.25rem}.-mr-0{margin-right:0}.-mr-0\.5{margin-right:-.125rem}.-mr-1{margin-right:-.25rem}.-mt-1{margin-top:-.25rem}.-mt-5{margin-top:-1.25rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.mb-8{margin-bottom:2rem}.mb-px{margin-bottom:1px}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-2\.5{margin-left:.625rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-2\.5{margin-right:.625rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-5{margin-right:1.25rem}.mr-6{margin-right:1.5rem}.mr-8{margin-right:2rem}.mr-auto{margin-right:auto}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-14{margin-top:3.5rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.mt-\[2px\]{margin-top:2px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.flow-root{display:flow-root}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-36{height:9rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1\.1rem\]{height:1.1rem}.h-\[140px\]{height:140px}.h-\[156px\]{height:156px}.h-\[172px\]{height:172px}.h-\[17px\]{height:17px}.h-\[18px\]{height:18px}.h-\[193px\]{height:193px}.h-\[213px\]{height:213px}.h-\[24px\]{height:24px}.h-\[32px\]{height:32px}.h-\[41px\]{height:41px}.h-\[426px\]{height:426px}.h-\[454px\]{height:454px}.h-\[46px\]{height:46px}.h-\[48px\]{height:48px}.h-\[52px\]{height:52px}.h-\[55px\]{height:55px}.h-\[56px\]{height:56px}.h-\[572px\]{height:572px}.h-\[5px\]{height:5px}.h-\[600px\]{height:600px}.h-\[63px\]{height:63px}.h-\[64px\]{height:64px}.h-\[78px\]{height:78px}.h-\[calc\(100\%-1rem\)\]{height:calc(100% - 1rem)}.h-\[calc\(100vh-5rem\)\]{height:calc(100vh - 5rem)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-72{max-height:18rem}.max-h-\[48px\]{max-height:48px}.max-h-full{max-height:100%}.w-1{width:.25rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/4{width:50%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-52{width:13rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[1\.1rem\]{width:1.1rem}.w-\[148px\]{width:148px}.w-\[188px\]{width:188px}.w-\[208px\]{width:208px}.w-\[272px\]{width:272px}.w-\[300px\]{width:300px}.w-\[3px\]{width:3px}.w-\[48px\]{width:48px}.w-\[52px\]{width:52px}.w-\[56px\]{width:56px}.w-\[6px\]{width:6px}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-2xl{max-width:42rem}.max-w-2xs{max-width:16rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-8xl{max-width:90rem}.max-w-\[128px\]{max-width:128px}.max-w-\[133px\]{max-width:133px}.max-w-\[300px\]{max-width:300px}.max-w-\[301px\]{max-width:301px}.max-w-\[330px\]{max-width:330px}.max-w-\[341px\]{max-width:341px}.max-w-\[351px\]{max-width:351px}.max-w-\[360px\]{max-width:360px}.max-w-\[380px\]{max-width:380px}.max-w-\[400px\]{max-width:400px}.max-w-\[440px\]{max-width:440px}.max-w-\[450px\]{max-width:450px}.max-w-\[460px\]{max-width:460px}.max-w-\[480px\]{max-width:480px}.max-w-\[48px\]{max-width:48px}.max-w-\[500px\]{max-width:500px}.max-w-\[540px\]{max-width:540px}.max-w-\[640px\]{max-width:640px}.max-w-\[83px\]{max-width:83px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-screen-md{max-width:768px}.max-w-screen-xl{max-width:1280px}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-\[0\]{transform-origin:0}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-x-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x:-100%}.-translate-y-1\/2{--tw-translate-y:-50%}.-translate-y-1\/2,.-translate-y-3{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-3{--tw-translate-y:-0.75rem}.-translate-y-4{--tw-translate-y:-1rem}.-translate-y-4,.-translate-y-6{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-6{--tw-translate-y:-1.5rem}.-translate-y-full{--tw-translate-y:-100%}.-translate-y-full,.translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px}.translate-x-1\/2{--tw-translate-x:50%}.translate-x-1\/2,.translate-x-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x:100%}.translate-y-1\/2{--tw-translate-y:50%}.translate-y-1\/2,.translate-y-1\/4{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\/4{--tw-translate-y:25%}.translate-y-full{--tw-translate-y:100%}.rotate-180,.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.rotate-45{--tw-rotate:45deg}.rotate-45,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.scale-75{--tw-scale-x:.75;--tw-scale-y:.75}.scale-75,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-12{gap:3rem}.gap-16{gap:4rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-16{-moz-column-gap:4rem;column-gap:4rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-3{row-gap:.75rem}.-space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(-.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(-.75rem*var(--tw-space-x-reverse))}.-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(-1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(-1rem*var(--tw-space-x-reverse))}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(-1px*(1 - var(--tw-space-x-reverse)));margin-right:calc(-1px*var(--tw-space-x-reverse))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-2\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.625rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.625rem*var(--tw-space-x-reverse))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.space-x-5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1.25rem*var(--tw-space-x-reverse))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1.5rem*var(--tw-space-x-reverse))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.125rem*var(--tw-space-y-reverse));margin-top:calc(.125rem*(1 - var(--tw-space-y-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.375rem*var(--tw-space-y-reverse));margin-top:calc(.375rem*(1 - var(--tw-space-y-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.625rem*var(--tw-space-y-reverse));margin-top:calc(.625rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.25rem*var(--tw-space-y-reverse));margin-top:calc(1.25rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(2rem*var(--tw-space-y-reverse));margin-top:calc(2rem*(1 - var(--tw-space-y-reverse)))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(1px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(1px*var(--tw-divide-x-reverse))}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(2px*var(--tw-divide-x-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(243 244 246/var(--tw-divide-opacity))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity))}.divide-gray-300>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(209 213 219/var(--tw-divide-opacity))}.divide-gray-500>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(107 114 128/var(--tw-divide-opacity))}.place-self-center{place-self:center}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.rounded{border-radius:.25rem}.rounded-\[2\.5rem\]{border-radius:2.5rem}.rounded-\[2rem\]{border-radius:2rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-b-\[1rem\]{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}.rounded-b-\[2\.5rem\]{border-bottom-left-radius:2.5rem;border-bottom-right-radius:2.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-b-xl{border-bottom-left-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-l{border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.rounded-l-lg{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem}.rounded-l-md{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.rounded-r{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.rounded-r-lg{border-bottom-right-radius:.5rem;border-top-right-radius:.5rem}.rounded-r-md{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-\[2\.5rem\]{border-top-left-radius:2.5rem;border-top-right-radius:2.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.rounded-bl-lg{border-bottom-left-radius:.5rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tr-lg{border-top-right-radius:.5rem}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-\[10px\]{border-width:10px}.border-\[14px\]{border-width:14px}.border-\[16px\]{border-width:16px}.border-\[8px\]{border-width:8px}.border-x{border-left-width:1px;border-right-width:1px}.border-y{border-top-width:1px}.border-b,.border-y{border-bottom-width:1px}.border-b-0{border-bottom-width:0}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0}.border-t{border-top-width:1px}.border-t-0{border-top-width:0}.border-t-4{border-top-width:4px}.border-dashed{border-style:dashed}.\!border-blue-700{--tw-border-opacity:1!important;border-color:rgb(26 86 219/var(--tw-border-opacity))!important}.border-blue-100{--tw-border-opacity:1;border-color:rgb(225 239 254/var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity:1;border-color:rgb(164 202 254/var(--tw-border-opacity))}.border-blue-400{--tw-border-opacity:1;border-color:rgb(118 169 250/var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity:1;border-color:rgb(28 100 242/var(--tw-border-opacity))}.border-blue-700{--tw-border-opacity:1;border-color:rgb(26 86 219/var(--tw-border-opacity))}.border-blue-800{--tw-border-opacity:1;border-color:rgb(30 66 159/var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}.border-gray-800{--tw-border-opacity:1;border-color:rgb(31 41 55/var(--tw-border-opacity))}.border-gray-900{--tw-border-opacity:1;border-color:rgb(17 24 39/var(--tw-border-opacity))}.border-green-300{--tw-border-opacity:1;border-color:rgb(132 225 188/var(--tw-border-opacity))}.border-green-400{--tw-border-opacity:1;border-color:rgb(49 196 141/var(--tw-border-opacity))}.border-green-500{--tw-border-opacity:1;border-color:rgb(14 159 110/var(--tw-border-opacity))}.border-green-600{--tw-border-opacity:1;border-color:rgb(5 122 85/var(--tw-border-opacity))}.border-green-700{--tw-border-opacity:1;border-color:rgb(4 108 78/var(--tw-border-opacity))}.border-green-800{--tw-border-opacity:1;border-color:rgb(3 84 63/var(--tw-border-opacity))}.border-indigo-400{--tw-border-opacity:1;border-color:rgb(141 162 251/var(--tw-border-opacity))}.border-pink-400{--tw-border-opacity:1;border-color:rgb(241 126 184/var(--tw-border-opacity))}.border-purple-400{--tw-border-opacity:1;border-color:rgb(172 148 250/var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity:1;border-color:rgb(108 43 217/var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgb(248 180 180/var(--tw-border-opacity))}.border-red-400{--tw-border-opacity:1;border-color:rgb(249 128 128/var(--tw-border-opacity))}.border-red-500{--tw-border-opacity:1;border-color:rgb(240 82 82/var(--tw-border-opacity))}.border-red-600{--tw-border-opacity:1;border-color:rgb(224 36 36/var(--tw-border-opacity))}.border-red-700{--tw-border-opacity:1;border-color:rgb(200 30 30/var(--tw-border-opacity))}.border-red-800{--tw-border-opacity:1;border-color:rgb(155 28 28/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.border-yellow-300{--tw-border-opacity:1;border-color:rgb(250 202 21/var(--tw-border-opacity))}.border-yellow-400{--tw-border-opacity:1;border-color:rgb(227 160 8/var(--tw-border-opacity))}.border-yellow-800{--tw-border-opacity:1;border-color:rgb(114 59 19/var(--tw-border-opacity))}.border-l-gray-100{--tw-border-opacity:1;border-left-color:rgb(243 244 246/var(--tw-border-opacity))}.border-l-gray-50{--tw-border-opacity:1;border-left-color:rgb(249 250 251/var(--tw-border-opacity))}.bg-\[\#050708\]{--tw-bg-opacity:1;background-color:rgb(5 7 8/var(--tw-bg-opacity))}.bg-\[\#1da1f2\]{--tw-bg-opacity:1;background-color:rgb(29 161 242/var(--tw-bg-opacity))}.bg-\[\#24292F\]{--tw-bg-opacity:1;background-color:rgb(36 41 47/var(--tw-bg-opacity))}.bg-\[\#2557D6\]{--tw-bg-opacity:1;background-color:rgb(37 87 214/var(--tw-bg-opacity))}.bg-\[\#3b5998\]{--tw-bg-opacity:1;background-color:rgb(59 89 152/var(--tw-bg-opacity))}.bg-\[\#4285F4\]{--tw-bg-opacity:1;background-color:rgb(66 133 244/var(--tw-bg-opacity))}.bg-\[\#F7BE38\]{--tw-bg-opacity:1;background-color:rgb(247 190 56/var(--tw-bg-opacity))}.bg-\[\#FF9119\]{--tw-bg-opacity:1;background-color:rgb(255 145 25/var(--tw-bg-opacity))}.bg-\[\#hex\]{background-color:#hex}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(225 239 254/var(--tw-bg-opacity))}.bg-blue-200{--tw-bg-opacity:1;background-color:rgb(195 221 253/var(--tw-bg-opacity))}.bg-blue-300{--tw-bg-opacity:1;background-color:rgb(164 202 254/var(--tw-bg-opacity))}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(118 169 250/var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(235 245 255/var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(63 131 248/var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(28 100 242/var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgb(26 86 219/var(--tw-bg-opacity))}.bg-blue-800{--tw-bg-opacity:1;background-color:rgb(30 66 159/var(--tw-bg-opacity))}.bg-blue-900{--tw-bg-opacity:1;background-color:rgb(35 56 118/var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.bg-gray-900\/50{background-color:rgba(17,24,39,.5)}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(222 247 236/var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity:1;background-color:rgb(188 240 218/var(--tw-bg-opacity))}.bg-green-300{--tw-bg-opacity:1;background-color:rgb(132 225 188/var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(49 196 141/var(--tw-bg-opacity))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(243 250 247/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(14 159 110/var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity:1;background-color:rgb(5 122 85/var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity:1;background-color:rgb(4 108 78/var(--tw-bg-opacity))}.bg-green-800{--tw-bg-opacity:1;background-color:rgb(3 84 63/var(--tw-bg-opacity))}.bg-green-900{--tw-bg-opacity:1;background-color:rgb(1 71 55/var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(229 237 255/var(--tw-bg-opacity))}.bg-indigo-200{--tw-bg-opacity:1;background-color:rgb(205 219 254/var(--tw-bg-opacity))}.bg-indigo-300{--tw-bg-opacity:1;background-color:rgb(180 198 252/var(--tw-bg-opacity))}.bg-indigo-400{--tw-bg-opacity:1;background-color:rgb(141 162 251/var(--tw-bg-opacity))}.bg-indigo-50{--tw-bg-opacity:1;background-color:rgb(240 245 255/var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity:1;background-color:rgb(104 117 245/var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(88 80 236/var(--tw-bg-opacity))}.bg-indigo-700{--tw-bg-opacity:1;background-color:rgb(81 69 205/var(--tw-bg-opacity))}.bg-indigo-800{--tw-bg-opacity:1;background-color:rgb(66 56 157/var(--tw-bg-opacity))}.bg-indigo-900{--tw-bg-opacity:1;background-color:rgb(54 47 120/var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(254 236 220/var(--tw-bg-opacity))}.bg-orange-300{--tw-bg-opacity:1;background-color:rgb(253 186 140/var(--tw-bg-opacity))}.bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 248 241/var(--tw-bg-opacity))}.bg-pink-100{--tw-bg-opacity:1;background-color:rgb(252 232 243/var(--tw-bg-opacity))}.bg-pink-200{--tw-bg-opacity:1;background-color:rgb(250 209 232/var(--tw-bg-opacity))}.bg-pink-300{--tw-bg-opacity:1;background-color:rgb(248 180 217/var(--tw-bg-opacity))}.bg-pink-400{--tw-bg-opacity:1;background-color:rgb(241 126 184/var(--tw-bg-opacity))}.bg-pink-50{--tw-bg-opacity:1;background-color:rgb(253 242 248/var(--tw-bg-opacity))}.bg-pink-500{--tw-bg-opacity:1;background-color:rgb(231 70 148/var(--tw-bg-opacity))}.bg-pink-600{--tw-bg-opacity:1;background-color:rgb(214 31 105/var(--tw-bg-opacity))}.bg-pink-700{--tw-bg-opacity:1;background-color:rgb(191 18 93/var(--tw-bg-opacity))}.bg-pink-800{--tw-bg-opacity:1;background-color:rgb(153 21 75/var(--tw-bg-opacity))}.bg-pink-900{--tw-bg-opacity:1;background-color:rgb(117 26 61/var(--tw-bg-opacity))}.bg-purple-100{--tw-bg-opacity:1;background-color:rgb(237 235 254/var(--tw-bg-opacity))}.bg-purple-200{--tw-bg-opacity:1;background-color:rgb(220 215 254/var(--tw-bg-opacity))}.bg-purple-300{--tw-bg-opacity:1;background-color:rgb(202 191 253/var(--tw-bg-opacity))}.bg-purple-400{--tw-bg-opacity:1;background-color:rgb(172 148 250/var(--tw-bg-opacity))}.bg-purple-50{--tw-bg-opacity:1;background-color:rgb(246 245 255/var(--tw-bg-opacity))}.bg-purple-500{--tw-bg-opacity:1;background-color:rgb(144 97 249/var(--tw-bg-opacity))}.bg-purple-600{--tw-bg-opacity:1;background-color:rgb(126 58 242/var(--tw-bg-opacity))}.bg-purple-700{--tw-bg-opacity:1;background-color:rgb(108 43 217/var(--tw-bg-opacity))}.bg-purple-800{--tw-bg-opacity:1;background-color:rgb(85 33 181/var(--tw-bg-opacity))}.bg-purple-900{--tw-bg-opacity:1;background-color:rgb(74 29 150/var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(253 232 232/var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity:1;background-color:rgb(251 213 213/var(--tw-bg-opacity))}.bg-red-300{--tw-bg-opacity:1;background-color:rgb(248 180 180/var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity:1;background-color:rgb(249 128 128/var(--tw-bg-opacity))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(253 242 242/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(240 82 82/var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(224 36 36/var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity:1;background-color:rgb(200 30 30/var(--tw-bg-opacity))}.bg-red-800{--tw-bg-opacity:1;background-color:rgb(155 28 28/var(--tw-bg-opacity))}.bg-red-900{--tw-bg-opacity:1;background-color:rgb(119 29 29/var(--tw-bg-opacity))}.bg-teal-100{--tw-bg-opacity:1;background-color:rgb(213 245 246/var(--tw-bg-opacity))}.bg-teal-50{--tw-bg-opacity:1;background-color:rgb(237 250 250/var(--tw-bg-opacity))}.bg-teal-500{--tw-bg-opacity:1;background-color:rgb(6 148 162/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-white\/30{background-color:hsla(0,0%,100%,.3)}.bg-white\/50{background-color:hsla(0,0%,100%,.5)}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(253 246 178/var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity:1;background-color:rgb(252 233 106/var(--tw-bg-opacity))}.bg-yellow-300{--tw-bg-opacity:1;background-color:rgb(250 202 21/var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity:1;background-color:rgb(227 160 8/var(--tw-bg-opacity))}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(253 253 234/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(194 120 3/var(--tw-bg-opacity))}.bg-yellow-600{--tw-bg-opacity:1;background-color:rgb(159 88 10/var(--tw-bg-opacity))}.bg-yellow-700{--tw-bg-opacity:1;background-color:rgb(142 75 16/var(--tw-bg-opacity))}.bg-yellow-800{--tw-bg-opacity:1;background-color:rgb(114 59 19/var(--tw-bg-opacity))}.bg-yellow-900{--tw-bg-opacity:1;background-color:rgb(99 49 18/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.bg-\[url\(\'https\:\/\/flowbite\.s3\.amazonaws\.com\/docs\/jumbotron\/conference\.jpg\'\)\]{background-image:url(https://flowbite.s3.amazonaws.com/docs/jumbotron/conference.jpg)}.bg-\[url\(\'https\:\/\/flowbite\.s3\.amazonaws\.com\/docs\/jumbotron\/hero-pattern\.svg\'\)\]{background-image:url(https://flowbite.s3.amazonaws.com/docs/jumbotron/hero-pattern.svg)}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:#ebf5ff var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(235,245,255,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from:#3f83f8 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(63,131,248,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-cyan-400{--tw-gradient-from:#22d3ee var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(34,211,238,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from:#06b6d4 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(6,182,212,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-green-400{--tw-gradient-from:#31c48d var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(49,196,141,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-lime-200{--tw-gradient-from:#d9f99d var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:hsla(81,88%,80%,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-pink-400{--tw-gradient-from:#f17eb8 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(241,126,184,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from:#e74694 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(231,70,148,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from:#9061f9 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(144,97,249,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from:#7e3af2 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(126,58,242,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-red-200{--tw-gradient-from:#fbd5d5 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:hsla(0,83%,91%,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-red-400{--tw-gradient-from:#f98080 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:hsla(0,91%,74%,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-sky-400{--tw-gradient-from:#38bdf8 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(56,189,248,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-teal-200{--tw-gradient-from:#afecef var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(175,236,239,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-teal-300{--tw-gradient-from:#7edce2 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(126,220,226,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-teal-400{--tw-gradient-from:#16bdca var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(22,189,202,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.via-blue-600{--tw-gradient-via-position: ;--tw-gradient-to:rgba(28,100,242,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#1c64f2 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-cyan-500{--tw-gradient-via-position: ;--tw-gradient-to:rgba(6,182,212,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#06b6d4 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-green-500{--tw-gradient-via-position: ;--tw-gradient-to:rgba(14,159,110,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#0e9f6e var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-lime-400{--tw-gradient-via-position: ;--tw-gradient-to:rgba(163,230,53,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#a3e635 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-pink-500{--tw-gradient-via-position: ;--tw-gradient-to:rgba(231,70,148,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#e74694 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-purple-600{--tw-gradient-via-position: ;--tw-gradient-to:rgba(126,58,242,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#7e3af2 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-red-300{--tw-gradient-via-position: ;--tw-gradient-to:hsla(0,83%,84%,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#f8b4b4 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-red-500{--tw-gradient-via-position: ;--tw-gradient-to:rgba(240,82,82,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#f05252 var(--tw-gradient-via-position),var(--tw-gradient-to)}.via-teal-500{--tw-gradient-via-position: ;--tw-gradient-to:rgba(6,148,162,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#0694a2 var(--tw-gradient-via-position),var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to:#3f83f8 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-blue-600{--tw-gradient-to:#1c64f2 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-blue-700{--tw-gradient-to:#1a56db var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-cyan-600{--tw-gradient-to:#0891b2 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-emerald-600{--tw-gradient-to:#059669 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-green-600{--tw-gradient-to:#057a55 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-lime-200{--tw-gradient-to:#d9f99d var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-lime-300{--tw-gradient-to:#bef264 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-lime-500{--tw-gradient-to:#84cc16 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-orange-400{--tw-gradient-to:#ff8a4c var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-pink-500{--tw-gradient-to:#e74694 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-pink-600{--tw-gradient-to:#d61f69 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-purple-700{--tw-gradient-to:#6c2bd9 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-red-600{--tw-gradient-to:#e02424 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-teal-600{--tw-gradient-to:#047481 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-transparent{--tw-gradient-to:transparent var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-yellow-200{--tw-gradient-to:#fce96a var(--tw-gradient-to-position);--tw-gradient-to-position: }.bg-cover{background-size:cover}.bg-local{background-attachment:local}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-center{background-position:50%}.bg-no-repeat{background-repeat:no-repeat}.fill-blue-600{fill:#1c64f2}.fill-gray-500{fill:#6b7280}.fill-gray-600{fill:#4b5563}.fill-green-500{fill:#0e9f6e}.fill-pink-600{fill:#d61f69}.fill-purple-600{fill:#7e3af2}.fill-red-600{fill:#e02424}.fill-yellow-400{fill:#e3a008}.object-cover{-o-object-fit:cover;object-fit:cover}.\!p-0{padding:0!important}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-bottom:0;padding-top:0}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-12{padding-bottom:3rem;padding-top:3rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.py-24{padding-bottom:6rem;padding-top:6rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-3\.5{padding-bottom:.875rem;padding-top:.875rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-48{padding-bottom:12rem;padding-top:12rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-px{padding-bottom:1px;padding-top:1px}.pb-0{padding-bottom:0}.pb-1{padding-bottom:.25rem}.pb-1\.5{padding-bottom:.375rem}.pb-10{padding-bottom:2.5rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-2\.5{padding-bottom:.625rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-48{padding-bottom:12rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-8{padding-bottom:2rem}.pb-96{padding-bottom:24rem}.pl-0{padding-left:0}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-3\.5{padding-left:.875rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-10{padding-top:2.5rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-24{padding-top:6rem}.pt-3{padding-top:.75rem}.pt-32{padding-top:8rem}.pt-36{padding-top:9rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-52{padding-top:13rem}.pt-6{padding-top:1.5rem}.pt-60{padding-top:15rem}.pt-64{padding-top:16rem}.pt-8{padding-top:2rem}.pt-80{padding-top:20rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-justify{text-align:justify}.font-sans{font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-2xs{font-size:.625rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-7xl{font-size:4.5rem;line-height:1}.text-8xl{font-size:6rem;line-height:1}.text-9xl{font-size:8rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-extralight{font-weight:200}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-loose{line-height:2}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-normal{letter-spacing:0}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.\!text-blue-700{--tw-text-opacity:1!important;color:rgb(26 86 219/var(--tw-text-opacity))!important}.text-\[\#626890\]{--tw-text-opacity:1;color:rgb(98 104 144/var(--tw-text-opacity))}.text-\[\#ff2d20\]{--tw-text-opacity:1;color:rgb(255 45 32/var(--tw-text-opacity))}.text-blue-100{--tw-text-opacity:1;color:rgb(225 239 254/var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity:1;color:rgb(118 169 250/var(--tw-text-opacity))}.text-blue-50{--tw-text-opacity:1;color:rgb(235 245 255/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}.text-blue-600\/100{color:#1c64f2}.text-blue-600\/25{color:rgba(28,100,242,.25)}.text-blue-600\/50{color:rgba(28,100,242,.5)}.text-blue-600\/75{color:rgba(28,100,242,.75)}.text-blue-700{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity:1;color:rgb(30 66 159/var(--tw-text-opacity))}.text-blue-900{--tw-text-opacity:1;color:rgb(35 56 118/var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-green-400{--tw-text-opacity:1;color:rgb(49 196 141/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(14 159 110/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(5 122 85/var(--tw-text-opacity))}.text-green-700{--tw-text-opacity:1;color:rgb(4 108 78/var(--tw-text-opacity))}.text-green-800{--tw-text-opacity:1;color:rgb(3 84 63/var(--tw-text-opacity))}.text-green-900{--tw-text-opacity:1;color:rgb(1 71 55/var(--tw-text-opacity))}.text-indigo-400{--tw-text-opacity:1;color:rgb(141 162 251/var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity:1;color:rgb(81 69 205/var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity:1;color:rgb(66 56 157/var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity:1;color:rgb(255 90 31/var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity:1;color:rgb(208 56 1/var(--tw-text-opacity))}.text-orange-800{--tw-text-opacity:1;color:rgb(138 44 13/var(--tw-text-opacity))}.text-pink-400{--tw-text-opacity:1;color:rgb(241 126 184/var(--tw-text-opacity))}.text-pink-800{--tw-text-opacity:1;color:rgb(153 21 75/var(--tw-text-opacity))}.text-purple-400{--tw-text-opacity:1;color:rgb(172 148 250/var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity:1;color:rgb(126 58 242/var(--tw-text-opacity))}.text-purple-700{--tw-text-opacity:1;color:rgb(108 43 217/var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity:1;color:rgb(85 33 181/var(--tw-text-opacity))}.text-red-400{--tw-text-opacity:1;color:rgb(249 128 128/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(240 82 82/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(224 36 36/var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:rgb(200 30 30/var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:rgb(155 28 28/var(--tw-text-opacity))}.text-red-900{--tw-text-opacity:1;color:rgb(119 29 29/var(--tw-text-opacity))}.text-sky-500{--tw-text-opacity:1;color:rgb(14 165 233/var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity:1;color:rgb(4 116 129/var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-300{--tw-text-opacity:1;color:rgb(250 202 21/var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity:1;color:rgb(227 160 8/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(194 120 3/var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity:1;color:rgb(142 75 16/var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity:1;color:rgb(114 59 19/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.decoration-blue-400{text-decoration-color:#76a9fa}.decoration-blue-500{text-decoration-color:#3f83f8}.decoration-gray-500{text-decoration-color:#6b7280}.decoration-green-500{text-decoration-color:#0e9f6e}.decoration-indigo-500{text-decoration-color:#6875f5}.decoration-red-500{text-decoration-color:#f05252}.decoration-sky-500{text-decoration-color:#0ea5e9}.decoration-solid{text-decoration-style:solid}.decoration-double{text-decoration-style:double}.decoration-dotted{text-decoration-style:dotted}.decoration-dashed{text-decoration-style:dashed}.decoration-wavy{text-decoration-style:wavy}.decoration-8{text-decoration-thickness:8px}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-green-700::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(4 108 78/var(--tw-placeholder-opacity))}.placeholder-green-700::placeholder{--tw-placeholder-opacity:1;color:rgb(4 108 78/var(--tw-placeholder-opacity))}.placeholder-red-700::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(200 30 30/var(--tw-placeholder-opacity))}.placeholder-red-700::placeholder{--tw-placeholder-opacity:1;color:rgb(200 30 30/var(--tw-placeholder-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.bg-blend-multiply{background-blend-mode:multiply}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/50{--tw-shadow-color:rgba(63,131,248,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-cyan-500\/50{--tw-shadow-color:rgba(6,182,212,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-green-500\/50{--tw-shadow-color:rgba(14,159,110,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-lime-500\/50{--tw-shadow-color:rgba(132,204,22,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-pink-500\/50{--tw-shadow-color:rgba(231,70,148,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-purple-500\/50{--tw-shadow-color:rgba(144,97,249,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-red-500\/50{--tw-shadow-color:rgba(240,82,82,.5);--tw-shadow:var(--tw-shadow-colored)}.shadow-teal-500\/50{--tw-shadow-color:rgba(6,148,162,.5);--tw-shadow:var(--tw-shadow-colored)}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-0,.ring-1{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-2,.ring-4{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-4{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-8{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-inset{--tw-ring-inset:inset}.ring-black{--tw-ring-opacity:1;--tw-ring-color:rgb(0 0 0/var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity))}.ring-white{--tw-ring-opacity:1;--tw-ring-color:rgb(255 255 255/var(--tw-ring-opacity))}.ring-opacity-0{--tw-ring-opacity:0}.blur{--tw-blur:blur(8px)}.blur,.blur-sm{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-sm{--tw-blur:blur(4px)}.grayscale{--tw-grayscale:grayscale(100%)}.grayscale,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.first-letter\:float-left:first-letter{float:left}.first-letter\:mr-3:first-letter{margin-right:.75rem}.first-letter\:text-7xl:first-letter{font-size:4.5rem;line-height:1}.first-letter\:font-bold:first-letter{font-weight:700}.first-letter\:text-gray-900:first-letter{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.first-line\:uppercase:first-line{text-transform:uppercase}.first-line\:tracking-widest:first-line{letter-spacing:.1em}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:left-\[4px\]:after{content:var(--tw-content);left:4px}.after\:top-0:after{content:var(--tw-content);top:0}.after\:top-0\.5:after{content:var(--tw-content);top:.125rem}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:mx-2:after{content:var(--tw-content);margin-left:.5rem;margin-right:.5rem}.after\:mx-6:after{content:var(--tw-content);margin-left:1.5rem;margin-right:1.5rem}.after\:inline-block:after{content:var(--tw-content);display:inline-block}.after\:hidden:after{content:var(--tw-content);display:none}.after\:h-1:after{content:var(--tw-content);height:.25rem}.after\:h-4:after{content:var(--tw-content);height:1rem}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:h-6:after{content:var(--tw-content);height:1.5rem}.after\:w-4:after{content:var(--tw-content);width:1rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:w-6:after{content:var(--tw-content);width:1.5rem}.after\:w-full:after{content:var(--tw-content);width:100%}.after\:rounded-full:after{border-radius:9999px;content:var(--tw-content)}.after\:border:after{border-width:1px;content:var(--tw-content)}.after\:border-4:after{border-width:4px;content:var(--tw-content)}.after\:border-b:after{border-bottom-width:1px;content:var(--tw-content)}.after\:border-blue-100:after{--tw-border-opacity:1;border-color:rgb(225 239 254/var(--tw-border-opacity));content:var(--tw-content)}.after\:border-gray-100:after{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity));content:var(--tw-content)}.after\:border-gray-200:after{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.after\:border-gray-300:after{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity));content:var(--tw-content)}.after\:bg-white:after{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));content:var(--tw-content)}.after\:text-gray-200:after{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity));content:var(--tw-content)}.after\:transition-all:after{content:var(--tw-content);transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}.after\:content-\[\'\/\'\]:after{--tw-content:"/";content:var(--tw-content)}.hover\:border-gray-200:hover{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.hover\:border-gray-300:hover{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.hover\:bg-\[\#050708\]\/80:hover{background-color:rgba(5,7,8,.8)}.hover\:bg-\[\#050708\]\/90:hover{background-color:rgba(5,7,8,.9)}.hover\:bg-\[\#1da1f2\]\/90:hover{background-color:rgba(29,161,242,.9)}.hover\:bg-\[\#24292F\]\/90:hover{background-color:rgba(36,41,47,.9)}.hover\:bg-\[\#2557D6\]\/90:hover{background-color:rgba(37,87,214,.9)}.hover\:bg-\[\#3b5998\]\/90:hover{background-color:rgba(59,89,152,.9)}.hover\:bg-\[\#4285F4\]\/90:hover{background-color:rgba(66,133,244,.9)}.hover\:bg-\[\#F7BE38\]\/90:hover{background-color:rgba(247,190,56,.9)}.hover\:bg-\[\#FF9119\]\/80:hover{background-color:rgba(255,145,25,.8)}.hover\:bg-blue-100:hover{--tw-bg-opacity:1;background-color:rgb(225 239 254/var(--tw-bg-opacity))}.hover\:bg-blue-200:hover{--tw-bg-opacity:1;background-color:rgb(195 221 253/var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity:1;background-color:rgb(63 131 248/var(--tw-bg-opacity))}.hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(26 86 219/var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity:1;background-color:rgb(30 66 159/var(--tw-bg-opacity))}.hover\:bg-blue-900:hover{--tw-bg-opacity:1;background-color:rgb(35 56 118/var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.hover\:bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.hover\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}.hover\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.hover\:bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.hover\:bg-green-200:hover{--tw-bg-opacity:1;background-color:rgb(188 240 218/var(--tw-bg-opacity))}.hover\:bg-green-800:hover{--tw-bg-opacity:1;background-color:rgb(3 84 63/var(--tw-bg-opacity))}.hover\:bg-green-900:hover{--tw-bg-opacity:1;background-color:rgb(1 71 55/var(--tw-bg-opacity))}.hover\:bg-indigo-200:hover{--tw-bg-opacity:1;background-color:rgb(205 219 254/var(--tw-bg-opacity))}.hover\:bg-pink-200:hover{--tw-bg-opacity:1;background-color:rgb(250 209 232/var(--tw-bg-opacity))}.hover\:bg-purple-200:hover{--tw-bg-opacity:1;background-color:rgb(220 215 254/var(--tw-bg-opacity))}.hover\:bg-purple-800:hover{--tw-bg-opacity:1;background-color:rgb(85 33 181/var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity:1;background-color:rgb(251 213 213/var(--tw-bg-opacity))}.hover\:bg-red-800:hover{--tw-bg-opacity:1;background-color:rgb(155 28 28/var(--tw-bg-opacity))}.hover\:bg-red-900:hover{--tw-bg-opacity:1;background-color:rgb(119 29 29/var(--tw-bg-opacity))}.hover\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.hover\:bg-yellow-200:hover{--tw-bg-opacity:1;background-color:rgb(252 233 106/var(--tw-bg-opacity))}.hover\:bg-yellow-500:hover{--tw-bg-opacity:1;background-color:rgb(194 120 3/var(--tw-bg-opacity))}.hover\:bg-yellow-900:hover{--tw-bg-opacity:1;background-color:rgb(99 49 18/var(--tw-bg-opacity))}.hover\:bg-gradient-to-bl:hover{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-br:hover{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.hover\:bg-gradient-to-l:hover{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.hover\:from-teal-200:hover{--tw-gradient-from:#afecef var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(175,236,239,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.hover\:to-lime-200:hover{--tw-gradient-to:#d9f99d var(--tw-gradient-to-position);--tw-gradient-to-position: }.hover\:\!text-blue-700:hover{--tw-text-opacity:1!important;color:rgb(26 86 219/var(--tw-text-opacity))!important}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 66 159/var(--tw-text-opacity))}.hover\:text-blue-900:hover{--tw-text-opacity:1;color:rgb(35 56 118/var(--tw-text-opacity))}.hover\:text-gray-500:hover{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.hover\:text-green-900:hover{--tw-text-opacity:1;color:rgb(1 71 55/var(--tw-text-opacity))}.hover\:text-indigo-900:hover{--tw-text-opacity:1;color:rgb(54 47 120/var(--tw-text-opacity))}.hover\:text-pink-900:hover{--tw-text-opacity:1;color:rgb(117 26 61/var(--tw-text-opacity))}.hover\:text-purple-900:hover{--tw-text-opacity:1;color:rgb(74 29 150/var(--tw-text-opacity))}.hover\:text-red-900:hover{--tw-text-opacity:1;color:rgb(119 29 29/var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.hover\:text-yellow-900:hover{--tw-text-opacity:1;color:rgb(99 49 18/var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:bg-blend-soft-light:hover{background-blend-mode:soft-light}.hover\:shadow:hover{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:blur-none:hover{--tw-blur:blur(0)}.hover\:blur-none:hover,.hover\:grayscale-0:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\:grayscale-0:hover{--tw-grayscale:grayscale(0)}.focus\:z-10:focus{z-index:10}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(63 131 248/var(--tw-border-opacity))}.focus\:border-blue-600:focus{--tw-border-opacity:1;border-color:rgb(28 100 242/var(--tw-border-opacity))}.focus\:border-gray-200:focus{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.focus\:border-green-500:focus{--tw-border-opacity:1;border-color:rgb(14 159 110/var(--tw-border-opacity))}.focus\:border-green-600:focus{--tw-border-opacity:1;border-color:rgb(5 122 85/var(--tw-border-opacity))}.focus\:border-red-500:focus{--tw-border-opacity:1;border-color:rgb(240 82 82/var(--tw-border-opacity))}.focus\:border-red-600:focus{--tw-border-opacity:1;border-color:rgb(224 36 36/var(--tw-border-opacity))}.focus\:bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.focus\:bg-gray-900:focus{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.focus\:text-blue-700:focus{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}.focus\:text-white:focus{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-0:focus,.focus\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-4:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-\[\#050708\]\/50:focus{--tw-ring-color:rgba(5,7,8,.5)}.focus\:ring-\[\#1da1f2\]\/50:focus{--tw-ring-color:rgba(29,161,242,.5)}.focus\:ring-\[\#24292F\]\/50:focus{--tw-ring-color:rgba(36,41,47,.5)}.focus\:ring-\[\#2557D6\]\/50:focus{--tw-ring-color:rgba(37,87,214,.5)}.focus\:ring-\[\#3b5998\]\/50:focus{--tw-ring-color:rgba(59,89,152,.5)}.focus\:ring-\[\#4285F4\]\/50:focus{--tw-ring-color:rgba(66,133,244,.5)}.focus\:ring-\[\#F7BE38\]\/50:focus{--tw-ring-color:rgba(247,190,56,.5)}.focus\:ring-\[\#FF9119\]\/50:focus{--tw-ring-color:rgba(255,145,25,.5)}.focus\:ring-blue-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(195 221 253/var(--tw-ring-opacity))}.focus\:ring-blue-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(164 202 254/var(--tw-ring-opacity))}.focus\:ring-blue-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(118 169 250/var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(63 131 248/var(--tw-ring-opacity))}.focus\:ring-blue-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(28 100 242/var(--tw-ring-opacity))}.focus\:ring-blue-700:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(26 86 219/var(--tw-ring-opacity))}.focus\:ring-cyan-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(165 243 252/var(--tw-ring-opacity))}.focus\:ring-cyan-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(103 232 249/var(--tw-ring-opacity))}.focus\:ring-gray-100:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(243 244 246/var(--tw-ring-opacity))}.focus\:ring-gray-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(229 231 235/var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(156 163 175/var(--tw-ring-opacity))}.focus\:ring-gray-50:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(249 250 251/var(--tw-ring-opacity))}.focus\:ring-gray-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity))}.focus\:ring-gray-700:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(55 65 81/var(--tw-ring-opacity))}.focus\:ring-green-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(188 240 218/var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(132 225 188/var(--tw-ring-opacity))}.focus\:ring-green-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(49 196 141/var(--tw-ring-opacity))}.focus\:ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(14 159 110/var(--tw-ring-opacity))}.focus\:ring-lime-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(217 249 157/var(--tw-ring-opacity))}.focus\:ring-lime-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(190 242 100/var(--tw-ring-opacity))}.focus\:ring-orange-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(255 90 31/var(--tw-ring-opacity))}.focus\:ring-pink-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(250 209 232/var(--tw-ring-opacity))}.focus\:ring-pink-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(248 180 217/var(--tw-ring-opacity))}.focus\:ring-purple-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(220 215 254/var(--tw-ring-opacity))}.focus\:ring-purple-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(202 191 253/var(--tw-ring-opacity))}.focus\:ring-purple-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(144 97 249/var(--tw-ring-opacity))}.focus\:ring-red-100:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(253 232 232/var(--tw-ring-opacity))}.focus\:ring-red-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(248 180 180/var(--tw-ring-opacity))}.focus\:ring-red-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(249 128 128/var(--tw-ring-opacity))}.focus\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(240 82 82/var(--tw-ring-opacity))}.focus\:ring-teal-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(126 220 226/var(--tw-ring-opacity))}.focus\:ring-teal-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(6 148 162/var(--tw-ring-opacity))}.focus\:ring-yellow-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(250 202 21/var(--tw-ring-opacity))}.focus\:ring-yellow-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(227 160 8/var(--tw-ring-opacity))}.focus\:ring-yellow-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(194 120 3/var(--tw-ring-opacity))}.group:hover .group-hover\:rotate-45{--tw-rotate:45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:bg-white\/50{background-color:hsla(0,0%,100%,.5)}.group:hover .group-hover\:bg-opacity-0{--tw-bg-opacity:0}.group:hover .group-hover\:from-cyan-500{--tw-gradient-from:#06b6d4 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(6,182,212,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:from-green-400{--tw-gradient-from:#31c48d var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(49,196,141,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:from-pink-500{--tw-gradient-from:#e74694 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(231,70,148,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-500{--tw-gradient-from:#9061f9 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(144,97,249,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-600{--tw-gradient-from:#7e3af2 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(126,58,242,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:from-red-200{--tw-gradient-from:#fbd5d5 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:hsla(0,83%,91%,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:from-teal-300{--tw-gradient-from:#7edce2 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(126,220,226,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.group:hover .group-hover\:via-red-300{--tw-gradient-via-position: ;--tw-gradient-to:hsla(0,83%,84%,0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),#f8b4b4 var(--tw-gradient-via-position),var(--tw-gradient-to)}.group:hover .group-hover\:to-blue-500{--tw-gradient-to:#3f83f8 var(--tw-gradient-to-position);--tw-gradient-to-position: }.group:hover .group-hover\:to-blue-600{--tw-gradient-to:#1c64f2 var(--tw-gradient-to-position);--tw-gradient-to-position: }.group:hover .group-hover\:to-lime-300{--tw-gradient-to:#bef264 var(--tw-gradient-to-position);--tw-gradient-to-position: }.group:hover .group-hover\:to-orange-400{--tw-gradient-to:#ff8a4c var(--tw-gradient-to-position);--tw-gradient-to-position: }.group:hover .group-hover\:to-pink-500{--tw-gradient-to:#e74694 var(--tw-gradient-to-position);--tw-gradient-to-position: }.group:hover .group-hover\:to-yellow-200{--tw-gradient-to:#fce96a var(--tw-gradient-to-position);--tw-gradient-to-position: }.group:hover .group-hover\:text-blue-600{--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}.group:hover .group-hover\:text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.group:hover .group-hover\:text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.group:focus .group-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.group:focus .group-focus\:ring-4{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.group:focus .group-focus\:ring-white{--tw-ring-opacity:1;--tw-ring-color:rgb(255 255 255/var(--tw-ring-opacity))}.peer:checked~.peer-checked\:border-blue-600{--tw-border-opacity:1;border-color:rgb(28 100 242/var(--tw-border-opacity))}.peer:checked~.peer-checked\:bg-blue-600{--tw-bg-opacity:1;background-color:rgb(28 100 242/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:bg-green-600{--tw-bg-opacity:1;background-color:rgb(5 122 85/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:bg-orange-500{--tw-bg-opacity:1;background-color:rgb(255 90 31/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:bg-purple-600{--tw-bg-opacity:1;background-color:rgb(126 58 242/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:bg-red-600{--tw-bg-opacity:1;background-color:rgb(224 36 36/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:bg-teal-600{--tw-bg-opacity:1;background-color:rgb(4 116 129/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:bg-yellow-400{--tw-bg-opacity:1;background-color:rgb(227 160 8/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:text-blue-600{--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}.peer:checked~.peer-checked\:text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.peer:checked~.peer-checked\:after\:translate-x-full:after{--tw-translate-x:100%;content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content)}.peer:-moz-placeholder-shown~.peer-placeholder-shown\:top-1\/2{top:50%}.peer:placeholder-shown~.peer-placeholder-shown\:top-1\/2{top:50%}.peer:-moz-placeholder-shown~.peer-placeholder-shown\:-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:placeholder-shown~.peer-placeholder-shown\:-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:-moz-placeholder-shown~.peer-placeholder-shown\:translate-y-0{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:placeholder-shown~.peer-placeholder-shown\:translate-y-0{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:-moz-placeholder-shown~.peer-placeholder-shown\:scale-100{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:placeholder-shown~.peer-placeholder-shown\:scale-100{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:focus~.peer-focus\:left-0{left:0}.peer:focus~.peer-focus\:top-1{top:.25rem}.peer:focus~.peer-focus\:top-2{top:.5rem}.peer:focus~.peer-focus\:-translate-y-3{--tw-translate-y:-0.75rem}.peer:focus~.peer-focus\:-translate-y-3,.peer:focus~.peer-focus\:-translate-y-4{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:focus~.peer-focus\:-translate-y-4{--tw-translate-y:-1rem}.peer:focus~.peer-focus\:-translate-y-6{--tw-translate-y:-1.5rem}.peer:focus~.peer-focus\:-translate-y-6,.peer:focus~.peer-focus\:scale-75{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:focus~.peer-focus\:scale-75{--tw-scale-x:.75;--tw-scale-y:.75}.peer:focus~.peer-focus\:px-2{padding-left:.5rem;padding-right:.5rem}.peer:focus~.peer-focus\:font-medium{font-weight:500}.peer:focus~.peer-focus\:text-blue-600{--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-4{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.peer:focus~.peer-focus\:ring-blue-300{--tw-ring-opacity:1;--tw-ring-color:rgb(164 202 254/var(--tw-ring-opacity))}.peer:focus~.peer-focus\:ring-green-300{--tw-ring-opacity:1;--tw-ring-color:rgb(132 225 188/var(--tw-ring-opacity))}.peer:focus~.peer-focus\:ring-orange-300{--tw-ring-opacity:1;--tw-ring-color:rgb(253 186 140/var(--tw-ring-opacity))}.peer:focus~.peer-focus\:ring-purple-300{--tw-ring-opacity:1;--tw-ring-color:rgb(202 191 253/var(--tw-ring-opacity))}.peer:focus~.peer-focus\:ring-red-300{--tw-ring-opacity:1;--tw-ring-color:rgb(248 180 180/var(--tw-ring-opacity))}.peer:focus~.peer-focus\:ring-teal-300{--tw-ring-opacity:1;--tw-ring-color:rgb(126 220 226/var(--tw-ring-opacity))}.peer:focus~.peer-focus\:ring-yellow-300{--tw-ring-opacity:1;--tw-ring-color:rgb(250 202 21/var(--tw-ring-opacity))}:is(.dark .dark\:block){display:block}:is(.dark .dark\:inline-block){display:inline-block}:is(.dark .dark\:hidden){display:none}:is(.dark .dark\:divide-gray-600)>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(75 85 99/var(--tw-divide-opacity))}:is(.dark .dark\:divide-gray-700)>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(55 65 81/var(--tw-divide-opacity))}:is(.dark .dark\:\!border-blue-500){--tw-border-opacity:1!important;border-color:rgb(63 131 248/var(--tw-border-opacity))!important}:is(.dark .dark\:border-blue-400){--tw-border-opacity:1;border-color:rgb(118 169 250/var(--tw-border-opacity))}:is(.dark .dark\:border-blue-500){--tw-border-opacity:1;border-color:rgb(63 131 248/var(--tw-border-opacity))}:is(.dark .dark\:border-blue-600){--tw-border-opacity:1;border-color:rgb(28 100 242/var(--tw-border-opacity))}:is(.dark .dark\:border-blue-800){--tw-border-opacity:1;border-color:rgb(30 66 159/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-400){--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-500){--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-600){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-800){--tw-border-opacity:1;border-color:rgb(31 41 55/var(--tw-border-opacity))}:is(.dark .dark\:border-gray-900){--tw-border-opacity:1;border-color:rgb(17 24 39/var(--tw-border-opacity))}:is(.dark .dark\:border-green-400){--tw-border-opacity:1;border-color:rgb(49 196 141/var(--tw-border-opacity))}:is(.dark .dark\:border-green-500){--tw-border-opacity:1;border-color:rgb(14 159 110/var(--tw-border-opacity))}:is(.dark .dark\:border-green-600){--tw-border-opacity:1;border-color:rgb(5 122 85/var(--tw-border-opacity))}:is(.dark .dark\:border-green-800){--tw-border-opacity:1;border-color:rgb(3 84 63/var(--tw-border-opacity))}:is(.dark .dark\:border-purple-400){--tw-border-opacity:1;border-color:rgb(172 148 250/var(--tw-border-opacity))}:is(.dark .dark\:border-red-400){--tw-border-opacity:1;border-color:rgb(249 128 128/var(--tw-border-opacity))}:is(.dark .dark\:border-red-500){--tw-border-opacity:1;border-color:rgb(240 82 82/var(--tw-border-opacity))}:is(.dark .dark\:border-red-600){--tw-border-opacity:1;border-color:rgb(224 36 36/var(--tw-border-opacity))}:is(.dark .dark\:border-red-800){--tw-border-opacity:1;border-color:rgb(155 28 28/var(--tw-border-opacity))}:is(.dark .dark\:border-transparent){border-color:transparent}:is(.dark .dark\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}:is(.dark .dark\:border-yellow-300){--tw-border-opacity:1;border-color:rgb(250 202 21/var(--tw-border-opacity))}:is(.dark .dark\:border-yellow-800){--tw-border-opacity:1;border-color:rgb(114 59 19/var(--tw-border-opacity))}:is(.dark .dark\:border-l-gray-700){--tw-border-opacity:1;border-left-color:rgb(55 65 81/var(--tw-border-opacity))}:is(.dark .dark\:bg-blue-200){--tw-bg-opacity:1;background-color:rgb(195 221 253/var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-400){--tw-bg-opacity:1;background-color:rgb(118 169 250/var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-500){--tw-bg-opacity:1;background-color:rgb(63 131 248/var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity:1;background-color:rgb(28 100 242/var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-800){--tw-bg-opacity:1;background-color:rgb(30 66 159/var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity:1;background-color:rgb(35 56 118/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-300){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-400){--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-700){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800\/30){background-color:rgba(31,41,55,.3)}:is(.dark .dark\:bg-gray-800\/50){background-color:rgba(31,41,55,.5)}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900\/60){background-color:rgba(17,24,39,.6)}:is(.dark .dark\:bg-green-100){--tw-bg-opacity:1;background-color:rgb(222 247 236/var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-500){--tw-bg-opacity:1;background-color:rgb(14 159 110/var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-600){--tw-bg-opacity:1;background-color:rgb(5 122 85/var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-800){--tw-bg-opacity:1;background-color:rgb(3 84 63/var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-900){--tw-bg-opacity:1;background-color:rgb(1 71 55/var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-500){--tw-bg-opacity:1;background-color:rgb(104 117 245/var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-900){--tw-bg-opacity:1;background-color:rgb(54 47 120/var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-200){--tw-bg-opacity:1;background-color:rgb(252 217 189/var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-400){--tw-bg-opacity:1;background-color:rgb(255 138 76/var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-700){--tw-bg-opacity:1;background-color:rgb(180 52 3/var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-900){--tw-bg-opacity:1;background-color:rgb(117 26 61/var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-500){--tw-bg-opacity:1;background-color:rgb(144 97 249/var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-600){--tw-bg-opacity:1;background-color:rgb(126 58 242/var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-900){--tw-bg-opacity:1;background-color:rgb(74 29 150/var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-100){--tw-bg-opacity:1;background-color:rgb(253 232 232/var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-500){--tw-bg-opacity:1;background-color:rgb(240 82 82/var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-600){--tw-bg-opacity:1;background-color:rgb(224 36 36/var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity:1;background-color:rgb(155 28 28/var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-900){--tw-bg-opacity:1;background-color:rgb(119 29 29/var(--tw-bg-opacity))}:is(.dark .dark\:bg-white){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}:is(.dark .dark\:bg-yellow-300){--tw-bg-opacity:1;background-color:rgb(250 202 21/var(--tw-bg-opacity))}:is(.dark .dark\:bg-yellow-900){--tw-bg-opacity:1;background-color:rgb(99 49 18/var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity:0.8}:is(.dark .dark\:bg-\[url\(\'https\:\/\/flowbite\.s3\.amazonaws\.com\/docs\/jumbotron\/hero-pattern-dark\.svg\'\)\]){background-image:url(https://flowbite.s3.amazonaws.com/docs/jumbotron/hero-pattern-dark.svg)}:is(.dark .dark\:from-blue-900){--tw-gradient-from:#233876 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(35,56,118,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}:is(.dark .dark\:fill-gray-300){fill:#d1d5db}:is(.dark .dark\:fill-gray-400){fill:#9ca3af}:is(.dark .dark\:\!text-blue-500){--tw-text-opacity:1!important;color:rgb(63 131 248/var(--tw-text-opacity))!important}:is(.dark .dark\:text-blue-100){--tw-text-opacity:1;color:rgb(225 239 254/var(--tw-text-opacity))}:is(.dark .dark\:text-blue-200){--tw-text-opacity:1;color:rgb(195 221 253/var(--tw-text-opacity))}:is(.dark .dark\:text-blue-300){--tw-text-opacity:1;color:rgb(164 202 254/var(--tw-text-opacity))}:is(.dark .dark\:text-blue-400){--tw-text-opacity:1;color:rgb(118 169 250/var(--tw-text-opacity))}:is(.dark .dark\:text-blue-500){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .dark\:text-blue-500\/100){color:#3f83f8}:is(.dark .dark\:text-blue-500\/25){color:rgba(63,131,248,.25)}:is(.dark .dark\:text-blue-500\/50){color:rgba(63,131,248,.5)}:is(.dark .dark\:text-blue-500\/75){color:rgba(63,131,248,.75)}:is(.dark .dark\:text-blue-600){--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}:is(.dark .dark\:text-blue-800){--tw-text-opacity:1;color:rgb(30 66 159/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-100){--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-500){--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-700){--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}:is(.dark .dark\:text-gray-900){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}:is(.dark .dark\:text-green-200){--tw-text-opacity:1;color:rgb(188 240 218/var(--tw-text-opacity))}:is(.dark .dark\:text-green-300){--tw-text-opacity:1;color:rgb(132 225 188/var(--tw-text-opacity))}:is(.dark .dark\:text-green-400){--tw-text-opacity:1;color:rgb(49 196 141/var(--tw-text-opacity))}:is(.dark .dark\:text-green-500){--tw-text-opacity:1;color:rgb(14 159 110/var(--tw-text-opacity))}:is(.dark .dark\:text-green-600){--tw-text-opacity:1;color:rgb(5 122 85/var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-300){--tw-text-opacity:1;color:rgb(180 198 252/var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-400){--tw-text-opacity:1;color:rgb(141 162 251/var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-500){--tw-text-opacity:1;color:rgb(104 117 245/var(--tw-text-opacity))}:is(.dark .dark\:text-orange-200){--tw-text-opacity:1;color:rgb(252 217 189/var(--tw-text-opacity))}:is(.dark .dark\:text-orange-300){--tw-text-opacity:1;color:rgb(253 186 140/var(--tw-text-opacity))}:is(.dark .dark\:text-orange-900){--tw-text-opacity:1;color:rgb(119 29 29/var(--tw-text-opacity))}:is(.dark .dark\:text-pink-300){--tw-text-opacity:1;color:rgb(248 180 217/var(--tw-text-opacity))}:is(.dark .dark\:text-pink-400){--tw-text-opacity:1;color:rgb(241 126 184/var(--tw-text-opacity))}:is(.dark .dark\:text-purple-300){--tw-text-opacity:1;color:rgb(202 191 253/var(--tw-text-opacity))}:is(.dark .dark\:text-purple-400){--tw-text-opacity:1;color:rgb(172 148 250/var(--tw-text-opacity))}:is(.dark .dark\:text-purple-500){--tw-text-opacity:1;color:rgb(144 97 249/var(--tw-text-opacity))}:is(.dark .dark\:text-red-200){--tw-text-opacity:1;color:rgb(251 213 213/var(--tw-text-opacity))}:is(.dark .dark\:text-red-300){--tw-text-opacity:1;color:rgb(248 180 180/var(--tw-text-opacity))}:is(.dark .dark\:text-red-400){--tw-text-opacity:1;color:rgb(249 128 128/var(--tw-text-opacity))}:is(.dark .dark\:text-red-500){--tw-text-opacity:1;color:rgb(240 82 82/var(--tw-text-opacity))}:is(.dark .dark\:text-teal-300){--tw-text-opacity:1;color:rgb(126 220 226/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-300){--tw-text-opacity:1;color:rgb(250 202 21/var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-500){--tw-text-opacity:1;color:rgb(194 120 3/var(--tw-text-opacity))}:is(.dark .dark\:decoration-blue-600){text-decoration-color:#1c64f2}:is(.dark .dark\:placeholder-gray-400)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-gray-400)::placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-green-500)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(14 159 110/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-green-500)::placeholder{--tw-placeholder-opacity:1;color:rgb(14 159 110/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-red-500)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(240 82 82/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-red-500)::placeholder{--tw-placeholder-opacity:1;color:rgb(240 82 82/var(--tw-placeholder-opacity))}:is(.dark .dark\:shadow-lg){--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:shadow-sm-light){--tw-shadow:0 2px 5px 0px hsla(0,0%,100%,.08);--tw-shadow-colored:0 2px 5px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:shadow-blue-800\/80){--tw-shadow-color:rgba(30,66,159,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-cyan-800\/80){--tw-shadow-color:rgba(21,94,117,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-gray-800){--tw-shadow-color:#1f2937;--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-green-800\/80){--tw-shadow-color:rgba(3,84,63,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-lime-800\/80){--tw-shadow-color:rgba(63,98,18,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-pink-800\/80){--tw-shadow-color:rgba(153,21,75,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-purple-800\/80){--tw-shadow-color:rgba(85,33,181,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-red-800\/80){--tw-shadow-color:rgba(155,28,28,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:shadow-teal-800\/80){--tw-shadow-color:rgba(5,80,92,.8);--tw-shadow:var(--tw-shadow-colored)}:is(.dark .dark\:ring-gray-500){--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity))}:is(.dark .dark\:ring-gray-900){--tw-ring-opacity:1;--tw-ring-color:rgb(17 24 39/var(--tw-ring-opacity))}:is(.dark .dark\:ring-offset-gray-700){--tw-ring-offset-color:#374151}:is(.dark .dark\:ring-offset-gray-800){--tw-ring-offset-color:#1f2937}:is(.dark .dark\:first-letter\:text-gray-100):first-letter{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}:is(.dark .dark\:after\:border-blue-800):after{--tw-border-opacity:1;border-color:rgb(30 66 159/var(--tw-border-opacity));content:var(--tw-content)}:is(.dark .dark\:after\:border-gray-700):after{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity));content:var(--tw-content)}:is(.dark .dark\:after\:text-gray-500):after{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity));content:var(--tw-content)}:is(.dark .dark\:hover\:border-gray-500:hover){--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity))}:is(.dark .dark\:hover\:border-gray-600:hover){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}:is(.dark .dark\:hover\:border-gray-700:hover){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}:is(.dark .dark\:hover\:bg-\[\#050708\]\/30:hover){background-color:rgba(5,7,8,.3)}:is(.dark .dark\:hover\:bg-\[\#050708\]\/40:hover){background-color:rgba(5,7,8,.4)}:is(.dark .dark\:hover\:bg-\[\#FF9119\]\/80:hover){background-color:rgba(255,145,25,.8)}:is(.dark .dark\:hover\:bg-blue-500:hover){--tw-bg-opacity:1;background-color:rgb(63 131 248/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-600:hover){--tw-bg-opacity:1;background-color:rgb(28 100 242/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-700:hover){--tw-bg-opacity:1;background-color:rgb(26 86 219/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-800:hover){--tw-bg-opacity:1;background-color:rgb(30 66 159/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-200:hover){--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-500:hover){--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-600:hover){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-700:hover){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-800:hover){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-600:hover){--tw-bg-opacity:1;background-color:rgb(5 122 85/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-700:hover){--tw-bg-opacity:1;background-color:rgb(4 108 78/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-800:hover){--tw-bg-opacity:1;background-color:rgb(3 84 63/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-indigo-800:hover){--tw-bg-opacity:1;background-color:rgb(66 56 157/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-800:hover){--tw-bg-opacity:1;background-color:rgb(153 21 75/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-500:hover){--tw-bg-opacity:1;background-color:rgb(144 97 249/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-700:hover){--tw-bg-opacity:1;background-color:rgb(108 43 217/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-800:hover){--tw-bg-opacity:1;background-color:rgb(85 33 181/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-600:hover){--tw-bg-opacity:1;background-color:rgb(224 36 36/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-700:hover){--tw-bg-opacity:1;background-color:rgb(200 30 30/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-800:hover){--tw-bg-opacity:1;background-color:rgb(155 28 28/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-300:hover){--tw-bg-opacity:1;background-color:rgb(250 202 21/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-400:hover){--tw-bg-opacity:1;background-color:rgb(227 160 8/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-800:hover){--tw-bg-opacity:1;background-color:rgb(114 59 19/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:\!text-blue-500:hover){--tw-text-opacity:1!important;color:rgb(63 131 248/var(--tw-text-opacity))!important}:is(.dark .dark\:hover\:text-blue-300:hover){--tw-text-opacity:1;color:rgb(164 202 254/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-blue-400:hover){--tw-text-opacity:1;color:rgb(118 169 250/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-blue-500:hover){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-blue-600:hover){--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-blue-700:hover){--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-300:hover){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-400:hover){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-800:hover){--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-900:hover){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-green-300:hover){--tw-text-opacity:1;color:rgb(132 225 188/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-indigo-300:hover){--tw-text-opacity:1;color:rgb(180 198 252/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-pink-300:hover){--tw-text-opacity:1;color:rgb(248 180 217/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-purple-300:hover){--tw-text-opacity:1;color:rgb(202 191 253/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-red-300:hover){--tw-text-opacity:1;color:rgb(248 180 180/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-white:hover){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-yellow-300:hover){--tw-text-opacity:1;color:rgb(250 202 21/var(--tw-text-opacity))}:is(.dark .dark\:hover\:bg-blend-darken:hover){background-blend-mode:darken}:is(.dark .dark\:focus\:border-blue-500:focus){--tw-border-opacity:1;border-color:rgb(63 131 248/var(--tw-border-opacity))}:is(.dark .dark\:focus\:border-green-500:focus){--tw-border-opacity:1;border-color:rgb(14 159 110/var(--tw-border-opacity))}:is(.dark .dark\:focus\:border-red-500:focus){--tw-border-opacity:1;border-color:rgb(240 82 82/var(--tw-border-opacity))}:is(.dark .dark\:focus\:bg-blue-600:focus){--tw-bg-opacity:1;background-color:rgb(28 100 242/var(--tw-bg-opacity))}:is(.dark .dark\:focus\:bg-gray-700:focus){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .dark\:focus\:text-white:focus){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:focus\:ring-\[\#050708\]\/50:focus){--tw-ring-color:rgba(5,7,8,.5)}:is(.dark .dark\:focus\:ring-\[\#2557D6\]\/50:focus){--tw-ring-color:rgba(37,87,214,.5)}:is(.dark .dark\:focus\:ring-\[\#F7BE38\]\/50:focus){--tw-ring-color:rgba(247,190,56,.5)}:is(.dark .dark\:focus\:ring-\[\#FF9119\]\/40:focus){--tw-ring-color:rgba(255,145,25,.4)}:is(.dark .dark\:focus\:ring-blue-500:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(63 131 248/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(28 100 242/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(30 66 159/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-900:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(35 56 118/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-cyan-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(21 94 117/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-400:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(156 163 175/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-500:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-700:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(55 65 81/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(31 41 55/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-green-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(5 122 85/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-green-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(3 84 63/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-lime-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(63 98 18/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-orange-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(208 56 1/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(153 21 75/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(126 58 242/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(85 33 181/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-900:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(74 29 150/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-400:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(249 128 128/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(224 36 36/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(155 28 28/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-900:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(119 29 29/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(4 116 129/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-700:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(3 102 114/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(5 80 92/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-600:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(159 88 10/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-800:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(114 59 19/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-900:focus){--tw-ring-opacity:1;--tw-ring-color:rgb(99 49 18/var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-offset-gray-700:focus){--tw-ring-offset-color:#374151}:is(.dark .dark\:focus\:ring-offset-gray-800:focus){--tw-ring-offset-color:#1f2937}:is(.dark .group:hover .dark\:group-hover\:bg-gray-800\/60){background-color:rgba(31,41,55,.6)}:is(.dark .group:hover .dark\:group-hover\:text-blue-500){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .group:hover .dark\:group-hover\:text-gray-300){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}:is(.dark .group:hover .dark\:group-hover\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .group:focus .dark\:group-focus\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .group:focus .dark\:group-focus\:ring-gray-800\/70){--tw-ring-color:rgba(31,41,55,.7)}:is(.dark .peer:checked~.dark\:peer-checked\:text-blue-500){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .peer:checked~.dark\:peer-checked\:text-gray-300){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.peer:focus~:is(.dark .peer-focus\:dark\:text-blue-500){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-blue-800){--tw-ring-opacity:1;--tw-ring-color:rgb(30 66 159/var(--tw-ring-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-green-800){--tw-ring-opacity:1;--tw-ring-color:rgb(3 84 63/var(--tw-ring-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-orange-800){--tw-ring-opacity:1;--tw-ring-color:rgb(138 44 13/var(--tw-ring-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-purple-800){--tw-ring-opacity:1;--tw-ring-color:rgb(85 33 181/var(--tw-ring-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-red-800){--tw-ring-opacity:1;--tw-ring-color:rgb(155 28 28/var(--tw-ring-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-teal-800){--tw-ring-opacity:1;--tw-ring-color:rgb(5 80 92/var(--tw-ring-opacity))}:is(.dark .peer:focus~.dark\:peer-focus\:ring-yellow-800){--tw-ring-opacity:1;--tw-ring-color:rgb(114 59 19/var(--tw-ring-opacity))}@media (min-width:640px){.sm\:order-last{order:9999}.sm\:col-span-1{grid-column:span 1/span 1}.sm\:col-span-3{grid-column:span 3/span 3}.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:mb-0{margin-bottom:0}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-5{margin-bottom:1.25rem}.sm\:ml-2{margin-left:.5rem}.sm\:ml-4{margin-left:1rem}.sm\:ml-64{margin-left:16rem}.sm\:ml-auto{margin-left:auto}.sm\:mt-0{margin-top:0}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:inline-flex{display:inline-flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-4{height:1rem}.sm\:h-64{height:16rem}.sm\:h-7{height:1.75rem}.sm\:h-9{height:2.25rem}.sm\:h-96{height:24rem}.sm\:w-4{width:1rem}.sm\:w-96{width:24rem}.sm\:w-auto{width:auto}.sm\:translate-x-0{--tw-translate-x:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:1.5rem}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.sm\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.sm\:divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(1px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(1px*var(--tw-divide-x-reverse))}.sm\:rounded-lg{border-radius:.5rem}.sm\:border-b-0{border-bottom-width:0}.sm\:border-r{border-right-width:1px}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:p-8{padding:2rem}.sm\:px-16{padding-left:4rem;padding-right:4rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:py-16{padding-bottom:4rem;padding-top:4rem}.sm\:py-4{padding-top:1rem}.sm\:pb-4,.sm\:py-4{padding-bottom:1rem}.sm\:pl-2{padding-left:.5rem}.sm\:pl-4{padding-left:1rem}.sm\:pr-4{padding-right:1rem}.sm\:pr-8{padding-right:2rem}.sm\:pt-4{padding-top:1rem}.sm\:text-center{text-align:center}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}.sm\:ring-8{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.sm\:after\:inline-block:after{content:var(--tw-content);display:inline-block}.sm\:after\:hidden:after{content:var(--tw-content);display:none}.sm\:after\:content-\[\'\'\]:after{--tw-content:"";content:var(--tw-content)}}@media (min-width:768px){.md\:relative{position:relative}.md\:inset-0{inset:0}.md\:right-auto{right:auto}.md\:top-auto{top:auto}.md\:order-1{order:1}.md\:order-2{order:2}.md\:m-0{margin:0}.md\:mx-2{margin-left:.5rem;margin-right:.5rem}.md\:my-0{margin-bottom:0;margin-top:0}.md\:my-10{margin-bottom:2.5rem;margin-top:2.5rem}.md\:my-12{margin-bottom:3rem;margin-top:3rem}.md\:mb-0{margin-bottom:0}.md\:mb-12{margin-bottom:3rem}.md\:ml-1{margin-left:.25rem}.md\:ml-2{margin-left:.5rem}.md\:mr-0{margin-right:0}.md\:mr-2{margin-right:.5rem}.md\:mr-24{margin-right:6rem}.md\:mr-4{margin-right:1rem}.md\:mr-6{margin-right:1.5rem}.md\:mt-0{margin-top:0}.md\:mt-6{margin-top:1.5rem}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:h-96{height:24rem}.md\:h-\[21px\]{height:21px}.md\:h-\[262px\]{height:262px}.md\:h-\[278px\]{height:278px}.md\:h-\[294px\]{height:294px}.md\:h-\[42px\]{height:42px}.md\:h-\[654px\]{height:654px}.md\:h-\[682px\]{height:682px}.md\:h-\[8px\]{height:8px}.md\:h-\[95px\]{height:95px}.md\:h-auto{height:auto}.md\:w-48{width:12rem}.md\:w-64{width:16rem}.md\:w-\[96px\]{width:96px}.md\:w-auto{width:auto}.md\:w-full{width:100%}.md\:max-w-\[142px\]{max-width:142px}.md\:max-w-\[512px\]{max-width:512px}.md\:max-w-\[597px\]{max-width:597px}.md\:max-w-screen-md{max-width:768px}.md\:max-w-xl{max-width:36rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-12{gap:3rem}.md\:gap-6{gap:1.5rem}.md\:gap-8{gap:2rem}.md\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.md\:space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.md\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.md\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.md\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.md\:rounded-none{border-radius:0}.md\:rounded-l-lg{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem}.md\:rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.md\:rounded-br-lg{border-bottom-right-radius:.5rem}.md\:rounded-tl-lg{border-top-left-radius:.5rem}.md\:border-0{border-width:0}.md\:border-b-0{border-bottom-width:0}.md\:border-r{border-right-width:1px}.md\:bg-transparent{background-color:transparent}.md\:bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.md\:p-0{padding:0}.md\:p-12{padding:3rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:px-5{padding-left:1.25rem;padding-right:1.25rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:py-2{padding-bottom:.5rem;padding-top:.5rem}.md\:py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.md\:py-8{padding-bottom:2rem;padding-top:2rem}.md\:pb-0{padding-bottom:0}.md\:pb-4{padding-bottom:1rem}.md\:pr-4{padding-right:1rem}.md\:pt-0{padding-top:0}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-5xl{font-size:3rem;line-height:1}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xl{font-size:1.25rem;line-height:1.75rem}.md\:font-medium{font-weight:500}.md\:text-blue-700{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}.md\:text-green-700{--tw-text-opacity:1;color:rgb(4 108 78/var(--tw-text-opacity))}.md\:hover\:bg-transparent:hover{background-color:transparent}.md\:hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgb(28 100 242/var(--tw-text-opacity))}.md\:hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}.md\:hover\:text-green-700:hover{--tw-text-opacity:1;color:rgb(4 108 78/var(--tw-text-opacity))}:is(.dark .md\:dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .md\:dark\:bg-transparent){background-color:transparent}:is(.dark .md\:dark\:text-blue-500){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .md\:dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .md\:dark\:hover\:bg-transparent:hover){background-color:transparent}:is(.dark .md\:dark\:hover\:text-blue-500:hover){--tw-text-opacity:1;color:rgb(63 131 248/var(--tw-text-opacity))}:is(.dark .md\:dark\:hover\:text-white:hover){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}}@media (min-width:1024px){.lg\:static{position:static}.lg\:sticky{position:sticky}.lg\:top-28{top:7rem}.lg\:order-1{order:1}.lg\:order-2{order:2}.lg\:col-span-5{grid-column:span 5/span 5}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:my-12{margin-bottom:3rem;margin-top:3rem}.lg\:my-8{margin-bottom:2rem;margin-top:2rem}.lg\:mb-0{margin-bottom:0}.lg\:mb-16{margin-bottom:4rem}.lg\:mb-8{margin-bottom:2rem}.lg\:mr-0{margin-right:0}.lg\:mt-0{margin-top:0}.lg\:mt-10{margin-top:2.5rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:hidden{display:none}.lg\:h-12{height:3rem}.lg\:h-4{height:1rem}.lg\:h-5{height:1.25rem}.lg\:h-6{height:1.5rem}.lg\:h-\[calc\(100vh-3rem\)\]{height:calc(100vh - 3rem)}.lg\:h-auto{height:auto}.lg\:max-h-full{max-height:100%}.lg\:w-12{width:3rem}.lg\:w-4{width:1rem}.lg\:w-48{width:12rem}.lg\:w-5{width:1.25rem}.lg\:w-6{width:1.5rem}.lg\:w-96{width:24rem}.lg\:w-auto{width:auto}.lg\:max-w-7xl{max-width:80rem}.lg\:max-w-screen-lg{max-width:1024px}.lg\:max-w-xl{max-width:36rem}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:gap-16{gap:4rem}.lg\:gap-8{gap:2rem}.lg\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.lg\:self-center{align-self:center}.lg\:overflow-visible{overflow:visible}.lg\:overflow-y-visible{overflow-y:visible}.lg\:border-0{border-width:0}.lg\:bg-transparent{background-color:transparent}.lg\:p-0{padding:0}.lg\:p-8{padding:2rem}.lg\:px-12{padding-left:3rem;padding-right:3rem}.lg\:px-2{padding-left:.5rem;padding-right:.5rem}.lg\:px-36{padding-left:9rem;padding-right:9rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-48{padding-left:12rem;padding-right:12rem}.lg\:px-5{padding-left:1.25rem;padding-right:1.25rem}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-0{padding-bottom:0;padding-top:0}.lg\:py-16{padding-bottom:4rem;padding-top:4rem}.lg\:py-2{padding-bottom:.5rem;padding-top:.5rem}.lg\:py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.lg\:py-4{padding-bottom:1rem;padding-top:1rem}.lg\:py-56{padding-bottom:14rem;padding-top:14rem}.lg\:py-8{padding-bottom:2rem;padding-top:2rem}.lg\:pb-16{padding-bottom:4rem}.lg\:pb-20{padding-bottom:5rem}.lg\:pl-0{padding-left:0}.lg\:pl-3{padding-left:.75rem}.lg\:pt-0{padding-top:0}.lg\:pt-2{padding-top:.5rem}.lg\:pt-8{padding-top:2rem}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\:text-6xl{font-size:3.75rem;line-height:1}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}.lg\:text-xs{font-size:.75rem;line-height:1rem}.lg\:text-blue-700{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}.lg\:hover\:bg-transparent:hover{background-color:transparent}.lg\:hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(26 86 219/var(--tw-text-opacity))}:is(.dark .lg\:dark\:hover\:bg-transparent:hover){background-color:transparent}:is(.dark .lg\:dark\:hover\:text-white:hover){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}}@media (min-width:1280px){.xl\:ml-16{margin-left:4rem}.xl\:block{display:block}.xl\:inline-flex{display:inline-flex}.xl\:hidden{display:none}.xl\:h-80{height:20rem}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.xl\:gap-0{gap:0}.xl\:gap-16{gap:4rem}.xl\:gap-24{gap:6rem}.xl\:px-2{padding-left:.5rem;padding-right:.5rem}.xl\:px-48{padding-left:12rem;padding-right:12rem}.xl\:pb-24{padding-bottom:6rem}.xl\:pl-4{padding-left:1rem}.xl\:pt-24{padding-top:6rem}.xl\:text-6xl{font-size:3.75rem;line-height:1}.xl\:text-sm{font-size:.875rem;line-height:1.25rem}.xl\:after\:mx-10:after{content:var(--tw-content);margin-left:2.5rem;margin-right:2.5rem}}@media (min-width:1536px){.\32xl\:block{display:block}.\32xl\:h-96{height:24rem}.\32xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.\32xl\:gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.\32xl\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(0px*(1 - var(--tw-space-x-reverse)));margin-right:calc(0px*var(--tw-space-x-reverse))}}.\[\&\>div\]\:mx-auto>div{margin-left:auto;margin-right:auto} \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.min.js b/node_modules/flowbite/dist/flowbite.min.js new file mode 100644 index 0000000..cd4e4a1 --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Flowbite",[],e):"object"==typeof exports?exports.Flowbite=e():t.Flowbite=e()}(self,(function(){return function(){"use strict";var t={647:function(t,e,i){i.r(e)},853:function(t,e,i){i.r(e),i.d(e,{afterMain:function(){return E},afterRead:function(){return _},afterWrite:function(){return x},applyStyles:function(){return S},arrow:function(){return Z},auto:function(){return a},basePlacements:function(){return c},beforeMain:function(){return b},beforeRead:function(){return m},beforeWrite:function(){return L},bottom:function(){return o},clippingParents:function(){return u},computeStyles:function(){return it},createPopper:function(){return St},createPopperBase:function(){return Pt},createPopperLite:function(){return Dt},detectOverflow:function(){return yt},end:function(){return d},eventListeners:function(){return ot},flip:function(){return _t},hide:function(){return Et},left:function(){return s},main:function(){return w},modifierPhases:function(){return k},offset:function(){return Lt},placements:function(){return v},popper:function(){return f},popperGenerator:function(){return jt},popperOffsets:function(){return Ot},preventOverflow:function(){return xt},read:function(){return y},reference:function(){return h},right:function(){return r},start:function(){return l},top:function(){return n},variationPlacements:function(){return g},viewport:function(){return p},write:function(){return O}});var n="top",o="bottom",r="right",s="left",a="auto",c=[n,o,r,s],l="start",d="end",u="clippingParents",p="viewport",f="popper",h="reference",g=c.reduce((function(t,e){return t.concat([e+"-"+l,e+"-"+d])}),[]),v=[].concat(c,[a]).reduce((function(t,e){return t.concat([e,e+"-"+l,e+"-"+d])}),[]),m="beforeRead",y="read",_="afterRead",b="beforeMain",w="main",E="afterMain",L="beforeWrite",O="write",x="afterWrite",k=[m,y,_,b,w,E,L,O,x];function A(t){return t?(t.nodeName||"").toLowerCase():null}function T(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return t instanceof T(t).Element||t instanceof Element}function j(t){return t instanceof T(t).HTMLElement||t instanceof HTMLElement}function P(t){return"undefined"!=typeof ShadowRoot&&(t instanceof T(t).ShadowRoot||t instanceof ShadowRoot)}var S={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];j(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});j(n)&&A(n)&&(Object.assign(n.style,r),Object.keys(o).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function D(t){return t.split("-")[0]}var I=Math.max,M=Math.min,q=Math.round;function H(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(H())}function V(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),o=1,r=1;e&&j(t)&&(o=t.offsetWidth>0&&q(n.width)/t.offsetWidth||1,r=t.offsetHeight>0&&q(n.height)/t.offsetHeight||1);var s=(C(t)?T(t):window).visualViewport,a=!B()&&i,c=(n.left+(a&&s?s.offsetLeft:0))/o,l=(n.top+(a&&s?s.offsetTop:0))/r,d=n.width/o,u=n.height/r;return{width:d,height:u,top:l,right:c+d,bottom:l+u,left:c,x:c,y:l}}function W(t){var e=V(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function z(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&P(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function R(t){return T(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(A(t))>=0}function N(t){return((C(t)?t.ownerDocument:t.document)||window.document).documentElement}function K(t){return"html"===A(t)?t:t.assignedSlot||t.parentNode||(P(t)?t.host:null)||N(t)}function U(t){return j(t)&&"fixed"!==R(t).position?t.offsetParent:null}function X(t){for(var e=T(t),i=U(t);i&&F(i)&&"static"===R(i).position;)i=U(i);return i&&("html"===A(i)||"body"===A(i)&&"static"===R(i).position)?e:i||function(t){var e=/firefox/i.test(H());if(/Trident/i.test(H())&&j(t)&&"fixed"===R(t).position)return null;var i=K(t);for(P(i)&&(i=i.host);j(i)&&["html","body"].indexOf(A(i))<0;){var n=R(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,i){return I(t,M(e,i))}function J(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Q(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var Z={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,a=t.name,l=t.options,d=i.elements.arrow,u=i.modifiersData.popperOffsets,p=D(i.placement),f=Y(p),h=[s,r].indexOf(p)>=0?"height":"width";if(d&&u){var g=function(t,e){return J("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Q(t,c))}(l.padding,i),v=W(d),m="y"===f?n:s,y="y"===f?o:r,_=i.rects.reference[h]+i.rects.reference[f]-u[f]-i.rects.popper[h],b=u[f]-i.rects.reference[f],w=X(d),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,L=_/2-b/2,O=g[m],x=E-v[h]-g[y],k=E/2-v[h]/2+L,A=G(O,k,x),T=f;i.modifiersData[a]=((e={})[T]=A,e.centerOffset=A-k,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&z(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,i=t.popper,a=t.popperRect,c=t.placement,l=t.variation,u=t.offsets,p=t.position,f=t.gpuAcceleration,h=t.adaptive,g=t.roundOffsets,v=t.isFixed,m=u.x,y=void 0===m?0:m,_=u.y,b=void 0===_?0:_,w="function"==typeof g?g({x:y,y:b}):{x:y,y:b};y=w.x,b=w.y;var E=u.hasOwnProperty("x"),L=u.hasOwnProperty("y"),O=s,x=n,k=window;if(h){var A=X(i),C="clientHeight",j="clientWidth";if(A===T(i)&&"static"!==R(A=N(i)).position&&"absolute"===p&&(C="scrollHeight",j="scrollWidth"),c===n||(c===s||c===r)&&l===d)x=o,b-=(v&&A===k&&k.visualViewport?k.visualViewport.height:A[C])-a.height,b*=f?1:-1;if(c===s||(c===n||c===o)&&l===d)O=r,y-=(v&&A===k&&k.visualViewport?k.visualViewport.width:A[j])-a.width,y*=f?1:-1}var P,S=Object.assign({position:p},h&&tt),D=!0===g?function(t){var e=t.x,i=t.y,n=window.devicePixelRatio||1;return{x:q(e*n)/n||0,y:q(i*n)/n||0}}({x:y,y:b}):{x:y,y:b};return y=D.x,b=D.y,f?Object.assign({},S,((P={})[x]=L?"0":"",P[O]=E?"0":"",P.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",P)):Object.assign({},S,((e={})[x]=L?b+"px":"",e[O]=E?y+"px":"",e.transform="",e))}var it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=void 0===n||n,r=i.adaptive,s=void 0===r||r,a=i.roundOffsets,c=void 0===a||a,l={placement:D(e.placement),variation:$(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},nt={passive:!0};var ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,r=void 0===o||o,s=n.resize,a=void 0===s||s,c=T(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&l.forEach((function(t){t.addEventListener("scroll",i.update,nt)})),a&&c.addEventListener("resize",i.update,nt),function(){r&&l.forEach((function(t){t.removeEventListener("scroll",i.update,nt)})),a&&c.removeEventListener("resize",i.update,nt)}},data:{}},rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var at={start:"end",end:"start"};function ct(t){return t.replace(/start|end/g,(function(t){return at[t]}))}function lt(t){var e=T(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dt(t){return V(N(t)).left+lt(t).scrollLeft}function ut(t){var e=R(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function pt(t){return["html","body","#document"].indexOf(A(t))>=0?t.ownerDocument.body:j(t)&&ut(t)?t:pt(K(t))}function ft(t,e){var i;void 0===e&&(e=[]);var n=pt(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),r=T(n),s=o?[r].concat(r.visualViewport||[],ut(n)?n:[]):n,a=e.concat(s);return o?a:a.concat(ft(K(s)))}function ht(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gt(t,e,i){return e===p?ht(function(t,e){var i=T(t),n=N(t),o=i.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(o){r=o.width,s=o.height;var l=B();(l||!l&&"fixed"===e)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:r,height:s,x:a+dt(t),y:c}}(t,i)):C(e)?function(t,e){var i=V(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):ht(function(t){var e,i=N(t),n=lt(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=I(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=I(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+dt(t),c=-n.scrollTop;return"rtl"===R(o||i).direction&&(a+=I(i.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:a,y:c}}(N(t)))}function vt(t,e,i,n){var o="clippingParents"===e?function(t){var e=ft(K(t)),i=["absolute","fixed"].indexOf(R(t).position)>=0&&j(t)?X(t):t;return C(i)?e.filter((function(t){return C(t)&&z(t,i)&&"body"!==A(t)})):[]}(t):[].concat(e),r=[].concat(o,[i]),s=r[0],a=r.reduce((function(e,i){var o=gt(t,i,n);return e.top=I(o.top,e.top),e.right=M(o.right,e.right),e.bottom=M(o.bottom,e.bottom),e.left=I(o.left,e.left),e}),gt(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mt(t){var e,i=t.reference,a=t.element,c=t.placement,u=c?D(c):null,p=c?$(c):null,f=i.x+i.width/2-a.width/2,h=i.y+i.height/2-a.height/2;switch(u){case n:e={x:f,y:i.y-a.height};break;case o:e={x:f,y:i.y+i.height};break;case r:e={x:i.x+i.width,y:h};break;case s:e={x:i.x-a.width,y:h};break;default:e={x:i.x,y:i.y}}var g=u?Y(u):null;if(null!=g){var v="y"===g?"height":"width";switch(p){case l:e[g]=e[g]-(i[v]/2-a[v]/2);break;case d:e[g]=e[g]+(i[v]/2-a[v]/2)}}return e}function yt(t,e){void 0===e&&(e={});var i=e,s=i.placement,a=void 0===s?t.placement:s,l=i.strategy,d=void 0===l?t.strategy:l,g=i.boundary,v=void 0===g?u:g,m=i.rootBoundary,y=void 0===m?p:m,_=i.elementContext,b=void 0===_?f:_,w=i.altBoundary,E=void 0!==w&&w,L=i.padding,O=void 0===L?0:L,x=J("number"!=typeof O?O:Q(O,c)),k=b===f?h:f,A=t.rects.popper,T=t.elements[E?k:b],j=vt(C(T)?T:T.contextElement||N(t.elements.popper),v,y,d),P=V(t.elements.reference),S=mt({reference:P,element:A,strategy:"absolute",placement:a}),D=ht(Object.assign({},A,S)),I=b===f?D:P,M={top:j.top-I.top+x.top,bottom:I.bottom-j.bottom+x.bottom,left:j.left-I.left+x.left,right:I.right-j.right+x.right},q=t.modifiersData.offset;if(b===f&&q){var H=q[a];Object.keys(M).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,i=[n,o].indexOf(t)>=0?"y":"x";M[t]+=H[i]*e}))}return M}var _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,d=t.name;if(!e.modifiersData[d]._skip){for(var u=i.mainAxis,p=void 0===u||u,f=i.altAxis,h=void 0===f||f,m=i.fallbackPlacements,y=i.padding,_=i.boundary,b=i.rootBoundary,w=i.altBoundary,E=i.flipVariations,L=void 0===E||E,O=i.allowedAutoPlacements,x=e.options.placement,k=D(x),A=m||(k===x||!L?[st(x)]:function(t){if(D(t)===a)return[];var e=st(t);return[ct(t),e,ct(e)]}(x)),T=[x].concat(A).reduce((function(t,i){return t.concat(D(i)===a?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=i.boundary,r=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,d=void 0===l?v:l,u=$(n),p=u?a?g:g.filter((function(t){return $(t)===u})):c,f=p.filter((function(t){return d.indexOf(t)>=0}));0===f.length&&(f=p);var h=f.reduce((function(e,i){return e[i]=yt(t,{placement:i,boundary:o,rootBoundary:r,padding:s})[D(i)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:i,boundary:_,rootBoundary:b,padding:y,flipVariations:L,allowedAutoPlacements:O}):i)}),[]),C=e.rects.reference,j=e.rects.popper,P=new Map,S=!0,I=T[0],M=0;M=0,W=V?"width":"height",z=yt(e,{placement:q,boundary:_,rootBoundary:b,altBoundary:w,padding:y}),R=V?B?r:s:B?o:n;C[W]>j[W]&&(R=st(R));var F=st(R),N=[];if(p&&N.push(z[H]<=0),h&&N.push(z[R]<=0,z[F]<=0),N.every((function(t){return t}))){I=q,S=!1;break}P.set(q,N)}if(S)for(var K=function(t){var e=T.find((function(e){var i=P.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},U=L?3:1;U>0;U--){if("break"===K(U))break}e.placement!==I&&(e.modifiersData[d]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function wt(t){return[n,r,o,s].some((function(e){return t[e]>=0}))}var Et={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),a=yt(e,{altBoundary:!0}),c=bt(s,n),l=bt(a,o,r),d=wt(c),u=wt(l);e.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Lt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,o=t.name,a=i.offset,c=void 0===a?[0,0]:a,l=v.reduce((function(t,i){return t[i]=function(t,e,i){var o=D(t),a=[s,n].indexOf(o)>=0?-1:1,c="function"==typeof i?i(Object.assign({},e,{placement:t})):i,l=c[0],d=c[1];return l=l||0,d=(d||0)*a,[s,r].indexOf(o)>=0?{x:d,y:l}:{x:l,y:d}}(i,e.rects,c),t}),{}),d=l[e.placement],u=d.x,p=d.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=p),e.modifiersData[o]=l}};var Ot={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,a=t.name,c=i.mainAxis,d=void 0===c||c,u=i.altAxis,p=void 0!==u&&u,f=i.boundary,h=i.rootBoundary,g=i.altBoundary,v=i.padding,m=i.tether,y=void 0===m||m,_=i.tetherOffset,b=void 0===_?0:_,w=yt(e,{boundary:f,rootBoundary:h,padding:v,altBoundary:g}),E=D(e.placement),L=$(e.placement),O=!L,x=Y(E),k="x"===x?"y":"x",A=e.modifiersData.popperOffsets,T=e.rects.reference,C=e.rects.popper,j="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,P="number"==typeof j?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(A){if(d){var H,B="y"===x?n:s,V="y"===x?o:r,z="y"===x?"height":"width",R=A[x],F=R+w[B],N=R-w[V],K=y?-C[z]/2:0,U=L===l?T[z]:C[z],J=L===l?-C[z]:-T[z],Q=e.elements.arrow,Z=y&&Q?W(Q):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[B],it=tt[V],nt=G(0,T[z],Z[z]),ot=O?T[z]/2-K-nt-et-P.mainAxis:U-nt-et-P.mainAxis,rt=O?-T[z]/2+K+nt+it+P.mainAxis:J+nt+it+P.mainAxis,st=e.elements.arrow&&X(e.elements.arrow),at=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,ct=null!=(H=null==S?void 0:S[x])?H:0,lt=R+rt-ct,dt=G(y?M(F,R+ot-ct-at):F,R,y?I(N,lt):N);A[x]=dt,q[x]=dt-R}if(p){var ut,pt="x"===x?n:s,ft="x"===x?o:r,ht=A[k],gt="y"===k?"height":"width",vt=ht+w[pt],mt=ht-w[ft],_t=-1!==[n,s].indexOf(E),bt=null!=(ut=null==S?void 0:S[k])?ut:0,wt=_t?vt:ht-T[gt]-C[gt]-bt+P.altAxis,Et=_t?ht+T[gt]+C[gt]-bt-P.altAxis:mt,Lt=y&&_t?function(t,e,i){var n=G(t,e,i);return n>i?i:n}(wt,ht,Et):G(y?wt:vt,ht,y?Et:mt);A[k]=Lt,q[k]=Lt-ht}e.modifiersData[a]=q}},requiresIfExists:["offset"]};function kt(t,e,i){void 0===i&&(i=!1);var n,o,r=j(e),s=j(e)&&function(t){var e=t.getBoundingClientRect(),i=q(e.width)/t.offsetWidth||1,n=q(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=N(e),c=V(t,s,i),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!i)&&(("body"!==A(e)||ut(a))&&(l=(n=e)!==T(n)&&j(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:lt(n)),j(e)?((d=V(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=dt(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function At(t){var e=new Map,i=new Set,n=[];function o(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&o(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||o(t)})),n}var Tt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ct(){for(var t=arguments.length,e=new Array(t),i=0;i 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { AccordionItem, AccordionOptions } from './types';\nimport { AccordionInterface } from './interface';\n\nconst Default: AccordionOptions = {\n alwaysOpen: false,\n activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',\n inactiveClasses: 'text-gray-500 dark:text-gray-400',\n onOpen: () => {},\n onClose: () => {},\n onToggle: () => {},\n};\n\nclass Accordion implements AccordionInterface {\n _items: AccordionItem[];\n _options: AccordionOptions;\n\n constructor(\n items: AccordionItem[] = [],\n options: AccordionOptions = Default\n ) {\n this._items = items;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n private _init() {\n if (this._items.length) {\n // show accordion item based on click\n this._items.map((item) => {\n if (item.active) {\n this.open(item.id);\n }\n\n item.triggerEl.addEventListener('click', () => {\n this.toggle(item.id);\n });\n });\n }\n }\n\n getItem(id: string) {\n return this._items.filter((item) => item.id === id)[0];\n }\n\n open(id: string) {\n const item = this.getItem(id);\n\n // don't hide other accordions if always open\n if (!this._options.alwaysOpen) {\n this._items.map((i) => {\n if (i !== item) {\n i.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n i.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n i.targetEl.classList.add('hidden');\n i.triggerEl.setAttribute('aria-expanded', 'false');\n i.active = false;\n\n // rotate icon if set\n if (i.iconEl) {\n i.iconEl.classList.remove('rotate-180');\n }\n }\n });\n }\n\n // show active item\n item.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n item.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n item.triggerEl.setAttribute('aria-expanded', 'true');\n item.targetEl.classList.remove('hidden');\n item.active = true;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.add('rotate-180');\n }\n\n // callback function\n this._options.onOpen(this, item);\n }\n\n toggle(id: string) {\n const item = this.getItem(id);\n\n if (item.active) {\n this.close(id);\n } else {\n this.open(id);\n }\n\n // callback function\n this._options.onToggle(this, item);\n }\n\n close(id: string) {\n const item = this.getItem(id);\n\n item.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n item.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n item.targetEl.classList.add('hidden');\n item.triggerEl.setAttribute('aria-expanded', 'false');\n item.active = false;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.remove('rotate-180');\n }\n\n // callback function\n this._options.onClose(this, item);\n }\n}\n\nexport function initAccordions() {\n document.querySelectorAll('[data-accordion]').forEach(($accordionEl) => {\n const alwaysOpen = $accordionEl.getAttribute('data-accordion');\n const activeClasses = $accordionEl.getAttribute('data-active-classes');\n const inactiveClasses = $accordionEl.getAttribute(\n 'data-inactive-classes'\n );\n\n const items = [] as AccordionItem[];\n $accordionEl\n .querySelectorAll('[data-accordion-target]')\n .forEach(($triggerEl) => {\n // Consider only items that directly belong to $accordionEl\n // (to make nested accordions work).\n if ($triggerEl.closest('[data-accordion]') === $accordionEl) {\n const item = {\n id: $triggerEl.getAttribute('data-accordion-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-accordion-target')\n ),\n iconEl: $triggerEl.querySelector(\n '[data-accordion-icon]'\n ),\n active:\n $triggerEl.getAttribute('aria-expanded') === 'true'\n ? true\n : false,\n } as AccordionItem;\n items.push(item);\n }\n });\n\n new Accordion(items, {\n alwaysOpen: alwaysOpen === 'open' ? true : false,\n activeClasses: activeClasses\n ? activeClasses\n : Default.activeClasses,\n inactiveClasses: inactiveClasses\n ? inactiveClasses\n : Default.inactiveClasses,\n } as AccordionOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Accordion = Accordion;\n window.initAccordions = initAccordions;\n}\n\nexport default Accordion;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {\n CarouselOptions,\n CarouselItem,\n IndicatorItem,\n RotationItems,\n} from './types';\nimport { CarouselInterface } from './interface';\n\nconst Default: CarouselOptions = {\n defaultPosition: 0,\n indicators: {\n items: [],\n activeClasses: 'bg-white dark:bg-gray-800',\n inactiveClasses:\n 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',\n },\n interval: 3000,\n onNext: () => {},\n onPrev: () => {},\n onChange: () => {},\n};\n\nclass Carousel implements CarouselInterface {\n _items: CarouselItem[];\n _indicators: IndicatorItem[];\n _activeItem: CarouselItem;\n _intervalDuration: number;\n _intervalInstance: number;\n _options: CarouselOptions;\n\n constructor(\n items: CarouselItem[] = [],\n options: CarouselOptions = Default\n ) {\n this._items = items;\n this._options = {\n ...Default,\n ...options,\n indicators: { ...Default.indicators, ...options.indicators },\n };\n this._activeItem = this.getItem(this._options.defaultPosition);\n this._indicators = this._options.indicators.items;\n this._intervalDuration = this._options.interval;\n this._intervalInstance = null;\n this._init();\n }\n\n /**\n * initialize carousel and items based on active one\n */\n _init() {\n this._items.map((item: CarouselItem) => {\n item.el.classList.add(\n 'absolute',\n 'inset-0',\n 'transition-transform',\n 'transform'\n );\n });\n\n // if no active item is set then first position is default\n if (this._getActiveItem()) {\n this.slideTo(this._getActiveItem().position);\n } else {\n this.slideTo(0);\n }\n\n this._indicators.map((indicator, position) => {\n indicator.el.addEventListener('click', () => {\n this.slideTo(position);\n });\n });\n }\n\n getItem(position: number) {\n return this._items[position];\n }\n\n /**\n * Slide to the element based on id\n * @param {*} position\n */\n slideTo(position: number) {\n const nextItem: CarouselItem = this._items[position];\n const rotationItems: RotationItems = {\n left:\n nextItem.position === 0\n ? this._items[this._items.length - 1]\n : this._items[nextItem.position - 1],\n middle: nextItem,\n right:\n nextItem.position === this._items.length - 1\n ? this._items[0]\n : this._items[nextItem.position + 1],\n };\n this._rotate(rotationItems);\n this._setActiveItem(nextItem);\n if (this._intervalInstance) {\n this.pause();\n this.cycle();\n }\n\n this._options.onChange(this);\n }\n\n /**\n * Based on the currently active item it will go to the next position\n */\n next() {\n const activeItem = this._getActiveItem();\n let nextItem = null;\n\n // check if last item\n if (activeItem.position === this._items.length - 1) {\n nextItem = this._items[0];\n } else {\n nextItem = this._items[activeItem.position + 1];\n }\n\n this.slideTo(nextItem.position);\n\n // callback function\n this._options.onNext(this);\n }\n\n /**\n * Based on the currently active item it will go to the previous position\n */\n prev() {\n const activeItem = this._getActiveItem();\n let prevItem = null;\n\n // check if first item\n if (activeItem.position === 0) {\n prevItem = this._items[this._items.length - 1];\n } else {\n prevItem = this._items[activeItem.position - 1];\n }\n\n this.slideTo(prevItem.position);\n\n // callback function\n this._options.onPrev(this);\n }\n\n /**\n * This method applies the transform classes based on the left, middle, and right rotation carousel items\n * @param {*} rotationItems\n */\n _rotate(rotationItems: RotationItems) {\n // reset\n this._items.map((item: CarouselItem) => {\n item.el.classList.add('hidden');\n });\n\n // left item (previously active)\n rotationItems.left.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.left.el.classList.add('-translate-x-full', 'z-10');\n\n // currently active item\n rotationItems.middle.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-10'\n );\n rotationItems.middle.el.classList.add('translate-x-0', 'z-20');\n\n // right item (upcoming active)\n rotationItems.right.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.right.el.classList.add('translate-x-full', 'z-10');\n }\n\n /**\n * Set an interval to cycle through the carousel items\n */\n cycle() {\n if (typeof window !== 'undefined') {\n this._intervalInstance = window.setInterval(() => {\n this.next();\n }, this._intervalDuration);\n }\n }\n\n /**\n * Clears the cycling interval\n */\n pause() {\n clearInterval(this._intervalInstance);\n }\n\n /**\n * Get the currently active item\n */\n _getActiveItem() {\n return this._activeItem;\n }\n\n /**\n * Set the currently active item and data attribute\n * @param {*} position\n */\n _setActiveItem(item: CarouselItem) {\n this._activeItem = item;\n const position = item.position;\n\n // update the indicators if available\n if (this._indicators.length) {\n this._indicators.map((indicator) => {\n indicator.el.setAttribute('aria-current', 'false');\n indicator.el.classList.remove(\n ...this._options.indicators.activeClasses.split(' ')\n );\n indicator.el.classList.add(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n });\n this._indicators[position].el.classList.add(\n ...this._options.indicators.activeClasses.split(' ')\n );\n this._indicators[position].el.classList.remove(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n this._indicators[position].el.setAttribute('aria-current', 'true');\n }\n }\n}\n\nexport function initCarousels() {\n document.querySelectorAll('[data-carousel]').forEach(($carouselEl) => {\n const interval = $carouselEl.getAttribute('data-carousel-interval');\n const slide =\n $carouselEl.getAttribute('data-carousel') === 'slide'\n ? true\n : false;\n\n const items: CarouselItem[] = [];\n let defaultPosition = 0;\n if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-item]')\n ).map(($carouselItemEl: HTMLElement, position: number) => {\n items.push({\n position: position,\n el: $carouselItemEl,\n });\n\n if (\n $carouselItemEl.getAttribute('data-carousel-item') ===\n 'active'\n ) {\n defaultPosition = position;\n }\n });\n }\n\n const indicators: IndicatorItem[] = [];\n if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-slide-to]')\n ).map(($indicatorEl: HTMLElement) => {\n indicators.push({\n position: parseInt(\n $indicatorEl.getAttribute('data-carousel-slide-to')\n ),\n el: $indicatorEl,\n });\n });\n }\n\n const carousel = new Carousel(items, {\n defaultPosition: defaultPosition,\n indicators: {\n items: indicators,\n },\n interval: interval ? interval : Default.interval,\n } as CarouselOptions);\n\n if (slide) {\n carousel.cycle();\n }\n\n // check for controls\n const carouselNextEl = $carouselEl.querySelector(\n '[data-carousel-next]'\n );\n const carouselPrevEl = $carouselEl.querySelector(\n '[data-carousel-prev]'\n );\n\n if (carouselNextEl) {\n carouselNextEl.addEventListener('click', () => {\n carousel.next();\n });\n }\n\n if (carouselPrevEl) {\n carouselPrevEl.addEventListener('click', () => {\n carousel.prev();\n });\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Carousel = Carousel;\n window.initCarousels = initCarousels;\n}\n\nexport default Carousel;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { CollapseOptions } from './types';\nimport { CollapseInterface } from './interface';\n\nconst Default: CollapseOptions = {\n onCollapse: () => {},\n onExpand: () => {},\n onToggle: () => {},\n};\n\nclass Collapse implements CollapseInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: CollapseOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: CollapseOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n if (this._triggerEl.hasAttribute('aria-expanded')) {\n this._visible =\n this._triggerEl.getAttribute('aria-expanded') === 'true';\n } else {\n // fix until v2 not to break previous single collapses which became dismiss\n this._visible = !this._targetEl.classList.contains('hidden');\n }\n\n this._triggerEl.addEventListener('click', () => {\n this.toggle();\n });\n }\n }\n\n collapse() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onCollapse(this);\n }\n\n expand() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onExpand(this);\n }\n\n toggle() {\n if (this._visible) {\n this.collapse();\n } else {\n this.expand();\n }\n // callback function\n this._options.onToggle(this);\n }\n}\n\nexport function initCollapses() {\n document\n .querySelectorAll('[data-collapse-toggle]')\n .forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-collapse-toggle');\n const $targetEl = document.getElementById(targetId);\n\n // check if the target element exists\n if ($targetEl) {\n new Collapse(\n $targetEl as HTMLElement,\n $triggerEl as HTMLElement\n );\n } else {\n console.error(\n `The target element with id \"${targetId}\" does not exist. Please check the data-collapse-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Collapse = Collapse;\n window.initCollapses = initCollapses;\n}\n\nexport default Collapse;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DialOptions, DialTriggerType } from './types';\nimport { DialInterface } from './interface';\n\nconst Default: DialOptions = {\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dial implements DialInterface {\n _parentEl: HTMLElement;\n _triggerEl: HTMLElement;\n _targetEl: HTMLElement;\n _options: DialOptions;\n _visible: boolean;\n\n constructor(\n parentEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n targetEl: HTMLElement | null = null,\n options: DialOptions = Default\n ) {\n this._parentEl = parentEl;\n this._triggerEl = triggerEl;\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n const triggerEventTypes = this._getTriggerEventTypes(\n this._options.triggerType\n );\n triggerEventTypes.showEvents.forEach((ev: string) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEventTypes.hideEvents.forEach((ev: string) => {\n this._parentEl.addEventListener(ev, () => {\n if (!this._parentEl.matches(':hover')) {\n this.hide();\n }\n });\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n\n _getTriggerEventTypes(triggerType: DialTriggerType) {\n switch (triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n}\n\nexport function initDials() {\n document.querySelectorAll('[data-dial-init]').forEach(($parentEl) => {\n const $triggerEl = $parentEl.querySelector('[data-dial-toggle]');\n\n if ($triggerEl) {\n const dialId = $triggerEl.getAttribute('data-dial-toggle');\n const $dialEl = document.getElementById(dialId);\n\n if ($dialEl) {\n const triggerType =\n $triggerEl.getAttribute('data-dial-trigger');\n new Dial(\n $parentEl as HTMLElement,\n $triggerEl as HTMLElement,\n $dialEl as HTMLElement,\n {\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as DialOptions\n );\n } else {\n console.error(\n `Dial with id ${dialId} does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?`\n );\n }\n } else {\n console.error(\n `Dial with id ${$parentEl.id} does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dial = Dial;\n window.initDials = initDials;\n}\n\nexport default Dial;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DismissOptions } from './types';\nimport { DismissInterface } from './interface';\n\nconst Default: DismissOptions = {\n transition: 'transition-opacity',\n duration: 300,\n timing: 'ease-out',\n onHide: () => {},\n};\n\nclass Dismiss implements DismissInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: DismissOptions;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: DismissOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._triggerEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add(\n this._options.transition,\n `duration-${this._options.duration}`,\n this._options.timing,\n 'opacity-0'\n );\n setTimeout(() => {\n this._targetEl.classList.add('hidden');\n }, this._options.duration);\n\n // callback function\n this._options.onHide(this, this._targetEl);\n }\n}\n\nexport function initDismisses() {\n document.querySelectorAll('[data-dismiss-target]').forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-dismiss-target');\n const $dismissEl = document.querySelector(targetId);\n\n if ($dismissEl) {\n new Dismiss($dismissEl as HTMLElement, $triggerEl as HTMLElement);\n } else {\n console.error(\n `The dismiss element with id \"${targetId}\" does not exist. Please check the data-dismiss-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dismiss = Dismiss;\n window.initDismisses = initDismisses;\n}\n\nexport default Dismiss;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DrawerInstance, DrawerOptions, PlacementClasses } from './types';\nimport { DrawerInterface } from './interface';\n\nconst Default: DrawerOptions = {\n placement: 'left',\n bodyScrolling: false,\n backdrop: true,\n edge: false,\n edgeOffset: 'bottom-[60px]',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Drawer implements DrawerInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DrawerOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: DrawerOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n // set initial accessibility attributes\n if (this._targetEl) {\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.classList.add('transition-transform');\n }\n\n // set base placement classes\n this._getPlacementClasses(this._options.placement).base.map((c) => {\n this._targetEl.classList.add(c);\n });\n\n // add keyboard event listener to document\n document.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n // if 'Escape' key is pressed\n if (this.isVisible()) {\n // if the Drawer is visible\n this.hide(); // hide the Drawer\n }\n }\n });\n }\n\n hide() {\n // based on the edge option show placement classes\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.remove(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.add(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n\n // enable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.remove('overflow-hidden');\n }\n\n // destroy backdrop\n if (this._options.backdrop) {\n this._destroyBackdropEl();\n }\n\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.add(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.remove(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n\n // disable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.add('overflow-hidden');\n }\n\n // show backdrop\n if (this._options.backdrop) {\n this._createBackdrop();\n }\n\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _createBackdrop() {\n if (!this._visible) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('drawer-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n backdropEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n _destroyBackdropEl() {\n if (this._visible) {\n document.querySelector('[drawer-backdrop]').remove();\n }\n }\n\n _getPlacementClasses(placement: string): PlacementClasses {\n switch (placement) {\n case 'top':\n return {\n base: ['top-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['-translate-y-full'],\n };\n case 'right':\n return {\n base: ['right-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-x-full'],\n };\n case 'bottom':\n return {\n base: ['bottom-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full'],\n };\n case 'left':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n case 'bottom-edge':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full', this._options.edgeOffset],\n };\n default:\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n}\n\nconst getDrawerInstance = (id: string, instances: DrawerInstance[]) => {\n if (instances.some((drawerInstance) => drawerInstance.id === id)) {\n return instances.find((drawerInstance) => drawerInstance.id === id);\n }\n};\n\nexport function initDrawers() {\n const drawerInstances = [] as DrawerInstance[];\n document.querySelectorAll('[data-drawer-target]').forEach(($triggerEl) => {\n // mandatory\n const drawerId = $triggerEl.getAttribute('data-drawer-target');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n // optional\n const placement = $triggerEl.getAttribute('data-drawer-placement');\n const bodyScrolling = $triggerEl.getAttribute(\n 'data-drawer-body-scrolling'\n );\n const backdrop = $triggerEl.getAttribute('data-drawer-backdrop');\n const edge = $triggerEl.getAttribute('data-drawer-edge');\n const edgeOffset = $triggerEl.getAttribute(\n 'data-drawer-edge-offset'\n );\n\n if (!getDrawerInstance(drawerId, drawerInstances)) {\n drawerInstances.push({\n id: drawerId,\n object: new Drawer($drawerEl, {\n placement: placement ? placement : Default.placement,\n bodyScrolling: bodyScrolling\n ? bodyScrolling === 'true'\n ? true\n : false\n : Default.bodyScrolling,\n backdrop: backdrop\n ? backdrop === 'true'\n ? true\n : false\n : Default.backdrop,\n edge: edge\n ? edge === 'true'\n ? true\n : false\n : Default.edge,\n edgeOffset: edgeOffset\n ? edgeOffset\n : Default.edgeOffset,\n } as DrawerOptions),\n });\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-toggle]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-toggle');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer: DrawerInstance = getDrawerInstance(\n drawerId,\n drawerInstances\n );\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.toggle();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document\n .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]')\n .forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-dismiss')\n ? $triggerEl.getAttribute('data-drawer-dismiss')\n : $triggerEl.getAttribute('data-drawer-hide');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.hide();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-show]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-show');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.show();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Drawer = Drawer;\n window.initDrawers = initDrawers;\n}\n\nexport default Drawer;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { DropdownOptions } from './types';\nimport { DropdownInterface } from './interface';\n\nconst Default: DropdownOptions = {\n placement: 'bottom',\n triggerType: 'click',\n offsetSkidding: 0,\n offsetDistance: 10,\n delay: 300,\n ignoreClickOutsideClass: false,\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dropdown implements DropdownInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DropdownOptions;\n _visible: boolean;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetElement: HTMLElement | null = null,\n triggerElement: HTMLElement | null = null,\n options: DropdownOptions = Default\n ) {\n this._targetEl = targetElement;\n this._triggerEl = triggerElement;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n // click event handling for trigger element\n if (this._options.triggerType === 'click') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.toggle();\n });\n });\n }\n\n // hover event handling for trigger element\n if (this._options.triggerType === 'hover') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n if (ev === 'click') {\n this.toggle();\n } else {\n setTimeout(() => {\n this.show();\n }, this._options.delay);\n }\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n });\n }\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [\n this._options.offsetSkidding,\n this._options.offsetDistance,\n ],\n },\n },\n ],\n });\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n\n // Ignore clicks on the trigger element (ie. a datepicker input)\n const ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;\n\n let isIgnored = false;\n if (ignoreClickOutsideClass) {\n const ignoredClickOutsideEls = document.querySelectorAll(\n `.${ignoreClickOutsideClass}`\n );\n ignoredClickOutsideEls.forEach((el) => {\n if (el.contains(clickedEl)) {\n isIgnored = true;\n return;\n }\n });\n }\n\n // Ignore clicks on the target element (ie. dropdown itself)\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n !isIgnored &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'click'],\n hideEvents: ['mouseleave'],\n };\n case 'click':\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n }\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n isVisible() {\n return this._visible;\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n this._targetEl.classList.add('block');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n this._setupClickOutsideListener();\n\n // Update its position\n this._popperInstance.update();\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('block');\n this._targetEl.classList.add('hidden');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n this._visible = false;\n\n this._removeClickOutsideListener();\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initDropdowns() {\n document\n .querySelectorAll('[data-dropdown-toggle]')\n .forEach(($triggerEl) => {\n const dropdownId = $triggerEl.getAttribute('data-dropdown-toggle');\n const $dropdownEl = document.getElementById(dropdownId);\n\n if ($dropdownEl) {\n const placement = $triggerEl.getAttribute(\n 'data-dropdown-placement'\n );\n const offsetSkidding = $triggerEl.getAttribute(\n 'data-dropdown-offset-skidding'\n );\n const offsetDistance = $triggerEl.getAttribute(\n 'data-dropdown-offset-distance'\n );\n const triggerType = $triggerEl.getAttribute(\n 'data-dropdown-trigger'\n );\n const delay = $triggerEl.getAttribute('data-dropdown-delay');\n const ignoreClickOutsideClass = $triggerEl.getAttribute(\n 'data-dropdown-ignore-click-outside-class'\n );\n\n new Dropdown(\n $dropdownEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n offsetSkidding: offsetSkidding\n ? parseInt(offsetSkidding)\n : Default.offsetSkidding,\n offsetDistance: offsetDistance\n ? parseInt(offsetDistance)\n : Default.offsetDistance,\n delay: delay ? parseInt(delay) : Default.delay,\n ignoreClickOutsideClass: ignoreClickOutsideClass\n ? ignoreClickOutsideClass\n : Default.ignoreClickOutsideClass,\n } as DropdownOptions\n );\n } else {\n console.error(\n `The dropdown element with id \"${dropdownId}\" does not exist. Please check the data-dropdown-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dropdown = Dropdown;\n window.initDropdowns = initDropdowns;\n}\n\nexport default Dropdown;\n","import { initAccordions } from './accordion';\nimport { initCarousels } from './carousel';\nimport { initCollapses } from './collapse';\nimport { initDials } from './dial';\nimport { initDismisses } from './dismiss';\nimport { initDrawers } from './drawer';\nimport { initDropdowns } from './dropdown';\nimport { initModals } from './modal';\nimport { initPopovers } from './popover';\nimport { initTabs } from './tabs';\nimport { initTooltips } from './tooltip';\n\nexport function initFlowbite() {\n initAccordions();\n initCollapses();\n initCarousels();\n initDismisses();\n initDropdowns();\n initModals();\n initDrawers();\n initTabs();\n initTooltips();\n initPopovers();\n initDials();\n}\n\nif (typeof window !== 'undefined') {\n window.initFlowbite = initFlowbite;\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ModalInstance, ModalOptions } from './types';\nimport { ModalInterface } from './interface';\n\nconst Default: ModalOptions = {\n placement: 'center',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',\n backdrop: 'dynamic',\n closable: true,\n onHide: () => {},\n onShow: () => {},\n onToggle: () => {},\n};\n\nclass Modal implements ModalInterface {\n _targetEl: HTMLElement | null;\n _options: ModalOptions;\n _isHidden: boolean;\n _backdropEl: HTMLElement | null;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: ModalOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._isHidden = true;\n this._backdropEl = null;\n this._init();\n }\n\n _init() {\n if (this._targetEl) {\n this._getPlacementClasses().map((c) => {\n this._targetEl.classList.add(c);\n });\n }\n }\n\n _createBackdrop() {\n if (this._isHidden) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('modal-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n this._backdropEl = backdropEl;\n }\n }\n\n _destroyBackdropEl() {\n if (!this._isHidden) {\n document.querySelector('[modal-backdrop]').remove();\n }\n }\n\n _setupModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleOutsideClick(ev.target);\n };\n this._targetEl.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._targetEl.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _handleOutsideClick(target: EventTarget) {\n if (\n target === this._targetEl ||\n (target === this._backdropEl && this.isVisible())\n ) {\n this.hide();\n }\n }\n\n _getPlacementClasses() {\n switch (this._options.placement) {\n // top\n case 'top-left':\n return ['justify-start', 'items-start'];\n case 'top-center':\n return ['justify-center', 'items-start'];\n case 'top-right':\n return ['justify-end', 'items-start'];\n\n // center\n case 'center-left':\n return ['justify-start', 'items-center'];\n case 'center':\n return ['justify-center', 'items-center'];\n case 'center-right':\n return ['justify-end', 'items-center'];\n\n // bottom\n case 'bottom-left':\n return ['justify-start', 'items-end'];\n case 'bottom-center':\n return ['justify-center', 'items-end'];\n case 'bottom-right':\n return ['justify-end', 'items-end'];\n\n default:\n return ['justify-center', 'items-center'];\n }\n }\n\n toggle() {\n if (this._isHidden) {\n this.show();\n } else {\n this.hide();\n }\n\n // callback function\n this._options.onToggle(this);\n }\n\n show() {\n if (this.isHidden) {\n this._targetEl.classList.add('flex');\n this._targetEl.classList.remove('hidden');\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n this._createBackdrop();\n this._isHidden = false;\n\n // prevent body scroll\n document.body.classList.add('overflow-hidden');\n\n // Add keyboard event listener to the document\n if (this._options.closable) {\n this._setupModalCloseEventListeners();\n }\n\n // callback function\n this._options.onShow(this);\n }\n }\n\n hide() {\n if (this.isVisible) {\n this._targetEl.classList.add('hidden');\n this._targetEl.classList.remove('flex');\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n this._destroyBackdropEl();\n this._isHidden = true;\n\n // re-apply body scroll\n document.body.classList.remove('overflow-hidden');\n\n if (this._options.closable) {\n this._removeModalCloseEventListeners();\n }\n\n // callback function\n this._options.onHide(this);\n }\n }\n\n isVisible() {\n return !this._isHidden;\n }\n\n isHidden() {\n return this._isHidden;\n }\n}\n\nconst getModalInstance = (id: string, instances: ModalInstance[]) => {\n if (instances.some((modalInstance) => modalInstance.id === id)) {\n return instances.find((modalInstance) => modalInstance.id === id);\n }\n return null;\n};\n\nexport function initModals() {\n const modalInstances = [] as ModalInstance[];\n\n // initiate modal based on data-modal-target\n document.querySelectorAll('[data-modal-target]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-target');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n if (!getModalInstance(modalId, modalInstances)) {\n modalInstances.push({\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n });\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.`\n );\n }\n });\n\n // support pre v1.6.0 data-modal-toggle initialization\n document.querySelectorAll('[data-modal-toggle]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-toggle');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n let modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (!modal) {\n modal = {\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n };\n modalInstances.push(modal);\n }\n\n $triggerEl.addEventListener('click', () => {\n modal.object.toggle();\n });\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?`\n );\n }\n });\n\n // show modal on click if exists based on id\n document.querySelectorAll('[data-modal-show]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-show');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isHidden) {\n modal.object.show();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?`\n );\n }\n });\n\n // hide modal on click if exists based on id\n document.querySelectorAll('[data-modal-hide]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-hide');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isVisible) {\n modal.object.hide();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Modal = Modal;\n window.initModals = initModals;\n}\n\nexport default Modal;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { PopoverOptions } from './types';\nimport { PopoverInterface } from './interface';\n\nconst Default: PopoverOptions = {\n placement: 'top',\n offset: 10,\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Popover implements PopoverInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: PopoverOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: PopoverOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, this._options.offset],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility to true\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility to false\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initPopovers() {\n document.querySelectorAll('[data-popover-target]').forEach(($triggerEl) => {\n const popoverID = $triggerEl.getAttribute('data-popover-target');\n const $popoverEl = document.getElementById(popoverID);\n\n if ($popoverEl) {\n const triggerType = $triggerEl.getAttribute('data-popover-trigger');\n const placement = $triggerEl.getAttribute('data-popover-placement');\n const offset = $triggerEl.getAttribute('data-popover-offset');\n\n new Popover(\n $popoverEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n offset: offset ? parseInt(offset) : Default.offset,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as PopoverOptions\n );\n } else {\n console.error(\n `The popover element with id \"${popoverID}\" does not exist. Please check the data-popover-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Popover = Popover;\n window.initPopovers = initPopovers;\n}\n\nexport default Popover;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { TabItem, TabsOptions } from './types';\nimport { TabsInterface } from './interface';\n\nconst Default: TabsOptions = {\n defaultTabId: null,\n activeClasses:\n 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500',\n inactiveClasses:\n 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300',\n onShow: () => {},\n};\n\nclass Tabs implements TabsInterface {\n _items: TabItem[];\n _activeTab: TabItem;\n _options: TabsOptions;\n\n constructor(items: TabItem[] = [], options: TabsOptions = Default) {\n this._items = items;\n this._activeTab = options ? this.getTab(options.defaultTabId) : null;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._items.length) {\n // set the first tab as active if not set by explicitly\n if (!this._activeTab) {\n this._setActiveTab(this._items[0]);\n }\n\n // force show the first default tab\n this.show(this._activeTab.id, true);\n\n // show tab content based on click\n this._items.map((tab) => {\n tab.triggerEl.addEventListener('click', () => {\n this.show(tab.id);\n });\n });\n }\n }\n\n getActiveTab() {\n return this._activeTab;\n }\n\n _setActiveTab(tab: TabItem) {\n this._activeTab = tab;\n }\n\n getTab(id: string) {\n return this._items.filter((t) => t.id === id)[0];\n }\n\n show(id: string, forceShow = false) {\n const tab = this.getTab(id);\n\n // don't do anything if already active\n if (tab === this._activeTab && !forceShow) {\n return;\n }\n\n // hide other tabs\n this._items.map((t: TabItem) => {\n if (t !== tab) {\n t.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n t.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n t.targetEl.classList.add('hidden');\n t.triggerEl.setAttribute('aria-selected', 'false');\n }\n });\n\n // show active tab\n tab.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n tab.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n tab.triggerEl.setAttribute('aria-selected', 'true');\n tab.targetEl.classList.remove('hidden');\n\n this._setActiveTab(tab);\n\n // callback function\n this._options.onShow(this, tab);\n }\n}\n\nexport function initTabs() {\n document.querySelectorAll('[data-tabs-toggle]').forEach(($triggerEl) => {\n const tabItems: TabItem[] = [];\n let defaultTabId = null;\n $triggerEl\n .querySelectorAll('[role=\"tab\"]')\n .forEach(($triggerEl: HTMLElement) => {\n const isActive =\n $triggerEl.getAttribute('aria-selected') === 'true';\n const tab: TabItem = {\n id: $triggerEl.getAttribute('data-tabs-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-tabs-target')\n ),\n };\n tabItems.push(tab);\n\n if (isActive) {\n defaultTabId = tab.id;\n }\n });\n new Tabs(tabItems, {\n defaultTabId: defaultTabId,\n } as TabsOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tabs = Tabs;\n window.initTabs = initTabs;\n}\n\nexport default Tabs;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { TooltipOptions } from './types';\nimport { TooltipInterface } from './interface';\n\nconst Default: TooltipOptions = {\n placement: 'top',\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Tooltip implements TooltipInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: TooltipOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: TooltipOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.hide();\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initTooltips() {\n document.querySelectorAll('[data-tooltip-target]').forEach(($triggerEl) => {\n const tooltipId = $triggerEl.getAttribute('data-tooltip-target');\n const $tooltipEl = document.getElementById(tooltipId);\n\n if ($tooltipEl) {\n const triggerType = $triggerEl.getAttribute('data-tooltip-trigger');\n const placement = $triggerEl.getAttribute('data-tooltip-placement');\n\n new Tooltip(\n $tooltipEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as TooltipOptions\n );\n } else {\n console.error(\n `The tooltip element with id \"${tooltipId}\" does not exist. Please check the data-tooltip-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tooltip = Tooltip;\n window.initTooltips = initTooltips;\n}\n\nexport default Tooltip;\n","class Events {\n private _eventType: string;\n private _eventFunctions: EventListener[];\n\n constructor(eventType: string, eventFunctions: EventListener[] = []) {\n this._eventType = eventType;\n this._eventFunctions = eventFunctions;\n }\n\n init() {\n this._eventFunctions.forEach((eventFunction) => {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import './flowbite.css';\n\n// core components\nimport Accordion, { initAccordions } from './components/accordion';\nimport Carousel, { initCarousels } from './components/carousel';\nimport Collapse, { initCollapses } from './components/collapse';\nimport Dial, { initDials } from './components/dial';\nimport Dismiss, { initDismisses } from './components/dismiss';\nimport Drawer, { initDrawers } from './components/drawer';\nimport Dropdown, { initDropdowns } from './components/dropdown';\nimport Modal, { initModals } from './components/modal';\nimport Popover, { initPopovers } from './components/popover';\nimport Tabs, { initTabs } from './components/tabs';\nimport Tooltip, { initTooltips } from './components/tooltip';\nimport './components/index';\nimport Events from './dom/events';\n\nconst events = new Events('load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nevents.init();\n\nexport default {\n Accordion,\n Carousel,\n Collapse,\n Dial,\n Drawer,\n Dismiss,\n Dropdown,\n Modal,\n Popover,\n Tabs,\n Tooltip,\n Events,\n};\n"],"names":["root","factory","exports","module","define","amd","self","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","getNodeName","element","nodeName","toLowerCase","getWindow","node","window","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","name","enabled","phase","fn","_ref","state","Object","keys","elements","forEach","style","styles","attributes","assign","value","removeAttribute","setAttribute","effect","_ref2","initialStyles","position","options","strategy","top","margin","arrow","hasOwnProperty","property","attribute","requires","getBasePlacement","split","Math","max","min","round","getUAString","uaData","navigator","userAgentData","brands","map","item","brand","version","join","userAgent","isLayoutViewport","test","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scaleX","scaleY","offsetWidth","width","offsetHeight","height","visualViewport","addVisualOffsets","x","offsetLeft","y","offsetTop","getLayoutRect","abs","contains","parent","child","rootNode","getRootNode","next","isSameNode","parentNode","host","getComputedStyle","isTableElement","indexOf","getDocumentElement","document","documentElement","getParentNode","assignedSlot","getTrueOffsetParent","offsetParent","getOffsetParent","isFirefox","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","getMainAxisFromPlacement","within","mergePaddingObject","paddingObject","expandToHashMap","hashMap","key","_state$modifiersData$","arrowElement","popperOffsets","modifiersData","basePlacement","axis","len","padding","rects","toPaddingObject","arrowRect","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","clientHeight","clientWidth","centerToReference","center","offset","axisProp","centerOffset","_options$element","querySelector","requiresIfExists","getVariation","unsetSides","mapToStyles","_Object$assign2","popperRect","variation","offsets","gpuAcceleration","adaptive","roundOffsets","isFixed","_offsets$x","_offsets$y","_ref3","hasX","hasY","sideX","sideY","win","heightProp","widthProp","_Object$assign","commonStyles","_ref4","dpr","devicePixelRatio","roundOffsetsByDPR","_ref5","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","data","passive","instance","_options$scroll","scroll","_options$resize","resize","scrollParents","scrollParent","addEventListener","update","removeEventListener","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","getWindowScroll","scrollLeft","pageXOffset","scrollTop","pageYOffset","getWindowScrollBarX","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getScrollParent","body","listScrollParents","list","_element$ownerDocumen","isBody","target","updatedList","rectToClientRect","rect","getClientRectFromMixedType","clippingParent","html","layoutViewport","getViewportRect","clientTop","clientLeft","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","computeOffsets","commonX","commonY","mainAxis","detectOverflow","_options","_options$placement","_options$strategy","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","altContext","clippingClientRect","contextElement","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","flipVariations","allowedAutoPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","placements","_options$allowedAutoP","allowedPlacements","length","overflows","sort","a","b","computeAutoPlacement","referenceRect","checksMap","Map","makeFallbackChecks","firstFittingPlacement","i","_basePlacement","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","push","every","check","set","_loop","_i","fittingPlacement","find","get","slice","reset","getSideOffsets","preventedOffsets","isAnySideFullyClipped","some","side","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","_options$offset","invertDistance","skidding","distance","distanceAndSkiddingToXY","_data$state$placement","_options$tether","tether","_options$tetherOffset","tetherOffset","isBasePlacement","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","_offsetModifierState$","mainSide","altSide","additive","minLen","maxLen","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","clientOffset","offsetModifierValue","tetherMax","preventedOffset","_offsetModifierState$2","_mainSide","_altSide","_offset","_len","_min","_max","isOriginSide","_offsetModifierValue","_tetherMin","_tetherMax","_preventedOffset","v","withinMaxClamp","getCompositeRect","elementOrVirtualElement","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","order","modifiers","visited","Set","result","modifier","add","dep","has","depModifier","DEFAULT_OPTIONS","areValidElements","arguments","args","Array","_key","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","pending","orderedModifiers","effectCleanupFns","isDestroyed","setOptions","setOptionsAction","cleanupModifierEffects","orderModifiers","merged","current","existing","mergeByName","m","_ref3$options","cleanupFn","noopFn","forceUpdate","_state$elements","index","_state$orderedModifie","_state$orderedModifie2","Promise","resolve","then","undefined","destroy","onFirstUpdate","createPopper","eventListeners","Default","alwaysOpen","activeClasses","inactiveClasses","onOpen","onClose","onToggle","items","this","_items","_init","active","open","id","triggerEl","toggle","getItem","classList","remove","targetEl","iconEl","close","initAccordions","querySelectorAll","$accordionEl","getAttribute","$triggerEl","closest","Accordion","defaultPosition","indicators","interval","onNext","onPrev","onChange","_activeItem","_indicators","_intervalDuration","_intervalInstance","el","_getActiveItem","slideTo","indicator","nextItem","rotationItems","middle","_rotate","_setActiveItem","pause","cycle","activeItem","prev","prevItem","setInterval","clearInterval","initCarousels","$carouselEl","slide","from","$carouselItemEl","$indicatorEl","parseInt","carousel","Carousel","carouselNextEl","carouselPrevEl","onCollapse","onExpand","_targetEl","_triggerEl","_visible","hasAttribute","collapse","expand","initCollapses","targetId","$targetEl","getElementById","Collapse","console","error","triggerType","onShow","onHide","parentEl","_parentEl","triggerEventTypes","_getTriggerEventTypes","showEvents","ev","show","hideEvents","matches","hide","isHidden","isVisible","initDials","$parentEl","dialId","$dialEl","Dial","transition","duration","timing","setTimeout","initDismisses","$dismissEl","Dismiss","bodyScrolling","backdrop","edge","edgeOffset","backdropClasses","_getPlacementClasses","base","c","event","inactive","_destroyBackdropEl","_createBackdrop","backdropEl","createElement","append","getDrawerInstance","instances","drawerInstance","initDrawers","drawerInstances","drawerId","$drawerEl","object","Drawer","offsetSkidding","offsetDistance","delay","ignoreClickOutsideClass","targetElement","triggerElement","_popperInstance","_createPopperInstance","_setupEventListeners","triggerEvents","_getTriggerEvents","_setupClickOutsideListener","_clickOutsideEventListener","_handleClickOutside","_removeClickOutsideListener","clickedEl","isIgnored","initDropdowns","dropdownId","$dropdownEl","Dropdown","initFlowbite","initModals","initTabs","initTooltips","initPopovers","closable","_isHidden","_backdropEl","_setupModalCloseEventListeners","_handleOutsideClick","_keydownEventListener","_removeModalCloseEventListeners","getModalInstance","modalInstance","modalInstances","modalId","$modalEl","Modal","_setupKeydownListener","_removeKeydownListener","popoverID","$popoverEl","Popover","defaultTabId","_activeTab","getTab","_setActiveTab","tab","getActiveTab","t","forceShow","tabItems","isActive","Tabs","tooltipId","$tooltipEl","Tooltip","eventType","eventFunctions","_eventType","_eventFunctions","init","eventFunction","Events","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","d","definition","o","defineProperty","enumerable","obj","prop","prototype","r","Symbol","toStringTag"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.phoenix.js b/node_modules/flowbite/dist/flowbite.phoenix.js new file mode 100644 index 0000000..4ead6dc --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.phoenix.js @@ -0,0 +1,4438 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("Flowbite", [], factory); + else if(typeof exports === 'object') + exports["Flowbite"] = factory(); + else + root["Flowbite"] = factory(); +})(self, function() { +return /******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ 853: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "afterMain": function() { return /* reexport */ afterMain; }, + "afterRead": function() { return /* reexport */ afterRead; }, + "afterWrite": function() { return /* reexport */ afterWrite; }, + "applyStyles": function() { return /* reexport */ modifiers_applyStyles; }, + "arrow": function() { return /* reexport */ modifiers_arrow; }, + "auto": function() { return /* reexport */ auto; }, + "basePlacements": function() { return /* reexport */ basePlacements; }, + "beforeMain": function() { return /* reexport */ beforeMain; }, + "beforeRead": function() { return /* reexport */ beforeRead; }, + "beforeWrite": function() { return /* reexport */ beforeWrite; }, + "bottom": function() { return /* reexport */ bottom; }, + "clippingParents": function() { return /* reexport */ clippingParents; }, + "computeStyles": function() { return /* reexport */ modifiers_computeStyles; }, + "createPopper": function() { return /* reexport */ popper_createPopper; }, + "createPopperBase": function() { return /* reexport */ createPopper; }, + "createPopperLite": function() { return /* reexport */ popper_lite_createPopper; }, + "detectOverflow": function() { return /* reexport */ detectOverflow; }, + "end": function() { return /* reexport */ end; }, + "eventListeners": function() { return /* reexport */ eventListeners; }, + "flip": function() { return /* reexport */ modifiers_flip; }, + "hide": function() { return /* reexport */ modifiers_hide; }, + "left": function() { return /* reexport */ left; }, + "main": function() { return /* reexport */ main; }, + "modifierPhases": function() { return /* reexport */ modifierPhases; }, + "offset": function() { return /* reexport */ modifiers_offset; }, + "placements": function() { return /* reexport */ enums_placements; }, + "popper": function() { return /* reexport */ popper; }, + "popperGenerator": function() { return /* reexport */ popperGenerator; }, + "popperOffsets": function() { return /* reexport */ modifiers_popperOffsets; }, + "preventOverflow": function() { return /* reexport */ modifiers_preventOverflow; }, + "read": function() { return /* reexport */ read; }, + "reference": function() { return /* reexport */ reference; }, + "right": function() { return /* reexport */ right; }, + "start": function() { return /* reexport */ start; }, + "top": function() { return /* reexport */ enums_top; }, + "variationPlacements": function() { return /* reexport */ variationPlacements; }, + "viewport": function() { return /* reexport */ viewport; }, + "write": function() { return /* reexport */ write; } +}); + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js +var enums_top = 'top'; +var bottom = 'bottom'; +var right = 'right'; +var left = 'left'; +var auto = 'auto'; +var basePlacements = [enums_top, bottom, right, left]; +var start = 'start'; +var end = 'end'; +var clippingParents = 'clippingParents'; +var viewport = 'viewport'; +var popper = 'popper'; +var reference = 'reference'; +var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); +}, []); +var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +}, []); // modifiers that need to read the DOM + +var beforeRead = 'beforeRead'; +var read = 'read'; +var afterRead = 'afterRead'; // pure-logic modifiers + +var beforeMain = 'beforeMain'; +var main = 'main'; +var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) + +var beforeWrite = 'beforeWrite'; +var write = 'write'; +var afterWrite = 'afterWrite'; +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +function getNodeName(element) { + return element ? (element.nodeName || '').toLowerCase() : null; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js +function getWindow(node) { + if (node == null) { + return window; + } + + if (node.toString() !== '[object Window]') { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + + return node; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js + + +function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; +} + +function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; +} + +function isShadowRoot(node) { + // IE 11 has no ShadowRoot + if (typeof ShadowRoot === 'undefined') { + return false; + } + + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js + + // This modifier takes the styles prepared by the `computeStyles` modifier +// and applies them to the HTMLElements such as popper and arrow + +function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function (name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } // Flow doesn't support to extend this property, but it's the most + // effective way to apply styles to an HTMLElement + // $FlowFixMe[cannot-write] + + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (name) { + var value = attributes[name]; + + if (value === false) { + element.removeAttribute(name); + } else { + element.setAttribute(name, value === true ? '' : value); + } + }); + }); +} + +function effect(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: '0', + top: '0', + margin: '0' + }, + arrow: { + position: 'absolute' + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + + return function () { + Object.keys(state.elements).forEach(function (name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them + + var style = styleProperties.reduce(function (style, property) { + style[property] = ''; + return style; + }, {}); // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (attribute) { + element.removeAttribute(attribute); + }); + }); + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_applyStyles = ({ + name: 'applyStyles', + enabled: true, + phase: 'write', + fn: applyStyles, + effect: effect, + requires: ['computeStyles'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js + +function getBasePlacement(placement) { + return placement.split('-')[0]; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js +var math_max = Math.max; +var math_min = Math.min; +var round = Math.round; +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/userAgent.js +function getUAString() { + var uaData = navigator.userAgentData; + + if (uaData != null && uaData.brands) { + return uaData.brands.map(function (item) { + return item.brand + "/" + item.version; + }).join(' '); + } + + return navigator.userAgent; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js + +function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js + + + + +function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; + } + + var _ref = isElement(element) ? getWindow(element) : window, + visualViewport = _ref.visualViewport; + + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width: width, + height: height, + top: y, + right: x + width, + bottom: y + height, + left: x, + x: x, + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js + // Returns the layout rect of an element relative to its offsetParent. Layout +// means it doesn't take into account transforms. + +function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. + // Fixes https://github.com/popperjs/popper-core/issues/1223 + + var width = element.offsetWidth; + var height = element.offsetHeight; + + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + + return { + x: element.offsetLeft, + y: element.offsetTop, + width: width, + height: height + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js + +function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method + + if (parent.contains(child)) { + return true; + } // then fallback to custom implementation with Shadow DOM support + else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + + + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false + + + return false; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js + +function getComputedStyle(element) { + return getWindow(element).getComputedStyle(element); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js + +function isTableElement(element) { + return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js + +function getDocumentElement(element) { + // $FlowFixMe[incompatible-return]: assume body is always available + return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] + element.document) || window.document).documentElement; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js + + + +function getParentNode(element) { + if (getNodeName(element) === 'html') { + return element; + } + + return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || ( // DOM Element detected + isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) // fallback + + ); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js + + + + + + + + +function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle(element).position === 'fixed') { + return null; + } + + return element.offsetParent; +} // `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block + + +function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + + if (isIE && isHTMLElement(element)) { + // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport + var elementCss = getComputedStyle(element); + + if (elementCss.position === 'fixed') { + return null; + } + } + + var currentNode = getParentNode(element); + + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + + while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that + // create a containing block. + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + + if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + + return null; +} // Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. + + +function getOffsetParent(element) { + var window = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { + offsetParent = getTrueOffsetParent(offsetParent); + } + + if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { + return window; + } + + return offsetParent || getContainingBlock(element) || window; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +function getMainAxisFromPlacement(placement) { + return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js + +function within(min, value, max) { + return math_max(min, math_min(value, max)); +} +function withinMaxClamp(min, value, max) { + var v = within(min, value, max); + return v > max ? max : v; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js + +function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js +function expandToHashMap(value, keys) { + return keys.reduce(function (hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js + + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var toPaddingObject = function toPaddingObject(padding, state) { + padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +}; + +function arrow(_ref) { + var _state$modifiersData$; + + var state = _ref.state, + name = _ref.name, + options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? 'height' : 'width'; + + if (!arrowElement || !popperOffsets) { + return; + } + + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === 'y' ? enums_top : left; + var maxProp = axis === 'y' ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; + var startDiff = popperOffsets[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is + // outside of the popper bounds + + var min = paddingObject[minProp]; + var max = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset = within(min, center, max); // Prevents breaking syntax highlighting... + + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); +} + +function arrow_effect(_ref2) { + var state = _ref2.state, + options = _ref2.options; + var _options$element = options.element, + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + + if (arrowElement == null) { + return; + } // CSS selector + + + if (typeof arrowElement === 'string') { + arrowElement = state.elements.popper.querySelector(arrowElement); + + if (!arrowElement) { + return; + } + } + + if (false) {} + + if (!contains(state.elements.popper, arrowElement)) { + if (false) {} + + return; + } + + state.elements.arrow = arrowElement; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_arrow = ({ + name: 'arrow', + enabled: true, + phase: 'main', + fn: arrow, + effect: arrow_effect, + requires: ['popperOffsets'], + requiresIfExists: ['preventOverflow'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js +function getVariation(placement) { + return placement.split('-')[1]; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var unsetSides = { + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto' +}; // Round the offsets to the nearest suitable subpixel based on the DPR. +// Zooming can change the DPR, but it seems to report a value that will +// cleanly divide the values into the appropriate subpixels. + +function roundOffsetsByDPR(_ref) { + var x = _ref.x, + y = _ref.y; + var win = window; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x * dpr) / dpr || 0, + y: round(y * dpr) / dpr || 0 + }; +} + +function mapToStyles(_ref2) { + var _Object$assign2; + + var popper = _ref2.popper, + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets, + isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, + x = _offsets$x === void 0 ? 0 : _offsets$x, + _offsets$y = offsets.y, + y = _offsets$y === void 0 ? 0 : _offsets$y; + + var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty('x'); + var hasY = offsets.hasOwnProperty('y'); + var sideX = left; + var sideY = enums_top; + var win = window; + + if (adaptive) { + var offsetParent = getOffsetParent(popper); + var heightProp = 'clientHeight'; + var widthProp = 'clientWidth'; + + if (offsetParent === getWindow(popper)) { + offsetParent = getDocumentElement(popper); + + if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { + heightProp = 'scrollHeight'; + widthProp = 'scrollWidth'; + } + } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it + + + offsetParent = offsetParent; + + if (placement === enums_top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] + offsetParent[heightProp]; + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + + if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] + offsetParent[widthProp]; + x -= offsetX - popperRect.width; + x *= gpuAcceleration ? 1 : -1; + } + } + + var commonStyles = Object.assign({ + position: position + }, adaptive && unsetSides); + + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref4.x; + y = _ref4.y; + + if (gpuAcceleration) { + var _Object$assign; + + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + } + + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +} + +function computeStyles(_ref5) { + var state = _ref5.state, + options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + + if (false) { var transitionProperty; } + + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration: gpuAcceleration, + isFixed: state.options.strategy === 'fixed' + }; + + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive: adaptive, + roundOffsets: roundOffsets + }))); + } + + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: 'absolute', + adaptive: false, + roundOffsets: roundOffsets + }))); + } + + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-placement': state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_computeStyles = ({ + name: 'computeStyles', + enabled: true, + phase: 'beforeWrite', + fn: computeStyles, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js + // eslint-disable-next-line import/no-unused-modules + +var passive = { + passive: true +}; + +function eventListeners_effect(_ref) { + var state = _ref.state, + instance = _ref.instance, + options = _ref.options; + var _options$scroll = options.scroll, + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; + var window = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.addEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.addEventListener('resize', instance.update, passive); + } + + return function () { + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.removeEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.removeEventListener('resize', instance.update, passive); + } + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var eventListeners = ({ + name: 'eventListeners', + enabled: true, + phase: 'write', + fn: function fn() {}, + effect: eventListeners_effect, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +var hash = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +var getOppositeVariationPlacement_hash = { + start: 'end', + end: 'start' +}; +function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function (matched) { + return getOppositeVariationPlacement_hash[matched]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js + +function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft: scrollLeft, + scrollTop: scrollTop + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js + + + +function getWindowScrollBarX(element) { + // If has a CSS width greater than the viewport, then this will be + // incorrect for RTL. + // Popper 1 is broken in this case and never had a bug report so let's assume + // it's not an issue. I don't think anyone ever specifies width on + // anyway. + // Browsers where the left scrollbar doesn't cause an issue report `0` for + // this (e.g. Edge 2019, IE11, Safari) + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js + + + + +function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x = 0; + var y = 0; + + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + + if (layoutViewport || !layoutViewport && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + + return { + width: width, + height: height, + x: x + getWindowScrollBarX(element), + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js + + + + + // Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable + +function getDocumentRect(element) { + var _element$ownerDocumen; + + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y = -winScroll.scrollTop; + + if (getComputedStyle(body || html).direction === 'rtl') { + x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + + return { + width: width, + height: height, + x: x, + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js + +function isScrollParent(element) { + // Firefox wants us to check `-x` and `-y` variations as well + var _getComputedStyle = getComputedStyle(element), + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; + + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js + + + + +function getScrollParent(node) { + if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { + // $FlowFixMe[incompatible-return]: assume body is always available + return node.ownerDocument.body; + } + + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + + return getScrollParent(getParentNode(node)); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js + + + + +/* +given a DOM element, return the list of all scroll parents, up the list of ancesors +until we get to the top window object. This list is what we attach scroll listeners +to, because if any of these parent elements scroll, we'll need to re-calculate the +reference element's position. +*/ + +function listScrollParents(element, list) { + var _element$ownerDocumen; + + if (list === void 0) { + list = []; + } + + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js +function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js + + + + + + + + + + + + + + + +function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === 'fixed'); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; +} + +function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +} // A "clipping parent" is an overflowable container with the characteristic of +// clipping (or hiding) overflowing elements with a position different from +// `initial` + + +function getClippingParents(element) { + var clippingParents = listScrollParents(getParentNode(element)); + var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + + if (!isElement(clipperElement)) { + return []; + } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 + + + return clippingParents.filter(function (clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; + }); +} // Gets the maximum area that the element is visible in due to any number of +// clipping parents + + +function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); + var clippingParents = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents[0]; + var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = math_max(rect.top, accRect.top); + accRect.right = math_min(rect.right, accRect.right); + accRect.bottom = math_min(rect.bottom, accRect.bottom); + accRect.left = math_max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js + + + + +function computeOffsets(_ref) { + var reference = _ref.reference, + element = _ref.element, + placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference.x + reference.width / 2 - element.width / 2; + var commonY = reference.y + reference.height / 2 - element.height / 2; + var offsets; + + switch (basePlacement) { + case enums_top: + offsets = { + x: commonX, + y: reference.y - element.height + }; + break; + + case bottom: + offsets = { + x: commonX, + y: reference.y + reference.height + }; + break; + + case right: + offsets = { + x: reference.x + reference.width, + y: commonY + }; + break; + + case left: + offsets = { + x: reference.x - element.width, + y: commonY + }; + break; + + default: + offsets = { + x: reference.x, + y: reference.y + }; + } + + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + + if (mainAxis != null) { + var len = mainAxis === 'y' ? 'height' : 'width'; + + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); + break; + + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); + break; + + default: + } + } + + return offsets; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + _options$placement = _options.placement, + placement = _options$placement === void 0 ? state.placement : _options$placement, + _options$strategy = _options.strategy, + strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, + _options$boundary = _options.boundary, + boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: 'absolute', + placement: placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect + // 0 or negative = within the clipping rect + + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element + + if (elementContext === popper && offsetData) { + var offset = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function (key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; + overflowOffsets[key] += offset[axis] * multiply; + }); + } + + return overflowOffsets; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js + + + + +function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { + return getVariation(placement) === variation; + }) : basePlacements; + var allowedPlacements = placements.filter(function (placement) { + return allowedAutoPlacements.indexOf(placement) >= 0; + }); + + if (allowedPlacements.length === 0) { + allowedPlacements = placements; + + if (false) {} + } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... + + + var overflows = allowedPlacements.reduce(function (acc, placement) { + acc[placement] = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding + })[getBasePlacement(placement)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function (a, b) { + return overflows[a] - overflows[b]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; +} + +function flip(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + + if (state.modifiersData[name]._skip) { + return; + } + + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { + return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + flipVariations: flipVariations, + allowedAutoPlacements: allowedAutoPlacements + }) : placement); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements[0]; + + for (var i = 0; i < placements.length; i++) { + var placement = placements[i]; + + var _basePlacement = getBasePlacement(placement); + + var isStartVariation = getVariation(placement) === start; + var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? 'width' : 'height'; + var overflow = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + altBoundary: altBoundary, + padding: padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; + + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + + if (checks.every(function (check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + + checksMap.set(placement, checks); + } + + if (makeFallbackChecks) { + // `2` may be desired in some cases – research later + var numberOfChecks = flipVariations ? 3 : 1; + + var _loop = function _loop(_i) { + var fittingPlacement = placements.find(function (placement) { + var checks = checksMap.get(placement); + + if (checks) { + return checks.slice(0, _i).every(function (check) { + return check; + }); + } + }); + + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + + if (_ret === "break") break; + } + } + + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_flip = ({ + name: 'flip', + enabled: true, + phase: 'main', + fn: flip, + requiresIfExists: ['offset'], + data: { + _skip: false + } +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js + + + +function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; +} + +function isAnySideFullyClipped(overflow) { + return [enums_top, right, bottom, left].some(function (side) { + return overflow[side] >= 0; + }); +} + +function hide(_ref) { + var state = _ref.state, + name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: 'reference' + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets: referenceClippingOffsets, + popperEscapeOffsets: popperEscapeOffsets, + isReferenceHidden: isReferenceHidden, + hasPopperEscaped: hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-reference-hidden': isReferenceHidden, + 'data-popper-escaped': hasPopperEscaped + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_hide = ({ + name: 'hide', + enabled: true, + phase: 'main', + requiresIfExists: ['preventOverflow'], + fn: hide +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js + + // eslint-disable-next-line import/no-unused-modules + +function distanceAndSkiddingToXY(placement, rects, offset) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; + + var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { + placement: placement + })) : offset, + skidding = _ref[0], + distance = _ref[1]; + + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; +} + +function offset(_ref2) { + var state = _ref2.state, + options = _ref2.options, + name = _ref2.name; + var _options$offset = options.offset, + offset = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = enums_placements.reduce(function (acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); + return acc; + }, {}); + var _data$state$placement = data[state.placement], + x = _data$state$placement.x, + y = _data$state$placement.y; + + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x; + state.modifiersData.popperOffsets.y += y; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_offset = ({ + name: 'offset', + enabled: true, + phase: 'main', + requires: ['popperOffsets'], + fn: offset +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js + + +function popperOffsets(_ref) { + var state = _ref.state, + name = _ref.name; + // Offsets are the actual position the popper needs to have to be + // properly positioned near its reference element + // This is the most basic placement, and will be adjusted by + // the modifiers in the next step + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: 'absolute', + placement: state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_popperOffsets = ({ + name: 'popperOffsets', + enabled: true, + phase: 'read', + fn: popperOffsets, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js +function getAltAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js + + + + + + + + + + + + +function preventOverflow(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + altBoundary: altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + + if (!popperOffsets) { + return; + } + + if (checkMainAxis) { + var _offsetModifierState$; + + var mainSide = mainAxis === 'y' ? enums_top : left; + var altSide = mainAxis === 'y' ? bottom : right; + var len = mainAxis === 'y' ? 'height' : 'width'; + var offset = popperOffsets[mainAxis]; + var min = offset + overflow[mainSide]; + var max = offset - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go + // outside the reference bounds + + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want + // to include its full size in the calculation. If the reference is small + // and near the edge of a boundary, the popper can overflow even if the + // reference is not overflowing as well (e.g. virtual elements with no + // width or height) + + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); + popperOffsets[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset; + } + + if (checkAltAxis) { + var _offsetModifierState$2; + + var _mainSide = mainAxis === 'x' ? enums_top : left; + + var _altSide = mainAxis === 'x' ? bottom : right; + + var _offset = popperOffsets[altAxis]; + + var _len = altAxis === 'y' ? 'height' : 'width'; + + var _min = _offset + overflow[_mainSide]; + + var _max = _offset - overflow[_altSide]; + + var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; + + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + + popperOffsets[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_preventOverflow = ({ + name: 'preventOverflow', + enabled: true, + phase: 'main', + fn: preventOverflow, + requiresIfExists: ['offset'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/index.js + + + + + + + + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js + + + + +function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js + + + + + + + + + +function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; +} // Returns the composite rect of an element relative to its offsetParent. +// Composite means it takes into account transforms as well as layout. + + +function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js + // source: https://stackoverflow.com/questions/49875255 + +function order(modifiers) { + var map = new Map(); + var visited = new Set(); + var result = []; + modifiers.forEach(function (modifier) { + map.set(modifier.name, modifier); + }); // On visiting object, check for its dependencies and visit them recursively + + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function (dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + + modifiers.forEach(function (modifier) { + if (!visited.has(modifier.name)) { + // check for visited object + sort(modifier); + } + }); + return result; +} + +function orderModifiers(modifiers) { + // order based on dependencies + var orderedModifiers = order(modifiers); // order based on phase + + return modifierPhases.reduce(function (acc, phase) { + return acc.concat(orderedModifiers.filter(function (modifier) { + return modifier.phase === phase; + })); + }, []); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js +function debounce(fn) { + var pending; + return function () { + if (!pending) { + pending = new Promise(function (resolve) { + Promise.resolve().then(function () { + pending = undefined; + resolve(fn()); + }); + }); + } + + return pending; + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js +function mergeByName(modifiers) { + var merged = modifiers.reduce(function (merged, current) { + var existing = merged[current.name]; + merged[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged; + }, {}); // IE11 does not support Object.values + + return Object.keys(merged).map(function (key) { + return merged[key]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js + + + + + + + + + + + + + + +var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +var DEFAULT_OPTIONS = { + placement: 'bottom', + modifiers: [], + strategy: 'absolute' +}; + +function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return !args.some(function (element) { + return !(element && typeof element.getBoundingClientRect === 'function'); + }); +} + +function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + + var _generatorOptions = generatorOptions, + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper(reference, popper, options) { + if (options === void 0) { + options = defaultOptions; + } + + var state = { + placement: 'bottom', + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference, + popper: popper + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state: state, + setOptions: function setOptions(setOptionsAction) { + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options); + state.scrollParents = { + reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], + popper: listScrollParents(popper) + }; // Orders the modifiers based on their dependencies and `phase` + // properties + + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers + + state.orderedModifiers = orderedModifiers.filter(function (m) { + return m.enabled; + }); // Validate the provided modifiers so that the consumer will get warned + // if one of the modifiers is invalid for any reason + + if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } + + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + + var _state$elements = state.elements, + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + // anymore + + if (!areValidElements(reference, popper)) { + if (false) {} + + return; + } // Store the reference and popper rects to be read by modifiers + + + state.rects = { + reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), + popper: getLayoutRect(popper) + }; // Modifiers have the ability to reset the current update cycle. The + // most common use case for this is the `flip` modifier changing the + // placement, which then needs to re-run all the modifiers, because the + // logic was previously ran for the previous placement and is therefore + // stale/incorrect + + state.reset = false; + state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier + // is filled with the initial data specified by the modifier. This means + // it doesn't persist and is fresh on each update. + // To ensure persistent data, use `${name}#persistent` + + state.orderedModifiers.forEach(function (modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + var __debug_loops__ = 0; + + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (false) {} + + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + + var _state$orderedModifie = state.orderedModifiers[index], + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; + + if (typeof fn === 'function') { + state = fn({ + state: state, + options: _options, + name: name, + instance: instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function () { + return new Promise(function (resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + + if (!areValidElements(reference, popper)) { + if (false) {} + + return instance; + } + + instance.setOptions(options).then(function (state) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state); + } + }); // Modifiers have the ability to execute arbitrary code before the first + // update cycle runs. They will be executed in the same order as the update + // cycle. This is useful when a modifier adds some persistent data that + // other modifiers need to use, but the modifier is run after the dependent + // one. + + function runModifierEffects() { + state.orderedModifiers.forEach(function (_ref3) { + var name = _ref3.name, + _ref3$options = _ref3.options, + options = _ref3$options === void 0 ? {} : _ref3$options, + effect = _ref3.effect; + + if (typeof effect === 'function') { + var cleanupFn = effect({ + state: state, + name: name, + instance: instance, + options: options + }); + + var noopFn = function noopFn() {}; + + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + + function cleanupModifierEffects() { + effectCleanupFns.forEach(function (fn) { + return fn(); + }); + effectCleanupFns = []; + } + + return instance; + }; +} +var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js + + + + + + + + + + +var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; +var popper_createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper-lite.js + + + + + +var popper_lite_defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles]; +var popper_lite_createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: popper_lite_defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/index.js + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + + +/***/ }), + +/***/ 902: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initAccordions = void 0; +var Default = { + alwaysOpen: false, + activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white', + inactiveClasses: 'text-gray-500 dark:text-gray-400', + onOpen: function () { }, + onClose: function () { }, + onToggle: function () { }, +}; +var Accordion = /** @class */ (function () { + function Accordion(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Accordion.prototype._init = function () { + var _this = this; + if (this._items.length) { + // show accordion item based on click + this._items.map(function (item) { + if (item.active) { + _this.open(item.id); + } + item.triggerEl.addEventListener('click', function () { + _this.toggle(item.id); + }); + }); + } + }; + Accordion.prototype.getItem = function (id) { + return this._items.filter(function (item) { return item.id === id; })[0]; + }; + Accordion.prototype.open = function (id) { + var _a, _b; + var _this = this; + var item = this.getItem(id); + // don't hide other accordions if always open + if (!this._options.alwaysOpen) { + this._items.map(function (i) { + var _a, _b; + if (i !== item) { + (_a = i.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = i.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + i.targetEl.classList.add('hidden'); + i.triggerEl.setAttribute('aria-expanded', 'false'); + i.active = false; + // rotate icon if set + if (i.iconEl) { + i.iconEl.classList.remove('rotate-180'); + } + } + }); + } + // show active item + (_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + item.triggerEl.setAttribute('aria-expanded', 'true'); + item.targetEl.classList.remove('hidden'); + item.active = true; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.add('rotate-180'); + } + // callback function + this._options.onOpen(this, item); + }; + Accordion.prototype.toggle = function (id) { + var item = this.getItem(id); + if (item.active) { + this.close(id); + } + else { + this.open(id); + } + // callback function + this._options.onToggle(this, item); + }; + Accordion.prototype.close = function (id) { + var _a, _b; + var item = this.getItem(id); + (_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(' ')); + item.targetEl.classList.add('hidden'); + item.triggerEl.setAttribute('aria-expanded', 'false'); + item.active = false; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.remove('rotate-180'); + } + // callback function + this._options.onClose(this, item); + }; + return Accordion; +}()); +function initAccordions() { + document.querySelectorAll('[data-accordion]').forEach(function ($accordionEl) { + var alwaysOpen = $accordionEl.getAttribute('data-accordion'); + var activeClasses = $accordionEl.getAttribute('data-active-classes'); + var inactiveClasses = $accordionEl.getAttribute('data-inactive-classes'); + var items = []; + $accordionEl + .querySelectorAll('[data-accordion-target]') + .forEach(function ($triggerEl) { + // Consider only items that directly belong to $accordionEl + // (to make nested accordions work). + if ($triggerEl.closest('[data-accordion]') === $accordionEl) { + var item = { + id: $triggerEl.getAttribute('data-accordion-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-accordion-target')), + iconEl: $triggerEl.querySelector('[data-accordion-icon]'), + active: $triggerEl.getAttribute('aria-expanded') === 'true' + ? true + : false, + }; + items.push(item); + } + }); + new Accordion(items, { + alwaysOpen: alwaysOpen === 'open' ? true : false, + activeClasses: activeClasses + ? activeClasses + : Default.activeClasses, + inactiveClasses: inactiveClasses + ? inactiveClasses + : Default.inactiveClasses, + }); + }); +} +exports.initAccordions = initAccordions; +if (typeof window !== 'undefined') { + window.Accordion = Accordion; + window.initAccordions = initAccordions; +} +exports["default"] = Accordion; + + +/***/ }), + +/***/ 33: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initCarousels = void 0; +var Default = { + defaultPosition: 0, + indicators: { + items: [], + activeClasses: 'bg-white dark:bg-gray-800', + inactiveClasses: 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800', + }, + interval: 3000, + onNext: function () { }, + onPrev: function () { }, + onChange: function () { }, +}; +var Carousel = /** @class */ (function () { + function Carousel(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign(__assign({}, Default), options), { indicators: __assign(__assign({}, Default.indicators), options.indicators) }); + this._activeItem = this.getItem(this._options.defaultPosition); + this._indicators = this._options.indicators.items; + this._intervalDuration = this._options.interval; + this._intervalInstance = null; + this._init(); + } + /** + * initialize carousel and items based on active one + */ + Carousel.prototype._init = function () { + var _this = this; + this._items.map(function (item) { + item.el.classList.add('absolute', 'inset-0', 'transition-transform', 'transform'); + }); + // if no active item is set then first position is default + if (this._getActiveItem()) { + this.slideTo(this._getActiveItem().position); + } + else { + this.slideTo(0); + } + this._indicators.map(function (indicator, position) { + indicator.el.addEventListener('click', function () { + _this.slideTo(position); + }); + }); + }; + Carousel.prototype.getItem = function (position) { + return this._items[position]; + }; + /** + * Slide to the element based on id + * @param {*} position + */ + Carousel.prototype.slideTo = function (position) { + var nextItem = this._items[position]; + var rotationItems = { + left: nextItem.position === 0 + ? this._items[this._items.length - 1] + : this._items[nextItem.position - 1], + middle: nextItem, + right: nextItem.position === this._items.length - 1 + ? this._items[0] + : this._items[nextItem.position + 1], + }; + this._rotate(rotationItems); + this._setActiveItem(nextItem); + if (this._intervalInstance) { + this.pause(); + this.cycle(); + } + this._options.onChange(this); + }; + /** + * Based on the currently active item it will go to the next position + */ + Carousel.prototype.next = function () { + var activeItem = this._getActiveItem(); + var nextItem = null; + // check if last item + if (activeItem.position === this._items.length - 1) { + nextItem = this._items[0]; + } + else { + nextItem = this._items[activeItem.position + 1]; + } + this.slideTo(nextItem.position); + // callback function + this._options.onNext(this); + }; + /** + * Based on the currently active item it will go to the previous position + */ + Carousel.prototype.prev = function () { + var activeItem = this._getActiveItem(); + var prevItem = null; + // check if first item + if (activeItem.position === 0) { + prevItem = this._items[this._items.length - 1]; + } + else { + prevItem = this._items[activeItem.position - 1]; + } + this.slideTo(prevItem.position); + // callback function + this._options.onPrev(this); + }; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + Carousel.prototype._rotate = function (rotationItems) { + // reset + this._items.map(function (item) { + item.el.classList.add('hidden'); + }); + // left item (previously active) + rotationItems.left.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.left.el.classList.add('-translate-x-full', 'z-10'); + // currently active item + rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10'); + rotationItems.middle.el.classList.add('translate-x-0', 'z-20'); + // right item (upcoming active) + rotationItems.right.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.right.el.classList.add('translate-x-full', 'z-10'); + }; + /** + * Set an interval to cycle through the carousel items + */ + Carousel.prototype.cycle = function () { + var _this = this; + if (typeof window !== 'undefined') { + this._intervalInstance = window.setInterval(function () { + _this.next(); + }, this._intervalDuration); + } + }; + /** + * Clears the cycling interval + */ + Carousel.prototype.pause = function () { + clearInterval(this._intervalInstance); + }; + /** + * Get the currently active item + */ + Carousel.prototype._getActiveItem = function () { + return this._activeItem; + }; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + Carousel.prototype._setActiveItem = function (item) { + var _a, _b; + var _this = this; + this._activeItem = item; + var position = item.position; + // update the indicators if available + if (this._indicators.length) { + this._indicators.map(function (indicator) { + var _a, _b; + indicator.el.setAttribute('aria-current', 'false'); + (_a = indicator.el.classList).remove.apply(_a, _this._options.indicators.activeClasses.split(' ')); + (_b = indicator.el.classList).add.apply(_b, _this._options.indicators.inactiveClasses.split(' ')); + }); + (_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(' ')); + (_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(' ')); + this._indicators[position].el.setAttribute('aria-current', 'true'); + } + }; + return Carousel; +}()); +function initCarousels() { + document.querySelectorAll('[data-carousel]').forEach(function ($carouselEl) { + var interval = $carouselEl.getAttribute('data-carousel-interval'); + var slide = $carouselEl.getAttribute('data-carousel') === 'slide' + ? true + : false; + var items = []; + var defaultPosition = 0; + if ($carouselEl.querySelectorAll('[data-carousel-item]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-item]')).map(function ($carouselItemEl, position) { + items.push({ + position: position, + el: $carouselItemEl, + }); + if ($carouselItemEl.getAttribute('data-carousel-item') === + 'active') { + defaultPosition = position; + } + }); + } + var indicators = []; + if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-slide-to]')).map(function ($indicatorEl) { + indicators.push({ + position: parseInt($indicatorEl.getAttribute('data-carousel-slide-to')), + el: $indicatorEl, + }); + }); + } + var carousel = new Carousel(items, { + defaultPosition: defaultPosition, + indicators: { + items: indicators, + }, + interval: interval ? interval : Default.interval, + }); + if (slide) { + carousel.cycle(); + } + // check for controls + var carouselNextEl = $carouselEl.querySelector('[data-carousel-next]'); + var carouselPrevEl = $carouselEl.querySelector('[data-carousel-prev]'); + if (carouselNextEl) { + carouselNextEl.addEventListener('click', function () { + carousel.next(); + }); + } + if (carouselPrevEl) { + carouselPrevEl.addEventListener('click', function () { + carousel.prev(); + }); + } + }); +} +exports.initCarousels = initCarousels; +if (typeof window !== 'undefined') { + window.Carousel = Carousel; + window.initCarousels = initCarousels; +} +exports["default"] = Carousel; + + +/***/ }), + +/***/ 922: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initCollapses = void 0; +var Default = { + onCollapse: function () { }, + onExpand: function () { }, + onToggle: function () { }, +}; +var Collapse = /** @class */ (function () { + function Collapse(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Collapse.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + if (this._triggerEl.hasAttribute('aria-expanded')) { + this._visible = + this._triggerEl.getAttribute('aria-expanded') === 'true'; + } + else { + // fix until v2 not to break previous single collapses which became dismiss + this._visible = !this._targetEl.classList.contains('hidden'); + } + this._triggerEl.addEventListener('click', function () { + _this.toggle(); + }); + } + }; + Collapse.prototype.collapse = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onCollapse(this); + }; + Collapse.prototype.expand = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onExpand(this); + }; + Collapse.prototype.toggle = function () { + if (this._visible) { + this.collapse(); + } + else { + this.expand(); + } + // callback function + this._options.onToggle(this); + }; + return Collapse; +}()); +function initCollapses() { + document + .querySelectorAll('[data-collapse-toggle]') + .forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-collapse-toggle'); + var $targetEl = document.getElementById(targetId); + // check if the target element exists + if ($targetEl) { + new Collapse($targetEl, $triggerEl); + } + else { + console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-collapse-toggle attribute.")); + } + }); +} +exports.initCollapses = initCollapses; +if (typeof window !== 'undefined') { + window.Collapse = Collapse; + window.initCollapses = initCollapses; +} +exports["default"] = Collapse; + + +/***/ }), + +/***/ 556: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDials = void 0; +var Default = { + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dial = /** @class */ (function () { + function Dial(parentEl, triggerEl, targetEl, options) { + if (parentEl === void 0) { parentEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._parentEl = parentEl; + this._triggerEl = triggerEl; + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Dial.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType); + triggerEventTypes.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEventTypes.hideEvents.forEach(function (ev) { + _this._parentEl.addEventListener(ev, function () { + if (!_this._parentEl.matches(':hover')) { + _this.hide(); + } + }); + }); + } + }; + Dial.prototype.hide = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Dial.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dial.prototype.toggle = function () { + if (this._visible) { + this.hide(); + } + else { + this.show(); + } + }; + Dial.prototype.isHidden = function () { + return !this._visible; + }; + Dial.prototype.isVisible = function () { + return this._visible; + }; + Dial.prototype._getTriggerEventTypes = function (triggerType) { + switch (triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + return Dial; +}()); +function initDials() { + document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) { + var $triggerEl = $parentEl.querySelector('[data-dial-toggle]'); + if ($triggerEl) { + var dialId = $triggerEl.getAttribute('data-dial-toggle'); + var $dialEl = document.getElementById(dialId); + if ($dialEl) { + var triggerType = $triggerEl.getAttribute('data-dial-trigger'); + new Dial($parentEl, $triggerEl, $dialEl, { + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?")); + } + } + else { + console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?")); + } + }); +} +exports.initDials = initDials; +if (typeof window !== 'undefined') { + window.Dial = Dial; + window.initDials = initDials; +} +exports["default"] = Dial; + + +/***/ }), + +/***/ 791: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDismisses = void 0; +var Default = { + transition: 'transition-opacity', + duration: 300, + timing: 'ease-out', + onHide: function () { }, +}; +var Dismiss = /** @class */ (function () { + function Dismiss(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Dismiss.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + this._triggerEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Dismiss.prototype.hide = function () { + var _this = this; + this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, 'opacity-0'); + setTimeout(function () { + _this._targetEl.classList.add('hidden'); + }, this._options.duration); + // callback function + this._options.onHide(this, this._targetEl); + }; + return Dismiss; +}()); +function initDismisses() { + document.querySelectorAll('[data-dismiss-target]').forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-dismiss-target'); + var $dismissEl = document.querySelector(targetId); + if ($dismissEl) { + new Dismiss($dismissEl, $triggerEl); + } + else { + console.error("The dismiss element with id \"".concat(targetId, "\" does not exist. Please check the data-dismiss-target attribute.")); + } + }); +} +exports.initDismisses = initDismisses; +if (typeof window !== 'undefined') { + window.Dismiss = Dismiss; + window.initDismisses = initDismisses; +} +exports["default"] = Dismiss; + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDrawers = void 0; +var Default = { + placement: 'left', + bodyScrolling: false, + backdrop: true, + edge: false, + edgeOffset: 'bottom-[60px]', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Drawer = /** @class */ (function () { + function Drawer(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Drawer.prototype._init = function () { + var _this = this; + // set initial accessibility attributes + if (this._targetEl) { + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.classList.add('transition-transform'); + } + // set base placement classes + this._getPlacementClasses(this._options.placement).base.map(function (c) { + _this._targetEl.classList.add(c); + }); + // add keyboard event listener to document + document.addEventListener('keydown', function (event) { + if (event.key === 'Escape') { + // if 'Escape' key is pressed + if (_this.isVisible()) { + // if the Drawer is visible + _this.hide(); // hide the Drawer + } + } + }); + }; + Drawer.prototype.hide = function () { + var _this = this; + // based on the edge option show placement classes + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + // enable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.remove('overflow-hidden'); + } + // destroy backdrop + if (this._options.backdrop) { + this._destroyBackdropEl(); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Drawer.prototype.show = function () { + var _this = this; + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + // disable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.add('overflow-hidden'); + } + // show backdrop + if (this._options.backdrop) { + this._createBackdrop(); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Drawer.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Drawer.prototype._createBackdrop = function () { + var _a; + var _this = this; + if (!this._visible) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('drawer-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + backdropEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Drawer.prototype._destroyBackdropEl = function () { + if (this._visible) { + document.querySelector('[drawer-backdrop]').remove(); + } + }; + Drawer.prototype._getPlacementClasses = function (placement) { + switch (placement) { + case 'top': + return { + base: ['top-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['-translate-y-full'], + }; + case 'right': + return { + base: ['right-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-x-full'], + }; + case 'bottom': + return { + base: ['bottom-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['translate-y-full'], + }; + case 'left': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + case 'bottom-edge': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-y-full', this._options.edgeOffset], + }; + default: + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + } + }; + Drawer.prototype.isHidden = function () { + return !this._visible; + }; + Drawer.prototype.isVisible = function () { + return this._visible; + }; + return Drawer; +}()); +var getDrawerInstance = function (id, instances) { + if (instances.some(function (drawerInstance) { return drawerInstance.id === id; })) { + return instances.find(function (drawerInstance) { return drawerInstance.id === id; }); + } +}; +function initDrawers() { + var drawerInstances = []; + document.querySelectorAll('[data-drawer-target]').forEach(function ($triggerEl) { + // mandatory + var drawerId = $triggerEl.getAttribute('data-drawer-target'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + // optional + var placement = $triggerEl.getAttribute('data-drawer-placement'); + var bodyScrolling = $triggerEl.getAttribute('data-drawer-body-scrolling'); + var backdrop = $triggerEl.getAttribute('data-drawer-backdrop'); + var edge = $triggerEl.getAttribute('data-drawer-edge'); + var edgeOffset = $triggerEl.getAttribute('data-drawer-edge-offset'); + if (!getDrawerInstance(drawerId, drawerInstances)) { + drawerInstances.push({ + id: drawerId, + object: new Drawer($drawerEl, { + placement: placement ? placement : Default.placement, + bodyScrolling: bodyScrolling + ? bodyScrolling === 'true' + ? true + : false + : Default.bodyScrolling, + backdrop: backdrop + ? backdrop === 'true' + ? true + : false + : Default.backdrop, + edge: edge + ? edge === 'true' + ? true + : false + : Default.edge, + edgeOffset: edgeOffset + ? edgeOffset + : Default.edgeOffset, + }), + }); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document.querySelectorAll('[data-drawer-toggle]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-toggle'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_1 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_1) { + $triggerEl.addEventListener('click', function () { + drawer_1.object.toggle(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document + .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]') + .forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-dismiss') + ? $triggerEl.getAttribute('data-drawer-dismiss') + : $triggerEl.getAttribute('data-drawer-hide'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_2 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_2) { + $triggerEl.addEventListener('click', function () { + drawer_2.object.hide(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id")); + } + }); + document.querySelectorAll('[data-drawer-show]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-show'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_3 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_3) { + $triggerEl.addEventListener('click', function () { + drawer_3.object.show(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); +} +exports.initDrawers = initDrawers; +if (typeof window !== 'undefined') { + window.Drawer = Drawer; + window.initDrawers = initDrawers; +} +exports["default"] = Drawer; + + +/***/ }), + +/***/ 316: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDropdowns = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'bottom', + triggerType: 'click', + offsetSkidding: 0, + offsetDistance: 10, + delay: 300, + ignoreClickOutsideClass: false, + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dropdown = /** @class */ (function () { + function Dropdown(targetElement, triggerElement, options) { + if (targetElement === void 0) { targetElement = null; } + if (triggerElement === void 0) { triggerElement = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetElement; + this._triggerEl = triggerElement; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Dropdown.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Dropdown.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + // click event handling for trigger element + if (this._options.triggerType === 'click') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.toggle(); + }); + }); + } + // hover event handling for trigger element + if (this._options.triggerType === 'hover') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + if (ev === 'click') { + _this.toggle(); + } + else { + setTimeout(function () { + _this.show(); + }, _this._options.delay); + } + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + }); + } + }; + Dropdown.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [ + this._options.offsetSkidding, + this._options.offsetDistance, + ], + }, + }, + ], + }); + }; + Dropdown.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + // Ignore clicks on the trigger element (ie. a datepicker input) + var ignoreClickOutsideClass = this._options.ignoreClickOutsideClass; + var isIgnored = false; + if (ignoreClickOutsideClass) { + var ignoredClickOutsideEls = document.querySelectorAll(".".concat(ignoreClickOutsideClass)); + ignoredClickOutsideEls.forEach(function (el) { + if (el.contains(clickedEl)) { + isIgnored = true; + return; + } + }); + } + // Ignore clicks on the target element (ie. dropdown itself) + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + !isIgnored && + this.isVisible()) { + this.hide(); + } + }; + Dropdown.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'click'], + hideEvents: ['mouseleave'], + }; + case 'click': + return { + showEvents: ['click'], + hideEvents: [], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['click'], + hideEvents: [], + }; + } + }; + Dropdown.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Dropdown.prototype.isVisible = function () { + return this._visible; + }; + Dropdown.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + this._targetEl.classList.add('block'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + this._setupClickOutsideListener(); + // Update its position + this._popperInstance.update(); + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dropdown.prototype.hide = function () { + this._targetEl.classList.remove('block'); + this._targetEl.classList.add('hidden'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + this._visible = false; + this._removeClickOutsideListener(); + // callback function + this._options.onHide(this); + }; + return Dropdown; +}()); +function initDropdowns() { + document + .querySelectorAll('[data-dropdown-toggle]') + .forEach(function ($triggerEl) { + var dropdownId = $triggerEl.getAttribute('data-dropdown-toggle'); + var $dropdownEl = document.getElementById(dropdownId); + if ($dropdownEl) { + var placement = $triggerEl.getAttribute('data-dropdown-placement'); + var offsetSkidding = $triggerEl.getAttribute('data-dropdown-offset-skidding'); + var offsetDistance = $triggerEl.getAttribute('data-dropdown-offset-distance'); + var triggerType = $triggerEl.getAttribute('data-dropdown-trigger'); + var delay = $triggerEl.getAttribute('data-dropdown-delay'); + var ignoreClickOutsideClass = $triggerEl.getAttribute('data-dropdown-ignore-click-outside-class'); + new Dropdown($dropdownEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + offsetSkidding: offsetSkidding + ? parseInt(offsetSkidding) + : Default.offsetSkidding, + offsetDistance: offsetDistance + ? parseInt(offsetDistance) + : Default.offsetDistance, + delay: delay ? parseInt(delay) : Default.delay, + ignoreClickOutsideClass: ignoreClickOutsideClass + ? ignoreClickOutsideClass + : Default.ignoreClickOutsideClass, + }); + } + else { + console.error("The dropdown element with id \"".concat(dropdownId, "\" does not exist. Please check the data-dropdown-toggle attribute.")); + } + }); +} +exports.initDropdowns = initDropdowns; +if (typeof window !== 'undefined') { + window.Dropdown = Dropdown; + window.initDropdowns = initDropdowns; +} +exports["default"] = Dropdown; + + +/***/ }), + +/***/ 311: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initFlowbite = void 0; +var accordion_1 = __webpack_require__(902); +var carousel_1 = __webpack_require__(33); +var collapse_1 = __webpack_require__(922); +var dial_1 = __webpack_require__(556); +var dismiss_1 = __webpack_require__(791); +var drawer_1 = __webpack_require__(340); +var dropdown_1 = __webpack_require__(316); +var modal_1 = __webpack_require__(16); +var popover_1 = __webpack_require__(903); +var tabs_1 = __webpack_require__(247); +var tooltip_1 = __webpack_require__(671); +function initFlowbite() { + (0, accordion_1.initAccordions)(); + (0, collapse_1.initCollapses)(); + (0, carousel_1.initCarousels)(); + (0, dismiss_1.initDismisses)(); + (0, dropdown_1.initDropdowns)(); + (0, modal_1.initModals)(); + (0, drawer_1.initDrawers)(); + (0, tabs_1.initTabs)(); + (0, tooltip_1.initTooltips)(); + (0, popover_1.initPopovers)(); + (0, dial_1.initDials)(); +} +exports.initFlowbite = initFlowbite; +if (typeof window !== 'undefined') { + window.initFlowbite = initFlowbite; +} + + +/***/ }), + +/***/ 16: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initModals = void 0; +var Default = { + placement: 'center', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', + backdrop: 'dynamic', + closable: true, + onHide: function () { }, + onShow: function () { }, + onToggle: function () { }, +}; +var Modal = /** @class */ (function () { + function Modal(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._isHidden = true; + this._backdropEl = null; + this._init(); + } + Modal.prototype._init = function () { + var _this = this; + if (this._targetEl) { + this._getPlacementClasses().map(function (c) { + _this._targetEl.classList.add(c); + }); + } + }; + Modal.prototype._createBackdrop = function () { + var _a; + if (this._isHidden) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('modal-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + this._backdropEl = backdropEl; + } + }; + Modal.prototype._destroyBackdropEl = function () { + if (!this._isHidden) { + document.querySelector('[modal-backdrop]').remove(); + } + }; + Modal.prototype._setupModalCloseEventListeners = function () { + var _this = this; + if (this._options.backdrop === 'dynamic') { + this._clickOutsideEventListener = function (ev) { + _this._handleOutsideClick(ev.target); + }; + this._targetEl.addEventListener('click', this._clickOutsideEventListener, true); + } + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._removeModalCloseEventListeners = function () { + if (this._options.backdrop === 'dynamic') { + this._targetEl.removeEventListener('click', this._clickOutsideEventListener, true); + } + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._handleOutsideClick = function (target) { + if (target === this._targetEl || + (target === this._backdropEl && this.isVisible())) { + this.hide(); + } + }; + Modal.prototype._getPlacementClasses = function () { + switch (this._options.placement) { + // top + case 'top-left': + return ['justify-start', 'items-start']; + case 'top-center': + return ['justify-center', 'items-start']; + case 'top-right': + return ['justify-end', 'items-start']; + // center + case 'center-left': + return ['justify-start', 'items-center']; + case 'center': + return ['justify-center', 'items-center']; + case 'center-right': + return ['justify-end', 'items-center']; + // bottom + case 'bottom-left': + return ['justify-start', 'items-end']; + case 'bottom-center': + return ['justify-center', 'items-end']; + case 'bottom-right': + return ['justify-end', 'items-end']; + default: + return ['justify-center', 'items-center']; + } + }; + Modal.prototype.toggle = function () { + if (this._isHidden) { + this.show(); + } + else { + this.hide(); + } + // callback function + this._options.onToggle(this); + }; + Modal.prototype.show = function () { + if (this.isHidden) { + this._targetEl.classList.add('flex'); + this._targetEl.classList.remove('hidden'); + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + this._createBackdrop(); + this._isHidden = false; + // prevent body scroll + document.body.classList.add('overflow-hidden'); + // Add keyboard event listener to the document + if (this._options.closable) { + this._setupModalCloseEventListeners(); + } + // callback function + this._options.onShow(this); + } + }; + Modal.prototype.hide = function () { + if (this.isVisible) { + this._targetEl.classList.add('hidden'); + this._targetEl.classList.remove('flex'); + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + this._destroyBackdropEl(); + this._isHidden = true; + // re-apply body scroll + document.body.classList.remove('overflow-hidden'); + if (this._options.closable) { + this._removeModalCloseEventListeners(); + } + // callback function + this._options.onHide(this); + } + }; + Modal.prototype.isVisible = function () { + return !this._isHidden; + }; + Modal.prototype.isHidden = function () { + return this._isHidden; + }; + return Modal; +}()); +var getModalInstance = function (id, instances) { + if (instances.some(function (modalInstance) { return modalInstance.id === id; })) { + return instances.find(function (modalInstance) { return modalInstance.id === id; }); + } + return null; +}; +function initModals() { + var modalInstances = []; + // initiate modal based on data-modal-target + document.querySelectorAll('[data-modal-target]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-target'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + if (!getModalInstance(modalId, modalInstances)) { + modalInstances.push({ + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.")); + } + }); + // support pre v1.6.0 data-modal-toggle initialization + document.querySelectorAll('[data-modal-toggle]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-toggle'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + var modal_1 = getModalInstance(modalId, modalInstances); + if (!modal_1) { + modal_1 = { + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }; + modalInstances.push(modal_1); + } + $triggerEl.addEventListener('click', function () { + modal_1.object.toggle(); + }); + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?")); + } + }); + // show modal on click if exists based on id + document.querySelectorAll('[data-modal-show]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-show'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_2 = getModalInstance(modalId, modalInstances); + if (modal_2) { + $triggerEl.addEventListener('click', function () { + if (modal_2.object.isHidden) { + modal_2.object.show(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?")); + } + }); + // hide modal on click if exists based on id + document.querySelectorAll('[data-modal-hide]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-hide'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_3 = getModalInstance(modalId, modalInstances); + if (modal_3) { + $triggerEl.addEventListener('click', function () { + if (modal_3.object.isVisible) { + modal_3.object.hide(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?")); + } + }); +} +exports.initModals = initModals; +if (typeof window !== 'undefined') { + window.Modal = Modal; + window.initModals = initModals; +} +exports["default"] = Modal; + + +/***/ }), + +/***/ 903: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initPopovers = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'top', + offset: 10, + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Popover = /** @class */ (function () { + function Popover(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Popover.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Popover.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + }); + }; + Popover.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, this._options.offset], + }, + }, + ], + }); + }; + Popover.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Popover.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Popover.prototype.isVisible = function () { + return this._visible; + }; + Popover.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Popover.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility to true + this._visible = true; + // callback function + this._options.onShow(this); + }; + Popover.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility to false + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Popover; +}()); +function initPopovers() { + document.querySelectorAll('[data-popover-target]').forEach(function ($triggerEl) { + var popoverID = $triggerEl.getAttribute('data-popover-target'); + var $popoverEl = document.getElementById(popoverID); + if ($popoverEl) { + var triggerType = $triggerEl.getAttribute('data-popover-trigger'); + var placement = $triggerEl.getAttribute('data-popover-placement'); + var offset = $triggerEl.getAttribute('data-popover-offset'); + new Popover($popoverEl, $triggerEl, { + placement: placement ? placement : Default.placement, + offset: offset ? parseInt(offset) : Default.offset, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The popover element with id \"".concat(popoverID, "\" does not exist. Please check the data-popover-target attribute.")); + } + }); +} +exports.initPopovers = initPopovers; +if (typeof window !== 'undefined') { + window.Popover = Popover; + window.initPopovers = initPopovers; +} +exports["default"] = Popover; + + +/***/ }), + +/***/ 247: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initTabs = void 0; +var Default = { + defaultTabId: null, + activeClasses: 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500', + inactiveClasses: 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300', + onShow: function () { }, +}; +var Tabs = /** @class */ (function () { + function Tabs(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._activeTab = options ? this.getTab(options.defaultTabId) : null; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Tabs.prototype._init = function () { + var _this = this; + if (this._items.length) { + // set the first tab as active if not set by explicitly + if (!this._activeTab) { + this._setActiveTab(this._items[0]); + } + // force show the first default tab + this.show(this._activeTab.id, true); + // show tab content based on click + this._items.map(function (tab) { + tab.triggerEl.addEventListener('click', function () { + _this.show(tab.id); + }); + }); + } + }; + Tabs.prototype.getActiveTab = function () { + return this._activeTab; + }; + Tabs.prototype._setActiveTab = function (tab) { + this._activeTab = tab; + }; + Tabs.prototype.getTab = function (id) { + return this._items.filter(function (t) { return t.id === id; })[0]; + }; + Tabs.prototype.show = function (id, forceShow) { + var _a, _b; + var _this = this; + if (forceShow === void 0) { forceShow = false; } + var tab = this.getTab(id); + // don't do anything if already active + if (tab === this._activeTab && !forceShow) { + return; + } + // hide other tabs + this._items.map(function (t) { + var _a, _b; + if (t !== tab) { + (_a = t.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = t.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + t.targetEl.classList.add('hidden'); + t.triggerEl.setAttribute('aria-selected', 'false'); + } + }); + // show active tab + (_a = tab.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = tab.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + tab.triggerEl.setAttribute('aria-selected', 'true'); + tab.targetEl.classList.remove('hidden'); + this._setActiveTab(tab); + // callback function + this._options.onShow(this, tab); + }; + return Tabs; +}()); +function initTabs() { + document.querySelectorAll('[data-tabs-toggle]').forEach(function ($triggerEl) { + var tabItems = []; + var defaultTabId = null; + $triggerEl + .querySelectorAll('[role="tab"]') + .forEach(function ($triggerEl) { + var isActive = $triggerEl.getAttribute('aria-selected') === 'true'; + var tab = { + id: $triggerEl.getAttribute('data-tabs-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-tabs-target')), + }; + tabItems.push(tab); + if (isActive) { + defaultTabId = tab.id; + } + }); + new Tabs(tabItems, { + defaultTabId: defaultTabId, + }); + }); +} +exports.initTabs = initTabs; +if (typeof window !== 'undefined') { + window.Tabs = Tabs; + window.initTabs = initTabs; +} +exports["default"] = Tabs; + + +/***/ }), + +/***/ 671: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initTooltips = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'top', + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Tooltip = /** @class */ (function () { + function Tooltip(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Tooltip.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Tooltip.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.hide(); + }); + }); + }; + Tooltip.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, 8], + }, + }, + ], + }); + }; + Tooltip.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Tooltip.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Tooltip.prototype.isVisible = function () { + return this._visible; + }; + Tooltip.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Tooltip.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility + this._visible = true; + // callback function + this._options.onShow(this); + }; + Tooltip.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Tooltip; +}()); +function initTooltips() { + document.querySelectorAll('[data-tooltip-target]').forEach(function ($triggerEl) { + var tooltipId = $triggerEl.getAttribute('data-tooltip-target'); + var $tooltipEl = document.getElementById(tooltipId); + if ($tooltipEl) { + var triggerType = $triggerEl.getAttribute('data-tooltip-trigger'); + var placement = $triggerEl.getAttribute('data-tooltip-placement'); + new Tooltip($tooltipEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The tooltip element with id \"".concat(tooltipId, "\" does not exist. Please check the data-tooltip-target attribute.")); + } + }); +} +exports.initTooltips = initTooltips; +if (typeof window !== 'undefined') { + window.Tooltip = Tooltip; + window.initTooltips = initTooltips; +} +exports["default"] = Tooltip; + + +/***/ }), + +/***/ 947: +/***/ (function(__unused_webpack_module, exports) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Events = /** @class */ (function () { + function Events(eventType, eventFunctions) { + if (eventFunctions === void 0) { eventFunctions = []; } + this._eventType = eventType; + this._eventFunctions = eventFunctions; + } + Events.prototype.init = function () { + var _this = this; + this._eventFunctions.forEach(function (eventFunction) { + if (typeof window !== 'undefined') { + window.addEventListener(_this._eventType, eventFunction); + } + }); + }; + return Events; +}()); +exports["default"] = Events; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +!function() { +var exports = __webpack_exports__; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +// core components +var accordion_1 = __webpack_require__(902); +var carousel_1 = __webpack_require__(33); +var collapse_1 = __webpack_require__(922); +var dial_1 = __webpack_require__(556); +var dismiss_1 = __webpack_require__(791); +var drawer_1 = __webpack_require__(340); +var dropdown_1 = __webpack_require__(316); +var modal_1 = __webpack_require__(16); +var popover_1 = __webpack_require__(903); +var tabs_1 = __webpack_require__(247); +var tooltip_1 = __webpack_require__(671); +__webpack_require__(311); +var events_1 = __webpack_require__(947); +var liveViewLoadEvents = new events_1.default('phx:page-loading-stop', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +liveViewLoadEvents.init(); +var regularViewLoadEvents = new events_1.default('load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +regularViewLoadEvents.init(); +exports["default"] = { + Accordion: accordion_1.default, + Carousel: carousel_1.default, + Collapse: collapse_1.default, + Dial: dial_1.default, + Drawer: drawer_1.default, + Dismiss: dismiss_1.default, + Dropdown: dropdown_1.default, + Modal: modal_1.default, + Popover: popover_1.default, + Tabs: tabs_1.default, + Tooltip: tooltip_1.default, + Events: events_1.default, +}; + +}(); +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=flowbite.phoenix.js.map \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.phoenix.js.map b/node_modules/flowbite/dist/flowbite.phoenix.js.map new file mode 100644 index 0000000..4896d72 --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.phoenix.js.map @@ -0,0 +1 @@ +{"version":3,"file":"flowbite.phoenix.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVO,IAAI,SAAG;AACP;AACA;AACA;AACA;AACA,sBAAsB,SAAG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA,CAAC;AACM,IAAI,gBAAU;AACrB;AACA,CAAC,OAAO;;AAED;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;;AC9BQ;AACf;AACA;;ACFe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;ACXuC;;AAEvC;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;;;ACpBsD;AACK,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC,SAAS,aAAa,cAAc,WAAW;AAC/C;AACA,MAAM;AACN;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uHAAuH;;AAEvH;AACA;AACA;AACA,OAAO,IAAI,GAAG;;AAEd,WAAW,aAAa,cAAc,WAAW;AACjD;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,EAAE;;;AAGF,0DAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;ACnFkC;AACpB;AACf;AACA;;ACHO,IAAI,QAAG;AACP,IAAI,QAAG;AACP;;ACFQ;AACf;;AAEA;AAC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AACA;AACA;AACA;AACA,UAAU,YAAM;AAChB;AACA;AACA,CAAC;;ACpGc;AACf;AACA;;ACF4D;AACE;AACZ;AACkB;AACJ;AACJ;AACR;AACX,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAK;AACZ,OAAO,KAAK;AACZ;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,IAAI;AAClB,cAAc,SAAG;AACjB;;AAEA;AACA,uBAAuB,eAAe;AACtC;AACA;;AAEA,yBAAyB,SAAS;AAClC,qBAAqB,kBAAkB;;AAEvC,UAAU,gBAAgB;AAC1B;AACA;AACA;AACA,MAAM;;;AAGN;;AAEA,sBAAsB,SAAG,mBAAmB,IAAI,kBAAkB,KAAK,mBAAmB,GAAG;AAC7F,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,IAAI,mBAAmB,SAAG,kBAAkB,MAAM,mBAAmB,GAAG;AAC9F,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,2BAA2B,oCAAoC;AAC/D;;AAEA,yBAAyB,qCAAqC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAM,KAAqC,EAAE,2BAQ1C;;AAEH;AACA,eAAe,gBAAgB;AAC/B,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,mDAAmD;AAC7F;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,yCAAyC,kDAAkD;AAC3F;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,4CAA4C;AAC5C;AACA,GAAG;AACH,EAAE;;;AAGF,4DAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACpLiD,CAAC;;AAEnD;AACA;AACA;;AAEA,SAAS,qBAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA,sBAAsB;AACtB,UAAU,qBAAM;AAChB;AACA,CAAC;;AChDD;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,GAAG;AACH;;ACVA,IAAI,kCAAI;AACR;AACA;AACA;AACe;AACf;AACA,WAAW,kCAAI;AACf,GAAG;AACH;;ACRuC;AACxB;AACf,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;ACT+D;AACN;AACN;AACpC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,kBAAkB,kBAAkB,eAAe;AAClF;;ACZuC;AACkB;AACE;AACN;AACtC;AACf,YAAY,SAAS;AACrB,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,gBAAgB;;AAEzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;AACA;;AC9ByD;AACJ;AACM;AACR;AACZ,CAAC;AACxC;;AAEe;AACf;;AAEA,aAAa,kBAAkB;AAC/B,kBAAkB,eAAe;AACjC;AACA,cAAc,QAAG;AACjB,eAAe,QAAG;AAClB,kCAAkC,mBAAmB;AACrD;;AAEA,MAAM,gBAAgB;AACtB,SAAS,QAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BqD;AACtC;AACf;AACA,0BAA0B,gBAAgB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AE1C;AACL,IAAI;;;AAGJ;AACA,qBAAqB,cAAc;AACnC;AACA;AACA;AACA;AACA,KAAK,EAAE,gBAAgB;AACvB;AACA,GAAG,IAAI;AACP;AACA;AACA,GAAG;AACH;;AC9CoE;AACR;AAC0B;AAC9B;AACY;AACA;AAChB,CAAC;;AAErD;AACA,MAAM,gBAAgB,gBAAgB,IAAI;AAC1C;AACA;;AAEA,0BAA0B,oBAAoB;AAC9C,UAAU,6BAA6B,gCAAgC,6BAA6B;AACpG;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gBAAgB;AACtC;AACA,iGAAiG,oBAAoB;AACrH;AACA,sBAAsB,gBAAgB,gBAAgB,IAAI,GAAG,oBAAoB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;;AAEA,yBAAyB,gBAAgB;;AAEzC,2BAA2B,YAAY,gBAAgB,KAAK;AAC5D,sBAAsB,SAAG,EAAE,MAAM;AACjC;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4DAA4D,KAAK,GAAG,IAAI,sBAAsB,MAAM,GAAG,SAAG;;AAE1G;AACA,0BAA0B,oBAAoB;AAC9C;;AAEA,2BAA2B,oBAAoB;AAC/C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,QAAQ;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AClJsD;AACC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,SAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI;AAClC;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA,GAAG;AACH,0BAA0B,cAAc;AACxC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,GAAG;AACH,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;AC5D2D;AACD,CAAC;;AAErD;AACP,sBAAsB,gBAAgB;AACtC,wBAAwB,IAAI,EAAE,SAAG;;AAEjC,mEAAmE;AACnE;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,UAAU,IAAI,EAAE,KAAK;AACrB;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAiB;AAC9B;AACA;AACA,GAAG,IAAI;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;;AAGF,qDAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACrDuD;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;;AAGF,4DAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACxBc;AACf;AACA;;ACF8D;AACF;AACgB;AAC5B;AACY;AACF;AACI;AACN;AACJ;AACY;AACE;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA,GAAG;AACH,sBAAsB,gBAAgB;AACtC,kBAAkB,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AgC,aAAa;AAC7C,6BAA6B,aAAa;AAC1C,wBAAwB,kBAAkB;AAC1C,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,WAAW;AACnB,IAAI,cAAc;AAClB,eAAe,aAAa;AAC5B;;AAEA,QAAQ,aAAa;AACrB,gBAAgB,qBAAqB;AACrC;AACA;AACA,MAAM;AACN,kBAAkB,mBAAmB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzD6C,CAAC;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG;;AAEN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEe;AACf;AACA,2CAA2C;;AAE3C,SAAS,qBAAqB;AAC9B;AACA;AACA,KAAK;AACL,GAAG;AACH;;AC3Ce;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;;ACde;AACf;AACA;AACA,sDAAsD;AACtD,+BAA+B;AAC/B,4BAA4B;AAC5B,KAAK;AACL;AACA,GAAG,IAAI,GAAG;;AAEV;AACA;AACA,GAAG;AACH;;ACb+D;AACN;AACQ;AACJ;AACE;AACR;AACZ;AACkB;AAClB;AACgB;AACV;AACM;AACD;AACpB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE,aAAa;AACnF;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B,uBAAuB;AACvB;AACA;AACA;AACA,OAAO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,qBAAqB,SAAS,cAAc,iBAAiB,yCAAyC,iBAAiB;AACvH,kBAAkB,iBAAiB;AACnC,WAAW;AACX;;AAEA,+BAA+B,cAAc,CAAC,WAAW,yDAAyD;;AAElH;AACA;AACA,SAAS,GAAG;AACZ;;AAEA,YAAY,KAAqC,EAAE,qGA+B1C;;AAET;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA,cAAc,KAAqC,EAAE,EAE1C;;AAEX;AACA,UAAU;;;AAGV;AACA,qBAAqB,gBAAgB,YAAY,eAAe;AAChE,kBAAkB,aAAa;AAC/B,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA;AACA,6CAA6C,KAAK;;AAElD;AACA,sEAAsE;AACtE,SAAS;AACT;;AAEA,4BAA4B,uCAAuC;AACnE,cAAc,KAAqC,EAAE,EAO1C;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gEAAgE;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,KAAqC,EAAE,EAE1C;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACO,mDAAmD;;;;AChQU;AACT;AACF;AACA;AACJ;AACV;AACJ;AACsB;AACpB;AACF;AACvC,wBAAwB,cAAc,EAAE,uBAAa,EAAE,uBAAa,EAAE,qBAAW,EAAE,gBAAM,EAAE,cAAI,EAAE,yBAAe,E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BAAM,CAAC,MAAM,EAAE;IAC7C,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAE7B,qBAAe;IACX,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;IACL,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;CACT,CAAC","sources":["webpack:///webpack/universalModuleDefinition","webpack:///./node_modules/@popperjs/core/lib/enums.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack:///./node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/math.js","webpack:///./node_modules/@popperjs/core/lib/utils/userAgent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack:///./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/within.js","webpack:///./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack:///./node_modules/@popperjs/core/lib/utils/getVariation.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack:///./node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/flip.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/hide.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/offset.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/index.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack:///./node_modules/@popperjs/core/lib/utils/debounce.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack:///./node_modules/@popperjs/core/lib/createPopper.js","webpack:///./node_modules/@popperjs/core/lib/popper.js","webpack:///./node_modules/@popperjs/core/lib/popper-lite.js","webpack:///./node_modules/@popperjs/core/lib/index.js","webpack:///./src/components/accordion/index.ts","webpack:///./src/components/carousel/index.ts","webpack:///./src/components/collapse/index.ts","webpack:///./src/components/dial/index.ts","webpack:///./src/components/dismiss/index.ts","webpack:///./src/components/drawer/index.ts","webpack:///./src/components/dropdown/index.ts","webpack:///./src/components/index.ts","webpack:///./src/components/modal/index.ts","webpack:///./src/components/popover/index.ts","webpack:///./src/components/tabs/index.ts","webpack:///./src/components/tooltip/index.ts","webpack:///./src/dom/events.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/index.phoenix.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Flowbite\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Flowbite\"] = factory();\n\telse\n\t\troot[\"Flowbite\"] = factory();\n})(self, function() {\nreturn ","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export { default as applyStyles } from \"./applyStyles.js\";\nexport { default as arrow } from \"./arrow.js\";\nexport { default as computeStyles } from \"./computeStyles.js\";\nexport { default as eventListeners } from \"./eventListeners.js\";\nexport { default as flip } from \"./flip.js\";\nexport { default as hide } from \"./hide.js\";\nexport { default as offset } from \"./offset.js\";\nexport { default as popperOffsets } from \"./popperOffsets.js\";\nexport { default as preventOverflow } from \"./preventOverflow.js\";","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","export * from \"./enums.js\";\nexport * from \"./modifiers/index.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { popperGenerator, detectOverflow, createPopper as createPopperBase } from \"./createPopper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper } from \"./popper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\";","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { AccordionItem, AccordionOptions } from './types';\nimport { AccordionInterface } from './interface';\n\nconst Default: AccordionOptions = {\n alwaysOpen: false,\n activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',\n inactiveClasses: 'text-gray-500 dark:text-gray-400',\n onOpen: () => {},\n onClose: () => {},\n onToggle: () => {},\n};\n\nclass Accordion implements AccordionInterface {\n _items: AccordionItem[];\n _options: AccordionOptions;\n\n constructor(\n items: AccordionItem[] = [],\n options: AccordionOptions = Default\n ) {\n this._items = items;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n private _init() {\n if (this._items.length) {\n // show accordion item based on click\n this._items.map((item) => {\n if (item.active) {\n this.open(item.id);\n }\n\n item.triggerEl.addEventListener('click', () => {\n this.toggle(item.id);\n });\n });\n }\n }\n\n getItem(id: string) {\n return this._items.filter((item) => item.id === id)[0];\n }\n\n open(id: string) {\n const item = this.getItem(id);\n\n // don't hide other accordions if always open\n if (!this._options.alwaysOpen) {\n this._items.map((i) => {\n if (i !== item) {\n i.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n i.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n i.targetEl.classList.add('hidden');\n i.triggerEl.setAttribute('aria-expanded', 'false');\n i.active = false;\n\n // rotate icon if set\n if (i.iconEl) {\n i.iconEl.classList.remove('rotate-180');\n }\n }\n });\n }\n\n // show active item\n item.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n item.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n item.triggerEl.setAttribute('aria-expanded', 'true');\n item.targetEl.classList.remove('hidden');\n item.active = true;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.add('rotate-180');\n }\n\n // callback function\n this._options.onOpen(this, item);\n }\n\n toggle(id: string) {\n const item = this.getItem(id);\n\n if (item.active) {\n this.close(id);\n } else {\n this.open(id);\n }\n\n // callback function\n this._options.onToggle(this, item);\n }\n\n close(id: string) {\n const item = this.getItem(id);\n\n item.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n item.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n item.targetEl.classList.add('hidden');\n item.triggerEl.setAttribute('aria-expanded', 'false');\n item.active = false;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.remove('rotate-180');\n }\n\n // callback function\n this._options.onClose(this, item);\n }\n}\n\nexport function initAccordions() {\n document.querySelectorAll('[data-accordion]').forEach(($accordionEl) => {\n const alwaysOpen = $accordionEl.getAttribute('data-accordion');\n const activeClasses = $accordionEl.getAttribute('data-active-classes');\n const inactiveClasses = $accordionEl.getAttribute(\n 'data-inactive-classes'\n );\n\n const items = [] as AccordionItem[];\n $accordionEl\n .querySelectorAll('[data-accordion-target]')\n .forEach(($triggerEl) => {\n // Consider only items that directly belong to $accordionEl\n // (to make nested accordions work).\n if ($triggerEl.closest('[data-accordion]') === $accordionEl) {\n const item = {\n id: $triggerEl.getAttribute('data-accordion-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-accordion-target')\n ),\n iconEl: $triggerEl.querySelector(\n '[data-accordion-icon]'\n ),\n active:\n $triggerEl.getAttribute('aria-expanded') === 'true'\n ? true\n : false,\n } as AccordionItem;\n items.push(item);\n }\n });\n\n new Accordion(items, {\n alwaysOpen: alwaysOpen === 'open' ? true : false,\n activeClasses: activeClasses\n ? activeClasses\n : Default.activeClasses,\n inactiveClasses: inactiveClasses\n ? inactiveClasses\n : Default.inactiveClasses,\n } as AccordionOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Accordion = Accordion;\n window.initAccordions = initAccordions;\n}\n\nexport default Accordion;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {\n CarouselOptions,\n CarouselItem,\n IndicatorItem,\n RotationItems,\n} from './types';\nimport { CarouselInterface } from './interface';\n\nconst Default: CarouselOptions = {\n defaultPosition: 0,\n indicators: {\n items: [],\n activeClasses: 'bg-white dark:bg-gray-800',\n inactiveClasses:\n 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',\n },\n interval: 3000,\n onNext: () => {},\n onPrev: () => {},\n onChange: () => {},\n};\n\nclass Carousel implements CarouselInterface {\n _items: CarouselItem[];\n _indicators: IndicatorItem[];\n _activeItem: CarouselItem;\n _intervalDuration: number;\n _intervalInstance: number;\n _options: CarouselOptions;\n\n constructor(\n items: CarouselItem[] = [],\n options: CarouselOptions = Default\n ) {\n this._items = items;\n this._options = {\n ...Default,\n ...options,\n indicators: { ...Default.indicators, ...options.indicators },\n };\n this._activeItem = this.getItem(this._options.defaultPosition);\n this._indicators = this._options.indicators.items;\n this._intervalDuration = this._options.interval;\n this._intervalInstance = null;\n this._init();\n }\n\n /**\n * initialize carousel and items based on active one\n */\n _init() {\n this._items.map((item: CarouselItem) => {\n item.el.classList.add(\n 'absolute',\n 'inset-0',\n 'transition-transform',\n 'transform'\n );\n });\n\n // if no active item is set then first position is default\n if (this._getActiveItem()) {\n this.slideTo(this._getActiveItem().position);\n } else {\n this.slideTo(0);\n }\n\n this._indicators.map((indicator, position) => {\n indicator.el.addEventListener('click', () => {\n this.slideTo(position);\n });\n });\n }\n\n getItem(position: number) {\n return this._items[position];\n }\n\n /**\n * Slide to the element based on id\n * @param {*} position\n */\n slideTo(position: number) {\n const nextItem: CarouselItem = this._items[position];\n const rotationItems: RotationItems = {\n left:\n nextItem.position === 0\n ? this._items[this._items.length - 1]\n : this._items[nextItem.position - 1],\n middle: nextItem,\n right:\n nextItem.position === this._items.length - 1\n ? this._items[0]\n : this._items[nextItem.position + 1],\n };\n this._rotate(rotationItems);\n this._setActiveItem(nextItem);\n if (this._intervalInstance) {\n this.pause();\n this.cycle();\n }\n\n this._options.onChange(this);\n }\n\n /**\n * Based on the currently active item it will go to the next position\n */\n next() {\n const activeItem = this._getActiveItem();\n let nextItem = null;\n\n // check if last item\n if (activeItem.position === this._items.length - 1) {\n nextItem = this._items[0];\n } else {\n nextItem = this._items[activeItem.position + 1];\n }\n\n this.slideTo(nextItem.position);\n\n // callback function\n this._options.onNext(this);\n }\n\n /**\n * Based on the currently active item it will go to the previous position\n */\n prev() {\n const activeItem = this._getActiveItem();\n let prevItem = null;\n\n // check if first item\n if (activeItem.position === 0) {\n prevItem = this._items[this._items.length - 1];\n } else {\n prevItem = this._items[activeItem.position - 1];\n }\n\n this.slideTo(prevItem.position);\n\n // callback function\n this._options.onPrev(this);\n }\n\n /**\n * This method applies the transform classes based on the left, middle, and right rotation carousel items\n * @param {*} rotationItems\n */\n _rotate(rotationItems: RotationItems) {\n // reset\n this._items.map((item: CarouselItem) => {\n item.el.classList.add('hidden');\n });\n\n // left item (previously active)\n rotationItems.left.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.left.el.classList.add('-translate-x-full', 'z-10');\n\n // currently active item\n rotationItems.middle.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-10'\n );\n rotationItems.middle.el.classList.add('translate-x-0', 'z-20');\n\n // right item (upcoming active)\n rotationItems.right.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.right.el.classList.add('translate-x-full', 'z-10');\n }\n\n /**\n * Set an interval to cycle through the carousel items\n */\n cycle() {\n if (typeof window !== 'undefined') {\n this._intervalInstance = window.setInterval(() => {\n this.next();\n }, this._intervalDuration);\n }\n }\n\n /**\n * Clears the cycling interval\n */\n pause() {\n clearInterval(this._intervalInstance);\n }\n\n /**\n * Get the currently active item\n */\n _getActiveItem() {\n return this._activeItem;\n }\n\n /**\n * Set the currently active item and data attribute\n * @param {*} position\n */\n _setActiveItem(item: CarouselItem) {\n this._activeItem = item;\n const position = item.position;\n\n // update the indicators if available\n if (this._indicators.length) {\n this._indicators.map((indicator) => {\n indicator.el.setAttribute('aria-current', 'false');\n indicator.el.classList.remove(\n ...this._options.indicators.activeClasses.split(' ')\n );\n indicator.el.classList.add(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n });\n this._indicators[position].el.classList.add(\n ...this._options.indicators.activeClasses.split(' ')\n );\n this._indicators[position].el.classList.remove(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n this._indicators[position].el.setAttribute('aria-current', 'true');\n }\n }\n}\n\nexport function initCarousels() {\n document.querySelectorAll('[data-carousel]').forEach(($carouselEl) => {\n const interval = $carouselEl.getAttribute('data-carousel-interval');\n const slide =\n $carouselEl.getAttribute('data-carousel') === 'slide'\n ? true\n : false;\n\n const items: CarouselItem[] = [];\n let defaultPosition = 0;\n if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-item]')\n ).map(($carouselItemEl: HTMLElement, position: number) => {\n items.push({\n position: position,\n el: $carouselItemEl,\n });\n\n if (\n $carouselItemEl.getAttribute('data-carousel-item') ===\n 'active'\n ) {\n defaultPosition = position;\n }\n });\n }\n\n const indicators: IndicatorItem[] = [];\n if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-slide-to]')\n ).map(($indicatorEl: HTMLElement) => {\n indicators.push({\n position: parseInt(\n $indicatorEl.getAttribute('data-carousel-slide-to')\n ),\n el: $indicatorEl,\n });\n });\n }\n\n const carousel = new Carousel(items, {\n defaultPosition: defaultPosition,\n indicators: {\n items: indicators,\n },\n interval: interval ? interval : Default.interval,\n } as CarouselOptions);\n\n if (slide) {\n carousel.cycle();\n }\n\n // check for controls\n const carouselNextEl = $carouselEl.querySelector(\n '[data-carousel-next]'\n );\n const carouselPrevEl = $carouselEl.querySelector(\n '[data-carousel-prev]'\n );\n\n if (carouselNextEl) {\n carouselNextEl.addEventListener('click', () => {\n carousel.next();\n });\n }\n\n if (carouselPrevEl) {\n carouselPrevEl.addEventListener('click', () => {\n carousel.prev();\n });\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Carousel = Carousel;\n window.initCarousels = initCarousels;\n}\n\nexport default Carousel;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { CollapseOptions } from './types';\nimport { CollapseInterface } from './interface';\n\nconst Default: CollapseOptions = {\n onCollapse: () => {},\n onExpand: () => {},\n onToggle: () => {},\n};\n\nclass Collapse implements CollapseInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: CollapseOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: CollapseOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n if (this._triggerEl.hasAttribute('aria-expanded')) {\n this._visible =\n this._triggerEl.getAttribute('aria-expanded') === 'true';\n } else {\n // fix until v2 not to break previous single collapses which became dismiss\n this._visible = !this._targetEl.classList.contains('hidden');\n }\n\n this._triggerEl.addEventListener('click', () => {\n this.toggle();\n });\n }\n }\n\n collapse() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onCollapse(this);\n }\n\n expand() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onExpand(this);\n }\n\n toggle() {\n if (this._visible) {\n this.collapse();\n } else {\n this.expand();\n }\n // callback function\n this._options.onToggle(this);\n }\n}\n\nexport function initCollapses() {\n document\n .querySelectorAll('[data-collapse-toggle]')\n .forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-collapse-toggle');\n const $targetEl = document.getElementById(targetId);\n\n // check if the target element exists\n if ($targetEl) {\n new Collapse(\n $targetEl as HTMLElement,\n $triggerEl as HTMLElement\n );\n } else {\n console.error(\n `The target element with id \"${targetId}\" does not exist. Please check the data-collapse-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Collapse = Collapse;\n window.initCollapses = initCollapses;\n}\n\nexport default Collapse;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DialOptions, DialTriggerType } from './types';\nimport { DialInterface } from './interface';\n\nconst Default: DialOptions = {\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dial implements DialInterface {\n _parentEl: HTMLElement;\n _triggerEl: HTMLElement;\n _targetEl: HTMLElement;\n _options: DialOptions;\n _visible: boolean;\n\n constructor(\n parentEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n targetEl: HTMLElement | null = null,\n options: DialOptions = Default\n ) {\n this._parentEl = parentEl;\n this._triggerEl = triggerEl;\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n const triggerEventTypes = this._getTriggerEventTypes(\n this._options.triggerType\n );\n triggerEventTypes.showEvents.forEach((ev: string) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEventTypes.hideEvents.forEach((ev: string) => {\n this._parentEl.addEventListener(ev, () => {\n if (!this._parentEl.matches(':hover')) {\n this.hide();\n }\n });\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n\n _getTriggerEventTypes(triggerType: DialTriggerType) {\n switch (triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n}\n\nexport function initDials() {\n document.querySelectorAll('[data-dial-init]').forEach(($parentEl) => {\n const $triggerEl = $parentEl.querySelector('[data-dial-toggle]');\n\n if ($triggerEl) {\n const dialId = $triggerEl.getAttribute('data-dial-toggle');\n const $dialEl = document.getElementById(dialId);\n\n if ($dialEl) {\n const triggerType =\n $triggerEl.getAttribute('data-dial-trigger');\n new Dial(\n $parentEl as HTMLElement,\n $triggerEl as HTMLElement,\n $dialEl as HTMLElement,\n {\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as DialOptions\n );\n } else {\n console.error(\n `Dial with id ${dialId} does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?`\n );\n }\n } else {\n console.error(\n `Dial with id ${$parentEl.id} does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dial = Dial;\n window.initDials = initDials;\n}\n\nexport default Dial;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DismissOptions } from './types';\nimport { DismissInterface } from './interface';\n\nconst Default: DismissOptions = {\n transition: 'transition-opacity',\n duration: 300,\n timing: 'ease-out',\n onHide: () => {},\n};\n\nclass Dismiss implements DismissInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: DismissOptions;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: DismissOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._triggerEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add(\n this._options.transition,\n `duration-${this._options.duration}`,\n this._options.timing,\n 'opacity-0'\n );\n setTimeout(() => {\n this._targetEl.classList.add('hidden');\n }, this._options.duration);\n\n // callback function\n this._options.onHide(this, this._targetEl);\n }\n}\n\nexport function initDismisses() {\n document.querySelectorAll('[data-dismiss-target]').forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-dismiss-target');\n const $dismissEl = document.querySelector(targetId);\n\n if ($dismissEl) {\n new Dismiss($dismissEl as HTMLElement, $triggerEl as HTMLElement);\n } else {\n console.error(\n `The dismiss element with id \"${targetId}\" does not exist. Please check the data-dismiss-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dismiss = Dismiss;\n window.initDismisses = initDismisses;\n}\n\nexport default Dismiss;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DrawerInstance, DrawerOptions, PlacementClasses } from './types';\nimport { DrawerInterface } from './interface';\n\nconst Default: DrawerOptions = {\n placement: 'left',\n bodyScrolling: false,\n backdrop: true,\n edge: false,\n edgeOffset: 'bottom-[60px]',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Drawer implements DrawerInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DrawerOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: DrawerOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n // set initial accessibility attributes\n if (this._targetEl) {\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.classList.add('transition-transform');\n }\n\n // set base placement classes\n this._getPlacementClasses(this._options.placement).base.map((c) => {\n this._targetEl.classList.add(c);\n });\n\n // add keyboard event listener to document\n document.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n // if 'Escape' key is pressed\n if (this.isVisible()) {\n // if the Drawer is visible\n this.hide(); // hide the Drawer\n }\n }\n });\n }\n\n hide() {\n // based on the edge option show placement classes\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.remove(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.add(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n\n // enable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.remove('overflow-hidden');\n }\n\n // destroy backdrop\n if (this._options.backdrop) {\n this._destroyBackdropEl();\n }\n\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.add(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.remove(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n\n // disable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.add('overflow-hidden');\n }\n\n // show backdrop\n if (this._options.backdrop) {\n this._createBackdrop();\n }\n\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _createBackdrop() {\n if (!this._visible) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('drawer-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n backdropEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n _destroyBackdropEl() {\n if (this._visible) {\n document.querySelector('[drawer-backdrop]').remove();\n }\n }\n\n _getPlacementClasses(placement: string): PlacementClasses {\n switch (placement) {\n case 'top':\n return {\n base: ['top-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['-translate-y-full'],\n };\n case 'right':\n return {\n base: ['right-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-x-full'],\n };\n case 'bottom':\n return {\n base: ['bottom-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full'],\n };\n case 'left':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n case 'bottom-edge':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full', this._options.edgeOffset],\n };\n default:\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n}\n\nconst getDrawerInstance = (id: string, instances: DrawerInstance[]) => {\n if (instances.some((drawerInstance) => drawerInstance.id === id)) {\n return instances.find((drawerInstance) => drawerInstance.id === id);\n }\n};\n\nexport function initDrawers() {\n const drawerInstances = [] as DrawerInstance[];\n document.querySelectorAll('[data-drawer-target]').forEach(($triggerEl) => {\n // mandatory\n const drawerId = $triggerEl.getAttribute('data-drawer-target');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n // optional\n const placement = $triggerEl.getAttribute('data-drawer-placement');\n const bodyScrolling = $triggerEl.getAttribute(\n 'data-drawer-body-scrolling'\n );\n const backdrop = $triggerEl.getAttribute('data-drawer-backdrop');\n const edge = $triggerEl.getAttribute('data-drawer-edge');\n const edgeOffset = $triggerEl.getAttribute(\n 'data-drawer-edge-offset'\n );\n\n if (!getDrawerInstance(drawerId, drawerInstances)) {\n drawerInstances.push({\n id: drawerId,\n object: new Drawer($drawerEl, {\n placement: placement ? placement : Default.placement,\n bodyScrolling: bodyScrolling\n ? bodyScrolling === 'true'\n ? true\n : false\n : Default.bodyScrolling,\n backdrop: backdrop\n ? backdrop === 'true'\n ? true\n : false\n : Default.backdrop,\n edge: edge\n ? edge === 'true'\n ? true\n : false\n : Default.edge,\n edgeOffset: edgeOffset\n ? edgeOffset\n : Default.edgeOffset,\n } as DrawerOptions),\n });\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-toggle]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-toggle');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer: DrawerInstance = getDrawerInstance(\n drawerId,\n drawerInstances\n );\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.toggle();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document\n .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]')\n .forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-dismiss')\n ? $triggerEl.getAttribute('data-drawer-dismiss')\n : $triggerEl.getAttribute('data-drawer-hide');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.hide();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-show]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-show');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.show();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Drawer = Drawer;\n window.initDrawers = initDrawers;\n}\n\nexport default Drawer;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { DropdownOptions } from './types';\nimport { DropdownInterface } from './interface';\n\nconst Default: DropdownOptions = {\n placement: 'bottom',\n triggerType: 'click',\n offsetSkidding: 0,\n offsetDistance: 10,\n delay: 300,\n ignoreClickOutsideClass: false,\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dropdown implements DropdownInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DropdownOptions;\n _visible: boolean;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetElement: HTMLElement | null = null,\n triggerElement: HTMLElement | null = null,\n options: DropdownOptions = Default\n ) {\n this._targetEl = targetElement;\n this._triggerEl = triggerElement;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n // click event handling for trigger element\n if (this._options.triggerType === 'click') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.toggle();\n });\n });\n }\n\n // hover event handling for trigger element\n if (this._options.triggerType === 'hover') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n if (ev === 'click') {\n this.toggle();\n } else {\n setTimeout(() => {\n this.show();\n }, this._options.delay);\n }\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n });\n }\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [\n this._options.offsetSkidding,\n this._options.offsetDistance,\n ],\n },\n },\n ],\n });\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n\n // Ignore clicks on the trigger element (ie. a datepicker input)\n const ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;\n\n let isIgnored = false;\n if (ignoreClickOutsideClass) {\n const ignoredClickOutsideEls = document.querySelectorAll(\n `.${ignoreClickOutsideClass}`\n );\n ignoredClickOutsideEls.forEach((el) => {\n if (el.contains(clickedEl)) {\n isIgnored = true;\n return;\n }\n });\n }\n\n // Ignore clicks on the target element (ie. dropdown itself)\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n !isIgnored &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'click'],\n hideEvents: ['mouseleave'],\n };\n case 'click':\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n }\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n isVisible() {\n return this._visible;\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n this._targetEl.classList.add('block');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n this._setupClickOutsideListener();\n\n // Update its position\n this._popperInstance.update();\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('block');\n this._targetEl.classList.add('hidden');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n this._visible = false;\n\n this._removeClickOutsideListener();\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initDropdowns() {\n document\n .querySelectorAll('[data-dropdown-toggle]')\n .forEach(($triggerEl) => {\n const dropdownId = $triggerEl.getAttribute('data-dropdown-toggle');\n const $dropdownEl = document.getElementById(dropdownId);\n\n if ($dropdownEl) {\n const placement = $triggerEl.getAttribute(\n 'data-dropdown-placement'\n );\n const offsetSkidding = $triggerEl.getAttribute(\n 'data-dropdown-offset-skidding'\n );\n const offsetDistance = $triggerEl.getAttribute(\n 'data-dropdown-offset-distance'\n );\n const triggerType = $triggerEl.getAttribute(\n 'data-dropdown-trigger'\n );\n const delay = $triggerEl.getAttribute('data-dropdown-delay');\n const ignoreClickOutsideClass = $triggerEl.getAttribute(\n 'data-dropdown-ignore-click-outside-class'\n );\n\n new Dropdown(\n $dropdownEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n offsetSkidding: offsetSkidding\n ? parseInt(offsetSkidding)\n : Default.offsetSkidding,\n offsetDistance: offsetDistance\n ? parseInt(offsetDistance)\n : Default.offsetDistance,\n delay: delay ? parseInt(delay) : Default.delay,\n ignoreClickOutsideClass: ignoreClickOutsideClass\n ? ignoreClickOutsideClass\n : Default.ignoreClickOutsideClass,\n } as DropdownOptions\n );\n } else {\n console.error(\n `The dropdown element with id \"${dropdownId}\" does not exist. Please check the data-dropdown-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dropdown = Dropdown;\n window.initDropdowns = initDropdowns;\n}\n\nexport default Dropdown;\n","import { initAccordions } from './accordion';\nimport { initCarousels } from './carousel';\nimport { initCollapses } from './collapse';\nimport { initDials } from './dial';\nimport { initDismisses } from './dismiss';\nimport { initDrawers } from './drawer';\nimport { initDropdowns } from './dropdown';\nimport { initModals } from './modal';\nimport { initPopovers } from './popover';\nimport { initTabs } from './tabs';\nimport { initTooltips } from './tooltip';\n\nexport function initFlowbite() {\n initAccordions();\n initCollapses();\n initCarousels();\n initDismisses();\n initDropdowns();\n initModals();\n initDrawers();\n initTabs();\n initTooltips();\n initPopovers();\n initDials();\n}\n\nif (typeof window !== 'undefined') {\n window.initFlowbite = initFlowbite;\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ModalInstance, ModalOptions } from './types';\nimport { ModalInterface } from './interface';\n\nconst Default: ModalOptions = {\n placement: 'center',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',\n backdrop: 'dynamic',\n closable: true,\n onHide: () => {},\n onShow: () => {},\n onToggle: () => {},\n};\n\nclass Modal implements ModalInterface {\n _targetEl: HTMLElement | null;\n _options: ModalOptions;\n _isHidden: boolean;\n _backdropEl: HTMLElement | null;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: ModalOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._isHidden = true;\n this._backdropEl = null;\n this._init();\n }\n\n _init() {\n if (this._targetEl) {\n this._getPlacementClasses().map((c) => {\n this._targetEl.classList.add(c);\n });\n }\n }\n\n _createBackdrop() {\n if (this._isHidden) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('modal-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n this._backdropEl = backdropEl;\n }\n }\n\n _destroyBackdropEl() {\n if (!this._isHidden) {\n document.querySelector('[modal-backdrop]').remove();\n }\n }\n\n _setupModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleOutsideClick(ev.target);\n };\n this._targetEl.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._targetEl.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _handleOutsideClick(target: EventTarget) {\n if (\n target === this._targetEl ||\n (target === this._backdropEl && this.isVisible())\n ) {\n this.hide();\n }\n }\n\n _getPlacementClasses() {\n switch (this._options.placement) {\n // top\n case 'top-left':\n return ['justify-start', 'items-start'];\n case 'top-center':\n return ['justify-center', 'items-start'];\n case 'top-right':\n return ['justify-end', 'items-start'];\n\n // center\n case 'center-left':\n return ['justify-start', 'items-center'];\n case 'center':\n return ['justify-center', 'items-center'];\n case 'center-right':\n return ['justify-end', 'items-center'];\n\n // bottom\n case 'bottom-left':\n return ['justify-start', 'items-end'];\n case 'bottom-center':\n return ['justify-center', 'items-end'];\n case 'bottom-right':\n return ['justify-end', 'items-end'];\n\n default:\n return ['justify-center', 'items-center'];\n }\n }\n\n toggle() {\n if (this._isHidden) {\n this.show();\n } else {\n this.hide();\n }\n\n // callback function\n this._options.onToggle(this);\n }\n\n show() {\n if (this.isHidden) {\n this._targetEl.classList.add('flex');\n this._targetEl.classList.remove('hidden');\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n this._createBackdrop();\n this._isHidden = false;\n\n // prevent body scroll\n document.body.classList.add('overflow-hidden');\n\n // Add keyboard event listener to the document\n if (this._options.closable) {\n this._setupModalCloseEventListeners();\n }\n\n // callback function\n this._options.onShow(this);\n }\n }\n\n hide() {\n if (this.isVisible) {\n this._targetEl.classList.add('hidden');\n this._targetEl.classList.remove('flex');\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n this._destroyBackdropEl();\n this._isHidden = true;\n\n // re-apply body scroll\n document.body.classList.remove('overflow-hidden');\n\n if (this._options.closable) {\n this._removeModalCloseEventListeners();\n }\n\n // callback function\n this._options.onHide(this);\n }\n }\n\n isVisible() {\n return !this._isHidden;\n }\n\n isHidden() {\n return this._isHidden;\n }\n}\n\nconst getModalInstance = (id: string, instances: ModalInstance[]) => {\n if (instances.some((modalInstance) => modalInstance.id === id)) {\n return instances.find((modalInstance) => modalInstance.id === id);\n }\n return null;\n};\n\nexport function initModals() {\n const modalInstances = [] as ModalInstance[];\n\n // initiate modal based on data-modal-target\n document.querySelectorAll('[data-modal-target]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-target');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n if (!getModalInstance(modalId, modalInstances)) {\n modalInstances.push({\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n });\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.`\n );\n }\n });\n\n // support pre v1.6.0 data-modal-toggle initialization\n document.querySelectorAll('[data-modal-toggle]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-toggle');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n let modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (!modal) {\n modal = {\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n };\n modalInstances.push(modal);\n }\n\n $triggerEl.addEventListener('click', () => {\n modal.object.toggle();\n });\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?`\n );\n }\n });\n\n // show modal on click if exists based on id\n document.querySelectorAll('[data-modal-show]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-show');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isHidden) {\n modal.object.show();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?`\n );\n }\n });\n\n // hide modal on click if exists based on id\n document.querySelectorAll('[data-modal-hide]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-hide');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isVisible) {\n modal.object.hide();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Modal = Modal;\n window.initModals = initModals;\n}\n\nexport default Modal;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { PopoverOptions } from './types';\nimport { PopoverInterface } from './interface';\n\nconst Default: PopoverOptions = {\n placement: 'top',\n offset: 10,\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Popover implements PopoverInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: PopoverOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: PopoverOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, this._options.offset],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility to true\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility to false\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initPopovers() {\n document.querySelectorAll('[data-popover-target]').forEach(($triggerEl) => {\n const popoverID = $triggerEl.getAttribute('data-popover-target');\n const $popoverEl = document.getElementById(popoverID);\n\n if ($popoverEl) {\n const triggerType = $triggerEl.getAttribute('data-popover-trigger');\n const placement = $triggerEl.getAttribute('data-popover-placement');\n const offset = $triggerEl.getAttribute('data-popover-offset');\n\n new Popover(\n $popoverEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n offset: offset ? parseInt(offset) : Default.offset,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as PopoverOptions\n );\n } else {\n console.error(\n `The popover element with id \"${popoverID}\" does not exist. Please check the data-popover-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Popover = Popover;\n window.initPopovers = initPopovers;\n}\n\nexport default Popover;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { TabItem, TabsOptions } from './types';\nimport { TabsInterface } from './interface';\n\nconst Default: TabsOptions = {\n defaultTabId: null,\n activeClasses:\n 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500',\n inactiveClasses:\n 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300',\n onShow: () => {},\n};\n\nclass Tabs implements TabsInterface {\n _items: TabItem[];\n _activeTab: TabItem;\n _options: TabsOptions;\n\n constructor(items: TabItem[] = [], options: TabsOptions = Default) {\n this._items = items;\n this._activeTab = options ? this.getTab(options.defaultTabId) : null;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._items.length) {\n // set the first tab as active if not set by explicitly\n if (!this._activeTab) {\n this._setActiveTab(this._items[0]);\n }\n\n // force show the first default tab\n this.show(this._activeTab.id, true);\n\n // show tab content based on click\n this._items.map((tab) => {\n tab.triggerEl.addEventListener('click', () => {\n this.show(tab.id);\n });\n });\n }\n }\n\n getActiveTab() {\n return this._activeTab;\n }\n\n _setActiveTab(tab: TabItem) {\n this._activeTab = tab;\n }\n\n getTab(id: string) {\n return this._items.filter((t) => t.id === id)[0];\n }\n\n show(id: string, forceShow = false) {\n const tab = this.getTab(id);\n\n // don't do anything if already active\n if (tab === this._activeTab && !forceShow) {\n return;\n }\n\n // hide other tabs\n this._items.map((t: TabItem) => {\n if (t !== tab) {\n t.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n t.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n t.targetEl.classList.add('hidden');\n t.triggerEl.setAttribute('aria-selected', 'false');\n }\n });\n\n // show active tab\n tab.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n tab.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n tab.triggerEl.setAttribute('aria-selected', 'true');\n tab.targetEl.classList.remove('hidden');\n\n this._setActiveTab(tab);\n\n // callback function\n this._options.onShow(this, tab);\n }\n}\n\nexport function initTabs() {\n document.querySelectorAll('[data-tabs-toggle]').forEach(($triggerEl) => {\n const tabItems: TabItem[] = [];\n let defaultTabId = null;\n $triggerEl\n .querySelectorAll('[role=\"tab\"]')\n .forEach(($triggerEl: HTMLElement) => {\n const isActive =\n $triggerEl.getAttribute('aria-selected') === 'true';\n const tab: TabItem = {\n id: $triggerEl.getAttribute('data-tabs-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-tabs-target')\n ),\n };\n tabItems.push(tab);\n\n if (isActive) {\n defaultTabId = tab.id;\n }\n });\n new Tabs(tabItems, {\n defaultTabId: defaultTabId,\n } as TabsOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tabs = Tabs;\n window.initTabs = initTabs;\n}\n\nexport default Tabs;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { TooltipOptions } from './types';\nimport { TooltipInterface } from './interface';\n\nconst Default: TooltipOptions = {\n placement: 'top',\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Tooltip implements TooltipInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: TooltipOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: TooltipOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.hide();\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initTooltips() {\n document.querySelectorAll('[data-tooltip-target]').forEach(($triggerEl) => {\n const tooltipId = $triggerEl.getAttribute('data-tooltip-target');\n const $tooltipEl = document.getElementById(tooltipId);\n\n if ($tooltipEl) {\n const triggerType = $triggerEl.getAttribute('data-tooltip-trigger');\n const placement = $triggerEl.getAttribute('data-tooltip-placement');\n\n new Tooltip(\n $tooltipEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as TooltipOptions\n );\n } else {\n console.error(\n `The tooltip element with id \"${tooltipId}\" does not exist. Please check the data-tooltip-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tooltip = Tooltip;\n window.initTooltips = initTooltips;\n}\n\nexport default Tooltip;\n","class Events {\n private _eventType: string;\n private _eventFunctions: EventListener[];\n\n constructor(eventType: string, eventFunctions: EventListener[] = []) {\n this._eventType = eventType;\n this._eventFunctions = eventFunctions;\n }\n\n init() {\n this._eventFunctions.forEach((eventFunction) => {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// core components\nimport Accordion, { initAccordions } from './components/accordion';\nimport Carousel, { initCarousels } from './components/carousel';\nimport Collapse, { initCollapses } from './components/collapse';\nimport Dial, { initDials } from './components/dial';\nimport Dismiss, { initDismisses } from './components/dismiss';\nimport Drawer, { initDrawers } from './components/drawer';\nimport Dropdown, { initDropdowns } from './components/dropdown';\nimport Modal, { initModals } from './components/modal';\nimport Popover, { initPopovers } from './components/popover';\nimport Tabs, { initTabs } from './components/tabs';\nimport Tooltip, { initTooltips } from './components/tooltip';\nimport './components/index';\nimport Events from './dom/events';\n\nconst liveViewLoadEvents = new Events('phx:page-loading-stop', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nliveViewLoadEvents.init();\n\nconst regularViewLoadEvents = new Events('load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nregularViewLoadEvents.init();\n\nexport default {\n Accordion,\n Carousel,\n Collapse,\n Dial,\n Drawer,\n Dismiss,\n Dropdown,\n Modal,\n Popover,\n Tabs,\n Tooltip,\n Events,\n};\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.phoenix.min.js b/node_modules/flowbite/dist/flowbite.phoenix.min.js new file mode 100644 index 0000000..7a06472 --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.phoenix.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Flowbite",[],e):"object"==typeof exports?exports.Flowbite=e():t.Flowbite=e()}(self,(function(){return function(){"use strict";var t={853:function(t,e,i){i.r(e),i.d(e,{afterMain:function(){return E},afterRead:function(){return _},afterWrite:function(){return x},applyStyles:function(){return D},arrow:function(){return Z},auto:function(){return a},basePlacements:function(){return c},beforeMain:function(){return b},beforeRead:function(){return m},beforeWrite:function(){return L},bottom:function(){return o},clippingParents:function(){return u},computeStyles:function(){return it},createPopper:function(){return Dt},createPopperBase:function(){return Pt},createPopperLite:function(){return St},detectOverflow:function(){return yt},end:function(){return d},eventListeners:function(){return ot},flip:function(){return _t},hide:function(){return Et},left:function(){return s},main:function(){return w},modifierPhases:function(){return k},offset:function(){return Lt},placements:function(){return v},popper:function(){return f},popperGenerator:function(){return jt},popperOffsets:function(){return Ot},preventOverflow:function(){return xt},read:function(){return y},reference:function(){return h},right:function(){return r},start:function(){return l},top:function(){return n},variationPlacements:function(){return g},viewport:function(){return p},write:function(){return O}});var n="top",o="bottom",r="right",s="left",a="auto",c=[n,o,r,s],l="start",d="end",u="clippingParents",p="viewport",f="popper",h="reference",g=c.reduce((function(t,e){return t.concat([e+"-"+l,e+"-"+d])}),[]),v=[].concat(c,[a]).reduce((function(t,e){return t.concat([e,e+"-"+l,e+"-"+d])}),[]),m="beforeRead",y="read",_="afterRead",b="beforeMain",w="main",E="afterMain",L="beforeWrite",O="write",x="afterWrite",k=[m,y,_,b,w,E,L,O,x];function A(t){return t?(t.nodeName||"").toLowerCase():null}function T(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return t instanceof T(t).Element||t instanceof Element}function j(t){return t instanceof T(t).HTMLElement||t instanceof HTMLElement}function P(t){return"undefined"!=typeof ShadowRoot&&(t instanceof T(t).ShadowRoot||t instanceof ShadowRoot)}var D={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];j(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});j(n)&&A(n)&&(Object.assign(n.style,r),Object.keys(o).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function S(t){return t.split("-")[0]}var I=Math.max,M=Math.min,q=Math.round;function H(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(H())}function V(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),o=1,r=1;e&&j(t)&&(o=t.offsetWidth>0&&q(n.width)/t.offsetWidth||1,r=t.offsetHeight>0&&q(n.height)/t.offsetHeight||1);var s=(C(t)?T(t):window).visualViewport,a=!B()&&i,c=(n.left+(a&&s?s.offsetLeft:0))/o,l=(n.top+(a&&s?s.offsetTop:0))/r,d=n.width/o,u=n.height/r;return{width:d,height:u,top:l,right:c+d,bottom:l+u,left:c,x:c,y:l}}function W(t){var e=V(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function z(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&P(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function R(t){return T(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(A(t))>=0}function N(t){return((C(t)?t.ownerDocument:t.document)||window.document).documentElement}function K(t){return"html"===A(t)?t:t.assignedSlot||t.parentNode||(P(t)?t.host:null)||N(t)}function U(t){return j(t)&&"fixed"!==R(t).position?t.offsetParent:null}function X(t){for(var e=T(t),i=U(t);i&&F(i)&&"static"===R(i).position;)i=U(i);return i&&("html"===A(i)||"body"===A(i)&&"static"===R(i).position)?e:i||function(t){var e=/firefox/i.test(H());if(/Trident/i.test(H())&&j(t)&&"fixed"===R(t).position)return null;var i=K(t);for(P(i)&&(i=i.host);j(i)&&["html","body"].indexOf(A(i))<0;){var n=R(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,i){return I(t,M(e,i))}function J(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Q(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var Z={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,a=t.name,l=t.options,d=i.elements.arrow,u=i.modifiersData.popperOffsets,p=S(i.placement),f=Y(p),h=[s,r].indexOf(p)>=0?"height":"width";if(d&&u){var g=function(t,e){return J("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Q(t,c))}(l.padding,i),v=W(d),m="y"===f?n:s,y="y"===f?o:r,_=i.rects.reference[h]+i.rects.reference[f]-u[f]-i.rects.popper[h],b=u[f]-i.rects.reference[f],w=X(d),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,L=_/2-b/2,O=g[m],x=E-v[h]-g[y],k=E/2-v[h]/2+L,A=G(O,k,x),T=f;i.modifiersData[a]=((e={})[T]=A,e.centerOffset=A-k,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&z(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,i=t.popper,a=t.popperRect,c=t.placement,l=t.variation,u=t.offsets,p=t.position,f=t.gpuAcceleration,h=t.adaptive,g=t.roundOffsets,v=t.isFixed,m=u.x,y=void 0===m?0:m,_=u.y,b=void 0===_?0:_,w="function"==typeof g?g({x:y,y:b}):{x:y,y:b};y=w.x,b=w.y;var E=u.hasOwnProperty("x"),L=u.hasOwnProperty("y"),O=s,x=n,k=window;if(h){var A=X(i),C="clientHeight",j="clientWidth";if(A===T(i)&&"static"!==R(A=N(i)).position&&"absolute"===p&&(C="scrollHeight",j="scrollWidth"),c===n||(c===s||c===r)&&l===d)x=o,b-=(v&&A===k&&k.visualViewport?k.visualViewport.height:A[C])-a.height,b*=f?1:-1;if(c===s||(c===n||c===o)&&l===d)O=r,y-=(v&&A===k&&k.visualViewport?k.visualViewport.width:A[j])-a.width,y*=f?1:-1}var P,D=Object.assign({position:p},h&&tt),S=!0===g?function(t){var e=t.x,i=t.y,n=window.devicePixelRatio||1;return{x:q(e*n)/n||0,y:q(i*n)/n||0}}({x:y,y:b}):{x:y,y:b};return y=S.x,b=S.y,f?Object.assign({},D,((P={})[x]=L?"0":"",P[O]=E?"0":"",P.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",P)):Object.assign({},D,((e={})[x]=L?b+"px":"",e[O]=E?y+"px":"",e.transform="",e))}var it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=void 0===n||n,r=i.adaptive,s=void 0===r||r,a=i.roundOffsets,c=void 0===a||a,l={placement:S(e.placement),variation:$(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},nt={passive:!0};var ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,r=void 0===o||o,s=n.resize,a=void 0===s||s,c=T(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&l.forEach((function(t){t.addEventListener("scroll",i.update,nt)})),a&&c.addEventListener("resize",i.update,nt),function(){r&&l.forEach((function(t){t.removeEventListener("scroll",i.update,nt)})),a&&c.removeEventListener("resize",i.update,nt)}},data:{}},rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var at={start:"end",end:"start"};function ct(t){return t.replace(/start|end/g,(function(t){return at[t]}))}function lt(t){var e=T(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dt(t){return V(N(t)).left+lt(t).scrollLeft}function ut(t){var e=R(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function pt(t){return["html","body","#document"].indexOf(A(t))>=0?t.ownerDocument.body:j(t)&&ut(t)?t:pt(K(t))}function ft(t,e){var i;void 0===e&&(e=[]);var n=pt(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),r=T(n),s=o?[r].concat(r.visualViewport||[],ut(n)?n:[]):n,a=e.concat(s);return o?a:a.concat(ft(K(s)))}function ht(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gt(t,e,i){return e===p?ht(function(t,e){var i=T(t),n=N(t),o=i.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(o){r=o.width,s=o.height;var l=B();(l||!l&&"fixed"===e)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:r,height:s,x:a+dt(t),y:c}}(t,i)):C(e)?function(t,e){var i=V(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):ht(function(t){var e,i=N(t),n=lt(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=I(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=I(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+dt(t),c=-n.scrollTop;return"rtl"===R(o||i).direction&&(a+=I(i.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:a,y:c}}(N(t)))}function vt(t,e,i,n){var o="clippingParents"===e?function(t){var e=ft(K(t)),i=["absolute","fixed"].indexOf(R(t).position)>=0&&j(t)?X(t):t;return C(i)?e.filter((function(t){return C(t)&&z(t,i)&&"body"!==A(t)})):[]}(t):[].concat(e),r=[].concat(o,[i]),s=r[0],a=r.reduce((function(e,i){var o=gt(t,i,n);return e.top=I(o.top,e.top),e.right=M(o.right,e.right),e.bottom=M(o.bottom,e.bottom),e.left=I(o.left,e.left),e}),gt(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mt(t){var e,i=t.reference,a=t.element,c=t.placement,u=c?S(c):null,p=c?$(c):null,f=i.x+i.width/2-a.width/2,h=i.y+i.height/2-a.height/2;switch(u){case n:e={x:f,y:i.y-a.height};break;case o:e={x:f,y:i.y+i.height};break;case r:e={x:i.x+i.width,y:h};break;case s:e={x:i.x-a.width,y:h};break;default:e={x:i.x,y:i.y}}var g=u?Y(u):null;if(null!=g){var v="y"===g?"height":"width";switch(p){case l:e[g]=e[g]-(i[v]/2-a[v]/2);break;case d:e[g]=e[g]+(i[v]/2-a[v]/2)}}return e}function yt(t,e){void 0===e&&(e={});var i=e,s=i.placement,a=void 0===s?t.placement:s,l=i.strategy,d=void 0===l?t.strategy:l,g=i.boundary,v=void 0===g?u:g,m=i.rootBoundary,y=void 0===m?p:m,_=i.elementContext,b=void 0===_?f:_,w=i.altBoundary,E=void 0!==w&&w,L=i.padding,O=void 0===L?0:L,x=J("number"!=typeof O?O:Q(O,c)),k=b===f?h:f,A=t.rects.popper,T=t.elements[E?k:b],j=vt(C(T)?T:T.contextElement||N(t.elements.popper),v,y,d),P=V(t.elements.reference),D=mt({reference:P,element:A,strategy:"absolute",placement:a}),S=ht(Object.assign({},A,D)),I=b===f?S:P,M={top:j.top-I.top+x.top,bottom:I.bottom-j.bottom+x.bottom,left:j.left-I.left+x.left,right:I.right-j.right+x.right},q=t.modifiersData.offset;if(b===f&&q){var H=q[a];Object.keys(M).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,i=[n,o].indexOf(t)>=0?"y":"x";M[t]+=H[i]*e}))}return M}var _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,d=t.name;if(!e.modifiersData[d]._skip){for(var u=i.mainAxis,p=void 0===u||u,f=i.altAxis,h=void 0===f||f,m=i.fallbackPlacements,y=i.padding,_=i.boundary,b=i.rootBoundary,w=i.altBoundary,E=i.flipVariations,L=void 0===E||E,O=i.allowedAutoPlacements,x=e.options.placement,k=S(x),A=m||(k===x||!L?[st(x)]:function(t){if(S(t)===a)return[];var e=st(t);return[ct(t),e,ct(e)]}(x)),T=[x].concat(A).reduce((function(t,i){return t.concat(S(i)===a?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=i.boundary,r=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,d=void 0===l?v:l,u=$(n),p=u?a?g:g.filter((function(t){return $(t)===u})):c,f=p.filter((function(t){return d.indexOf(t)>=0}));0===f.length&&(f=p);var h=f.reduce((function(e,i){return e[i]=yt(t,{placement:i,boundary:o,rootBoundary:r,padding:s})[S(i)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:i,boundary:_,rootBoundary:b,padding:y,flipVariations:L,allowedAutoPlacements:O}):i)}),[]),C=e.rects.reference,j=e.rects.popper,P=new Map,D=!0,I=T[0],M=0;M=0,W=V?"width":"height",z=yt(e,{placement:q,boundary:_,rootBoundary:b,altBoundary:w,padding:y}),R=V?B?r:s:B?o:n;C[W]>j[W]&&(R=st(R));var F=st(R),N=[];if(p&&N.push(z[H]<=0),h&&N.push(z[R]<=0,z[F]<=0),N.every((function(t){return t}))){I=q,D=!1;break}P.set(q,N)}if(D)for(var K=function(t){var e=T.find((function(e){var i=P.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},U=L?3:1;U>0;U--){if("break"===K(U))break}e.placement!==I&&(e.modifiersData[d]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function wt(t){return[n,r,o,s].some((function(e){return t[e]>=0}))}var Et={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),a=yt(e,{altBoundary:!0}),c=bt(s,n),l=bt(a,o,r),d=wt(c),u=wt(l);e.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Lt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,o=t.name,a=i.offset,c=void 0===a?[0,0]:a,l=v.reduce((function(t,i){return t[i]=function(t,e,i){var o=S(t),a=[s,n].indexOf(o)>=0?-1:1,c="function"==typeof i?i(Object.assign({},e,{placement:t})):i,l=c[0],d=c[1];return l=l||0,d=(d||0)*a,[s,r].indexOf(o)>=0?{x:d,y:l}:{x:l,y:d}}(i,e.rects,c),t}),{}),d=l[e.placement],u=d.x,p=d.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=p),e.modifiersData[o]=l}};var Ot={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,a=t.name,c=i.mainAxis,d=void 0===c||c,u=i.altAxis,p=void 0!==u&&u,f=i.boundary,h=i.rootBoundary,g=i.altBoundary,v=i.padding,m=i.tether,y=void 0===m||m,_=i.tetherOffset,b=void 0===_?0:_,w=yt(e,{boundary:f,rootBoundary:h,padding:v,altBoundary:g}),E=S(e.placement),L=$(e.placement),O=!L,x=Y(E),k="x"===x?"y":"x",A=e.modifiersData.popperOffsets,T=e.rects.reference,C=e.rects.popper,j="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,P="number"==typeof j?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(A){if(d){var H,B="y"===x?n:s,V="y"===x?o:r,z="y"===x?"height":"width",R=A[x],F=R+w[B],N=R-w[V],K=y?-C[z]/2:0,U=L===l?T[z]:C[z],J=L===l?-C[z]:-T[z],Q=e.elements.arrow,Z=y&&Q?W(Q):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[B],it=tt[V],nt=G(0,T[z],Z[z]),ot=O?T[z]/2-K-nt-et-P.mainAxis:U-nt-et-P.mainAxis,rt=O?-T[z]/2+K+nt+it+P.mainAxis:J+nt+it+P.mainAxis,st=e.elements.arrow&&X(e.elements.arrow),at=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,ct=null!=(H=null==D?void 0:D[x])?H:0,lt=R+rt-ct,dt=G(y?M(F,R+ot-ct-at):F,R,y?I(N,lt):N);A[x]=dt,q[x]=dt-R}if(p){var ut,pt="x"===x?n:s,ft="x"===x?o:r,ht=A[k],gt="y"===k?"height":"width",vt=ht+w[pt],mt=ht-w[ft],_t=-1!==[n,s].indexOf(E),bt=null!=(ut=null==D?void 0:D[k])?ut:0,wt=_t?vt:ht-T[gt]-C[gt]-bt+P.altAxis,Et=_t?ht+T[gt]+C[gt]-bt-P.altAxis:mt,Lt=y&&_t?function(t,e,i){var n=G(t,e,i);return n>i?i:n}(wt,ht,Et):G(y?wt:vt,ht,y?Et:mt);A[k]=Lt,q[k]=Lt-ht}e.modifiersData[a]=q}},requiresIfExists:["offset"]};function kt(t,e,i){void 0===i&&(i=!1);var n,o,r=j(e),s=j(e)&&function(t){var e=t.getBoundingClientRect(),i=q(e.width)/t.offsetWidth||1,n=q(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=N(e),c=V(t,s,i),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!i)&&(("body"!==A(e)||ut(a))&&(l=(n=e)!==T(n)&&j(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:lt(n)),j(e)?((d=V(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=dt(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function At(t){var e=new Map,i=new Set,n=[];function o(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&o(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||o(t)})),n}var Tt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ct(){for(var t=arguments.length,e=new Array(t),i=0;i 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { AccordionItem, AccordionOptions } from './types';\nimport { AccordionInterface } from './interface';\n\nconst Default: AccordionOptions = {\n alwaysOpen: false,\n activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',\n inactiveClasses: 'text-gray-500 dark:text-gray-400',\n onOpen: () => {},\n onClose: () => {},\n onToggle: () => {},\n};\n\nclass Accordion implements AccordionInterface {\n _items: AccordionItem[];\n _options: AccordionOptions;\n\n constructor(\n items: AccordionItem[] = [],\n options: AccordionOptions = Default\n ) {\n this._items = items;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n private _init() {\n if (this._items.length) {\n // show accordion item based on click\n this._items.map((item) => {\n if (item.active) {\n this.open(item.id);\n }\n\n item.triggerEl.addEventListener('click', () => {\n this.toggle(item.id);\n });\n });\n }\n }\n\n getItem(id: string) {\n return this._items.filter((item) => item.id === id)[0];\n }\n\n open(id: string) {\n const item = this.getItem(id);\n\n // don't hide other accordions if always open\n if (!this._options.alwaysOpen) {\n this._items.map((i) => {\n if (i !== item) {\n i.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n i.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n i.targetEl.classList.add('hidden');\n i.triggerEl.setAttribute('aria-expanded', 'false');\n i.active = false;\n\n // rotate icon if set\n if (i.iconEl) {\n i.iconEl.classList.remove('rotate-180');\n }\n }\n });\n }\n\n // show active item\n item.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n item.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n item.triggerEl.setAttribute('aria-expanded', 'true');\n item.targetEl.classList.remove('hidden');\n item.active = true;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.add('rotate-180');\n }\n\n // callback function\n this._options.onOpen(this, item);\n }\n\n toggle(id: string) {\n const item = this.getItem(id);\n\n if (item.active) {\n this.close(id);\n } else {\n this.open(id);\n }\n\n // callback function\n this._options.onToggle(this, item);\n }\n\n close(id: string) {\n const item = this.getItem(id);\n\n item.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n item.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n item.targetEl.classList.add('hidden');\n item.triggerEl.setAttribute('aria-expanded', 'false');\n item.active = false;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.remove('rotate-180');\n }\n\n // callback function\n this._options.onClose(this, item);\n }\n}\n\nexport function initAccordions() {\n document.querySelectorAll('[data-accordion]').forEach(($accordionEl) => {\n const alwaysOpen = $accordionEl.getAttribute('data-accordion');\n const activeClasses = $accordionEl.getAttribute('data-active-classes');\n const inactiveClasses = $accordionEl.getAttribute(\n 'data-inactive-classes'\n );\n\n const items = [] as AccordionItem[];\n $accordionEl\n .querySelectorAll('[data-accordion-target]')\n .forEach(($triggerEl) => {\n // Consider only items that directly belong to $accordionEl\n // (to make nested accordions work).\n if ($triggerEl.closest('[data-accordion]') === $accordionEl) {\n const item = {\n id: $triggerEl.getAttribute('data-accordion-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-accordion-target')\n ),\n iconEl: $triggerEl.querySelector(\n '[data-accordion-icon]'\n ),\n active:\n $triggerEl.getAttribute('aria-expanded') === 'true'\n ? true\n : false,\n } as AccordionItem;\n items.push(item);\n }\n });\n\n new Accordion(items, {\n alwaysOpen: alwaysOpen === 'open' ? true : false,\n activeClasses: activeClasses\n ? activeClasses\n : Default.activeClasses,\n inactiveClasses: inactiveClasses\n ? inactiveClasses\n : Default.inactiveClasses,\n } as AccordionOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Accordion = Accordion;\n window.initAccordions = initAccordions;\n}\n\nexport default Accordion;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {\n CarouselOptions,\n CarouselItem,\n IndicatorItem,\n RotationItems,\n} from './types';\nimport { CarouselInterface } from './interface';\n\nconst Default: CarouselOptions = {\n defaultPosition: 0,\n indicators: {\n items: [],\n activeClasses: 'bg-white dark:bg-gray-800',\n inactiveClasses:\n 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',\n },\n interval: 3000,\n onNext: () => {},\n onPrev: () => {},\n onChange: () => {},\n};\n\nclass Carousel implements CarouselInterface {\n _items: CarouselItem[];\n _indicators: IndicatorItem[];\n _activeItem: CarouselItem;\n _intervalDuration: number;\n _intervalInstance: number;\n _options: CarouselOptions;\n\n constructor(\n items: CarouselItem[] = [],\n options: CarouselOptions = Default\n ) {\n this._items = items;\n this._options = {\n ...Default,\n ...options,\n indicators: { ...Default.indicators, ...options.indicators },\n };\n this._activeItem = this.getItem(this._options.defaultPosition);\n this._indicators = this._options.indicators.items;\n this._intervalDuration = this._options.interval;\n this._intervalInstance = null;\n this._init();\n }\n\n /**\n * initialize carousel and items based on active one\n */\n _init() {\n this._items.map((item: CarouselItem) => {\n item.el.classList.add(\n 'absolute',\n 'inset-0',\n 'transition-transform',\n 'transform'\n );\n });\n\n // if no active item is set then first position is default\n if (this._getActiveItem()) {\n this.slideTo(this._getActiveItem().position);\n } else {\n this.slideTo(0);\n }\n\n this._indicators.map((indicator, position) => {\n indicator.el.addEventListener('click', () => {\n this.slideTo(position);\n });\n });\n }\n\n getItem(position: number) {\n return this._items[position];\n }\n\n /**\n * Slide to the element based on id\n * @param {*} position\n */\n slideTo(position: number) {\n const nextItem: CarouselItem = this._items[position];\n const rotationItems: RotationItems = {\n left:\n nextItem.position === 0\n ? this._items[this._items.length - 1]\n : this._items[nextItem.position - 1],\n middle: nextItem,\n right:\n nextItem.position === this._items.length - 1\n ? this._items[0]\n : this._items[nextItem.position + 1],\n };\n this._rotate(rotationItems);\n this._setActiveItem(nextItem);\n if (this._intervalInstance) {\n this.pause();\n this.cycle();\n }\n\n this._options.onChange(this);\n }\n\n /**\n * Based on the currently active item it will go to the next position\n */\n next() {\n const activeItem = this._getActiveItem();\n let nextItem = null;\n\n // check if last item\n if (activeItem.position === this._items.length - 1) {\n nextItem = this._items[0];\n } else {\n nextItem = this._items[activeItem.position + 1];\n }\n\n this.slideTo(nextItem.position);\n\n // callback function\n this._options.onNext(this);\n }\n\n /**\n * Based on the currently active item it will go to the previous position\n */\n prev() {\n const activeItem = this._getActiveItem();\n let prevItem = null;\n\n // check if first item\n if (activeItem.position === 0) {\n prevItem = this._items[this._items.length - 1];\n } else {\n prevItem = this._items[activeItem.position - 1];\n }\n\n this.slideTo(prevItem.position);\n\n // callback function\n this._options.onPrev(this);\n }\n\n /**\n * This method applies the transform classes based on the left, middle, and right rotation carousel items\n * @param {*} rotationItems\n */\n _rotate(rotationItems: RotationItems) {\n // reset\n this._items.map((item: CarouselItem) => {\n item.el.classList.add('hidden');\n });\n\n // left item (previously active)\n rotationItems.left.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.left.el.classList.add('-translate-x-full', 'z-10');\n\n // currently active item\n rotationItems.middle.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-10'\n );\n rotationItems.middle.el.classList.add('translate-x-0', 'z-20');\n\n // right item (upcoming active)\n rotationItems.right.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.right.el.classList.add('translate-x-full', 'z-10');\n }\n\n /**\n * Set an interval to cycle through the carousel items\n */\n cycle() {\n if (typeof window !== 'undefined') {\n this._intervalInstance = window.setInterval(() => {\n this.next();\n }, this._intervalDuration);\n }\n }\n\n /**\n * Clears the cycling interval\n */\n pause() {\n clearInterval(this._intervalInstance);\n }\n\n /**\n * Get the currently active item\n */\n _getActiveItem() {\n return this._activeItem;\n }\n\n /**\n * Set the currently active item and data attribute\n * @param {*} position\n */\n _setActiveItem(item: CarouselItem) {\n this._activeItem = item;\n const position = item.position;\n\n // update the indicators if available\n if (this._indicators.length) {\n this._indicators.map((indicator) => {\n indicator.el.setAttribute('aria-current', 'false');\n indicator.el.classList.remove(\n ...this._options.indicators.activeClasses.split(' ')\n );\n indicator.el.classList.add(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n });\n this._indicators[position].el.classList.add(\n ...this._options.indicators.activeClasses.split(' ')\n );\n this._indicators[position].el.classList.remove(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n this._indicators[position].el.setAttribute('aria-current', 'true');\n }\n }\n}\n\nexport function initCarousels() {\n document.querySelectorAll('[data-carousel]').forEach(($carouselEl) => {\n const interval = $carouselEl.getAttribute('data-carousel-interval');\n const slide =\n $carouselEl.getAttribute('data-carousel') === 'slide'\n ? true\n : false;\n\n const items: CarouselItem[] = [];\n let defaultPosition = 0;\n if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-item]')\n ).map(($carouselItemEl: HTMLElement, position: number) => {\n items.push({\n position: position,\n el: $carouselItemEl,\n });\n\n if (\n $carouselItemEl.getAttribute('data-carousel-item') ===\n 'active'\n ) {\n defaultPosition = position;\n }\n });\n }\n\n const indicators: IndicatorItem[] = [];\n if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-slide-to]')\n ).map(($indicatorEl: HTMLElement) => {\n indicators.push({\n position: parseInt(\n $indicatorEl.getAttribute('data-carousel-slide-to')\n ),\n el: $indicatorEl,\n });\n });\n }\n\n const carousel = new Carousel(items, {\n defaultPosition: defaultPosition,\n indicators: {\n items: indicators,\n },\n interval: interval ? interval : Default.interval,\n } as CarouselOptions);\n\n if (slide) {\n carousel.cycle();\n }\n\n // check for controls\n const carouselNextEl = $carouselEl.querySelector(\n '[data-carousel-next]'\n );\n const carouselPrevEl = $carouselEl.querySelector(\n '[data-carousel-prev]'\n );\n\n if (carouselNextEl) {\n carouselNextEl.addEventListener('click', () => {\n carousel.next();\n });\n }\n\n if (carouselPrevEl) {\n carouselPrevEl.addEventListener('click', () => {\n carousel.prev();\n });\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Carousel = Carousel;\n window.initCarousels = initCarousels;\n}\n\nexport default Carousel;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { CollapseOptions } from './types';\nimport { CollapseInterface } from './interface';\n\nconst Default: CollapseOptions = {\n onCollapse: () => {},\n onExpand: () => {},\n onToggle: () => {},\n};\n\nclass Collapse implements CollapseInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: CollapseOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: CollapseOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n if (this._triggerEl.hasAttribute('aria-expanded')) {\n this._visible =\n this._triggerEl.getAttribute('aria-expanded') === 'true';\n } else {\n // fix until v2 not to break previous single collapses which became dismiss\n this._visible = !this._targetEl.classList.contains('hidden');\n }\n\n this._triggerEl.addEventListener('click', () => {\n this.toggle();\n });\n }\n }\n\n collapse() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onCollapse(this);\n }\n\n expand() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onExpand(this);\n }\n\n toggle() {\n if (this._visible) {\n this.collapse();\n } else {\n this.expand();\n }\n // callback function\n this._options.onToggle(this);\n }\n}\n\nexport function initCollapses() {\n document\n .querySelectorAll('[data-collapse-toggle]')\n .forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-collapse-toggle');\n const $targetEl = document.getElementById(targetId);\n\n // check if the target element exists\n if ($targetEl) {\n new Collapse(\n $targetEl as HTMLElement,\n $triggerEl as HTMLElement\n );\n } else {\n console.error(\n `The target element with id \"${targetId}\" does not exist. Please check the data-collapse-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Collapse = Collapse;\n window.initCollapses = initCollapses;\n}\n\nexport default Collapse;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DialOptions, DialTriggerType } from './types';\nimport { DialInterface } from './interface';\n\nconst Default: DialOptions = {\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dial implements DialInterface {\n _parentEl: HTMLElement;\n _triggerEl: HTMLElement;\n _targetEl: HTMLElement;\n _options: DialOptions;\n _visible: boolean;\n\n constructor(\n parentEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n targetEl: HTMLElement | null = null,\n options: DialOptions = Default\n ) {\n this._parentEl = parentEl;\n this._triggerEl = triggerEl;\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n const triggerEventTypes = this._getTriggerEventTypes(\n this._options.triggerType\n );\n triggerEventTypes.showEvents.forEach((ev: string) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEventTypes.hideEvents.forEach((ev: string) => {\n this._parentEl.addEventListener(ev, () => {\n if (!this._parentEl.matches(':hover')) {\n this.hide();\n }\n });\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n\n _getTriggerEventTypes(triggerType: DialTriggerType) {\n switch (triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n}\n\nexport function initDials() {\n document.querySelectorAll('[data-dial-init]').forEach(($parentEl) => {\n const $triggerEl = $parentEl.querySelector('[data-dial-toggle]');\n\n if ($triggerEl) {\n const dialId = $triggerEl.getAttribute('data-dial-toggle');\n const $dialEl = document.getElementById(dialId);\n\n if ($dialEl) {\n const triggerType =\n $triggerEl.getAttribute('data-dial-trigger');\n new Dial(\n $parentEl as HTMLElement,\n $triggerEl as HTMLElement,\n $dialEl as HTMLElement,\n {\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as DialOptions\n );\n } else {\n console.error(\n `Dial with id ${dialId} does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?`\n );\n }\n } else {\n console.error(\n `Dial with id ${$parentEl.id} does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dial = Dial;\n window.initDials = initDials;\n}\n\nexport default Dial;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DismissOptions } from './types';\nimport { DismissInterface } from './interface';\n\nconst Default: DismissOptions = {\n transition: 'transition-opacity',\n duration: 300,\n timing: 'ease-out',\n onHide: () => {},\n};\n\nclass Dismiss implements DismissInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: DismissOptions;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: DismissOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._triggerEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add(\n this._options.transition,\n `duration-${this._options.duration}`,\n this._options.timing,\n 'opacity-0'\n );\n setTimeout(() => {\n this._targetEl.classList.add('hidden');\n }, this._options.duration);\n\n // callback function\n this._options.onHide(this, this._targetEl);\n }\n}\n\nexport function initDismisses() {\n document.querySelectorAll('[data-dismiss-target]').forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-dismiss-target');\n const $dismissEl = document.querySelector(targetId);\n\n if ($dismissEl) {\n new Dismiss($dismissEl as HTMLElement, $triggerEl as HTMLElement);\n } else {\n console.error(\n `The dismiss element with id \"${targetId}\" does not exist. Please check the data-dismiss-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dismiss = Dismiss;\n window.initDismisses = initDismisses;\n}\n\nexport default Dismiss;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DrawerInstance, DrawerOptions, PlacementClasses } from './types';\nimport { DrawerInterface } from './interface';\n\nconst Default: DrawerOptions = {\n placement: 'left',\n bodyScrolling: false,\n backdrop: true,\n edge: false,\n edgeOffset: 'bottom-[60px]',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Drawer implements DrawerInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DrawerOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: DrawerOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n // set initial accessibility attributes\n if (this._targetEl) {\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.classList.add('transition-transform');\n }\n\n // set base placement classes\n this._getPlacementClasses(this._options.placement).base.map((c) => {\n this._targetEl.classList.add(c);\n });\n\n // add keyboard event listener to document\n document.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n // if 'Escape' key is pressed\n if (this.isVisible()) {\n // if the Drawer is visible\n this.hide(); // hide the Drawer\n }\n }\n });\n }\n\n hide() {\n // based on the edge option show placement classes\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.remove(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.add(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n\n // enable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.remove('overflow-hidden');\n }\n\n // destroy backdrop\n if (this._options.backdrop) {\n this._destroyBackdropEl();\n }\n\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.add(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.remove(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n\n // disable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.add('overflow-hidden');\n }\n\n // show backdrop\n if (this._options.backdrop) {\n this._createBackdrop();\n }\n\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _createBackdrop() {\n if (!this._visible) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('drawer-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n backdropEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n _destroyBackdropEl() {\n if (this._visible) {\n document.querySelector('[drawer-backdrop]').remove();\n }\n }\n\n _getPlacementClasses(placement: string): PlacementClasses {\n switch (placement) {\n case 'top':\n return {\n base: ['top-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['-translate-y-full'],\n };\n case 'right':\n return {\n base: ['right-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-x-full'],\n };\n case 'bottom':\n return {\n base: ['bottom-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full'],\n };\n case 'left':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n case 'bottom-edge':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full', this._options.edgeOffset],\n };\n default:\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n}\n\nconst getDrawerInstance = (id: string, instances: DrawerInstance[]) => {\n if (instances.some((drawerInstance) => drawerInstance.id === id)) {\n return instances.find((drawerInstance) => drawerInstance.id === id);\n }\n};\n\nexport function initDrawers() {\n const drawerInstances = [] as DrawerInstance[];\n document.querySelectorAll('[data-drawer-target]').forEach(($triggerEl) => {\n // mandatory\n const drawerId = $triggerEl.getAttribute('data-drawer-target');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n // optional\n const placement = $triggerEl.getAttribute('data-drawer-placement');\n const bodyScrolling = $triggerEl.getAttribute(\n 'data-drawer-body-scrolling'\n );\n const backdrop = $triggerEl.getAttribute('data-drawer-backdrop');\n const edge = $triggerEl.getAttribute('data-drawer-edge');\n const edgeOffset = $triggerEl.getAttribute(\n 'data-drawer-edge-offset'\n );\n\n if (!getDrawerInstance(drawerId, drawerInstances)) {\n drawerInstances.push({\n id: drawerId,\n object: new Drawer($drawerEl, {\n placement: placement ? placement : Default.placement,\n bodyScrolling: bodyScrolling\n ? bodyScrolling === 'true'\n ? true\n : false\n : Default.bodyScrolling,\n backdrop: backdrop\n ? backdrop === 'true'\n ? true\n : false\n : Default.backdrop,\n edge: edge\n ? edge === 'true'\n ? true\n : false\n : Default.edge,\n edgeOffset: edgeOffset\n ? edgeOffset\n : Default.edgeOffset,\n } as DrawerOptions),\n });\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-toggle]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-toggle');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer: DrawerInstance = getDrawerInstance(\n drawerId,\n drawerInstances\n );\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.toggle();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document\n .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]')\n .forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-dismiss')\n ? $triggerEl.getAttribute('data-drawer-dismiss')\n : $triggerEl.getAttribute('data-drawer-hide');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.hide();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-show]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-show');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.show();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Drawer = Drawer;\n window.initDrawers = initDrawers;\n}\n\nexport default Drawer;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { DropdownOptions } from './types';\nimport { DropdownInterface } from './interface';\n\nconst Default: DropdownOptions = {\n placement: 'bottom',\n triggerType: 'click',\n offsetSkidding: 0,\n offsetDistance: 10,\n delay: 300,\n ignoreClickOutsideClass: false,\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dropdown implements DropdownInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DropdownOptions;\n _visible: boolean;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetElement: HTMLElement | null = null,\n triggerElement: HTMLElement | null = null,\n options: DropdownOptions = Default\n ) {\n this._targetEl = targetElement;\n this._triggerEl = triggerElement;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n // click event handling for trigger element\n if (this._options.triggerType === 'click') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.toggle();\n });\n });\n }\n\n // hover event handling for trigger element\n if (this._options.triggerType === 'hover') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n if (ev === 'click') {\n this.toggle();\n } else {\n setTimeout(() => {\n this.show();\n }, this._options.delay);\n }\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n });\n }\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [\n this._options.offsetSkidding,\n this._options.offsetDistance,\n ],\n },\n },\n ],\n });\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n\n // Ignore clicks on the trigger element (ie. a datepicker input)\n const ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;\n\n let isIgnored = false;\n if (ignoreClickOutsideClass) {\n const ignoredClickOutsideEls = document.querySelectorAll(\n `.${ignoreClickOutsideClass}`\n );\n ignoredClickOutsideEls.forEach((el) => {\n if (el.contains(clickedEl)) {\n isIgnored = true;\n return;\n }\n });\n }\n\n // Ignore clicks on the target element (ie. dropdown itself)\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n !isIgnored &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'click'],\n hideEvents: ['mouseleave'],\n };\n case 'click':\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n }\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n isVisible() {\n return this._visible;\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n this._targetEl.classList.add('block');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n this._setupClickOutsideListener();\n\n // Update its position\n this._popperInstance.update();\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('block');\n this._targetEl.classList.add('hidden');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n this._visible = false;\n\n this._removeClickOutsideListener();\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initDropdowns() {\n document\n .querySelectorAll('[data-dropdown-toggle]')\n .forEach(($triggerEl) => {\n const dropdownId = $triggerEl.getAttribute('data-dropdown-toggle');\n const $dropdownEl = document.getElementById(dropdownId);\n\n if ($dropdownEl) {\n const placement = $triggerEl.getAttribute(\n 'data-dropdown-placement'\n );\n const offsetSkidding = $triggerEl.getAttribute(\n 'data-dropdown-offset-skidding'\n );\n const offsetDistance = $triggerEl.getAttribute(\n 'data-dropdown-offset-distance'\n );\n const triggerType = $triggerEl.getAttribute(\n 'data-dropdown-trigger'\n );\n const delay = $triggerEl.getAttribute('data-dropdown-delay');\n const ignoreClickOutsideClass = $triggerEl.getAttribute(\n 'data-dropdown-ignore-click-outside-class'\n );\n\n new Dropdown(\n $dropdownEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n offsetSkidding: offsetSkidding\n ? parseInt(offsetSkidding)\n : Default.offsetSkidding,\n offsetDistance: offsetDistance\n ? parseInt(offsetDistance)\n : Default.offsetDistance,\n delay: delay ? parseInt(delay) : Default.delay,\n ignoreClickOutsideClass: ignoreClickOutsideClass\n ? ignoreClickOutsideClass\n : Default.ignoreClickOutsideClass,\n } as DropdownOptions\n );\n } else {\n console.error(\n `The dropdown element with id \"${dropdownId}\" does not exist. Please check the data-dropdown-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dropdown = Dropdown;\n window.initDropdowns = initDropdowns;\n}\n\nexport default Dropdown;\n","import { initAccordions } from './accordion';\nimport { initCarousels } from './carousel';\nimport { initCollapses } from './collapse';\nimport { initDials } from './dial';\nimport { initDismisses } from './dismiss';\nimport { initDrawers } from './drawer';\nimport { initDropdowns } from './dropdown';\nimport { initModals } from './modal';\nimport { initPopovers } from './popover';\nimport { initTabs } from './tabs';\nimport { initTooltips } from './tooltip';\n\nexport function initFlowbite() {\n initAccordions();\n initCollapses();\n initCarousels();\n initDismisses();\n initDropdowns();\n initModals();\n initDrawers();\n initTabs();\n initTooltips();\n initPopovers();\n initDials();\n}\n\nif (typeof window !== 'undefined') {\n window.initFlowbite = initFlowbite;\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ModalInstance, ModalOptions } from './types';\nimport { ModalInterface } from './interface';\n\nconst Default: ModalOptions = {\n placement: 'center',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',\n backdrop: 'dynamic',\n closable: true,\n onHide: () => {},\n onShow: () => {},\n onToggle: () => {},\n};\n\nclass Modal implements ModalInterface {\n _targetEl: HTMLElement | null;\n _options: ModalOptions;\n _isHidden: boolean;\n _backdropEl: HTMLElement | null;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: ModalOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._isHidden = true;\n this._backdropEl = null;\n this._init();\n }\n\n _init() {\n if (this._targetEl) {\n this._getPlacementClasses().map((c) => {\n this._targetEl.classList.add(c);\n });\n }\n }\n\n _createBackdrop() {\n if (this._isHidden) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('modal-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n this._backdropEl = backdropEl;\n }\n }\n\n _destroyBackdropEl() {\n if (!this._isHidden) {\n document.querySelector('[modal-backdrop]').remove();\n }\n }\n\n _setupModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleOutsideClick(ev.target);\n };\n this._targetEl.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._targetEl.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _handleOutsideClick(target: EventTarget) {\n if (\n target === this._targetEl ||\n (target === this._backdropEl && this.isVisible())\n ) {\n this.hide();\n }\n }\n\n _getPlacementClasses() {\n switch (this._options.placement) {\n // top\n case 'top-left':\n return ['justify-start', 'items-start'];\n case 'top-center':\n return ['justify-center', 'items-start'];\n case 'top-right':\n return ['justify-end', 'items-start'];\n\n // center\n case 'center-left':\n return ['justify-start', 'items-center'];\n case 'center':\n return ['justify-center', 'items-center'];\n case 'center-right':\n return ['justify-end', 'items-center'];\n\n // bottom\n case 'bottom-left':\n return ['justify-start', 'items-end'];\n case 'bottom-center':\n return ['justify-center', 'items-end'];\n case 'bottom-right':\n return ['justify-end', 'items-end'];\n\n default:\n return ['justify-center', 'items-center'];\n }\n }\n\n toggle() {\n if (this._isHidden) {\n this.show();\n } else {\n this.hide();\n }\n\n // callback function\n this._options.onToggle(this);\n }\n\n show() {\n if (this.isHidden) {\n this._targetEl.classList.add('flex');\n this._targetEl.classList.remove('hidden');\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n this._createBackdrop();\n this._isHidden = false;\n\n // prevent body scroll\n document.body.classList.add('overflow-hidden');\n\n // Add keyboard event listener to the document\n if (this._options.closable) {\n this._setupModalCloseEventListeners();\n }\n\n // callback function\n this._options.onShow(this);\n }\n }\n\n hide() {\n if (this.isVisible) {\n this._targetEl.classList.add('hidden');\n this._targetEl.classList.remove('flex');\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n this._destroyBackdropEl();\n this._isHidden = true;\n\n // re-apply body scroll\n document.body.classList.remove('overflow-hidden');\n\n if (this._options.closable) {\n this._removeModalCloseEventListeners();\n }\n\n // callback function\n this._options.onHide(this);\n }\n }\n\n isVisible() {\n return !this._isHidden;\n }\n\n isHidden() {\n return this._isHidden;\n }\n}\n\nconst getModalInstance = (id: string, instances: ModalInstance[]) => {\n if (instances.some((modalInstance) => modalInstance.id === id)) {\n return instances.find((modalInstance) => modalInstance.id === id);\n }\n return null;\n};\n\nexport function initModals() {\n const modalInstances = [] as ModalInstance[];\n\n // initiate modal based on data-modal-target\n document.querySelectorAll('[data-modal-target]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-target');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n if (!getModalInstance(modalId, modalInstances)) {\n modalInstances.push({\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n });\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.`\n );\n }\n });\n\n // support pre v1.6.0 data-modal-toggle initialization\n document.querySelectorAll('[data-modal-toggle]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-toggle');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n let modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (!modal) {\n modal = {\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n };\n modalInstances.push(modal);\n }\n\n $triggerEl.addEventListener('click', () => {\n modal.object.toggle();\n });\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?`\n );\n }\n });\n\n // show modal on click if exists based on id\n document.querySelectorAll('[data-modal-show]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-show');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isHidden) {\n modal.object.show();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?`\n );\n }\n });\n\n // hide modal on click if exists based on id\n document.querySelectorAll('[data-modal-hide]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-hide');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isVisible) {\n modal.object.hide();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Modal = Modal;\n window.initModals = initModals;\n}\n\nexport default Modal;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { PopoverOptions } from './types';\nimport { PopoverInterface } from './interface';\n\nconst Default: PopoverOptions = {\n placement: 'top',\n offset: 10,\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Popover implements PopoverInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: PopoverOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: PopoverOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, this._options.offset],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility to true\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility to false\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initPopovers() {\n document.querySelectorAll('[data-popover-target]').forEach(($triggerEl) => {\n const popoverID = $triggerEl.getAttribute('data-popover-target');\n const $popoverEl = document.getElementById(popoverID);\n\n if ($popoverEl) {\n const triggerType = $triggerEl.getAttribute('data-popover-trigger');\n const placement = $triggerEl.getAttribute('data-popover-placement');\n const offset = $triggerEl.getAttribute('data-popover-offset');\n\n new Popover(\n $popoverEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n offset: offset ? parseInt(offset) : Default.offset,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as PopoverOptions\n );\n } else {\n console.error(\n `The popover element with id \"${popoverID}\" does not exist. Please check the data-popover-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Popover = Popover;\n window.initPopovers = initPopovers;\n}\n\nexport default Popover;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { TabItem, TabsOptions } from './types';\nimport { TabsInterface } from './interface';\n\nconst Default: TabsOptions = {\n defaultTabId: null,\n activeClasses:\n 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500',\n inactiveClasses:\n 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300',\n onShow: () => {},\n};\n\nclass Tabs implements TabsInterface {\n _items: TabItem[];\n _activeTab: TabItem;\n _options: TabsOptions;\n\n constructor(items: TabItem[] = [], options: TabsOptions = Default) {\n this._items = items;\n this._activeTab = options ? this.getTab(options.defaultTabId) : null;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._items.length) {\n // set the first tab as active if not set by explicitly\n if (!this._activeTab) {\n this._setActiveTab(this._items[0]);\n }\n\n // force show the first default tab\n this.show(this._activeTab.id, true);\n\n // show tab content based on click\n this._items.map((tab) => {\n tab.triggerEl.addEventListener('click', () => {\n this.show(tab.id);\n });\n });\n }\n }\n\n getActiveTab() {\n return this._activeTab;\n }\n\n _setActiveTab(tab: TabItem) {\n this._activeTab = tab;\n }\n\n getTab(id: string) {\n return this._items.filter((t) => t.id === id)[0];\n }\n\n show(id: string, forceShow = false) {\n const tab = this.getTab(id);\n\n // don't do anything if already active\n if (tab === this._activeTab && !forceShow) {\n return;\n }\n\n // hide other tabs\n this._items.map((t: TabItem) => {\n if (t !== tab) {\n t.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n t.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n t.targetEl.classList.add('hidden');\n t.triggerEl.setAttribute('aria-selected', 'false');\n }\n });\n\n // show active tab\n tab.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n tab.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n tab.triggerEl.setAttribute('aria-selected', 'true');\n tab.targetEl.classList.remove('hidden');\n\n this._setActiveTab(tab);\n\n // callback function\n this._options.onShow(this, tab);\n }\n}\n\nexport function initTabs() {\n document.querySelectorAll('[data-tabs-toggle]').forEach(($triggerEl) => {\n const tabItems: TabItem[] = [];\n let defaultTabId = null;\n $triggerEl\n .querySelectorAll('[role=\"tab\"]')\n .forEach(($triggerEl: HTMLElement) => {\n const isActive =\n $triggerEl.getAttribute('aria-selected') === 'true';\n const tab: TabItem = {\n id: $triggerEl.getAttribute('data-tabs-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-tabs-target')\n ),\n };\n tabItems.push(tab);\n\n if (isActive) {\n defaultTabId = tab.id;\n }\n });\n new Tabs(tabItems, {\n defaultTabId: defaultTabId,\n } as TabsOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tabs = Tabs;\n window.initTabs = initTabs;\n}\n\nexport default Tabs;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { TooltipOptions } from './types';\nimport { TooltipInterface } from './interface';\n\nconst Default: TooltipOptions = {\n placement: 'top',\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Tooltip implements TooltipInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: TooltipOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: TooltipOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.hide();\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initTooltips() {\n document.querySelectorAll('[data-tooltip-target]').forEach(($triggerEl) => {\n const tooltipId = $triggerEl.getAttribute('data-tooltip-target');\n const $tooltipEl = document.getElementById(tooltipId);\n\n if ($tooltipEl) {\n const triggerType = $triggerEl.getAttribute('data-tooltip-trigger');\n const placement = $triggerEl.getAttribute('data-tooltip-placement');\n\n new Tooltip(\n $tooltipEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as TooltipOptions\n );\n } else {\n console.error(\n `The tooltip element with id \"${tooltipId}\" does not exist. Please check the data-tooltip-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tooltip = Tooltip;\n window.initTooltips = initTooltips;\n}\n\nexport default Tooltip;\n","class Events {\n private _eventType: string;\n private _eventFunctions: EventListener[];\n\n constructor(eventType: string, eventFunctions: EventListener[] = []) {\n this._eventType = eventType;\n this._eventFunctions = eventFunctions;\n }\n\n init() {\n this._eventFunctions.forEach((eventFunction) => {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// core components\nimport Accordion, { initAccordions } from './components/accordion';\nimport Carousel, { initCarousels } from './components/carousel';\nimport Collapse, { initCollapses } from './components/collapse';\nimport Dial, { initDials } from './components/dial';\nimport Dismiss, { initDismisses } from './components/dismiss';\nimport Drawer, { initDrawers } from './components/drawer';\nimport Dropdown, { initDropdowns } from './components/dropdown';\nimport Modal, { initModals } from './components/modal';\nimport Popover, { initPopovers } from './components/popover';\nimport Tabs, { initTabs } from './components/tabs';\nimport Tooltip, { initTooltips } from './components/tooltip';\nimport './components/index';\nimport Events from './dom/events';\n\nconst liveViewLoadEvents = new Events('phx:page-loading-stop', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nliveViewLoadEvents.init();\n\nconst regularViewLoadEvents = new Events('load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nregularViewLoadEvents.init();\n\nexport default {\n Accordion,\n Carousel,\n Collapse,\n Dial,\n Drawer,\n Dismiss,\n Dropdown,\n Modal,\n Popover,\n Tabs,\n Tooltip,\n Events,\n};\n"],"names":["root","factory","exports","module","define","amd","self","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","getNodeName","element","nodeName","toLowerCase","getWindow","node","window","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","name","enabled","phase","fn","_ref","state","Object","keys","elements","forEach","style","styles","attributes","assign","value","removeAttribute","setAttribute","effect","_ref2","initialStyles","position","options","strategy","top","margin","arrow","hasOwnProperty","property","attribute","requires","getBasePlacement","split","Math","max","min","round","getUAString","uaData","navigator","userAgentData","brands","map","item","brand","version","join","userAgent","isLayoutViewport","test","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scaleX","scaleY","offsetWidth","width","offsetHeight","height","visualViewport","addVisualOffsets","x","offsetLeft","y","offsetTop","getLayoutRect","abs","contains","parent","child","rootNode","getRootNode","next","isSameNode","parentNode","host","getComputedStyle","isTableElement","indexOf","getDocumentElement","document","documentElement","getParentNode","assignedSlot","getTrueOffsetParent","offsetParent","getOffsetParent","isFirefox","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","getMainAxisFromPlacement","within","mergePaddingObject","paddingObject","expandToHashMap","hashMap","key","_state$modifiersData$","arrowElement","popperOffsets","modifiersData","basePlacement","axis","len","padding","rects","toPaddingObject","arrowRect","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","clientHeight","clientWidth","centerToReference","center","offset","axisProp","centerOffset","_options$element","querySelector","requiresIfExists","getVariation","unsetSides","mapToStyles","_Object$assign2","popperRect","variation","offsets","gpuAcceleration","adaptive","roundOffsets","isFixed","_offsets$x","_offsets$y","_ref3","hasX","hasY","sideX","sideY","win","heightProp","widthProp","_Object$assign","commonStyles","_ref4","dpr","devicePixelRatio","roundOffsetsByDPR","_ref5","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","data","passive","instance","_options$scroll","scroll","_options$resize","resize","scrollParents","scrollParent","addEventListener","update","removeEventListener","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","getWindowScroll","scrollLeft","pageXOffset","scrollTop","pageYOffset","getWindowScrollBarX","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getScrollParent","body","listScrollParents","list","_element$ownerDocumen","isBody","target","updatedList","rectToClientRect","rect","getClientRectFromMixedType","clippingParent","html","layoutViewport","getViewportRect","clientTop","clientLeft","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","computeOffsets","commonX","commonY","mainAxis","detectOverflow","_options","_options$placement","_options$strategy","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","altContext","clippingClientRect","contextElement","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","flipVariations","allowedAutoPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","placements","_options$allowedAutoP","allowedPlacements","length","overflows","sort","a","b","computeAutoPlacement","referenceRect","checksMap","Map","makeFallbackChecks","firstFittingPlacement","i","_basePlacement","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","push","every","check","set","_loop","_i","fittingPlacement","find","get","slice","reset","getSideOffsets","preventedOffsets","isAnySideFullyClipped","some","side","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","_options$offset","invertDistance","skidding","distance","distanceAndSkiddingToXY","_data$state$placement","_options$tether","tether","_options$tetherOffset","tetherOffset","isBasePlacement","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","_offsetModifierState$","mainSide","altSide","additive","minLen","maxLen","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","clientOffset","offsetModifierValue","tetherMax","preventedOffset","_offsetModifierState$2","_mainSide","_altSide","_offset","_len","_min","_max","isOriginSide","_offsetModifierValue","_tetherMin","_tetherMax","_preventedOffset","v","withinMaxClamp","getCompositeRect","elementOrVirtualElement","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","order","modifiers","visited","Set","result","modifier","add","dep","has","depModifier","DEFAULT_OPTIONS","areValidElements","arguments","args","Array","_key","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","pending","orderedModifiers","effectCleanupFns","isDestroyed","setOptions","setOptionsAction","cleanupModifierEffects","orderModifiers","merged","current","existing","mergeByName","m","_ref3$options","cleanupFn","noopFn","forceUpdate","_state$elements","index","_state$orderedModifie","_state$orderedModifie2","Promise","resolve","then","undefined","destroy","onFirstUpdate","createPopper","eventListeners","Default","alwaysOpen","activeClasses","inactiveClasses","onOpen","onClose","onToggle","items","this","_items","_init","active","open","id","triggerEl","toggle","getItem","classList","remove","targetEl","iconEl","close","initAccordions","querySelectorAll","$accordionEl","getAttribute","$triggerEl","closest","Accordion","defaultPosition","indicators","interval","onNext","onPrev","onChange","_activeItem","_indicators","_intervalDuration","_intervalInstance","el","_getActiveItem","slideTo","indicator","nextItem","rotationItems","middle","_rotate","_setActiveItem","pause","cycle","activeItem","prev","prevItem","setInterval","clearInterval","initCarousels","$carouselEl","slide","from","$carouselItemEl","$indicatorEl","parseInt","carousel","Carousel","carouselNextEl","carouselPrevEl","onCollapse","onExpand","_targetEl","_triggerEl","_visible","hasAttribute","collapse","expand","initCollapses","targetId","$targetEl","getElementById","Collapse","console","error","triggerType","onShow","onHide","parentEl","_parentEl","triggerEventTypes","_getTriggerEventTypes","showEvents","ev","show","hideEvents","matches","hide","isHidden","isVisible","initDials","$parentEl","dialId","$dialEl","Dial","transition","duration","timing","setTimeout","initDismisses","$dismissEl","Dismiss","bodyScrolling","backdrop","edge","edgeOffset","backdropClasses","_getPlacementClasses","base","c","event","inactive","_destroyBackdropEl","_createBackdrop","backdropEl","createElement","append","getDrawerInstance","instances","drawerInstance","initDrawers","drawerInstances","drawerId","$drawerEl","object","Drawer","offsetSkidding","offsetDistance","delay","ignoreClickOutsideClass","targetElement","triggerElement","_popperInstance","_createPopperInstance","_setupEventListeners","triggerEvents","_getTriggerEvents","_setupClickOutsideListener","_clickOutsideEventListener","_handleClickOutside","_removeClickOutsideListener","clickedEl","isIgnored","initDropdowns","dropdownId","$dropdownEl","Dropdown","initFlowbite","initModals","initTabs","initTooltips","initPopovers","closable","_isHidden","_backdropEl","_setupModalCloseEventListeners","_handleOutsideClick","_keydownEventListener","_removeModalCloseEventListeners","getModalInstance","modalInstance","modalInstances","modalId","$modalEl","Modal","_setupKeydownListener","_removeKeydownListener","popoverID","$popoverEl","Popover","defaultTabId","_activeTab","getTab","_setActiveTab","tab","getActiveTab","t","forceShow","tabItems","isActive","Tabs","tooltipId","$tooltipEl","Tooltip","eventType","eventFunctions","_eventType","_eventFunctions","init","eventFunction","Events","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","d","definition","o","defineProperty","enumerable","obj","prop","prototype","r","Symbol","toStringTag"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.turbo.js b/node_modules/flowbite/dist/flowbite.turbo.js new file mode 100644 index 0000000..ac78acb --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.turbo.js @@ -0,0 +1,4438 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("Flowbite", [], factory); + else if(typeof exports === 'object') + exports["Flowbite"] = factory(); + else + root["Flowbite"] = factory(); +})(self, function() { +return /******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ 853: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "afterMain": function() { return /* reexport */ afterMain; }, + "afterRead": function() { return /* reexport */ afterRead; }, + "afterWrite": function() { return /* reexport */ afterWrite; }, + "applyStyles": function() { return /* reexport */ modifiers_applyStyles; }, + "arrow": function() { return /* reexport */ modifiers_arrow; }, + "auto": function() { return /* reexport */ auto; }, + "basePlacements": function() { return /* reexport */ basePlacements; }, + "beforeMain": function() { return /* reexport */ beforeMain; }, + "beforeRead": function() { return /* reexport */ beforeRead; }, + "beforeWrite": function() { return /* reexport */ beforeWrite; }, + "bottom": function() { return /* reexport */ bottom; }, + "clippingParents": function() { return /* reexport */ clippingParents; }, + "computeStyles": function() { return /* reexport */ modifiers_computeStyles; }, + "createPopper": function() { return /* reexport */ popper_createPopper; }, + "createPopperBase": function() { return /* reexport */ createPopper; }, + "createPopperLite": function() { return /* reexport */ popper_lite_createPopper; }, + "detectOverflow": function() { return /* reexport */ detectOverflow; }, + "end": function() { return /* reexport */ end; }, + "eventListeners": function() { return /* reexport */ eventListeners; }, + "flip": function() { return /* reexport */ modifiers_flip; }, + "hide": function() { return /* reexport */ modifiers_hide; }, + "left": function() { return /* reexport */ left; }, + "main": function() { return /* reexport */ main; }, + "modifierPhases": function() { return /* reexport */ modifierPhases; }, + "offset": function() { return /* reexport */ modifiers_offset; }, + "placements": function() { return /* reexport */ enums_placements; }, + "popper": function() { return /* reexport */ popper; }, + "popperGenerator": function() { return /* reexport */ popperGenerator; }, + "popperOffsets": function() { return /* reexport */ modifiers_popperOffsets; }, + "preventOverflow": function() { return /* reexport */ modifiers_preventOverflow; }, + "read": function() { return /* reexport */ read; }, + "reference": function() { return /* reexport */ reference; }, + "right": function() { return /* reexport */ right; }, + "start": function() { return /* reexport */ start; }, + "top": function() { return /* reexport */ enums_top; }, + "variationPlacements": function() { return /* reexport */ variationPlacements; }, + "viewport": function() { return /* reexport */ viewport; }, + "write": function() { return /* reexport */ write; } +}); + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js +var enums_top = 'top'; +var bottom = 'bottom'; +var right = 'right'; +var left = 'left'; +var auto = 'auto'; +var basePlacements = [enums_top, bottom, right, left]; +var start = 'start'; +var end = 'end'; +var clippingParents = 'clippingParents'; +var viewport = 'viewport'; +var popper = 'popper'; +var reference = 'reference'; +var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); +}, []); +var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +}, []); // modifiers that need to read the DOM + +var beforeRead = 'beforeRead'; +var read = 'read'; +var afterRead = 'afterRead'; // pure-logic modifiers + +var beforeMain = 'beforeMain'; +var main = 'main'; +var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) + +var beforeWrite = 'beforeWrite'; +var write = 'write'; +var afterWrite = 'afterWrite'; +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +function getNodeName(element) { + return element ? (element.nodeName || '').toLowerCase() : null; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js +function getWindow(node) { + if (node == null) { + return window; + } + + if (node.toString() !== '[object Window]') { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + + return node; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js + + +function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; +} + +function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; +} + +function isShadowRoot(node) { + // IE 11 has no ShadowRoot + if (typeof ShadowRoot === 'undefined') { + return false; + } + + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js + + // This modifier takes the styles prepared by the `computeStyles` modifier +// and applies them to the HTMLElements such as popper and arrow + +function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function (name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } // Flow doesn't support to extend this property, but it's the most + // effective way to apply styles to an HTMLElement + // $FlowFixMe[cannot-write] + + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (name) { + var value = attributes[name]; + + if (value === false) { + element.removeAttribute(name); + } else { + element.setAttribute(name, value === true ? '' : value); + } + }); + }); +} + +function effect(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: '0', + top: '0', + margin: '0' + }, + arrow: { + position: 'absolute' + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + + return function () { + Object.keys(state.elements).forEach(function (name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them + + var style = styleProperties.reduce(function (style, property) { + style[property] = ''; + return style; + }, {}); // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (attribute) { + element.removeAttribute(attribute); + }); + }); + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_applyStyles = ({ + name: 'applyStyles', + enabled: true, + phase: 'write', + fn: applyStyles, + effect: effect, + requires: ['computeStyles'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js + +function getBasePlacement(placement) { + return placement.split('-')[0]; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js +var math_max = Math.max; +var math_min = Math.min; +var round = Math.round; +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/userAgent.js +function getUAString() { + var uaData = navigator.userAgentData; + + if (uaData != null && uaData.brands) { + return uaData.brands.map(function (item) { + return item.brand + "/" + item.version; + }).join(' '); + } + + return navigator.userAgent; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js + +function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js + + + + +function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; + } + + var _ref = isElement(element) ? getWindow(element) : window, + visualViewport = _ref.visualViewport; + + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width: width, + height: height, + top: y, + right: x + width, + bottom: y + height, + left: x, + x: x, + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js + // Returns the layout rect of an element relative to its offsetParent. Layout +// means it doesn't take into account transforms. + +function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. + // Fixes https://github.com/popperjs/popper-core/issues/1223 + + var width = element.offsetWidth; + var height = element.offsetHeight; + + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + + return { + x: element.offsetLeft, + y: element.offsetTop, + width: width, + height: height + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js + +function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method + + if (parent.contains(child)) { + return true; + } // then fallback to custom implementation with Shadow DOM support + else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + + + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false + + + return false; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js + +function getComputedStyle(element) { + return getWindow(element).getComputedStyle(element); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js + +function isTableElement(element) { + return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js + +function getDocumentElement(element) { + // $FlowFixMe[incompatible-return]: assume body is always available + return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] + element.document) || window.document).documentElement; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js + + + +function getParentNode(element) { + if (getNodeName(element) === 'html') { + return element; + } + + return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || ( // DOM Element detected + isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) // fallback + + ); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js + + + + + + + + +function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle(element).position === 'fixed') { + return null; + } + + return element.offsetParent; +} // `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block + + +function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + + if (isIE && isHTMLElement(element)) { + // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport + var elementCss = getComputedStyle(element); + + if (elementCss.position === 'fixed') { + return null; + } + } + + var currentNode = getParentNode(element); + + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + + while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that + // create a containing block. + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + + if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + + return null; +} // Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. + + +function getOffsetParent(element) { + var window = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { + offsetParent = getTrueOffsetParent(offsetParent); + } + + if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { + return window; + } + + return offsetParent || getContainingBlock(element) || window; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +function getMainAxisFromPlacement(placement) { + return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js + +function within(min, value, max) { + return math_max(min, math_min(value, max)); +} +function withinMaxClamp(min, value, max) { + var v = within(min, value, max); + return v > max ? max : v; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js + +function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js +function expandToHashMap(value, keys) { + return keys.reduce(function (hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js + + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var toPaddingObject = function toPaddingObject(padding, state) { + padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +}; + +function arrow(_ref) { + var _state$modifiersData$; + + var state = _ref.state, + name = _ref.name, + options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? 'height' : 'width'; + + if (!arrowElement || !popperOffsets) { + return; + } + + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === 'y' ? enums_top : left; + var maxProp = axis === 'y' ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; + var startDiff = popperOffsets[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is + // outside of the popper bounds + + var min = paddingObject[minProp]; + var max = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset = within(min, center, max); // Prevents breaking syntax highlighting... + + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); +} + +function arrow_effect(_ref2) { + var state = _ref2.state, + options = _ref2.options; + var _options$element = options.element, + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + + if (arrowElement == null) { + return; + } // CSS selector + + + if (typeof arrowElement === 'string') { + arrowElement = state.elements.popper.querySelector(arrowElement); + + if (!arrowElement) { + return; + } + } + + if (false) {} + + if (!contains(state.elements.popper, arrowElement)) { + if (false) {} + + return; + } + + state.elements.arrow = arrowElement; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_arrow = ({ + name: 'arrow', + enabled: true, + phase: 'main', + fn: arrow, + effect: arrow_effect, + requires: ['popperOffsets'], + requiresIfExists: ['preventOverflow'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js +function getVariation(placement) { + return placement.split('-')[1]; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +var unsetSides = { + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto' +}; // Round the offsets to the nearest suitable subpixel based on the DPR. +// Zooming can change the DPR, but it seems to report a value that will +// cleanly divide the values into the appropriate subpixels. + +function roundOffsetsByDPR(_ref) { + var x = _ref.x, + y = _ref.y; + var win = window; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x * dpr) / dpr || 0, + y: round(y * dpr) / dpr || 0 + }; +} + +function mapToStyles(_ref2) { + var _Object$assign2; + + var popper = _ref2.popper, + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets, + isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, + x = _offsets$x === void 0 ? 0 : _offsets$x, + _offsets$y = offsets.y, + y = _offsets$y === void 0 ? 0 : _offsets$y; + + var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty('x'); + var hasY = offsets.hasOwnProperty('y'); + var sideX = left; + var sideY = enums_top; + var win = window; + + if (adaptive) { + var offsetParent = getOffsetParent(popper); + var heightProp = 'clientHeight'; + var widthProp = 'clientWidth'; + + if (offsetParent === getWindow(popper)) { + offsetParent = getDocumentElement(popper); + + if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { + heightProp = 'scrollHeight'; + widthProp = 'scrollWidth'; + } + } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it + + + offsetParent = offsetParent; + + if (placement === enums_top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] + offsetParent[heightProp]; + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + + if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] + offsetParent[widthProp]; + x -= offsetX - popperRect.width; + x *= gpuAcceleration ? 1 : -1; + } + } + + var commonStyles = Object.assign({ + position: position + }, adaptive && unsetSides); + + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref4.x; + y = _ref4.y; + + if (gpuAcceleration) { + var _Object$assign; + + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + } + + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +} + +function computeStyles(_ref5) { + var state = _ref5.state, + options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + + if (false) { var transitionProperty; } + + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration: gpuAcceleration, + isFixed: state.options.strategy === 'fixed' + }; + + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive: adaptive, + roundOffsets: roundOffsets + }))); + } + + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: 'absolute', + adaptive: false, + roundOffsets: roundOffsets + }))); + } + + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-placement': state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_computeStyles = ({ + name: 'computeStyles', + enabled: true, + phase: 'beforeWrite', + fn: computeStyles, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js + // eslint-disable-next-line import/no-unused-modules + +var passive = { + passive: true +}; + +function eventListeners_effect(_ref) { + var state = _ref.state, + instance = _ref.instance, + options = _ref.options; + var _options$scroll = options.scroll, + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; + var window = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.addEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.addEventListener('resize', instance.update, passive); + } + + return function () { + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.removeEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.removeEventListener('resize', instance.update, passive); + } + }; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var eventListeners = ({ + name: 'eventListeners', + enabled: true, + phase: 'write', + fn: function fn() {}, + effect: eventListeners_effect, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +var hash = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +var getOppositeVariationPlacement_hash = { + start: 'end', + end: 'start' +}; +function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function (matched) { + return getOppositeVariationPlacement_hash[matched]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js + +function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft: scrollLeft, + scrollTop: scrollTop + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js + + + +function getWindowScrollBarX(element) { + // If has a CSS width greater than the viewport, then this will be + // incorrect for RTL. + // Popper 1 is broken in this case and never had a bug report so let's assume + // it's not an issue. I don't think anyone ever specifies width on + // anyway. + // Browsers where the left scrollbar doesn't cause an issue report `0` for + // this (e.g. Edge 2019, IE11, Safari) + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js + + + + +function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x = 0; + var y = 0; + + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + + if (layoutViewport || !layoutViewport && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + + return { + width: width, + height: height, + x: x + getWindowScrollBarX(element), + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js + + + + + // Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable + +function getDocumentRect(element) { + var _element$ownerDocumen; + + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y = -winScroll.scrollTop; + + if (getComputedStyle(body || html).direction === 'rtl') { + x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + + return { + width: width, + height: height, + x: x, + y: y + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js + +function isScrollParent(element) { + // Firefox wants us to check `-x` and `-y` variations as well + var _getComputedStyle = getComputedStyle(element), + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; + + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js + + + + +function getScrollParent(node) { + if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { + // $FlowFixMe[incompatible-return]: assume body is always available + return node.ownerDocument.body; + } + + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + + return getScrollParent(getParentNode(node)); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js + + + + +/* +given a DOM element, return the list of all scroll parents, up the list of ancesors +until we get to the top window object. This list is what we attach scroll listeners +to, because if any of these parent elements scroll, we'll need to re-calculate the +reference element's position. +*/ + +function listScrollParents(element, list) { + var _element$ownerDocumen; + + if (list === void 0) { + list = []; + } + + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js +function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js + + + + + + + + + + + + + + + +function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === 'fixed'); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; +} + +function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +} // A "clipping parent" is an overflowable container with the characteristic of +// clipping (or hiding) overflowing elements with a position different from +// `initial` + + +function getClippingParents(element) { + var clippingParents = listScrollParents(getParentNode(element)); + var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + + if (!isElement(clipperElement)) { + return []; + } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 + + + return clippingParents.filter(function (clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; + }); +} // Gets the maximum area that the element is visible in due to any number of +// clipping parents + + +function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); + var clippingParents = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents[0]; + var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = math_max(rect.top, accRect.top); + accRect.right = math_min(rect.right, accRect.right); + accRect.bottom = math_min(rect.bottom, accRect.bottom); + accRect.left = math_max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js + + + + +function computeOffsets(_ref) { + var reference = _ref.reference, + element = _ref.element, + placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference.x + reference.width / 2 - element.width / 2; + var commonY = reference.y + reference.height / 2 - element.height / 2; + var offsets; + + switch (basePlacement) { + case enums_top: + offsets = { + x: commonX, + y: reference.y - element.height + }; + break; + + case bottom: + offsets = { + x: commonX, + y: reference.y + reference.height + }; + break; + + case right: + offsets = { + x: reference.x + reference.width, + y: commonY + }; + break; + + case left: + offsets = { + x: reference.x - element.width, + y: commonY + }; + break; + + default: + offsets = { + x: reference.x, + y: reference.y + }; + } + + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + + if (mainAxis != null) { + var len = mainAxis === 'y' ? 'height' : 'width'; + + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); + break; + + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); + break; + + default: + } + } + + return offsets; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js + + + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + _options$placement = _options.placement, + placement = _options$placement === void 0 ? state.placement : _options$placement, + _options$strategy = _options.strategy, + strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, + _options$boundary = _options.boundary, + boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: 'absolute', + placement: placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect + // 0 or negative = within the clipping rect + + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element + + if (elementContext === popper && offsetData) { + var offset = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function (key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; + overflowOffsets[key] += offset[axis] * multiply; + }); + } + + return overflowOffsets; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js + + + + +function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { + return getVariation(placement) === variation; + }) : basePlacements; + var allowedPlacements = placements.filter(function (placement) { + return allowedAutoPlacements.indexOf(placement) >= 0; + }); + + if (allowedPlacements.length === 0) { + allowedPlacements = placements; + + if (false) {} + } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... + + + var overflows = allowedPlacements.reduce(function (acc, placement) { + acc[placement] = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding + })[getBasePlacement(placement)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function (a, b) { + return overflows[a] - overflows[b]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js + + + + + + + // eslint-disable-next-line import/no-unused-modules + +function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; +} + +function flip(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + + if (state.modifiersData[name]._skip) { + return; + } + + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { + return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + flipVariations: flipVariations, + allowedAutoPlacements: allowedAutoPlacements + }) : placement); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements[0]; + + for (var i = 0; i < placements.length; i++) { + var placement = placements[i]; + + var _basePlacement = getBasePlacement(placement); + + var isStartVariation = getVariation(placement) === start; + var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? 'width' : 'height'; + var overflow = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + altBoundary: altBoundary, + padding: padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; + + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + + if (checks.every(function (check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + + checksMap.set(placement, checks); + } + + if (makeFallbackChecks) { + // `2` may be desired in some cases – research later + var numberOfChecks = flipVariations ? 3 : 1; + + var _loop = function _loop(_i) { + var fittingPlacement = placements.find(function (placement) { + var checks = checksMap.get(placement); + + if (checks) { + return checks.slice(0, _i).every(function (check) { + return check; + }); + } + }); + + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + + if (_ret === "break") break; + } + } + + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_flip = ({ + name: 'flip', + enabled: true, + phase: 'main', + fn: flip, + requiresIfExists: ['offset'], + data: { + _skip: false + } +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js + + + +function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; +} + +function isAnySideFullyClipped(overflow) { + return [enums_top, right, bottom, left].some(function (side) { + return overflow[side] >= 0; + }); +} + +function hide(_ref) { + var state = _ref.state, + name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: 'reference' + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets: referenceClippingOffsets, + popperEscapeOffsets: popperEscapeOffsets, + isReferenceHidden: isReferenceHidden, + hasPopperEscaped: hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-reference-hidden': isReferenceHidden, + 'data-popper-escaped': hasPopperEscaped + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_hide = ({ + name: 'hide', + enabled: true, + phase: 'main', + requiresIfExists: ['preventOverflow'], + fn: hide +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js + + // eslint-disable-next-line import/no-unused-modules + +function distanceAndSkiddingToXY(placement, rects, offset) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; + + var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { + placement: placement + })) : offset, + skidding = _ref[0], + distance = _ref[1]; + + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; +} + +function offset(_ref2) { + var state = _ref2.state, + options = _ref2.options, + name = _ref2.name; + var _options$offset = options.offset, + offset = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = enums_placements.reduce(function (acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); + return acc; + }, {}); + var _data$state$placement = data[state.placement], + x = _data$state$placement.x, + y = _data$state$placement.y; + + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x; + state.modifiersData.popperOffsets.y += y; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_offset = ({ + name: 'offset', + enabled: true, + phase: 'main', + requires: ['popperOffsets'], + fn: offset +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js + + +function popperOffsets(_ref) { + var state = _ref.state, + name = _ref.name; + // Offsets are the actual position the popper needs to have to be + // properly positioned near its reference element + // This is the most basic placement, and will be adjusted by + // the modifiers in the next step + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: 'absolute', + placement: state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_popperOffsets = ({ + name: 'popperOffsets', + enabled: true, + phase: 'read', + fn: popperOffsets, + data: {} +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js +function getAltAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js + + + + + + + + + + + + +function preventOverflow(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + altBoundary: altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + + if (!popperOffsets) { + return; + } + + if (checkMainAxis) { + var _offsetModifierState$; + + var mainSide = mainAxis === 'y' ? enums_top : left; + var altSide = mainAxis === 'y' ? bottom : right; + var len = mainAxis === 'y' ? 'height' : 'width'; + var offset = popperOffsets[mainAxis]; + var min = offset + overflow[mainSide]; + var max = offset - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go + // outside the reference bounds + + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want + // to include its full size in the calculation. If the reference is small + // and near the edge of a boundary, the popper can overflow even if the + // reference is not overflowing as well (e.g. virtual elements with no + // width or height) + + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); + popperOffsets[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset; + } + + if (checkAltAxis) { + var _offsetModifierState$2; + + var _mainSide = mainAxis === 'x' ? enums_top : left; + + var _altSide = mainAxis === 'x' ? bottom : right; + + var _offset = popperOffsets[altAxis]; + + var _len = altAxis === 'y' ? 'height' : 'width'; + + var _min = _offset + overflow[_mainSide]; + + var _max = _offset - overflow[_altSide]; + + var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; + + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + + popperOffsets[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +/* harmony default export */ var modifiers_preventOverflow = ({ + name: 'preventOverflow', + enabled: true, + phase: 'main', + fn: preventOverflow, + requiresIfExists: ['offset'] +}); +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/index.js + + + + + + + + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js + + + + +function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js + + + + + + + + + +function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; +} // Returns the composite rect of an element relative to its offsetParent. +// Composite means it takes into account transforms as well as layout. + + +function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js + // source: https://stackoverflow.com/questions/49875255 + +function order(modifiers) { + var map = new Map(); + var visited = new Set(); + var result = []; + modifiers.forEach(function (modifier) { + map.set(modifier.name, modifier); + }); // On visiting object, check for its dependencies and visit them recursively + + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function (dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + + modifiers.forEach(function (modifier) { + if (!visited.has(modifier.name)) { + // check for visited object + sort(modifier); + } + }); + return result; +} + +function orderModifiers(modifiers) { + // order based on dependencies + var orderedModifiers = order(modifiers); // order based on phase + + return modifierPhases.reduce(function (acc, phase) { + return acc.concat(orderedModifiers.filter(function (modifier) { + return modifier.phase === phase; + })); + }, []); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js +function debounce(fn) { + var pending; + return function () { + if (!pending) { + pending = new Promise(function (resolve) { + Promise.resolve().then(function () { + pending = undefined; + resolve(fn()); + }); + }); + } + + return pending; + }; +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js +function mergeByName(modifiers) { + var merged = modifiers.reduce(function (merged, current) { + var existing = merged[current.name]; + merged[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged; + }, {}); // IE11 does not support Object.values + + return Object.keys(merged).map(function (key) { + return merged[key]; + }); +} +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js + + + + + + + + + + + + + + +var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +var DEFAULT_OPTIONS = { + placement: 'bottom', + modifiers: [], + strategy: 'absolute' +}; + +function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return !args.some(function (element) { + return !(element && typeof element.getBoundingClientRect === 'function'); + }); +} + +function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + + var _generatorOptions = generatorOptions, + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper(reference, popper, options) { + if (options === void 0) { + options = defaultOptions; + } + + var state = { + placement: 'bottom', + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference, + popper: popper + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state: state, + setOptions: function setOptions(setOptionsAction) { + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options); + state.scrollParents = { + reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], + popper: listScrollParents(popper) + }; // Orders the modifiers based on their dependencies and `phase` + // properties + + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers + + state.orderedModifiers = orderedModifiers.filter(function (m) { + return m.enabled; + }); // Validate the provided modifiers so that the consumer will get warned + // if one of the modifiers is invalid for any reason + + if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } + + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + + var _state$elements = state.elements, + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + // anymore + + if (!areValidElements(reference, popper)) { + if (false) {} + + return; + } // Store the reference and popper rects to be read by modifiers + + + state.rects = { + reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), + popper: getLayoutRect(popper) + }; // Modifiers have the ability to reset the current update cycle. The + // most common use case for this is the `flip` modifier changing the + // placement, which then needs to re-run all the modifiers, because the + // logic was previously ran for the previous placement and is therefore + // stale/incorrect + + state.reset = false; + state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier + // is filled with the initial data specified by the modifier. This means + // it doesn't persist and is fresh on each update. + // To ensure persistent data, use `${name}#persistent` + + state.orderedModifiers.forEach(function (modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + var __debug_loops__ = 0; + + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (false) {} + + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + + var _state$orderedModifie = state.orderedModifiers[index], + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; + + if (typeof fn === 'function') { + state = fn({ + state: state, + options: _options, + name: name, + instance: instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function () { + return new Promise(function (resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + + if (!areValidElements(reference, popper)) { + if (false) {} + + return instance; + } + + instance.setOptions(options).then(function (state) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state); + } + }); // Modifiers have the ability to execute arbitrary code before the first + // update cycle runs. They will be executed in the same order as the update + // cycle. This is useful when a modifier adds some persistent data that + // other modifiers need to use, but the modifier is run after the dependent + // one. + + function runModifierEffects() { + state.orderedModifiers.forEach(function (_ref3) { + var name = _ref3.name, + _ref3$options = _ref3.options, + options = _ref3$options === void 0 ? {} : _ref3$options, + effect = _ref3.effect; + + if (typeof effect === 'function') { + var cleanupFn = effect({ + state: state, + name: name, + instance: instance, + options: options + }); + + var noopFn = function noopFn() {}; + + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + + function cleanupModifierEffects() { + effectCleanupFns.forEach(function (fn) { + return fn(); + }); + effectCleanupFns = []; + } + + return instance; + }; +} +var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js + + + + + + + + + + +var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; +var popper_createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper-lite.js + + + + + +var popper_lite_defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles]; +var popper_lite_createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: popper_lite_defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + + +;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/index.js + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + // eslint-disable-next-line import/no-unused-modules + + + +/***/ }), + +/***/ 902: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initAccordions = void 0; +var Default = { + alwaysOpen: false, + activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white', + inactiveClasses: 'text-gray-500 dark:text-gray-400', + onOpen: function () { }, + onClose: function () { }, + onToggle: function () { }, +}; +var Accordion = /** @class */ (function () { + function Accordion(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Accordion.prototype._init = function () { + var _this = this; + if (this._items.length) { + // show accordion item based on click + this._items.map(function (item) { + if (item.active) { + _this.open(item.id); + } + item.triggerEl.addEventListener('click', function () { + _this.toggle(item.id); + }); + }); + } + }; + Accordion.prototype.getItem = function (id) { + return this._items.filter(function (item) { return item.id === id; })[0]; + }; + Accordion.prototype.open = function (id) { + var _a, _b; + var _this = this; + var item = this.getItem(id); + // don't hide other accordions if always open + if (!this._options.alwaysOpen) { + this._items.map(function (i) { + var _a, _b; + if (i !== item) { + (_a = i.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = i.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + i.targetEl.classList.add('hidden'); + i.triggerEl.setAttribute('aria-expanded', 'false'); + i.active = false; + // rotate icon if set + if (i.iconEl) { + i.iconEl.classList.remove('rotate-180'); + } + } + }); + } + // show active item + (_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + item.triggerEl.setAttribute('aria-expanded', 'true'); + item.targetEl.classList.remove('hidden'); + item.active = true; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.add('rotate-180'); + } + // callback function + this._options.onOpen(this, item); + }; + Accordion.prototype.toggle = function (id) { + var item = this.getItem(id); + if (item.active) { + this.close(id); + } + else { + this.open(id); + } + // callback function + this._options.onToggle(this, item); + }; + Accordion.prototype.close = function (id) { + var _a, _b; + var item = this.getItem(id); + (_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(' ')); + item.targetEl.classList.add('hidden'); + item.triggerEl.setAttribute('aria-expanded', 'false'); + item.active = false; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.remove('rotate-180'); + } + // callback function + this._options.onClose(this, item); + }; + return Accordion; +}()); +function initAccordions() { + document.querySelectorAll('[data-accordion]').forEach(function ($accordionEl) { + var alwaysOpen = $accordionEl.getAttribute('data-accordion'); + var activeClasses = $accordionEl.getAttribute('data-active-classes'); + var inactiveClasses = $accordionEl.getAttribute('data-inactive-classes'); + var items = []; + $accordionEl + .querySelectorAll('[data-accordion-target]') + .forEach(function ($triggerEl) { + // Consider only items that directly belong to $accordionEl + // (to make nested accordions work). + if ($triggerEl.closest('[data-accordion]') === $accordionEl) { + var item = { + id: $triggerEl.getAttribute('data-accordion-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-accordion-target')), + iconEl: $triggerEl.querySelector('[data-accordion-icon]'), + active: $triggerEl.getAttribute('aria-expanded') === 'true' + ? true + : false, + }; + items.push(item); + } + }); + new Accordion(items, { + alwaysOpen: alwaysOpen === 'open' ? true : false, + activeClasses: activeClasses + ? activeClasses + : Default.activeClasses, + inactiveClasses: inactiveClasses + ? inactiveClasses + : Default.inactiveClasses, + }); + }); +} +exports.initAccordions = initAccordions; +if (typeof window !== 'undefined') { + window.Accordion = Accordion; + window.initAccordions = initAccordions; +} +exports["default"] = Accordion; + + +/***/ }), + +/***/ 33: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initCarousels = void 0; +var Default = { + defaultPosition: 0, + indicators: { + items: [], + activeClasses: 'bg-white dark:bg-gray-800', + inactiveClasses: 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800', + }, + interval: 3000, + onNext: function () { }, + onPrev: function () { }, + onChange: function () { }, +}; +var Carousel = /** @class */ (function () { + function Carousel(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign(__assign({}, Default), options), { indicators: __assign(__assign({}, Default.indicators), options.indicators) }); + this._activeItem = this.getItem(this._options.defaultPosition); + this._indicators = this._options.indicators.items; + this._intervalDuration = this._options.interval; + this._intervalInstance = null; + this._init(); + } + /** + * initialize carousel and items based on active one + */ + Carousel.prototype._init = function () { + var _this = this; + this._items.map(function (item) { + item.el.classList.add('absolute', 'inset-0', 'transition-transform', 'transform'); + }); + // if no active item is set then first position is default + if (this._getActiveItem()) { + this.slideTo(this._getActiveItem().position); + } + else { + this.slideTo(0); + } + this._indicators.map(function (indicator, position) { + indicator.el.addEventListener('click', function () { + _this.slideTo(position); + }); + }); + }; + Carousel.prototype.getItem = function (position) { + return this._items[position]; + }; + /** + * Slide to the element based on id + * @param {*} position + */ + Carousel.prototype.slideTo = function (position) { + var nextItem = this._items[position]; + var rotationItems = { + left: nextItem.position === 0 + ? this._items[this._items.length - 1] + : this._items[nextItem.position - 1], + middle: nextItem, + right: nextItem.position === this._items.length - 1 + ? this._items[0] + : this._items[nextItem.position + 1], + }; + this._rotate(rotationItems); + this._setActiveItem(nextItem); + if (this._intervalInstance) { + this.pause(); + this.cycle(); + } + this._options.onChange(this); + }; + /** + * Based on the currently active item it will go to the next position + */ + Carousel.prototype.next = function () { + var activeItem = this._getActiveItem(); + var nextItem = null; + // check if last item + if (activeItem.position === this._items.length - 1) { + nextItem = this._items[0]; + } + else { + nextItem = this._items[activeItem.position + 1]; + } + this.slideTo(nextItem.position); + // callback function + this._options.onNext(this); + }; + /** + * Based on the currently active item it will go to the previous position + */ + Carousel.prototype.prev = function () { + var activeItem = this._getActiveItem(); + var prevItem = null; + // check if first item + if (activeItem.position === 0) { + prevItem = this._items[this._items.length - 1]; + } + else { + prevItem = this._items[activeItem.position - 1]; + } + this.slideTo(prevItem.position); + // callback function + this._options.onPrev(this); + }; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + Carousel.prototype._rotate = function (rotationItems) { + // reset + this._items.map(function (item) { + item.el.classList.add('hidden'); + }); + // left item (previously active) + rotationItems.left.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.left.el.classList.add('-translate-x-full', 'z-10'); + // currently active item + rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10'); + rotationItems.middle.el.classList.add('translate-x-0', 'z-20'); + // right item (upcoming active) + rotationItems.right.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.right.el.classList.add('translate-x-full', 'z-10'); + }; + /** + * Set an interval to cycle through the carousel items + */ + Carousel.prototype.cycle = function () { + var _this = this; + if (typeof window !== 'undefined') { + this._intervalInstance = window.setInterval(function () { + _this.next(); + }, this._intervalDuration); + } + }; + /** + * Clears the cycling interval + */ + Carousel.prototype.pause = function () { + clearInterval(this._intervalInstance); + }; + /** + * Get the currently active item + */ + Carousel.prototype._getActiveItem = function () { + return this._activeItem; + }; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + Carousel.prototype._setActiveItem = function (item) { + var _a, _b; + var _this = this; + this._activeItem = item; + var position = item.position; + // update the indicators if available + if (this._indicators.length) { + this._indicators.map(function (indicator) { + var _a, _b; + indicator.el.setAttribute('aria-current', 'false'); + (_a = indicator.el.classList).remove.apply(_a, _this._options.indicators.activeClasses.split(' ')); + (_b = indicator.el.classList).add.apply(_b, _this._options.indicators.inactiveClasses.split(' ')); + }); + (_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(' ')); + (_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(' ')); + this._indicators[position].el.setAttribute('aria-current', 'true'); + } + }; + return Carousel; +}()); +function initCarousels() { + document.querySelectorAll('[data-carousel]').forEach(function ($carouselEl) { + var interval = $carouselEl.getAttribute('data-carousel-interval'); + var slide = $carouselEl.getAttribute('data-carousel') === 'slide' + ? true + : false; + var items = []; + var defaultPosition = 0; + if ($carouselEl.querySelectorAll('[data-carousel-item]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-item]')).map(function ($carouselItemEl, position) { + items.push({ + position: position, + el: $carouselItemEl, + }); + if ($carouselItemEl.getAttribute('data-carousel-item') === + 'active') { + defaultPosition = position; + } + }); + } + var indicators = []; + if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-slide-to]')).map(function ($indicatorEl) { + indicators.push({ + position: parseInt($indicatorEl.getAttribute('data-carousel-slide-to')), + el: $indicatorEl, + }); + }); + } + var carousel = new Carousel(items, { + defaultPosition: defaultPosition, + indicators: { + items: indicators, + }, + interval: interval ? interval : Default.interval, + }); + if (slide) { + carousel.cycle(); + } + // check for controls + var carouselNextEl = $carouselEl.querySelector('[data-carousel-next]'); + var carouselPrevEl = $carouselEl.querySelector('[data-carousel-prev]'); + if (carouselNextEl) { + carouselNextEl.addEventListener('click', function () { + carousel.next(); + }); + } + if (carouselPrevEl) { + carouselPrevEl.addEventListener('click', function () { + carousel.prev(); + }); + } + }); +} +exports.initCarousels = initCarousels; +if (typeof window !== 'undefined') { + window.Carousel = Carousel; + window.initCarousels = initCarousels; +} +exports["default"] = Carousel; + + +/***/ }), + +/***/ 922: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initCollapses = void 0; +var Default = { + onCollapse: function () { }, + onExpand: function () { }, + onToggle: function () { }, +}; +var Collapse = /** @class */ (function () { + function Collapse(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Collapse.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + if (this._triggerEl.hasAttribute('aria-expanded')) { + this._visible = + this._triggerEl.getAttribute('aria-expanded') === 'true'; + } + else { + // fix until v2 not to break previous single collapses which became dismiss + this._visible = !this._targetEl.classList.contains('hidden'); + } + this._triggerEl.addEventListener('click', function () { + _this.toggle(); + }); + } + }; + Collapse.prototype.collapse = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onCollapse(this); + }; + Collapse.prototype.expand = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onExpand(this); + }; + Collapse.prototype.toggle = function () { + if (this._visible) { + this.collapse(); + } + else { + this.expand(); + } + // callback function + this._options.onToggle(this); + }; + return Collapse; +}()); +function initCollapses() { + document + .querySelectorAll('[data-collapse-toggle]') + .forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-collapse-toggle'); + var $targetEl = document.getElementById(targetId); + // check if the target element exists + if ($targetEl) { + new Collapse($targetEl, $triggerEl); + } + else { + console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-collapse-toggle attribute.")); + } + }); +} +exports.initCollapses = initCollapses; +if (typeof window !== 'undefined') { + window.Collapse = Collapse; + window.initCollapses = initCollapses; +} +exports["default"] = Collapse; + + +/***/ }), + +/***/ 556: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDials = void 0; +var Default = { + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dial = /** @class */ (function () { + function Dial(parentEl, triggerEl, targetEl, options) { + if (parentEl === void 0) { parentEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._parentEl = parentEl; + this._triggerEl = triggerEl; + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Dial.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType); + triggerEventTypes.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEventTypes.hideEvents.forEach(function (ev) { + _this._parentEl.addEventListener(ev, function () { + if (!_this._parentEl.matches(':hover')) { + _this.hide(); + } + }); + }); + } + }; + Dial.prototype.hide = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Dial.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dial.prototype.toggle = function () { + if (this._visible) { + this.hide(); + } + else { + this.show(); + } + }; + Dial.prototype.isHidden = function () { + return !this._visible; + }; + Dial.prototype.isVisible = function () { + return this._visible; + }; + Dial.prototype._getTriggerEventTypes = function (triggerType) { + switch (triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + return Dial; +}()); +function initDials() { + document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) { + var $triggerEl = $parentEl.querySelector('[data-dial-toggle]'); + if ($triggerEl) { + var dialId = $triggerEl.getAttribute('data-dial-toggle'); + var $dialEl = document.getElementById(dialId); + if ($dialEl) { + var triggerType = $triggerEl.getAttribute('data-dial-trigger'); + new Dial($parentEl, $triggerEl, $dialEl, { + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?")); + } + } + else { + console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?")); + } + }); +} +exports.initDials = initDials; +if (typeof window !== 'undefined') { + window.Dial = Dial; + window.initDials = initDials; +} +exports["default"] = Dial; + + +/***/ }), + +/***/ 791: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDismisses = void 0; +var Default = { + transition: 'transition-opacity', + duration: 300, + timing: 'ease-out', + onHide: function () { }, +}; +var Dismiss = /** @class */ (function () { + function Dismiss(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Dismiss.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + this._triggerEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Dismiss.prototype.hide = function () { + var _this = this; + this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, 'opacity-0'); + setTimeout(function () { + _this._targetEl.classList.add('hidden'); + }, this._options.duration); + // callback function + this._options.onHide(this, this._targetEl); + }; + return Dismiss; +}()); +function initDismisses() { + document.querySelectorAll('[data-dismiss-target]').forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-dismiss-target'); + var $dismissEl = document.querySelector(targetId); + if ($dismissEl) { + new Dismiss($dismissEl, $triggerEl); + } + else { + console.error("The dismiss element with id \"".concat(targetId, "\" does not exist. Please check the data-dismiss-target attribute.")); + } + }); +} +exports.initDismisses = initDismisses; +if (typeof window !== 'undefined') { + window.Dismiss = Dismiss; + window.initDismisses = initDismisses; +} +exports["default"] = Dismiss; + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDrawers = void 0; +var Default = { + placement: 'left', + bodyScrolling: false, + backdrop: true, + edge: false, + edgeOffset: 'bottom-[60px]', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Drawer = /** @class */ (function () { + function Drawer(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Drawer.prototype._init = function () { + var _this = this; + // set initial accessibility attributes + if (this._targetEl) { + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.classList.add('transition-transform'); + } + // set base placement classes + this._getPlacementClasses(this._options.placement).base.map(function (c) { + _this._targetEl.classList.add(c); + }); + // add keyboard event listener to document + document.addEventListener('keydown', function (event) { + if (event.key === 'Escape') { + // if 'Escape' key is pressed + if (_this.isVisible()) { + // if the Drawer is visible + _this.hide(); // hide the Drawer + } + } + }); + }; + Drawer.prototype.hide = function () { + var _this = this; + // based on the edge option show placement classes + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + // enable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.remove('overflow-hidden'); + } + // destroy backdrop + if (this._options.backdrop) { + this._destroyBackdropEl(); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Drawer.prototype.show = function () { + var _this = this; + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + // disable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.add('overflow-hidden'); + } + // show backdrop + if (this._options.backdrop) { + this._createBackdrop(); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Drawer.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Drawer.prototype._createBackdrop = function () { + var _a; + var _this = this; + if (!this._visible) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('drawer-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + backdropEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Drawer.prototype._destroyBackdropEl = function () { + if (this._visible) { + document.querySelector('[drawer-backdrop]').remove(); + } + }; + Drawer.prototype._getPlacementClasses = function (placement) { + switch (placement) { + case 'top': + return { + base: ['top-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['-translate-y-full'], + }; + case 'right': + return { + base: ['right-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-x-full'], + }; + case 'bottom': + return { + base: ['bottom-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['translate-y-full'], + }; + case 'left': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + case 'bottom-edge': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-y-full', this._options.edgeOffset], + }; + default: + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + } + }; + Drawer.prototype.isHidden = function () { + return !this._visible; + }; + Drawer.prototype.isVisible = function () { + return this._visible; + }; + return Drawer; +}()); +var getDrawerInstance = function (id, instances) { + if (instances.some(function (drawerInstance) { return drawerInstance.id === id; })) { + return instances.find(function (drawerInstance) { return drawerInstance.id === id; }); + } +}; +function initDrawers() { + var drawerInstances = []; + document.querySelectorAll('[data-drawer-target]').forEach(function ($triggerEl) { + // mandatory + var drawerId = $triggerEl.getAttribute('data-drawer-target'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + // optional + var placement = $triggerEl.getAttribute('data-drawer-placement'); + var bodyScrolling = $triggerEl.getAttribute('data-drawer-body-scrolling'); + var backdrop = $triggerEl.getAttribute('data-drawer-backdrop'); + var edge = $triggerEl.getAttribute('data-drawer-edge'); + var edgeOffset = $triggerEl.getAttribute('data-drawer-edge-offset'); + if (!getDrawerInstance(drawerId, drawerInstances)) { + drawerInstances.push({ + id: drawerId, + object: new Drawer($drawerEl, { + placement: placement ? placement : Default.placement, + bodyScrolling: bodyScrolling + ? bodyScrolling === 'true' + ? true + : false + : Default.bodyScrolling, + backdrop: backdrop + ? backdrop === 'true' + ? true + : false + : Default.backdrop, + edge: edge + ? edge === 'true' + ? true + : false + : Default.edge, + edgeOffset: edgeOffset + ? edgeOffset + : Default.edgeOffset, + }), + }); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document.querySelectorAll('[data-drawer-toggle]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-toggle'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_1 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_1) { + $triggerEl.addEventListener('click', function () { + drawer_1.object.toggle(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document + .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]') + .forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-dismiss') + ? $triggerEl.getAttribute('data-drawer-dismiss') + : $triggerEl.getAttribute('data-drawer-hide'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_2 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_2) { + $triggerEl.addEventListener('click', function () { + drawer_2.object.hide(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id")); + } + }); + document.querySelectorAll('[data-drawer-show]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-show'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_3 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_3) { + $triggerEl.addEventListener('click', function () { + drawer_3.object.show(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); +} +exports.initDrawers = initDrawers; +if (typeof window !== 'undefined') { + window.Drawer = Drawer; + window.initDrawers = initDrawers; +} +exports["default"] = Drawer; + + +/***/ }), + +/***/ 316: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initDropdowns = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'bottom', + triggerType: 'click', + offsetSkidding: 0, + offsetDistance: 10, + delay: 300, + ignoreClickOutsideClass: false, + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dropdown = /** @class */ (function () { + function Dropdown(targetElement, triggerElement, options) { + if (targetElement === void 0) { targetElement = null; } + if (triggerElement === void 0) { triggerElement = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetElement; + this._triggerEl = triggerElement; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Dropdown.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Dropdown.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + // click event handling for trigger element + if (this._options.triggerType === 'click') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.toggle(); + }); + }); + } + // hover event handling for trigger element + if (this._options.triggerType === 'hover') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + if (ev === 'click') { + _this.toggle(); + } + else { + setTimeout(function () { + _this.show(); + }, _this._options.delay); + } + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + }); + } + }; + Dropdown.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [ + this._options.offsetSkidding, + this._options.offsetDistance, + ], + }, + }, + ], + }); + }; + Dropdown.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + // Ignore clicks on the trigger element (ie. a datepicker input) + var ignoreClickOutsideClass = this._options.ignoreClickOutsideClass; + var isIgnored = false; + if (ignoreClickOutsideClass) { + var ignoredClickOutsideEls = document.querySelectorAll(".".concat(ignoreClickOutsideClass)); + ignoredClickOutsideEls.forEach(function (el) { + if (el.contains(clickedEl)) { + isIgnored = true; + return; + } + }); + } + // Ignore clicks on the target element (ie. dropdown itself) + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + !isIgnored && + this.isVisible()) { + this.hide(); + } + }; + Dropdown.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'click'], + hideEvents: ['mouseleave'], + }; + case 'click': + return { + showEvents: ['click'], + hideEvents: [], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['click'], + hideEvents: [], + }; + } + }; + Dropdown.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Dropdown.prototype.isVisible = function () { + return this._visible; + }; + Dropdown.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + this._targetEl.classList.add('block'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + this._setupClickOutsideListener(); + // Update its position + this._popperInstance.update(); + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dropdown.prototype.hide = function () { + this._targetEl.classList.remove('block'); + this._targetEl.classList.add('hidden'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + this._visible = false; + this._removeClickOutsideListener(); + // callback function + this._options.onHide(this); + }; + return Dropdown; +}()); +function initDropdowns() { + document + .querySelectorAll('[data-dropdown-toggle]') + .forEach(function ($triggerEl) { + var dropdownId = $triggerEl.getAttribute('data-dropdown-toggle'); + var $dropdownEl = document.getElementById(dropdownId); + if ($dropdownEl) { + var placement = $triggerEl.getAttribute('data-dropdown-placement'); + var offsetSkidding = $triggerEl.getAttribute('data-dropdown-offset-skidding'); + var offsetDistance = $triggerEl.getAttribute('data-dropdown-offset-distance'); + var triggerType = $triggerEl.getAttribute('data-dropdown-trigger'); + var delay = $triggerEl.getAttribute('data-dropdown-delay'); + var ignoreClickOutsideClass = $triggerEl.getAttribute('data-dropdown-ignore-click-outside-class'); + new Dropdown($dropdownEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + offsetSkidding: offsetSkidding + ? parseInt(offsetSkidding) + : Default.offsetSkidding, + offsetDistance: offsetDistance + ? parseInt(offsetDistance) + : Default.offsetDistance, + delay: delay ? parseInt(delay) : Default.delay, + ignoreClickOutsideClass: ignoreClickOutsideClass + ? ignoreClickOutsideClass + : Default.ignoreClickOutsideClass, + }); + } + else { + console.error("The dropdown element with id \"".concat(dropdownId, "\" does not exist. Please check the data-dropdown-toggle attribute.")); + } + }); +} +exports.initDropdowns = initDropdowns; +if (typeof window !== 'undefined') { + window.Dropdown = Dropdown; + window.initDropdowns = initDropdowns; +} +exports["default"] = Dropdown; + + +/***/ }), + +/***/ 311: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initFlowbite = void 0; +var accordion_1 = __webpack_require__(902); +var carousel_1 = __webpack_require__(33); +var collapse_1 = __webpack_require__(922); +var dial_1 = __webpack_require__(556); +var dismiss_1 = __webpack_require__(791); +var drawer_1 = __webpack_require__(340); +var dropdown_1 = __webpack_require__(316); +var modal_1 = __webpack_require__(16); +var popover_1 = __webpack_require__(903); +var tabs_1 = __webpack_require__(247); +var tooltip_1 = __webpack_require__(671); +function initFlowbite() { + (0, accordion_1.initAccordions)(); + (0, collapse_1.initCollapses)(); + (0, carousel_1.initCarousels)(); + (0, dismiss_1.initDismisses)(); + (0, dropdown_1.initDropdowns)(); + (0, modal_1.initModals)(); + (0, drawer_1.initDrawers)(); + (0, tabs_1.initTabs)(); + (0, tooltip_1.initTooltips)(); + (0, popover_1.initPopovers)(); + (0, dial_1.initDials)(); +} +exports.initFlowbite = initFlowbite; +if (typeof window !== 'undefined') { + window.initFlowbite = initFlowbite; +} + + +/***/ }), + +/***/ 16: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initModals = void 0; +var Default = { + placement: 'center', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', + backdrop: 'dynamic', + closable: true, + onHide: function () { }, + onShow: function () { }, + onToggle: function () { }, +}; +var Modal = /** @class */ (function () { + function Modal(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._isHidden = true; + this._backdropEl = null; + this._init(); + } + Modal.prototype._init = function () { + var _this = this; + if (this._targetEl) { + this._getPlacementClasses().map(function (c) { + _this._targetEl.classList.add(c); + }); + } + }; + Modal.prototype._createBackdrop = function () { + var _a; + if (this._isHidden) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('modal-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + this._backdropEl = backdropEl; + } + }; + Modal.prototype._destroyBackdropEl = function () { + if (!this._isHidden) { + document.querySelector('[modal-backdrop]').remove(); + } + }; + Modal.prototype._setupModalCloseEventListeners = function () { + var _this = this; + if (this._options.backdrop === 'dynamic') { + this._clickOutsideEventListener = function (ev) { + _this._handleOutsideClick(ev.target); + }; + this._targetEl.addEventListener('click', this._clickOutsideEventListener, true); + } + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._removeModalCloseEventListeners = function () { + if (this._options.backdrop === 'dynamic') { + this._targetEl.removeEventListener('click', this._clickOutsideEventListener, true); + } + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._handleOutsideClick = function (target) { + if (target === this._targetEl || + (target === this._backdropEl && this.isVisible())) { + this.hide(); + } + }; + Modal.prototype._getPlacementClasses = function () { + switch (this._options.placement) { + // top + case 'top-left': + return ['justify-start', 'items-start']; + case 'top-center': + return ['justify-center', 'items-start']; + case 'top-right': + return ['justify-end', 'items-start']; + // center + case 'center-left': + return ['justify-start', 'items-center']; + case 'center': + return ['justify-center', 'items-center']; + case 'center-right': + return ['justify-end', 'items-center']; + // bottom + case 'bottom-left': + return ['justify-start', 'items-end']; + case 'bottom-center': + return ['justify-center', 'items-end']; + case 'bottom-right': + return ['justify-end', 'items-end']; + default: + return ['justify-center', 'items-center']; + } + }; + Modal.prototype.toggle = function () { + if (this._isHidden) { + this.show(); + } + else { + this.hide(); + } + // callback function + this._options.onToggle(this); + }; + Modal.prototype.show = function () { + if (this.isHidden) { + this._targetEl.classList.add('flex'); + this._targetEl.classList.remove('hidden'); + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + this._createBackdrop(); + this._isHidden = false; + // prevent body scroll + document.body.classList.add('overflow-hidden'); + // Add keyboard event listener to the document + if (this._options.closable) { + this._setupModalCloseEventListeners(); + } + // callback function + this._options.onShow(this); + } + }; + Modal.prototype.hide = function () { + if (this.isVisible) { + this._targetEl.classList.add('hidden'); + this._targetEl.classList.remove('flex'); + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + this._destroyBackdropEl(); + this._isHidden = true; + // re-apply body scroll + document.body.classList.remove('overflow-hidden'); + if (this._options.closable) { + this._removeModalCloseEventListeners(); + } + // callback function + this._options.onHide(this); + } + }; + Modal.prototype.isVisible = function () { + return !this._isHidden; + }; + Modal.prototype.isHidden = function () { + return this._isHidden; + }; + return Modal; +}()); +var getModalInstance = function (id, instances) { + if (instances.some(function (modalInstance) { return modalInstance.id === id; })) { + return instances.find(function (modalInstance) { return modalInstance.id === id; }); + } + return null; +}; +function initModals() { + var modalInstances = []; + // initiate modal based on data-modal-target + document.querySelectorAll('[data-modal-target]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-target'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + if (!getModalInstance(modalId, modalInstances)) { + modalInstances.push({ + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.")); + } + }); + // support pre v1.6.0 data-modal-toggle initialization + document.querySelectorAll('[data-modal-toggle]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-toggle'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + var modal_1 = getModalInstance(modalId, modalInstances); + if (!modal_1) { + modal_1 = { + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }; + modalInstances.push(modal_1); + } + $triggerEl.addEventListener('click', function () { + modal_1.object.toggle(); + }); + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?")); + } + }); + // show modal on click if exists based on id + document.querySelectorAll('[data-modal-show]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-show'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_2 = getModalInstance(modalId, modalInstances); + if (modal_2) { + $triggerEl.addEventListener('click', function () { + if (modal_2.object.isHidden) { + modal_2.object.show(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?")); + } + }); + // hide modal on click if exists based on id + document.querySelectorAll('[data-modal-hide]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-hide'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_3 = getModalInstance(modalId, modalInstances); + if (modal_3) { + $triggerEl.addEventListener('click', function () { + if (modal_3.object.isVisible) { + modal_3.object.hide(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?")); + } + }); +} +exports.initModals = initModals; +if (typeof window !== 'undefined') { + window.Modal = Modal; + window.initModals = initModals; +} +exports["default"] = Modal; + + +/***/ }), + +/***/ 903: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initPopovers = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'top', + offset: 10, + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Popover = /** @class */ (function () { + function Popover(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Popover.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Popover.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + }); + }; + Popover.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, this._options.offset], + }, + }, + ], + }); + }; + Popover.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Popover.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Popover.prototype.isVisible = function () { + return this._visible; + }; + Popover.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Popover.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility to true + this._visible = true; + // callback function + this._options.onShow(this); + }; + Popover.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility to false + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Popover; +}()); +function initPopovers() { + document.querySelectorAll('[data-popover-target]').forEach(function ($triggerEl) { + var popoverID = $triggerEl.getAttribute('data-popover-target'); + var $popoverEl = document.getElementById(popoverID); + if ($popoverEl) { + var triggerType = $triggerEl.getAttribute('data-popover-trigger'); + var placement = $triggerEl.getAttribute('data-popover-placement'); + var offset = $triggerEl.getAttribute('data-popover-offset'); + new Popover($popoverEl, $triggerEl, { + placement: placement ? placement : Default.placement, + offset: offset ? parseInt(offset) : Default.offset, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The popover element with id \"".concat(popoverID, "\" does not exist. Please check the data-popover-target attribute.")); + } + }); +} +exports.initPopovers = initPopovers; +if (typeof window !== 'undefined') { + window.Popover = Popover; + window.initPopovers = initPopovers; +} +exports["default"] = Popover; + + +/***/ }), + +/***/ 247: +/***/ (function(__unused_webpack_module, exports) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initTabs = void 0; +var Default = { + defaultTabId: null, + activeClasses: 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500', + inactiveClasses: 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300', + onShow: function () { }, +}; +var Tabs = /** @class */ (function () { + function Tabs(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._activeTab = options ? this.getTab(options.defaultTabId) : null; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Tabs.prototype._init = function () { + var _this = this; + if (this._items.length) { + // set the first tab as active if not set by explicitly + if (!this._activeTab) { + this._setActiveTab(this._items[0]); + } + // force show the first default tab + this.show(this._activeTab.id, true); + // show tab content based on click + this._items.map(function (tab) { + tab.triggerEl.addEventListener('click', function () { + _this.show(tab.id); + }); + }); + } + }; + Tabs.prototype.getActiveTab = function () { + return this._activeTab; + }; + Tabs.prototype._setActiveTab = function (tab) { + this._activeTab = tab; + }; + Tabs.prototype.getTab = function (id) { + return this._items.filter(function (t) { return t.id === id; })[0]; + }; + Tabs.prototype.show = function (id, forceShow) { + var _a, _b; + var _this = this; + if (forceShow === void 0) { forceShow = false; } + var tab = this.getTab(id); + // don't do anything if already active + if (tab === this._activeTab && !forceShow) { + return; + } + // hide other tabs + this._items.map(function (t) { + var _a, _b; + if (t !== tab) { + (_a = t.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = t.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + t.targetEl.classList.add('hidden'); + t.triggerEl.setAttribute('aria-selected', 'false'); + } + }); + // show active tab + (_a = tab.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = tab.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + tab.triggerEl.setAttribute('aria-selected', 'true'); + tab.targetEl.classList.remove('hidden'); + this._setActiveTab(tab); + // callback function + this._options.onShow(this, tab); + }; + return Tabs; +}()); +function initTabs() { + document.querySelectorAll('[data-tabs-toggle]').forEach(function ($triggerEl) { + var tabItems = []; + var defaultTabId = null; + $triggerEl + .querySelectorAll('[role="tab"]') + .forEach(function ($triggerEl) { + var isActive = $triggerEl.getAttribute('aria-selected') === 'true'; + var tab = { + id: $triggerEl.getAttribute('data-tabs-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-tabs-target')), + }; + tabItems.push(tab); + if (isActive) { + defaultTabId = tab.id; + } + }); + new Tabs(tabItems, { + defaultTabId: defaultTabId, + }); + }); +} +exports.initTabs = initTabs; +if (typeof window !== 'undefined') { + window.Tabs = Tabs; + window.initTabs = initTabs; +} +exports["default"] = Tabs; + + +/***/ }), + +/***/ 671: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.initTooltips = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = __webpack_require__(853); +var Default = { + placement: 'top', + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Tooltip = /** @class */ (function () { + function Tooltip(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Tooltip.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Tooltip.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.hide(); + }); + }); + }; + Tooltip.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, 8], + }, + }, + ], + }); + }; + Tooltip.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Tooltip.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Tooltip.prototype.isVisible = function () { + return this._visible; + }; + Tooltip.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Tooltip.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility + this._visible = true; + // callback function + this._options.onShow(this); + }; + Tooltip.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Tooltip; +}()); +function initTooltips() { + document.querySelectorAll('[data-tooltip-target]').forEach(function ($triggerEl) { + var tooltipId = $triggerEl.getAttribute('data-tooltip-target'); + var $tooltipEl = document.getElementById(tooltipId); + if ($tooltipEl) { + var triggerType = $triggerEl.getAttribute('data-tooltip-trigger'); + var placement = $triggerEl.getAttribute('data-tooltip-placement'); + new Tooltip($tooltipEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The tooltip element with id \"".concat(tooltipId, "\" does not exist. Please check the data-tooltip-target attribute.")); + } + }); +} +exports.initTooltips = initTooltips; +if (typeof window !== 'undefined') { + window.Tooltip = Tooltip; + window.initTooltips = initTooltips; +} +exports["default"] = Tooltip; + + +/***/ }), + +/***/ 947: +/***/ (function(__unused_webpack_module, exports) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Events = /** @class */ (function () { + function Events(eventType, eventFunctions) { + if (eventFunctions === void 0) { eventFunctions = []; } + this._eventType = eventType; + this._eventFunctions = eventFunctions; + } + Events.prototype.init = function () { + var _this = this; + this._eventFunctions.forEach(function (eventFunction) { + if (typeof window !== 'undefined') { + window.addEventListener(_this._eventType, eventFunction); + } + }); + }; + return Events; +}()); +exports["default"] = Events; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +!function() { +var exports = __webpack_exports__; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +// core components +var accordion_1 = __webpack_require__(902); +var carousel_1 = __webpack_require__(33); +var collapse_1 = __webpack_require__(922); +var dial_1 = __webpack_require__(556); +var dismiss_1 = __webpack_require__(791); +var drawer_1 = __webpack_require__(340); +var dropdown_1 = __webpack_require__(316); +var modal_1 = __webpack_require__(16); +var popover_1 = __webpack_require__(903); +var tabs_1 = __webpack_require__(247); +var tooltip_1 = __webpack_require__(671); +__webpack_require__(311); +var events_1 = __webpack_require__(947); +var turboLoadEvents = new events_1.default('turbo:load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +turboLoadEvents.init(); +var turboFrameLoadEvents = new events_1.default('turbo:frame-load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +turboFrameLoadEvents.init(); +exports["default"] = { + Accordion: accordion_1.default, + Carousel: carousel_1.default, + Collapse: collapse_1.default, + Dial: dial_1.default, + Drawer: drawer_1.default, + Dismiss: dismiss_1.default, + Dropdown: dropdown_1.default, + Modal: modal_1.default, + Popover: popover_1.default, + Tabs: tabs_1.default, + Tooltip: tooltip_1.default, + Events: events_1.default, +}; + +}(); +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=flowbite.turbo.js.map \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.turbo.js.map b/node_modules/flowbite/dist/flowbite.turbo.js.map new file mode 100644 index 0000000..1d25895 --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.turbo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"flowbite.turbo.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVO,IAAI,SAAG;AACP;AACA;AACA;AACA;AACA,sBAAsB,SAAG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA,CAAC;AACM,IAAI,gBAAU;AACrB;AACA,CAAC,OAAO;;AAED;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;;AC9BQ;AACf;AACA;;ACFe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;ACXuC;;AAEvC;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;;;ACpBsD;AACK,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC,SAAS,aAAa,cAAc,WAAW;AAC/C;AACA,MAAM;AACN;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uHAAuH;;AAEvH;AACA;AACA;AACA,OAAO,IAAI,GAAG;;AAEd,WAAW,aAAa,cAAc,WAAW;AACjD;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,EAAE;;;AAGF,0DAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;ACnFkC;AACpB;AACf;AACA;;ACHO,IAAI,QAAG;AACP,IAAI,QAAG;AACP;;ACFQ;AACf;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;ACVgD;AACjC;AACf,gDAAgD,WAAW;AAC3D;;ACH2D;AAClB;AACF;AACc;AACtC;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,aAAa;AACnC,uCAAuC,KAAK;AAC5C,wCAAwC,KAAK;AAC7C;;AAEA,aAAa,SAAS,YAAY,SAAS;AAC3C;;AAEA,0BAA0B,gBAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxC+D,CAAC;AAChE;;AAEe;AACf,mBAAmB,qBAAqB,WAAW;AACnD;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxB+C;AAChC;AACf,2DAA2D;;AAE3D;AACA;AACA,IAAI;AACJ,uBAAuB,YAAY;AACnC;;AAEA;AACA;AACA;AACA,UAAU;;;AAGV;AACA,QAAQ;AACR,MAAM;;;AAGN;AACA;;ACtBuC;AACxB;AACf,SAAS,SAAS;AAClB;;ACH2C;AAC5B;AACf,uCAAuC,WAAW;AAClD;;ACH4C;AAC7B;AACf;AACA,WAAW,SAAS;AACpB;AACA;;ACL2C;AACc;AACV;AAChC;AACf,MAAM,WAAW;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,YAAY;AAChB;AACA,IAAI,kBAAkB;;AAEtB;AACA;;AClBuC;AACI;AACU;AACS;AACb;AACF;AACC;;AAEhD;AACA,OAAO,aAAa;AACpB,EAAE,gBAAgB;AAClB;AACA;;AAEA;AACA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2BAQ1C;;AAEH;AACA,eAAe,gBAAgB;AAC/B,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,mDAAmD;AAC7F;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,yCAAyC,kDAAkD;AAC3F;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,4CAA4C;AAC5C;AACA,GAAG;AACH,EAAE;;;AAGF,4DAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACpLiD,CAAC;;AAEnD;AACA;AACA;;AAEA,SAAS,qBAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA,sBAAsB;AACtB,UAAU,qBAAM;AAChB;AACA,CAAC;;AChDD;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA,GAAG;AACH;;ACVA,IAAI,kCAAI;AACR;AACA;AACA;AACe;AACf;AACA,WAAW,kCAAI;AACf,GAAG;AACH;;ACRuC;AACxB;AACf,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;ACT+D;AACN;AACN;AACpC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,kBAAkB,kBAAkB,eAAe;AAClF;;ACZuC;AACkB;AACE;AACN;AACtC;AACf,YAAY,SAAS;AACrB,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,gBAAgB;;AAEzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;AACA;;AC9ByD;AACJ;AACM;AACR;AACZ,CAAC;AACxC;;AAEe;AACf;;AAEA,aAAa,kBAAkB;AAC/B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AAG;AACtB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;ACrEqD;AACR;AACwB;AACF;AACpD;AACf;AACA;AACA;AACA,kCAAkC,gBAAgB;AAClD,8BAA8B,YAAY;AAC1C;AACA;AACA;;AAEA;AACA,SAAS,SAAG;AACZ;AACA;AACA;AACA;AACA;;AAEA,SAAS,MAAM;AACf;AACA;AACA;AACA;AACA;;AAEA,SAAS,KAAK;AACd;AACA;AACA;AACA;AACA;;AAEA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,wBAAwB;;AAEzD;AACA;;AAEA;AACA,WAAW,KAAK;AAChB;AACA;;AAEA,WAAW,GAAG;AACd;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;ACrE8D;AACM;AACM;AACzB;AACI;AAC0D;AACxD;AACE;AACN,CAAC;;AAErC;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D;AACA,wDAAwD,QAAQ;AAChE;AACA,0DAA0D,MAAM;AAChE;AACA;AACA;AACA;AACA,sBAAsB,kBAAkB,yCAAyC,eAAe,UAAU,cAAc;AACxH,sCAAsC,MAAM,GAAG,SAAS,GAAG,MAAM;AACjE;AACA;AACA,2BAA2B,eAAe,CAAC,SAAS,gDAAgD,kBAAkB;AACtH,4BAA4B,qBAAqB;AACjD,sBAAsB,cAAc;AACpC;AACA;AACA;AACA;AACA,GAAG;AACH,yBAAyB,gBAAgB,iBAAiB;AAC1D,6CAA6C,MAAM,2CAA2C;AAC9F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;;AAE/C,yBAAyB,MAAM;AAC/B;AACA;AACA,sBAAsB,KAAK,EAAE,MAAM;AACnC,kBAAkB,SAAG,EAAE,MAAM;AAC7B;AACA,KAAK;AACL;;AAEA;AACA;;AChE6C;AACkD;AAC9C;AACI;AACtC;AACf;AACA;AACA;;AAEA;AACA;A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A;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,QAAQ;AAC1C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AClJsD;AACC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,SAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI;AAClC;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA,GAAG;AACH,0BAA0B,cAAc;AACxC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,GAAG;AACH,EAAE;;;AAGF,mDAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;AC5D2D;AACD,CAAC;;AAErD;AACP,sBAAsB,gBAAgB;AACtC,wBAAwB,IAAI,EAAE,SAAG;;AAEjC,mEAAmE;AACnE;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,UAAU,IAAI,EAAE,KAAK;AACrB;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAiB;AAC9B;AACA;AACA,GAAG,IAAI;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,EAAE;;;AAGF,qDAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACrDuD;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;;AAGF,4DAAe;AACf;AACA;AACA;AACA;AACA;AACA,CAAC;;ACxBc;AACf;AACA;;ACF8D;AACF;AACgB;A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D,WAAW,eAAe;AAC1B,IAAI;AACJ,WAAW,oBAAoB;AAC/B;AACA;;ACV+D;AAChB;AACJ;AACK;AACW;AACF;AACR;AACR;;AAEzC;AACA;AACA,eAAe,KAAK;AACpB,eAAe,KAAK;AACpB;AACA,EAAE;AACF;;;AAGe;AACf;AACA;AACA;;AAEA,gCAAgC,aAAa;AAC7C,6BAA6B,aAAa;AAC1C,wBAAwB,kBAAkB;AAC1C,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,WAAW;AACnB,IAAI,cAAc;AAClB,eAAe,aAAa;AAC5B;;AAEA,QAAQ,aAAa;AACrB,gBAAgB,qBAAqB;AACrC;AACA;AACA,MAAM;AACN,kBAAkB,mBAAmB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzD6C,CAAC;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,GAAG;;AAEN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEe;AACf;AACA,2CAA2C;;AAE3C,SAAS,qBAAqB;AAC9B;AACA;AACA,KAAK;AACL,GAAG;AACH;;AC3Ce;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;;ACde;AACf;AACA;AACA,sDAAsD;AACtD,+BAA+B;AAC/B,4BAA4B;AAC5B,KAAK;AACL;AACA,GAAG,IAAI,GAAG;;AAEV;AACA;AACA,GAAG;AACH;;ACb+D;AACN;AACQ;AACJ;AACE;AACR;AACZ;AACkB;AAClB;AACgB;AACV;AACM;AACD;AACpB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE,aAAa;AACnF;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B,uBAAuB;AACvB;AACA;AACA;AACA,OAAO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,qBAAqB,SAAS,cAAc,iBAAiB,yCAAyC,iBAAiB;AACvH,kBAAkB,iBAAiB;AACnC,WAAW;AACX;;AAEA,+BAA+B,cAAc,CAAC,WAAW,yDAAyD;;AAElH;AACA;AACA,SAAS,GAAG;AACZ;;AAEA,YAAY,KAAqC,EAAE,qGA+B1C;;AAET;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA,cAAc,KAAqC,EAAE,EAE1C;;AAEX;AACA,UAAU;;;AAGV;AACA,qBAAqB,gBAAgB,YAAY,eAAe;AAChE,kBAAkB,aAAa;AAC/B,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA;AACA,6CAA6C,KAAK;;AAElD;AACA,sEAAsE;AACtE,SAAS;AACT;;AAEA,4BAA4B,uCAAuC;AACnE,cAAc,KAAqC,EAAE,EAO1C;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gEAAgE;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,KAAqC,EAAE,EAE1C;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;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a;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,eAAe,CAAC,IAAI,EAAE,CAAC;AAEvB,IAAM,oBAAoB,GAAG,IAAI,gBAAM,CAAC,kBAAkB,EAAE;IACxD,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,oBAAoB,CAAC,IAAI,EAAE,CAAC;AAE5B,qBAAe;IACX,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;IACL,OAAO;IACP,IAAI;IACJ,OAAO;IACP,MAAM;CACT,CAAC","sources":["webpack:///webpack/universalModuleDefinition","webpack:///./node_modules/@popperjs/core/lib/enums.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack:///./node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/math.js","webpack:///./node_modules/@popperjs/core/lib/utils/userAgent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack:///./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/within.js","webpack:///./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack:///./node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack:///./node_modules/@popperjs/core/lib/utils/getVariation.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack:///./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack:///./node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack:///./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/flip.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/hide.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/offset.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack:///./node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack:///./node_modules/@popperjs/core/lib/modifiers/index.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack:///./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack:///./node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack:///./node_modules/@popperjs/core/lib/utils/debounce.js","webpack:///./node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack:///./node_modules/@popperjs/core/lib/createPopper.js","webpack:///./node_modules/@popperjs/core/lib/popper.js","webpack:///./node_modules/@popperjs/core/lib/popper-lite.js","webpack:///./node_modules/@popperjs/core/lib/index.js","webpack:///./src/components/accordion/index.ts","webpack:///./src/components/carousel/index.ts","webpack:///./src/components/collapse/index.ts","webpack:///./src/components/dial/index.ts","webpack:///./src/components/dismiss/index.ts","webpack:///./src/components/drawer/index.ts","webpack:///./src/components/dropdown/index.ts","webpack:///./src/components/index.ts","webpack:///./src/components/modal/index.ts","webpack:///./src/components/popover/index.ts","webpack:///./src/components/tabs/index.ts","webpack:///./src/components/tooltip/index.ts","webpack:///./src/dom/events.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/index.turbo.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Flowbite\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Flowbite\"] = factory();\n\telse\n\t\troot[\"Flowbite\"] = factory();\n})(self, function() {\nreturn ","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export { default as applyStyles } from \"./applyStyles.js\";\nexport { default as arrow } from \"./arrow.js\";\nexport { default as computeStyles } from \"./computeStyles.js\";\nexport { default as eventListeners } from \"./eventListeners.js\";\nexport { default as flip } from \"./flip.js\";\nexport { default as hide } from \"./hide.js\";\nexport { default as offset } from \"./offset.js\";\nexport { default as popperOffsets } from \"./popperOffsets.js\";\nexport { default as preventOverflow } from \"./preventOverflow.js\";","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","export * from \"./enums.js\";\nexport * from \"./modifiers/index.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { popperGenerator, detectOverflow, createPopper as createPopperBase } from \"./createPopper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper } from \"./popper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\";","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { AccordionItem, AccordionOptions } from './types';\nimport { AccordionInterface } from './interface';\n\nconst Default: AccordionOptions = {\n alwaysOpen: false,\n activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',\n inactiveClasses: 'text-gray-500 dark:text-gray-400',\n onOpen: () => {},\n onClose: () => {},\n onToggle: () => {},\n};\n\nclass Accordion implements AccordionInterface {\n _items: AccordionItem[];\n _options: AccordionOptions;\n\n constructor(\n items: AccordionItem[] = [],\n options: AccordionOptions = Default\n ) {\n this._items = items;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n private _init() {\n if (this._items.length) {\n // show accordion item based on click\n this._items.map((item) => {\n if (item.active) {\n this.open(item.id);\n }\n\n item.triggerEl.addEventListener('click', () => {\n this.toggle(item.id);\n });\n });\n }\n }\n\n getItem(id: string) {\n return this._items.filter((item) => item.id === id)[0];\n }\n\n open(id: string) {\n const item = this.getItem(id);\n\n // don't hide other accordions if always open\n if (!this._options.alwaysOpen) {\n this._items.map((i) => {\n if (i !== item) {\n i.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n i.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n i.targetEl.classList.add('hidden');\n i.triggerEl.setAttribute('aria-expanded', 'false');\n i.active = false;\n\n // rotate icon if set\n if (i.iconEl) {\n i.iconEl.classList.remove('rotate-180');\n }\n }\n });\n }\n\n // show active item\n item.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n item.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n item.triggerEl.setAttribute('aria-expanded', 'true');\n item.targetEl.classList.remove('hidden');\n item.active = true;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.add('rotate-180');\n }\n\n // callback function\n this._options.onOpen(this, item);\n }\n\n toggle(id: string) {\n const item = this.getItem(id);\n\n if (item.active) {\n this.close(id);\n } else {\n this.open(id);\n }\n\n // callback function\n this._options.onToggle(this, item);\n }\n\n close(id: string) {\n const item = this.getItem(id);\n\n item.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n item.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n item.targetEl.classList.add('hidden');\n item.triggerEl.setAttribute('aria-expanded', 'false');\n item.active = false;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.remove('rotate-180');\n }\n\n // callback function\n this._options.onClose(this, item);\n }\n}\n\nexport function initAccordions() {\n document.querySelectorAll('[data-accordion]').forEach(($accordionEl) => {\n const alwaysOpen = $accordionEl.getAttribute('data-accordion');\n const activeClasses = $accordionEl.getAttribute('data-active-classes');\n const inactiveClasses = $accordionEl.getAttribute(\n 'data-inactive-classes'\n );\n\n const items = [] as AccordionItem[];\n $accordionEl\n .querySelectorAll('[data-accordion-target]')\n .forEach(($triggerEl) => {\n // Consider only items that directly belong to $accordionEl\n // (to make nested accordions work).\n if ($triggerEl.closest('[data-accordion]') === $accordionEl) {\n const item = {\n id: $triggerEl.getAttribute('data-accordion-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-accordion-target')\n ),\n iconEl: $triggerEl.querySelector(\n '[data-accordion-icon]'\n ),\n active:\n $triggerEl.getAttribute('aria-expanded') === 'true'\n ? true\n : false,\n } as AccordionItem;\n items.push(item);\n }\n });\n\n new Accordion(items, {\n alwaysOpen: alwaysOpen === 'open' ? true : false,\n activeClasses: activeClasses\n ? activeClasses\n : Default.activeClasses,\n inactiveClasses: inactiveClasses\n ? inactiveClasses\n : Default.inactiveClasses,\n } as AccordionOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Accordion = Accordion;\n window.initAccordions = initAccordions;\n}\n\nexport default Accordion;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {\n CarouselOptions,\n CarouselItem,\n IndicatorItem,\n RotationItems,\n} from './types';\nimport { CarouselInterface } from './interface';\n\nconst Default: CarouselOptions = {\n defaultPosition: 0,\n indicators: {\n items: [],\n activeClasses: 'bg-white dark:bg-gray-800',\n inactiveClasses:\n 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',\n },\n interval: 3000,\n onNext: () => {},\n onPrev: () => {},\n onChange: () => {},\n};\n\nclass Carousel implements CarouselInterface {\n _items: CarouselItem[];\n _indicators: IndicatorItem[];\n _activeItem: CarouselItem;\n _intervalDuration: number;\n _intervalInstance: number;\n _options: CarouselOptions;\n\n constructor(\n items: CarouselItem[] = [],\n options: CarouselOptions = Default\n ) {\n this._items = items;\n this._options = {\n ...Default,\n ...options,\n indicators: { ...Default.indicators, ...options.indicators },\n };\n this._activeItem = this.getItem(this._options.defaultPosition);\n this._indicators = this._options.indicators.items;\n this._intervalDuration = this._options.interval;\n this._intervalInstance = null;\n this._init();\n }\n\n /**\n * initialize carousel and items based on active one\n */\n _init() {\n this._items.map((item: CarouselItem) => {\n item.el.classList.add(\n 'absolute',\n 'inset-0',\n 'transition-transform',\n 'transform'\n );\n });\n\n // if no active item is set then first position is default\n if (this._getActiveItem()) {\n this.slideTo(this._getActiveItem().position);\n } else {\n this.slideTo(0);\n }\n\n this._indicators.map((indicator, position) => {\n indicator.el.addEventListener('click', () => {\n this.slideTo(position);\n });\n });\n }\n\n getItem(position: number) {\n return this._items[position];\n }\n\n /**\n * Slide to the element based on id\n * @param {*} position\n */\n slideTo(position: number) {\n const nextItem: CarouselItem = this._items[position];\n const rotationItems: RotationItems = {\n left:\n nextItem.position === 0\n ? this._items[this._items.length - 1]\n : this._items[nextItem.position - 1],\n middle: nextItem,\n right:\n nextItem.position === this._items.length - 1\n ? this._items[0]\n : this._items[nextItem.position + 1],\n };\n this._rotate(rotationItems);\n this._setActiveItem(nextItem);\n if (this._intervalInstance) {\n this.pause();\n this.cycle();\n }\n\n this._options.onChange(this);\n }\n\n /**\n * Based on the currently active item it will go to the next position\n */\n next() {\n const activeItem = this._getActiveItem();\n let nextItem = null;\n\n // check if last item\n if (activeItem.position === this._items.length - 1) {\n nextItem = this._items[0];\n } else {\n nextItem = this._items[activeItem.position + 1];\n }\n\n this.slideTo(nextItem.position);\n\n // callback function\n this._options.onNext(this);\n }\n\n /**\n * Based on the currently active item it will go to the previous position\n */\n prev() {\n const activeItem = this._getActiveItem();\n let prevItem = null;\n\n // check if first item\n if (activeItem.position === 0) {\n prevItem = this._items[this._items.length - 1];\n } else {\n prevItem = this._items[activeItem.position - 1];\n }\n\n this.slideTo(prevItem.position);\n\n // callback function\n this._options.onPrev(this);\n }\n\n /**\n * This method applies the transform classes based on the left, middle, and right rotation carousel items\n * @param {*} rotationItems\n */\n _rotate(rotationItems: RotationItems) {\n // reset\n this._items.map((item: CarouselItem) => {\n item.el.classList.add('hidden');\n });\n\n // left item (previously active)\n rotationItems.left.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.left.el.classList.add('-translate-x-full', 'z-10');\n\n // currently active item\n rotationItems.middle.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-10'\n );\n rotationItems.middle.el.classList.add('translate-x-0', 'z-20');\n\n // right item (upcoming active)\n rotationItems.right.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.right.el.classList.add('translate-x-full', 'z-10');\n }\n\n /**\n * Set an interval to cycle through the carousel items\n */\n cycle() {\n if (typeof window !== 'undefined') {\n this._intervalInstance = window.setInterval(() => {\n this.next();\n }, this._intervalDuration);\n }\n }\n\n /**\n * Clears the cycling interval\n */\n pause() {\n clearInterval(this._intervalInstance);\n }\n\n /**\n * Get the currently active item\n */\n _getActiveItem() {\n return this._activeItem;\n }\n\n /**\n * Set the currently active item and data attribute\n * @param {*} position\n */\n _setActiveItem(item: CarouselItem) {\n this._activeItem = item;\n const position = item.position;\n\n // update the indicators if available\n if (this._indicators.length) {\n this._indicators.map((indicator) => {\n indicator.el.setAttribute('aria-current', 'false');\n indicator.el.classList.remove(\n ...this._options.indicators.activeClasses.split(' ')\n );\n indicator.el.classList.add(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n });\n this._indicators[position].el.classList.add(\n ...this._options.indicators.activeClasses.split(' ')\n );\n this._indicators[position].el.classList.remove(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n this._indicators[position].el.setAttribute('aria-current', 'true');\n }\n }\n}\n\nexport function initCarousels() {\n document.querySelectorAll('[data-carousel]').forEach(($carouselEl) => {\n const interval = $carouselEl.getAttribute('data-carousel-interval');\n const slide =\n $carouselEl.getAttribute('data-carousel') === 'slide'\n ? true\n : false;\n\n const items: CarouselItem[] = [];\n let defaultPosition = 0;\n if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-item]')\n ).map(($carouselItemEl: HTMLElement, position: number) => {\n items.push({\n position: position,\n el: $carouselItemEl,\n });\n\n if (\n $carouselItemEl.getAttribute('data-carousel-item') ===\n 'active'\n ) {\n defaultPosition = position;\n }\n });\n }\n\n const indicators: IndicatorItem[] = [];\n if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-slide-to]')\n ).map(($indicatorEl: HTMLElement) => {\n indicators.push({\n position: parseInt(\n $indicatorEl.getAttribute('data-carousel-slide-to')\n ),\n el: $indicatorEl,\n });\n });\n }\n\n const carousel = new Carousel(items, {\n defaultPosition: defaultPosition,\n indicators: {\n items: indicators,\n },\n interval: interval ? interval : Default.interval,\n } as CarouselOptions);\n\n if (slide) {\n carousel.cycle();\n }\n\n // check for controls\n const carouselNextEl = $carouselEl.querySelector(\n '[data-carousel-next]'\n );\n const carouselPrevEl = $carouselEl.querySelector(\n '[data-carousel-prev]'\n );\n\n if (carouselNextEl) {\n carouselNextEl.addEventListener('click', () => {\n carousel.next();\n });\n }\n\n if (carouselPrevEl) {\n carouselPrevEl.addEventListener('click', () => {\n carousel.prev();\n });\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Carousel = Carousel;\n window.initCarousels = initCarousels;\n}\n\nexport default Carousel;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { CollapseOptions } from './types';\nimport { CollapseInterface } from './interface';\n\nconst Default: CollapseOptions = {\n onCollapse: () => {},\n onExpand: () => {},\n onToggle: () => {},\n};\n\nclass Collapse implements CollapseInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: CollapseOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: CollapseOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n if (this._triggerEl.hasAttribute('aria-expanded')) {\n this._visible =\n this._triggerEl.getAttribute('aria-expanded') === 'true';\n } else {\n // fix until v2 not to break previous single collapses which became dismiss\n this._visible = !this._targetEl.classList.contains('hidden');\n }\n\n this._triggerEl.addEventListener('click', () => {\n this.toggle();\n });\n }\n }\n\n collapse() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onCollapse(this);\n }\n\n expand() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onExpand(this);\n }\n\n toggle() {\n if (this._visible) {\n this.collapse();\n } else {\n this.expand();\n }\n // callback function\n this._options.onToggle(this);\n }\n}\n\nexport function initCollapses() {\n document\n .querySelectorAll('[data-collapse-toggle]')\n .forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-collapse-toggle');\n const $targetEl = document.getElementById(targetId);\n\n // check if the target element exists\n if ($targetEl) {\n new Collapse(\n $targetEl as HTMLElement,\n $triggerEl as HTMLElement\n );\n } else {\n console.error(\n `The target element with id \"${targetId}\" does not exist. Please check the data-collapse-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Collapse = Collapse;\n window.initCollapses = initCollapses;\n}\n\nexport default Collapse;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DialOptions, DialTriggerType } from './types';\nimport { DialInterface } from './interface';\n\nconst Default: DialOptions = {\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dial implements DialInterface {\n _parentEl: HTMLElement;\n _triggerEl: HTMLElement;\n _targetEl: HTMLElement;\n _options: DialOptions;\n _visible: boolean;\n\n constructor(\n parentEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n targetEl: HTMLElement | null = null,\n options: DialOptions = Default\n ) {\n this._parentEl = parentEl;\n this._triggerEl = triggerEl;\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n const triggerEventTypes = this._getTriggerEventTypes(\n this._options.triggerType\n );\n triggerEventTypes.showEvents.forEach((ev: string) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEventTypes.hideEvents.forEach((ev: string) => {\n this._parentEl.addEventListener(ev, () => {\n if (!this._parentEl.matches(':hover')) {\n this.hide();\n }\n });\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n\n _getTriggerEventTypes(triggerType: DialTriggerType) {\n switch (triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n}\n\nexport function initDials() {\n document.querySelectorAll('[data-dial-init]').forEach(($parentEl) => {\n const $triggerEl = $parentEl.querySelector('[data-dial-toggle]');\n\n if ($triggerEl) {\n const dialId = $triggerEl.getAttribute('data-dial-toggle');\n const $dialEl = document.getElementById(dialId);\n\n if ($dialEl) {\n const triggerType =\n $triggerEl.getAttribute('data-dial-trigger');\n new Dial(\n $parentEl as HTMLElement,\n $triggerEl as HTMLElement,\n $dialEl as HTMLElement,\n {\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as DialOptions\n );\n } else {\n console.error(\n `Dial with id ${dialId} does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?`\n );\n }\n } else {\n console.error(\n `Dial with id ${$parentEl.id} does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dial = Dial;\n window.initDials = initDials;\n}\n\nexport default Dial;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DismissOptions } from './types';\nimport { DismissInterface } from './interface';\n\nconst Default: DismissOptions = {\n transition: 'transition-opacity',\n duration: 300,\n timing: 'ease-out',\n onHide: () => {},\n};\n\nclass Dismiss implements DismissInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: DismissOptions;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: DismissOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._triggerEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add(\n this._options.transition,\n `duration-${this._options.duration}`,\n this._options.timing,\n 'opacity-0'\n );\n setTimeout(() => {\n this._targetEl.classList.add('hidden');\n }, this._options.duration);\n\n // callback function\n this._options.onHide(this, this._targetEl);\n }\n}\n\nexport function initDismisses() {\n document.querySelectorAll('[data-dismiss-target]').forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-dismiss-target');\n const $dismissEl = document.querySelector(targetId);\n\n if ($dismissEl) {\n new Dismiss($dismissEl as HTMLElement, $triggerEl as HTMLElement);\n } else {\n console.error(\n `The dismiss element with id \"${targetId}\" does not exist. Please check the data-dismiss-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dismiss = Dismiss;\n window.initDismisses = initDismisses;\n}\n\nexport default Dismiss;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DrawerInstance, DrawerOptions, PlacementClasses } from './types';\nimport { DrawerInterface } from './interface';\n\nconst Default: DrawerOptions = {\n placement: 'left',\n bodyScrolling: false,\n backdrop: true,\n edge: false,\n edgeOffset: 'bottom-[60px]',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Drawer implements DrawerInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DrawerOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: DrawerOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n // set initial accessibility attributes\n if (this._targetEl) {\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.classList.add('transition-transform');\n }\n\n // set base placement classes\n this._getPlacementClasses(this._options.placement).base.map((c) => {\n this._targetEl.classList.add(c);\n });\n\n // add keyboard event listener to document\n document.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n // if 'Escape' key is pressed\n if (this.isVisible()) {\n // if the Drawer is visible\n this.hide(); // hide the Drawer\n }\n }\n });\n }\n\n hide() {\n // based on the edge option show placement classes\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.remove(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.add(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n\n // enable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.remove('overflow-hidden');\n }\n\n // destroy backdrop\n if (this._options.backdrop) {\n this._destroyBackdropEl();\n }\n\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.add(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.remove(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n\n // disable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.add('overflow-hidden');\n }\n\n // show backdrop\n if (this._options.backdrop) {\n this._createBackdrop();\n }\n\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _createBackdrop() {\n if (!this._visible) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('drawer-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n backdropEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n _destroyBackdropEl() {\n if (this._visible) {\n document.querySelector('[drawer-backdrop]').remove();\n }\n }\n\n _getPlacementClasses(placement: string): PlacementClasses {\n switch (placement) {\n case 'top':\n return {\n base: ['top-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['-translate-y-full'],\n };\n case 'right':\n return {\n base: ['right-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-x-full'],\n };\n case 'bottom':\n return {\n base: ['bottom-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full'],\n };\n case 'left':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n case 'bottom-edge':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full', this._options.edgeOffset],\n };\n default:\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n}\n\nconst getDrawerInstance = (id: string, instances: DrawerInstance[]) => {\n if (instances.some((drawerInstance) => drawerInstance.id === id)) {\n return instances.find((drawerInstance) => drawerInstance.id === id);\n }\n};\n\nexport function initDrawers() {\n const drawerInstances = [] as DrawerInstance[];\n document.querySelectorAll('[data-drawer-target]').forEach(($triggerEl) => {\n // mandatory\n const drawerId = $triggerEl.getAttribute('data-drawer-target');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n // optional\n const placement = $triggerEl.getAttribute('data-drawer-placement');\n const bodyScrolling = $triggerEl.getAttribute(\n 'data-drawer-body-scrolling'\n );\n const backdrop = $triggerEl.getAttribute('data-drawer-backdrop');\n const edge = $triggerEl.getAttribute('data-drawer-edge');\n const edgeOffset = $triggerEl.getAttribute(\n 'data-drawer-edge-offset'\n );\n\n if (!getDrawerInstance(drawerId, drawerInstances)) {\n drawerInstances.push({\n id: drawerId,\n object: new Drawer($drawerEl, {\n placement: placement ? placement : Default.placement,\n bodyScrolling: bodyScrolling\n ? bodyScrolling === 'true'\n ? true\n : false\n : Default.bodyScrolling,\n backdrop: backdrop\n ? backdrop === 'true'\n ? true\n : false\n : Default.backdrop,\n edge: edge\n ? edge === 'true'\n ? true\n : false\n : Default.edge,\n edgeOffset: edgeOffset\n ? edgeOffset\n : Default.edgeOffset,\n } as DrawerOptions),\n });\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-toggle]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-toggle');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer: DrawerInstance = getDrawerInstance(\n drawerId,\n drawerInstances\n );\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.toggle();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document\n .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]')\n .forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-dismiss')\n ? $triggerEl.getAttribute('data-drawer-dismiss')\n : $triggerEl.getAttribute('data-drawer-hide');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.hide();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-show]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-show');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.show();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Drawer = Drawer;\n window.initDrawers = initDrawers;\n}\n\nexport default Drawer;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { DropdownOptions } from './types';\nimport { DropdownInterface } from './interface';\n\nconst Default: DropdownOptions = {\n placement: 'bottom',\n triggerType: 'click',\n offsetSkidding: 0,\n offsetDistance: 10,\n delay: 300,\n ignoreClickOutsideClass: false,\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dropdown implements DropdownInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DropdownOptions;\n _visible: boolean;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetElement: HTMLElement | null = null,\n triggerElement: HTMLElement | null = null,\n options: DropdownOptions = Default\n ) {\n this._targetEl = targetElement;\n this._triggerEl = triggerElement;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n // click event handling for trigger element\n if (this._options.triggerType === 'click') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.toggle();\n });\n });\n }\n\n // hover event handling for trigger element\n if (this._options.triggerType === 'hover') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n if (ev === 'click') {\n this.toggle();\n } else {\n setTimeout(() => {\n this.show();\n }, this._options.delay);\n }\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n });\n }\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [\n this._options.offsetSkidding,\n this._options.offsetDistance,\n ],\n },\n },\n ],\n });\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n\n // Ignore clicks on the trigger element (ie. a datepicker input)\n const ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;\n\n let isIgnored = false;\n if (ignoreClickOutsideClass) {\n const ignoredClickOutsideEls = document.querySelectorAll(\n `.${ignoreClickOutsideClass}`\n );\n ignoredClickOutsideEls.forEach((el) => {\n if (el.contains(clickedEl)) {\n isIgnored = true;\n return;\n }\n });\n }\n\n // Ignore clicks on the target element (ie. dropdown itself)\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n !isIgnored &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'click'],\n hideEvents: ['mouseleave'],\n };\n case 'click':\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n }\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n isVisible() {\n return this._visible;\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n this._targetEl.classList.add('block');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n this._setupClickOutsideListener();\n\n // Update its position\n this._popperInstance.update();\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('block');\n this._targetEl.classList.add('hidden');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n this._visible = false;\n\n this._removeClickOutsideListener();\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initDropdowns() {\n document\n .querySelectorAll('[data-dropdown-toggle]')\n .forEach(($triggerEl) => {\n const dropdownId = $triggerEl.getAttribute('data-dropdown-toggle');\n const $dropdownEl = document.getElementById(dropdownId);\n\n if ($dropdownEl) {\n const placement = $triggerEl.getAttribute(\n 'data-dropdown-placement'\n );\n const offsetSkidding = $triggerEl.getAttribute(\n 'data-dropdown-offset-skidding'\n );\n const offsetDistance = $triggerEl.getAttribute(\n 'data-dropdown-offset-distance'\n );\n const triggerType = $triggerEl.getAttribute(\n 'data-dropdown-trigger'\n );\n const delay = $triggerEl.getAttribute('data-dropdown-delay');\n const ignoreClickOutsideClass = $triggerEl.getAttribute(\n 'data-dropdown-ignore-click-outside-class'\n );\n\n new Dropdown(\n $dropdownEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n offsetSkidding: offsetSkidding\n ? parseInt(offsetSkidding)\n : Default.offsetSkidding,\n offsetDistance: offsetDistance\n ? parseInt(offsetDistance)\n : Default.offsetDistance,\n delay: delay ? parseInt(delay) : Default.delay,\n ignoreClickOutsideClass: ignoreClickOutsideClass\n ? ignoreClickOutsideClass\n : Default.ignoreClickOutsideClass,\n } as DropdownOptions\n );\n } else {\n console.error(\n `The dropdown element with id \"${dropdownId}\" does not exist. Please check the data-dropdown-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dropdown = Dropdown;\n window.initDropdowns = initDropdowns;\n}\n\nexport default Dropdown;\n","import { initAccordions } from './accordion';\nimport { initCarousels } from './carousel';\nimport { initCollapses } from './collapse';\nimport { initDials } from './dial';\nimport { initDismisses } from './dismiss';\nimport { initDrawers } from './drawer';\nimport { initDropdowns } from './dropdown';\nimport { initModals } from './modal';\nimport { initPopovers } from './popover';\nimport { initTabs } from './tabs';\nimport { initTooltips } from './tooltip';\n\nexport function initFlowbite() {\n initAccordions();\n initCollapses();\n initCarousels();\n initDismisses();\n initDropdowns();\n initModals();\n initDrawers();\n initTabs();\n initTooltips();\n initPopovers();\n initDials();\n}\n\nif (typeof window !== 'undefined') {\n window.initFlowbite = initFlowbite;\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ModalInstance, ModalOptions } from './types';\nimport { ModalInterface } from './interface';\n\nconst Default: ModalOptions = {\n placement: 'center',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',\n backdrop: 'dynamic',\n closable: true,\n onHide: () => {},\n onShow: () => {},\n onToggle: () => {},\n};\n\nclass Modal implements ModalInterface {\n _targetEl: HTMLElement | null;\n _options: ModalOptions;\n _isHidden: boolean;\n _backdropEl: HTMLElement | null;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: ModalOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._isHidden = true;\n this._backdropEl = null;\n this._init();\n }\n\n _init() {\n if (this._targetEl) {\n this._getPlacementClasses().map((c) => {\n this._targetEl.classList.add(c);\n });\n }\n }\n\n _createBackdrop() {\n if (this._isHidden) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('modal-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n this._backdropEl = backdropEl;\n }\n }\n\n _destroyBackdropEl() {\n if (!this._isHidden) {\n document.querySelector('[modal-backdrop]').remove();\n }\n }\n\n _setupModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleOutsideClick(ev.target);\n };\n this._targetEl.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._targetEl.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _handleOutsideClick(target: EventTarget) {\n if (\n target === this._targetEl ||\n (target === this._backdropEl && this.isVisible())\n ) {\n this.hide();\n }\n }\n\n _getPlacementClasses() {\n switch (this._options.placement) {\n // top\n case 'top-left':\n return ['justify-start', 'items-start'];\n case 'top-center':\n return ['justify-center', 'items-start'];\n case 'top-right':\n return ['justify-end', 'items-start'];\n\n // center\n case 'center-left':\n return ['justify-start', 'items-center'];\n case 'center':\n return ['justify-center', 'items-center'];\n case 'center-right':\n return ['justify-end', 'items-center'];\n\n // bottom\n case 'bottom-left':\n return ['justify-start', 'items-end'];\n case 'bottom-center':\n return ['justify-center', 'items-end'];\n case 'bottom-right':\n return ['justify-end', 'items-end'];\n\n default:\n return ['justify-center', 'items-center'];\n }\n }\n\n toggle() {\n if (this._isHidden) {\n this.show();\n } else {\n this.hide();\n }\n\n // callback function\n this._options.onToggle(this);\n }\n\n show() {\n if (this.isHidden) {\n this._targetEl.classList.add('flex');\n this._targetEl.classList.remove('hidden');\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n this._createBackdrop();\n this._isHidden = false;\n\n // prevent body scroll\n document.body.classList.add('overflow-hidden');\n\n // Add keyboard event listener to the document\n if (this._options.closable) {\n this._setupModalCloseEventListeners();\n }\n\n // callback function\n this._options.onShow(this);\n }\n }\n\n hide() {\n if (this.isVisible) {\n this._targetEl.classList.add('hidden');\n this._targetEl.classList.remove('flex');\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n this._destroyBackdropEl();\n this._isHidden = true;\n\n // re-apply body scroll\n document.body.classList.remove('overflow-hidden');\n\n if (this._options.closable) {\n this._removeModalCloseEventListeners();\n }\n\n // callback function\n this._options.onHide(this);\n }\n }\n\n isVisible() {\n return !this._isHidden;\n }\n\n isHidden() {\n return this._isHidden;\n }\n}\n\nconst getModalInstance = (id: string, instances: ModalInstance[]) => {\n if (instances.some((modalInstance) => modalInstance.id === id)) {\n return instances.find((modalInstance) => modalInstance.id === id);\n }\n return null;\n};\n\nexport function initModals() {\n const modalInstances = [] as ModalInstance[];\n\n // initiate modal based on data-modal-target\n document.querySelectorAll('[data-modal-target]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-target');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n if (!getModalInstance(modalId, modalInstances)) {\n modalInstances.push({\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n });\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.`\n );\n }\n });\n\n // support pre v1.6.0 data-modal-toggle initialization\n document.querySelectorAll('[data-modal-toggle]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-toggle');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n let modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (!modal) {\n modal = {\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n };\n modalInstances.push(modal);\n }\n\n $triggerEl.addEventListener('click', () => {\n modal.object.toggle();\n });\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?`\n );\n }\n });\n\n // show modal on click if exists based on id\n document.querySelectorAll('[data-modal-show]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-show');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isHidden) {\n modal.object.show();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?`\n );\n }\n });\n\n // hide modal on click if exists based on id\n document.querySelectorAll('[data-modal-hide]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-hide');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isVisible) {\n modal.object.hide();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Modal = Modal;\n window.initModals = initModals;\n}\n\nexport default Modal;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { PopoverOptions } from './types';\nimport { PopoverInterface } from './interface';\n\nconst Default: PopoverOptions = {\n placement: 'top',\n offset: 10,\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Popover implements PopoverInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: PopoverOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: PopoverOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, this._options.offset],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility to true\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility to false\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initPopovers() {\n document.querySelectorAll('[data-popover-target]').forEach(($triggerEl) => {\n const popoverID = $triggerEl.getAttribute('data-popover-target');\n const $popoverEl = document.getElementById(popoverID);\n\n if ($popoverEl) {\n const triggerType = $triggerEl.getAttribute('data-popover-trigger');\n const placement = $triggerEl.getAttribute('data-popover-placement');\n const offset = $triggerEl.getAttribute('data-popover-offset');\n\n new Popover(\n $popoverEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n offset: offset ? parseInt(offset) : Default.offset,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as PopoverOptions\n );\n } else {\n console.error(\n `The popover element with id \"${popoverID}\" does not exist. Please check the data-popover-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Popover = Popover;\n window.initPopovers = initPopovers;\n}\n\nexport default Popover;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { TabItem, TabsOptions } from './types';\nimport { TabsInterface } from './interface';\n\nconst Default: TabsOptions = {\n defaultTabId: null,\n activeClasses:\n 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500',\n inactiveClasses:\n 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300',\n onShow: () => {},\n};\n\nclass Tabs implements TabsInterface {\n _items: TabItem[];\n _activeTab: TabItem;\n _options: TabsOptions;\n\n constructor(items: TabItem[] = [], options: TabsOptions = Default) {\n this._items = items;\n this._activeTab = options ? this.getTab(options.defaultTabId) : null;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._items.length) {\n // set the first tab as active if not set by explicitly\n if (!this._activeTab) {\n this._setActiveTab(this._items[0]);\n }\n\n // force show the first default tab\n this.show(this._activeTab.id, true);\n\n // show tab content based on click\n this._items.map((tab) => {\n tab.triggerEl.addEventListener('click', () => {\n this.show(tab.id);\n });\n });\n }\n }\n\n getActiveTab() {\n return this._activeTab;\n }\n\n _setActiveTab(tab: TabItem) {\n this._activeTab = tab;\n }\n\n getTab(id: string) {\n return this._items.filter((t) => t.id === id)[0];\n }\n\n show(id: string, forceShow = false) {\n const tab = this.getTab(id);\n\n // don't do anything if already active\n if (tab === this._activeTab && !forceShow) {\n return;\n }\n\n // hide other tabs\n this._items.map((t: TabItem) => {\n if (t !== tab) {\n t.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n t.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n t.targetEl.classList.add('hidden');\n t.triggerEl.setAttribute('aria-selected', 'false');\n }\n });\n\n // show active tab\n tab.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n tab.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n tab.triggerEl.setAttribute('aria-selected', 'true');\n tab.targetEl.classList.remove('hidden');\n\n this._setActiveTab(tab);\n\n // callback function\n this._options.onShow(this, tab);\n }\n}\n\nexport function initTabs() {\n document.querySelectorAll('[data-tabs-toggle]').forEach(($triggerEl) => {\n const tabItems: TabItem[] = [];\n let defaultTabId = null;\n $triggerEl\n .querySelectorAll('[role=\"tab\"]')\n .forEach(($triggerEl: HTMLElement) => {\n const isActive =\n $triggerEl.getAttribute('aria-selected') === 'true';\n const tab: TabItem = {\n id: $triggerEl.getAttribute('data-tabs-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-tabs-target')\n ),\n };\n tabItems.push(tab);\n\n if (isActive) {\n defaultTabId = tab.id;\n }\n });\n new Tabs(tabItems, {\n defaultTabId: defaultTabId,\n } as TabsOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tabs = Tabs;\n window.initTabs = initTabs;\n}\n\nexport default Tabs;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { TooltipOptions } from './types';\nimport { TooltipInterface } from './interface';\n\nconst Default: TooltipOptions = {\n placement: 'top',\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Tooltip implements TooltipInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: TooltipOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: TooltipOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.hide();\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initTooltips() {\n document.querySelectorAll('[data-tooltip-target]').forEach(($triggerEl) => {\n const tooltipId = $triggerEl.getAttribute('data-tooltip-target');\n const $tooltipEl = document.getElementById(tooltipId);\n\n if ($tooltipEl) {\n const triggerType = $triggerEl.getAttribute('data-tooltip-trigger');\n const placement = $triggerEl.getAttribute('data-tooltip-placement');\n\n new Tooltip(\n $tooltipEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as TooltipOptions\n );\n } else {\n console.error(\n `The tooltip element with id \"${tooltipId}\" does not exist. Please check the data-tooltip-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tooltip = Tooltip;\n window.initTooltips = initTooltips;\n}\n\nexport default Tooltip;\n","class Events {\n private _eventType: string;\n private _eventFunctions: EventListener[];\n\n constructor(eventType: string, eventFunctions: EventListener[] = []) {\n this._eventType = eventType;\n this._eventFunctions = eventFunctions;\n }\n\n init() {\n this._eventFunctions.forEach((eventFunction) => {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// core components\nimport Accordion, { initAccordions } from './components/accordion';\nimport Carousel, { initCarousels } from './components/carousel';\nimport Collapse, { initCollapses } from './components/collapse';\nimport Dial, { initDials } from './components/dial';\nimport Dismiss, { initDismisses } from './components/dismiss';\nimport Drawer, { initDrawers } from './components/drawer';\nimport Dropdown, { initDropdowns } from './components/dropdown';\nimport Modal, { initModals } from './components/modal';\nimport Popover, { initPopovers } from './components/popover';\nimport Tabs, { initTabs } from './components/tabs';\nimport Tooltip, { initTooltips } from './components/tooltip';\nimport './components/index';\nimport Events from './dom/events';\n\nconst turboLoadEvents = new Events('turbo:load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nturboLoadEvents.init();\n\nconst turboFrameLoadEvents = new Events('turbo:frame-load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nturboFrameLoadEvents.init();\n\nexport default {\n Accordion,\n Carousel,\n Collapse,\n Dial,\n Drawer,\n Dismiss,\n Dropdown,\n Modal,\n Popover,\n Tabs,\n Tooltip,\n Events,\n};\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/dist/flowbite.turbo.min.js b/node_modules/flowbite/dist/flowbite.turbo.min.js new file mode 100644 index 0000000..65c47ff --- /dev/null +++ b/node_modules/flowbite/dist/flowbite.turbo.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Flowbite",[],e):"object"==typeof exports?exports.Flowbite=e():t.Flowbite=e()}(self,(function(){return function(){"use strict";var t={853:function(t,e,i){i.r(e),i.d(e,{afterMain:function(){return E},afterRead:function(){return _},afterWrite:function(){return x},applyStyles:function(){return D},arrow:function(){return Z},auto:function(){return a},basePlacements:function(){return c},beforeMain:function(){return b},beforeRead:function(){return m},beforeWrite:function(){return L},bottom:function(){return o},clippingParents:function(){return u},computeStyles:function(){return it},createPopper:function(){return Dt},createPopperBase:function(){return Pt},createPopperLite:function(){return St},detectOverflow:function(){return yt},end:function(){return d},eventListeners:function(){return ot},flip:function(){return _t},hide:function(){return Et},left:function(){return s},main:function(){return w},modifierPhases:function(){return k},offset:function(){return Lt},placements:function(){return v},popper:function(){return f},popperGenerator:function(){return jt},popperOffsets:function(){return Ot},preventOverflow:function(){return xt},read:function(){return y},reference:function(){return h},right:function(){return r},start:function(){return l},top:function(){return n},variationPlacements:function(){return g},viewport:function(){return p},write:function(){return O}});var n="top",o="bottom",r="right",s="left",a="auto",c=[n,o,r,s],l="start",d="end",u="clippingParents",p="viewport",f="popper",h="reference",g=c.reduce((function(t,e){return t.concat([e+"-"+l,e+"-"+d])}),[]),v=[].concat(c,[a]).reduce((function(t,e){return t.concat([e,e+"-"+l,e+"-"+d])}),[]),m="beforeRead",y="read",_="afterRead",b="beforeMain",w="main",E="afterMain",L="beforeWrite",O="write",x="afterWrite",k=[m,y,_,b,w,E,L,O,x];function A(t){return t?(t.nodeName||"").toLowerCase():null}function T(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return t instanceof T(t).Element||t instanceof Element}function j(t){return t instanceof T(t).HTMLElement||t instanceof HTMLElement}function P(t){return"undefined"!=typeof ShadowRoot&&(t instanceof T(t).ShadowRoot||t instanceof ShadowRoot)}var D={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];j(o)&&A(o)&&(Object.assign(o.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],o=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});j(n)&&A(n)&&(Object.assign(n.style,r),Object.keys(o).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function S(t){return t.split("-")[0]}var I=Math.max,M=Math.min,q=Math.round;function H(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(H())}function V(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),o=1,r=1;e&&j(t)&&(o=t.offsetWidth>0&&q(n.width)/t.offsetWidth||1,r=t.offsetHeight>0&&q(n.height)/t.offsetHeight||1);var s=(C(t)?T(t):window).visualViewport,a=!B()&&i,c=(n.left+(a&&s?s.offsetLeft:0))/o,l=(n.top+(a&&s?s.offsetTop:0))/r,d=n.width/o,u=n.height/r;return{width:d,height:u,top:l,right:c+d,bottom:l+u,left:c,x:c,y:l}}function W(t){var e=V(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function z(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&P(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function R(t){return T(t).getComputedStyle(t)}function F(t){return["table","td","th"].indexOf(A(t))>=0}function N(t){return((C(t)?t.ownerDocument:t.document)||window.document).documentElement}function K(t){return"html"===A(t)?t:t.assignedSlot||t.parentNode||(P(t)?t.host:null)||N(t)}function U(t){return j(t)&&"fixed"!==R(t).position?t.offsetParent:null}function X(t){for(var e=T(t),i=U(t);i&&F(i)&&"static"===R(i).position;)i=U(i);return i&&("html"===A(i)||"body"===A(i)&&"static"===R(i).position)?e:i||function(t){var e=/firefox/i.test(H());if(/Trident/i.test(H())&&j(t)&&"fixed"===R(t).position)return null;var i=K(t);for(P(i)&&(i=i.host);j(i)&&["html","body"].indexOf(A(i))<0;){var n=R(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function G(t,e,i){return I(t,M(e,i))}function J(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Q(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var Z={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,a=t.name,l=t.options,d=i.elements.arrow,u=i.modifiersData.popperOffsets,p=S(i.placement),f=Y(p),h=[s,r].indexOf(p)>=0?"height":"width";if(d&&u){var g=function(t,e){return J("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Q(t,c))}(l.padding,i),v=W(d),m="y"===f?n:s,y="y"===f?o:r,_=i.rects.reference[h]+i.rects.reference[f]-u[f]-i.rects.popper[h],b=u[f]-i.rects.reference[f],w=X(d),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,L=_/2-b/2,O=g[m],x=E-v[h]-g[y],k=E/2-v[h]/2+L,A=G(O,k,x),T=f;i.modifiersData[a]=((e={})[T]=A,e.centerOffset=A-k,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&z(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,i=t.popper,a=t.popperRect,c=t.placement,l=t.variation,u=t.offsets,p=t.position,f=t.gpuAcceleration,h=t.adaptive,g=t.roundOffsets,v=t.isFixed,m=u.x,y=void 0===m?0:m,_=u.y,b=void 0===_?0:_,w="function"==typeof g?g({x:y,y:b}):{x:y,y:b};y=w.x,b=w.y;var E=u.hasOwnProperty("x"),L=u.hasOwnProperty("y"),O=s,x=n,k=window;if(h){var A=X(i),C="clientHeight",j="clientWidth";if(A===T(i)&&"static"!==R(A=N(i)).position&&"absolute"===p&&(C="scrollHeight",j="scrollWidth"),c===n||(c===s||c===r)&&l===d)x=o,b-=(v&&A===k&&k.visualViewport?k.visualViewport.height:A[C])-a.height,b*=f?1:-1;if(c===s||(c===n||c===o)&&l===d)O=r,y-=(v&&A===k&&k.visualViewport?k.visualViewport.width:A[j])-a.width,y*=f?1:-1}var P,D=Object.assign({position:p},h&&tt),S=!0===g?function(t){var e=t.x,i=t.y,n=window.devicePixelRatio||1;return{x:q(e*n)/n||0,y:q(i*n)/n||0}}({x:y,y:b}):{x:y,y:b};return y=S.x,b=S.y,f?Object.assign({},D,((P={})[x]=L?"0":"",P[O]=E?"0":"",P.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",P)):Object.assign({},D,((e={})[x]=L?b+"px":"",e[O]=E?y+"px":"",e.transform="",e))}var it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=void 0===n||n,r=i.adaptive,s=void 0===r||r,a=i.roundOffsets,c=void 0===a||a,l={placement:S(e.placement),variation:$(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},nt={passive:!0};var ot={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,r=void 0===o||o,s=n.resize,a=void 0===s||s,c=T(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&l.forEach((function(t){t.addEventListener("scroll",i.update,nt)})),a&&c.addEventListener("resize",i.update,nt),function(){r&&l.forEach((function(t){t.removeEventListener("scroll",i.update,nt)})),a&&c.removeEventListener("resize",i.update,nt)}},data:{}},rt={left:"right",right:"left",bottom:"top",top:"bottom"};function st(t){return t.replace(/left|right|bottom|top/g,(function(t){return rt[t]}))}var at={start:"end",end:"start"};function ct(t){return t.replace(/start|end/g,(function(t){return at[t]}))}function lt(t){var e=T(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dt(t){return V(N(t)).left+lt(t).scrollLeft}function ut(t){var e=R(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function pt(t){return["html","body","#document"].indexOf(A(t))>=0?t.ownerDocument.body:j(t)&&ut(t)?t:pt(K(t))}function ft(t,e){var i;void 0===e&&(e=[]);var n=pt(t),o=n===(null==(i=t.ownerDocument)?void 0:i.body),r=T(n),s=o?[r].concat(r.visualViewport||[],ut(n)?n:[]):n,a=e.concat(s);return o?a:a.concat(ft(K(s)))}function ht(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gt(t,e,i){return e===p?ht(function(t,e){var i=T(t),n=N(t),o=i.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(o){r=o.width,s=o.height;var l=B();(l||!l&&"fixed"===e)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:r,height:s,x:a+dt(t),y:c}}(t,i)):C(e)?function(t,e){var i=V(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):ht(function(t){var e,i=N(t),n=lt(t),o=null==(e=t.ownerDocument)?void 0:e.body,r=I(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=I(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+dt(t),c=-n.scrollTop;return"rtl"===R(o||i).direction&&(a+=I(i.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:a,y:c}}(N(t)))}function vt(t,e,i,n){var o="clippingParents"===e?function(t){var e=ft(K(t)),i=["absolute","fixed"].indexOf(R(t).position)>=0&&j(t)?X(t):t;return C(i)?e.filter((function(t){return C(t)&&z(t,i)&&"body"!==A(t)})):[]}(t):[].concat(e),r=[].concat(o,[i]),s=r[0],a=r.reduce((function(e,i){var o=gt(t,i,n);return e.top=I(o.top,e.top),e.right=M(o.right,e.right),e.bottom=M(o.bottom,e.bottom),e.left=I(o.left,e.left),e}),gt(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mt(t){var e,i=t.reference,a=t.element,c=t.placement,u=c?S(c):null,p=c?$(c):null,f=i.x+i.width/2-a.width/2,h=i.y+i.height/2-a.height/2;switch(u){case n:e={x:f,y:i.y-a.height};break;case o:e={x:f,y:i.y+i.height};break;case r:e={x:i.x+i.width,y:h};break;case s:e={x:i.x-a.width,y:h};break;default:e={x:i.x,y:i.y}}var g=u?Y(u):null;if(null!=g){var v="y"===g?"height":"width";switch(p){case l:e[g]=e[g]-(i[v]/2-a[v]/2);break;case d:e[g]=e[g]+(i[v]/2-a[v]/2)}}return e}function yt(t,e){void 0===e&&(e={});var i=e,s=i.placement,a=void 0===s?t.placement:s,l=i.strategy,d=void 0===l?t.strategy:l,g=i.boundary,v=void 0===g?u:g,m=i.rootBoundary,y=void 0===m?p:m,_=i.elementContext,b=void 0===_?f:_,w=i.altBoundary,E=void 0!==w&&w,L=i.padding,O=void 0===L?0:L,x=J("number"!=typeof O?O:Q(O,c)),k=b===f?h:f,A=t.rects.popper,T=t.elements[E?k:b],j=vt(C(T)?T:T.contextElement||N(t.elements.popper),v,y,d),P=V(t.elements.reference),D=mt({reference:P,element:A,strategy:"absolute",placement:a}),S=ht(Object.assign({},A,D)),I=b===f?S:P,M={top:j.top-I.top+x.top,bottom:I.bottom-j.bottom+x.bottom,left:j.left-I.left+x.left,right:I.right-j.right+x.right},q=t.modifiersData.offset;if(b===f&&q){var H=q[a];Object.keys(M).forEach((function(t){var e=[r,o].indexOf(t)>=0?1:-1,i=[n,o].indexOf(t)>=0?"y":"x";M[t]+=H[i]*e}))}return M}var _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,d=t.name;if(!e.modifiersData[d]._skip){for(var u=i.mainAxis,p=void 0===u||u,f=i.altAxis,h=void 0===f||f,m=i.fallbackPlacements,y=i.padding,_=i.boundary,b=i.rootBoundary,w=i.altBoundary,E=i.flipVariations,L=void 0===E||E,O=i.allowedAutoPlacements,x=e.options.placement,k=S(x),A=m||(k===x||!L?[st(x)]:function(t){if(S(t)===a)return[];var e=st(t);return[ct(t),e,ct(e)]}(x)),T=[x].concat(A).reduce((function(t,i){return t.concat(S(i)===a?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,o=i.boundary,r=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,d=void 0===l?v:l,u=$(n),p=u?a?g:g.filter((function(t){return $(t)===u})):c,f=p.filter((function(t){return d.indexOf(t)>=0}));0===f.length&&(f=p);var h=f.reduce((function(e,i){return e[i]=yt(t,{placement:i,boundary:o,rootBoundary:r,padding:s})[S(i)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:i,boundary:_,rootBoundary:b,padding:y,flipVariations:L,allowedAutoPlacements:O}):i)}),[]),C=e.rects.reference,j=e.rects.popper,P=new Map,D=!0,I=T[0],M=0;M=0,W=V?"width":"height",z=yt(e,{placement:q,boundary:_,rootBoundary:b,altBoundary:w,padding:y}),R=V?B?r:s:B?o:n;C[W]>j[W]&&(R=st(R));var F=st(R),N=[];if(p&&N.push(z[H]<=0),h&&N.push(z[R]<=0,z[F]<=0),N.every((function(t){return t}))){I=q,D=!1;break}P.set(q,N)}if(D)for(var K=function(t){var e=T.find((function(e){var i=P.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},U=L?3:1;U>0;U--){if("break"===K(U))break}e.placement!==I&&(e.modifiersData[d]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function wt(t){return[n,r,o,s].some((function(e){return t[e]>=0}))}var Et={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,s=yt(e,{elementContext:"reference"}),a=yt(e,{altBoundary:!0}),c=bt(s,n),l=bt(a,o,r),d=wt(c),u=wt(l);e.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Lt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,o=t.name,a=i.offset,c=void 0===a?[0,0]:a,l=v.reduce((function(t,i){return t[i]=function(t,e,i){var o=S(t),a=[s,n].indexOf(o)>=0?-1:1,c="function"==typeof i?i(Object.assign({},e,{placement:t})):i,l=c[0],d=c[1];return l=l||0,d=(d||0)*a,[s,r].indexOf(o)>=0?{x:d,y:l}:{x:l,y:d}}(i,e.rects,c),t}),{}),d=l[e.placement],u=d.x,p=d.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=p),e.modifiersData[o]=l}};var Ot={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,a=t.name,c=i.mainAxis,d=void 0===c||c,u=i.altAxis,p=void 0!==u&&u,f=i.boundary,h=i.rootBoundary,g=i.altBoundary,v=i.padding,m=i.tether,y=void 0===m||m,_=i.tetherOffset,b=void 0===_?0:_,w=yt(e,{boundary:f,rootBoundary:h,padding:v,altBoundary:g}),E=S(e.placement),L=$(e.placement),O=!L,x=Y(E),k="x"===x?"y":"x",A=e.modifiersData.popperOffsets,T=e.rects.reference,C=e.rects.popper,j="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,P="number"==typeof j?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(A){if(d){var H,B="y"===x?n:s,V="y"===x?o:r,z="y"===x?"height":"width",R=A[x],F=R+w[B],N=R-w[V],K=y?-C[z]/2:0,U=L===l?T[z]:C[z],J=L===l?-C[z]:-T[z],Q=e.elements.arrow,Z=y&&Q?W(Q):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[B],it=tt[V],nt=G(0,T[z],Z[z]),ot=O?T[z]/2-K-nt-et-P.mainAxis:U-nt-et-P.mainAxis,rt=O?-T[z]/2+K+nt+it+P.mainAxis:J+nt+it+P.mainAxis,st=e.elements.arrow&&X(e.elements.arrow),at=st?"y"===x?st.clientTop||0:st.clientLeft||0:0,ct=null!=(H=null==D?void 0:D[x])?H:0,lt=R+rt-ct,dt=G(y?M(F,R+ot-ct-at):F,R,y?I(N,lt):N);A[x]=dt,q[x]=dt-R}if(p){var ut,pt="x"===x?n:s,ft="x"===x?o:r,ht=A[k],gt="y"===k?"height":"width",vt=ht+w[pt],mt=ht-w[ft],_t=-1!==[n,s].indexOf(E),bt=null!=(ut=null==D?void 0:D[k])?ut:0,wt=_t?vt:ht-T[gt]-C[gt]-bt+P.altAxis,Et=_t?ht+T[gt]+C[gt]-bt-P.altAxis:mt,Lt=y&&_t?function(t,e,i){var n=G(t,e,i);return n>i?i:n}(wt,ht,Et):G(y?wt:vt,ht,y?Et:mt);A[k]=Lt,q[k]=Lt-ht}e.modifiersData[a]=q}},requiresIfExists:["offset"]};function kt(t,e,i){void 0===i&&(i=!1);var n,o,r=j(e),s=j(e)&&function(t){var e=t.getBoundingClientRect(),i=q(e.width)/t.offsetWidth||1,n=q(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=N(e),c=V(t,s,i),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!i)&&(("body"!==A(e)||ut(a))&&(l=(n=e)!==T(n)&&j(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:lt(n)),j(e)?((d=V(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=dt(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function At(t){var e=new Map,i=new Set,n=[];function o(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&o(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||o(t)})),n}var Tt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ct(){for(var t=arguments.length,e=new Array(t),i=0;i 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { AccordionItem, AccordionOptions } from './types';\nimport { AccordionInterface } from './interface';\n\nconst Default: AccordionOptions = {\n alwaysOpen: false,\n activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',\n inactiveClasses: 'text-gray-500 dark:text-gray-400',\n onOpen: () => {},\n onClose: () => {},\n onToggle: () => {},\n};\n\nclass Accordion implements AccordionInterface {\n _items: AccordionItem[];\n _options: AccordionOptions;\n\n constructor(\n items: AccordionItem[] = [],\n options: AccordionOptions = Default\n ) {\n this._items = items;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n private _init() {\n if (this._items.length) {\n // show accordion item based on click\n this._items.map((item) => {\n if (item.active) {\n this.open(item.id);\n }\n\n item.triggerEl.addEventListener('click', () => {\n this.toggle(item.id);\n });\n });\n }\n }\n\n getItem(id: string) {\n return this._items.filter((item) => item.id === id)[0];\n }\n\n open(id: string) {\n const item = this.getItem(id);\n\n // don't hide other accordions if always open\n if (!this._options.alwaysOpen) {\n this._items.map((i) => {\n if (i !== item) {\n i.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n i.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n i.targetEl.classList.add('hidden');\n i.triggerEl.setAttribute('aria-expanded', 'false');\n i.active = false;\n\n // rotate icon if set\n if (i.iconEl) {\n i.iconEl.classList.remove('rotate-180');\n }\n }\n });\n }\n\n // show active item\n item.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n item.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n item.triggerEl.setAttribute('aria-expanded', 'true');\n item.targetEl.classList.remove('hidden');\n item.active = true;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.add('rotate-180');\n }\n\n // callback function\n this._options.onOpen(this, item);\n }\n\n toggle(id: string) {\n const item = this.getItem(id);\n\n if (item.active) {\n this.close(id);\n } else {\n this.open(id);\n }\n\n // callback function\n this._options.onToggle(this, item);\n }\n\n close(id: string) {\n const item = this.getItem(id);\n\n item.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n item.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n item.targetEl.classList.add('hidden');\n item.triggerEl.setAttribute('aria-expanded', 'false');\n item.active = false;\n\n // rotate icon if set\n if (item.iconEl) {\n item.iconEl.classList.remove('rotate-180');\n }\n\n // callback function\n this._options.onClose(this, item);\n }\n}\n\nexport function initAccordions() {\n document.querySelectorAll('[data-accordion]').forEach(($accordionEl) => {\n const alwaysOpen = $accordionEl.getAttribute('data-accordion');\n const activeClasses = $accordionEl.getAttribute('data-active-classes');\n const inactiveClasses = $accordionEl.getAttribute(\n 'data-inactive-classes'\n );\n\n const items = [] as AccordionItem[];\n $accordionEl\n .querySelectorAll('[data-accordion-target]')\n .forEach(($triggerEl) => {\n // Consider only items that directly belong to $accordionEl\n // (to make nested accordions work).\n if ($triggerEl.closest('[data-accordion]') === $accordionEl) {\n const item = {\n id: $triggerEl.getAttribute('data-accordion-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-accordion-target')\n ),\n iconEl: $triggerEl.querySelector(\n '[data-accordion-icon]'\n ),\n active:\n $triggerEl.getAttribute('aria-expanded') === 'true'\n ? true\n : false,\n } as AccordionItem;\n items.push(item);\n }\n });\n\n new Accordion(items, {\n alwaysOpen: alwaysOpen === 'open' ? true : false,\n activeClasses: activeClasses\n ? activeClasses\n : Default.activeClasses,\n inactiveClasses: inactiveClasses\n ? inactiveClasses\n : Default.inactiveClasses,\n } as AccordionOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Accordion = Accordion;\n window.initAccordions = initAccordions;\n}\n\nexport default Accordion;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {\n CarouselOptions,\n CarouselItem,\n IndicatorItem,\n RotationItems,\n} from './types';\nimport { CarouselInterface } from './interface';\n\nconst Default: CarouselOptions = {\n defaultPosition: 0,\n indicators: {\n items: [],\n activeClasses: 'bg-white dark:bg-gray-800',\n inactiveClasses:\n 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800',\n },\n interval: 3000,\n onNext: () => {},\n onPrev: () => {},\n onChange: () => {},\n};\n\nclass Carousel implements CarouselInterface {\n _items: CarouselItem[];\n _indicators: IndicatorItem[];\n _activeItem: CarouselItem;\n _intervalDuration: number;\n _intervalInstance: number;\n _options: CarouselOptions;\n\n constructor(\n items: CarouselItem[] = [],\n options: CarouselOptions = Default\n ) {\n this._items = items;\n this._options = {\n ...Default,\n ...options,\n indicators: { ...Default.indicators, ...options.indicators },\n };\n this._activeItem = this.getItem(this._options.defaultPosition);\n this._indicators = this._options.indicators.items;\n this._intervalDuration = this._options.interval;\n this._intervalInstance = null;\n this._init();\n }\n\n /**\n * initialize carousel and items based on active one\n */\n _init() {\n this._items.map((item: CarouselItem) => {\n item.el.classList.add(\n 'absolute',\n 'inset-0',\n 'transition-transform',\n 'transform'\n );\n });\n\n // if no active item is set then first position is default\n if (this._getActiveItem()) {\n this.slideTo(this._getActiveItem().position);\n } else {\n this.slideTo(0);\n }\n\n this._indicators.map((indicator, position) => {\n indicator.el.addEventListener('click', () => {\n this.slideTo(position);\n });\n });\n }\n\n getItem(position: number) {\n return this._items[position];\n }\n\n /**\n * Slide to the element based on id\n * @param {*} position\n */\n slideTo(position: number) {\n const nextItem: CarouselItem = this._items[position];\n const rotationItems: RotationItems = {\n left:\n nextItem.position === 0\n ? this._items[this._items.length - 1]\n : this._items[nextItem.position - 1],\n middle: nextItem,\n right:\n nextItem.position === this._items.length - 1\n ? this._items[0]\n : this._items[nextItem.position + 1],\n };\n this._rotate(rotationItems);\n this._setActiveItem(nextItem);\n if (this._intervalInstance) {\n this.pause();\n this.cycle();\n }\n\n this._options.onChange(this);\n }\n\n /**\n * Based on the currently active item it will go to the next position\n */\n next() {\n const activeItem = this._getActiveItem();\n let nextItem = null;\n\n // check if last item\n if (activeItem.position === this._items.length - 1) {\n nextItem = this._items[0];\n } else {\n nextItem = this._items[activeItem.position + 1];\n }\n\n this.slideTo(nextItem.position);\n\n // callback function\n this._options.onNext(this);\n }\n\n /**\n * Based on the currently active item it will go to the previous position\n */\n prev() {\n const activeItem = this._getActiveItem();\n let prevItem = null;\n\n // check if first item\n if (activeItem.position === 0) {\n prevItem = this._items[this._items.length - 1];\n } else {\n prevItem = this._items[activeItem.position - 1];\n }\n\n this.slideTo(prevItem.position);\n\n // callback function\n this._options.onPrev(this);\n }\n\n /**\n * This method applies the transform classes based on the left, middle, and right rotation carousel items\n * @param {*} rotationItems\n */\n _rotate(rotationItems: RotationItems) {\n // reset\n this._items.map((item: CarouselItem) => {\n item.el.classList.add('hidden');\n });\n\n // left item (previously active)\n rotationItems.left.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.left.el.classList.add('-translate-x-full', 'z-10');\n\n // currently active item\n rotationItems.middle.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-10'\n );\n rotationItems.middle.el.classList.add('translate-x-0', 'z-20');\n\n // right item (upcoming active)\n rotationItems.right.el.classList.remove(\n '-translate-x-full',\n 'translate-x-full',\n 'translate-x-0',\n 'hidden',\n 'z-20'\n );\n rotationItems.right.el.classList.add('translate-x-full', 'z-10');\n }\n\n /**\n * Set an interval to cycle through the carousel items\n */\n cycle() {\n if (typeof window !== 'undefined') {\n this._intervalInstance = window.setInterval(() => {\n this.next();\n }, this._intervalDuration);\n }\n }\n\n /**\n * Clears the cycling interval\n */\n pause() {\n clearInterval(this._intervalInstance);\n }\n\n /**\n * Get the currently active item\n */\n _getActiveItem() {\n return this._activeItem;\n }\n\n /**\n * Set the currently active item and data attribute\n * @param {*} position\n */\n _setActiveItem(item: CarouselItem) {\n this._activeItem = item;\n const position = item.position;\n\n // update the indicators if available\n if (this._indicators.length) {\n this._indicators.map((indicator) => {\n indicator.el.setAttribute('aria-current', 'false');\n indicator.el.classList.remove(\n ...this._options.indicators.activeClasses.split(' ')\n );\n indicator.el.classList.add(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n });\n this._indicators[position].el.classList.add(\n ...this._options.indicators.activeClasses.split(' ')\n );\n this._indicators[position].el.classList.remove(\n ...this._options.indicators.inactiveClasses.split(' ')\n );\n this._indicators[position].el.setAttribute('aria-current', 'true');\n }\n }\n}\n\nexport function initCarousels() {\n document.querySelectorAll('[data-carousel]').forEach(($carouselEl) => {\n const interval = $carouselEl.getAttribute('data-carousel-interval');\n const slide =\n $carouselEl.getAttribute('data-carousel') === 'slide'\n ? true\n : false;\n\n const items: CarouselItem[] = [];\n let defaultPosition = 0;\n if ($carouselEl.querySelectorAll('[data-carousel-item]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-item]')\n ).map(($carouselItemEl: HTMLElement, position: number) => {\n items.push({\n position: position,\n el: $carouselItemEl,\n });\n\n if (\n $carouselItemEl.getAttribute('data-carousel-item') ===\n 'active'\n ) {\n defaultPosition = position;\n }\n });\n }\n\n const indicators: IndicatorItem[] = [];\n if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) {\n Array.from(\n $carouselEl.querySelectorAll('[data-carousel-slide-to]')\n ).map(($indicatorEl: HTMLElement) => {\n indicators.push({\n position: parseInt(\n $indicatorEl.getAttribute('data-carousel-slide-to')\n ),\n el: $indicatorEl,\n });\n });\n }\n\n const carousel = new Carousel(items, {\n defaultPosition: defaultPosition,\n indicators: {\n items: indicators,\n },\n interval: interval ? interval : Default.interval,\n } as CarouselOptions);\n\n if (slide) {\n carousel.cycle();\n }\n\n // check for controls\n const carouselNextEl = $carouselEl.querySelector(\n '[data-carousel-next]'\n );\n const carouselPrevEl = $carouselEl.querySelector(\n '[data-carousel-prev]'\n );\n\n if (carouselNextEl) {\n carouselNextEl.addEventListener('click', () => {\n carousel.next();\n });\n }\n\n if (carouselPrevEl) {\n carouselPrevEl.addEventListener('click', () => {\n carousel.prev();\n });\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Carousel = Carousel;\n window.initCarousels = initCarousels;\n}\n\nexport default Carousel;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { CollapseOptions } from './types';\nimport { CollapseInterface } from './interface';\n\nconst Default: CollapseOptions = {\n onCollapse: () => {},\n onExpand: () => {},\n onToggle: () => {},\n};\n\nclass Collapse implements CollapseInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: CollapseOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: CollapseOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n if (this._triggerEl.hasAttribute('aria-expanded')) {\n this._visible =\n this._triggerEl.getAttribute('aria-expanded') === 'true';\n } else {\n // fix until v2 not to break previous single collapses which became dismiss\n this._visible = !this._targetEl.classList.contains('hidden');\n }\n\n this._triggerEl.addEventListener('click', () => {\n this.toggle();\n });\n }\n }\n\n collapse() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onCollapse(this);\n }\n\n expand() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onExpand(this);\n }\n\n toggle() {\n if (this._visible) {\n this.collapse();\n } else {\n this.expand();\n }\n // callback function\n this._options.onToggle(this);\n }\n}\n\nexport function initCollapses() {\n document\n .querySelectorAll('[data-collapse-toggle]')\n .forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-collapse-toggle');\n const $targetEl = document.getElementById(targetId);\n\n // check if the target element exists\n if ($targetEl) {\n new Collapse(\n $targetEl as HTMLElement,\n $triggerEl as HTMLElement\n );\n } else {\n console.error(\n `The target element with id \"${targetId}\" does not exist. Please check the data-collapse-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Collapse = Collapse;\n window.initCollapses = initCollapses;\n}\n\nexport default Collapse;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DialOptions, DialTriggerType } from './types';\nimport { DialInterface } from './interface';\n\nconst Default: DialOptions = {\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dial implements DialInterface {\n _parentEl: HTMLElement;\n _triggerEl: HTMLElement;\n _targetEl: HTMLElement;\n _options: DialOptions;\n _visible: boolean;\n\n constructor(\n parentEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n targetEl: HTMLElement | null = null,\n options: DialOptions = Default\n ) {\n this._parentEl = parentEl;\n this._triggerEl = triggerEl;\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n const triggerEventTypes = this._getTriggerEventTypes(\n this._options.triggerType\n );\n triggerEventTypes.showEvents.forEach((ev: string) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEventTypes.hideEvents.forEach((ev: string) => {\n this._parentEl.addEventListener(ev, () => {\n if (!this._parentEl.matches(':hover')) {\n this.hide();\n }\n });\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'false');\n }\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n if (this._triggerEl) {\n this._triggerEl.setAttribute('aria-expanded', 'true');\n }\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this._visible) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n\n _getTriggerEventTypes(triggerType: DialTriggerType) {\n switch (triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n}\n\nexport function initDials() {\n document.querySelectorAll('[data-dial-init]').forEach(($parentEl) => {\n const $triggerEl = $parentEl.querySelector('[data-dial-toggle]');\n\n if ($triggerEl) {\n const dialId = $triggerEl.getAttribute('data-dial-toggle');\n const $dialEl = document.getElementById(dialId);\n\n if ($dialEl) {\n const triggerType =\n $triggerEl.getAttribute('data-dial-trigger');\n new Dial(\n $parentEl as HTMLElement,\n $triggerEl as HTMLElement,\n $dialEl as HTMLElement,\n {\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as DialOptions\n );\n } else {\n console.error(\n `Dial with id ${dialId} does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?`\n );\n }\n } else {\n console.error(\n `Dial with id ${$parentEl.id} does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dial = Dial;\n window.initDials = initDials;\n}\n\nexport default Dial;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DismissOptions } from './types';\nimport { DismissInterface } from './interface';\n\nconst Default: DismissOptions = {\n transition: 'transition-opacity',\n duration: 300,\n timing: 'ease-out',\n onHide: () => {},\n};\n\nclass Dismiss implements DismissInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: DismissOptions;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: DismissOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._triggerEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n hide() {\n this._targetEl.classList.add(\n this._options.transition,\n `duration-${this._options.duration}`,\n this._options.timing,\n 'opacity-0'\n );\n setTimeout(() => {\n this._targetEl.classList.add('hidden');\n }, this._options.duration);\n\n // callback function\n this._options.onHide(this, this._targetEl);\n }\n}\n\nexport function initDismisses() {\n document.querySelectorAll('[data-dismiss-target]').forEach(($triggerEl) => {\n const targetId = $triggerEl.getAttribute('data-dismiss-target');\n const $dismissEl = document.querySelector(targetId);\n\n if ($dismissEl) {\n new Dismiss($dismissEl as HTMLElement, $triggerEl as HTMLElement);\n } else {\n console.error(\n `The dismiss element with id \"${targetId}\" does not exist. Please check the data-dismiss-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dismiss = Dismiss;\n window.initDismisses = initDismisses;\n}\n\nexport default Dismiss;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { DrawerInstance, DrawerOptions, PlacementClasses } from './types';\nimport { DrawerInterface } from './interface';\n\nconst Default: DrawerOptions = {\n placement: 'left',\n bodyScrolling: false,\n backdrop: true,\n edge: false,\n edgeOffset: 'bottom-[60px]',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Drawer implements DrawerInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DrawerOptions;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: DrawerOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._visible = false;\n this._init();\n }\n\n _init() {\n // set initial accessibility attributes\n if (this._targetEl) {\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.classList.add('transition-transform');\n }\n\n // set base placement classes\n this._getPlacementClasses(this._options.placement).base.map((c) => {\n this._targetEl.classList.add(c);\n });\n\n // add keyboard event listener to document\n document.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n // if 'Escape' key is pressed\n if (this.isVisible()) {\n // if the Drawer is visible\n this.hide(); // hide the Drawer\n }\n }\n });\n }\n\n hide() {\n // based on the edge option show placement classes\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.remove(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.add(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n\n // enable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.remove('overflow-hidden');\n }\n\n // destroy backdrop\n if (this._options.backdrop) {\n this._destroyBackdropEl();\n }\n\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n\n show() {\n if (this._options.edge) {\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).active.map((c) => {\n this._targetEl.classList.add(c);\n });\n this._getPlacementClasses(\n this._options.placement + '-edge'\n ).inactive.map((c) => {\n this._targetEl.classList.remove(c);\n });\n } else {\n this._getPlacementClasses(this._options.placement).active.map(\n (c) => {\n this._targetEl.classList.add(c);\n }\n );\n this._getPlacementClasses(this._options.placement).inactive.map(\n (c) => {\n this._targetEl.classList.remove(c);\n }\n );\n }\n\n // set accessibility attributes\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n\n // disable body scroll\n if (!this._options.bodyScrolling) {\n document.body.classList.add('overflow-hidden');\n }\n\n // show backdrop\n if (this._options.backdrop) {\n this._createBackdrop();\n }\n\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n _createBackdrop() {\n if (!this._visible) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('drawer-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n backdropEl.addEventListener('click', () => {\n this.hide();\n });\n }\n }\n\n _destroyBackdropEl() {\n if (this._visible) {\n document.querySelector('[drawer-backdrop]').remove();\n }\n }\n\n _getPlacementClasses(placement: string): PlacementClasses {\n switch (placement) {\n case 'top':\n return {\n base: ['top-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['-translate-y-full'],\n };\n case 'right':\n return {\n base: ['right-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-x-full'],\n };\n case 'bottom':\n return {\n base: ['bottom-0', 'left-0', 'right-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full'],\n };\n case 'left':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n case 'bottom-edge':\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['translate-y-full', this._options.edgeOffset],\n };\n default:\n return {\n base: ['left-0', 'top-0'],\n active: ['transform-none'],\n inactive: ['-translate-x-full'],\n };\n }\n }\n\n isHidden() {\n return !this._visible;\n }\n\n isVisible() {\n return this._visible;\n }\n}\n\nconst getDrawerInstance = (id: string, instances: DrawerInstance[]) => {\n if (instances.some((drawerInstance) => drawerInstance.id === id)) {\n return instances.find((drawerInstance) => drawerInstance.id === id);\n }\n};\n\nexport function initDrawers() {\n const drawerInstances = [] as DrawerInstance[];\n document.querySelectorAll('[data-drawer-target]').forEach(($triggerEl) => {\n // mandatory\n const drawerId = $triggerEl.getAttribute('data-drawer-target');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n // optional\n const placement = $triggerEl.getAttribute('data-drawer-placement');\n const bodyScrolling = $triggerEl.getAttribute(\n 'data-drawer-body-scrolling'\n );\n const backdrop = $triggerEl.getAttribute('data-drawer-backdrop');\n const edge = $triggerEl.getAttribute('data-drawer-edge');\n const edgeOffset = $triggerEl.getAttribute(\n 'data-drawer-edge-offset'\n );\n\n if (!getDrawerInstance(drawerId, drawerInstances)) {\n drawerInstances.push({\n id: drawerId,\n object: new Drawer($drawerEl, {\n placement: placement ? placement : Default.placement,\n bodyScrolling: bodyScrolling\n ? bodyScrolling === 'true'\n ? true\n : false\n : Default.bodyScrolling,\n backdrop: backdrop\n ? backdrop === 'true'\n ? true\n : false\n : Default.backdrop,\n edge: edge\n ? edge === 'true'\n ? true\n : false\n : Default.edge,\n edgeOffset: edgeOffset\n ? edgeOffset\n : Default.edgeOffset,\n } as DrawerOptions),\n });\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-toggle]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-toggle');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer: DrawerInstance = getDrawerInstance(\n drawerId,\n drawerInstances\n );\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.toggle();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n\n document\n .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]')\n .forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-dismiss')\n ? $triggerEl.getAttribute('data-drawer-dismiss')\n : $triggerEl.getAttribute('data-drawer-hide');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.hide();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id`\n );\n }\n });\n\n document.querySelectorAll('[data-drawer-show]').forEach(($triggerEl) => {\n const drawerId = $triggerEl.getAttribute('data-drawer-show');\n const $drawerEl = document.getElementById(drawerId);\n\n if ($drawerEl) {\n const drawer = getDrawerInstance(drawerId, drawerInstances);\n\n if (drawer) {\n $triggerEl.addEventListener('click', () => {\n drawer.object.show();\n });\n } else {\n console.error(\n `Drawer with id ${drawerId} has not been initialized. Please initialize it using the data-drawer-target attribute.`\n );\n }\n } else {\n console.error(\n `Drawer with id ${drawerId} not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Drawer = Drawer;\n window.initDrawers = initDrawers;\n}\n\nexport default Drawer;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { DropdownOptions } from './types';\nimport { DropdownInterface } from './interface';\n\nconst Default: DropdownOptions = {\n placement: 'bottom',\n triggerType: 'click',\n offsetSkidding: 0,\n offsetDistance: 10,\n delay: 300,\n ignoreClickOutsideClass: false,\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Dropdown implements DropdownInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: DropdownOptions;\n _visible: boolean;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetElement: HTMLElement | null = null,\n triggerElement: HTMLElement | null = null,\n options: DropdownOptions = Default\n ) {\n this._targetEl = targetElement;\n this._triggerEl = triggerElement;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n // click event handling for trigger element\n if (this._options.triggerType === 'click') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.toggle();\n });\n });\n }\n\n // hover event handling for trigger element\n if (this._options.triggerType === 'hover') {\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n if (ev === 'click') {\n this.toggle();\n } else {\n setTimeout(() => {\n this.show();\n }, this._options.delay);\n }\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, this._options.delay);\n });\n });\n }\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [\n this._options.offsetSkidding,\n this._options.offsetDistance,\n ],\n },\n },\n ],\n });\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n\n // Ignore clicks on the trigger element (ie. a datepicker input)\n const ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;\n\n let isIgnored = false;\n if (ignoreClickOutsideClass) {\n const ignoredClickOutsideEls = document.querySelectorAll(\n `.${ignoreClickOutsideClass}`\n );\n ignoredClickOutsideEls.forEach((el) => {\n if (el.contains(clickedEl)) {\n isIgnored = true;\n return;\n }\n });\n }\n\n // Ignore clicks on the target element (ie. dropdown itself)\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n !isIgnored &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'click'],\n hideEvents: ['mouseleave'],\n };\n case 'click':\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['click'],\n hideEvents: [],\n };\n }\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n isVisible() {\n return this._visible;\n }\n\n show() {\n this._targetEl.classList.remove('hidden');\n this._targetEl.classList.add('block');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n this._setupClickOutsideListener();\n\n // Update its position\n this._popperInstance.update();\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('block');\n this._targetEl.classList.add('hidden');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n this._visible = false;\n\n this._removeClickOutsideListener();\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initDropdowns() {\n document\n .querySelectorAll('[data-dropdown-toggle]')\n .forEach(($triggerEl) => {\n const dropdownId = $triggerEl.getAttribute('data-dropdown-toggle');\n const $dropdownEl = document.getElementById(dropdownId);\n\n if ($dropdownEl) {\n const placement = $triggerEl.getAttribute(\n 'data-dropdown-placement'\n );\n const offsetSkidding = $triggerEl.getAttribute(\n 'data-dropdown-offset-skidding'\n );\n const offsetDistance = $triggerEl.getAttribute(\n 'data-dropdown-offset-distance'\n );\n const triggerType = $triggerEl.getAttribute(\n 'data-dropdown-trigger'\n );\n const delay = $triggerEl.getAttribute('data-dropdown-delay');\n const ignoreClickOutsideClass = $triggerEl.getAttribute(\n 'data-dropdown-ignore-click-outside-class'\n );\n\n new Dropdown(\n $dropdownEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n offsetSkidding: offsetSkidding\n ? parseInt(offsetSkidding)\n : Default.offsetSkidding,\n offsetDistance: offsetDistance\n ? parseInt(offsetDistance)\n : Default.offsetDistance,\n delay: delay ? parseInt(delay) : Default.delay,\n ignoreClickOutsideClass: ignoreClickOutsideClass\n ? ignoreClickOutsideClass\n : Default.ignoreClickOutsideClass,\n } as DropdownOptions\n );\n } else {\n console.error(\n `The dropdown element with id \"${dropdownId}\" does not exist. Please check the data-dropdown-toggle attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Dropdown = Dropdown;\n window.initDropdowns = initDropdowns;\n}\n\nexport default Dropdown;\n","import { initAccordions } from './accordion';\nimport { initCarousels } from './carousel';\nimport { initCollapses } from './collapse';\nimport { initDials } from './dial';\nimport { initDismisses } from './dismiss';\nimport { initDrawers } from './drawer';\nimport { initDropdowns } from './dropdown';\nimport { initModals } from './modal';\nimport { initPopovers } from './popover';\nimport { initTabs } from './tabs';\nimport { initTooltips } from './tooltip';\n\nexport function initFlowbite() {\n initAccordions();\n initCollapses();\n initCarousels();\n initDismisses();\n initDropdowns();\n initModals();\n initDrawers();\n initTabs();\n initTooltips();\n initPopovers();\n initDials();\n}\n\nif (typeof window !== 'undefined') {\n window.initFlowbite = initFlowbite;\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ModalInstance, ModalOptions } from './types';\nimport { ModalInterface } from './interface';\n\nconst Default: ModalOptions = {\n placement: 'center',\n backdropClasses:\n 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',\n backdrop: 'dynamic',\n closable: true,\n onHide: () => {},\n onShow: () => {},\n onToggle: () => {},\n};\n\nclass Modal implements ModalInterface {\n _targetEl: HTMLElement | null;\n _options: ModalOptions;\n _isHidden: boolean;\n _backdropEl: HTMLElement | null;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n\n constructor(\n targetEl: HTMLElement | null = null,\n options: ModalOptions = Default\n ) {\n this._targetEl = targetEl;\n this._options = { ...Default, ...options };\n this._isHidden = true;\n this._backdropEl = null;\n this._init();\n }\n\n _init() {\n if (this._targetEl) {\n this._getPlacementClasses().map((c) => {\n this._targetEl.classList.add(c);\n });\n }\n }\n\n _createBackdrop() {\n if (this._isHidden) {\n const backdropEl = document.createElement('div');\n backdropEl.setAttribute('modal-backdrop', '');\n backdropEl.classList.add(\n ...this._options.backdropClasses.split(' ')\n );\n document.querySelector('body').append(backdropEl);\n this._backdropEl = backdropEl;\n }\n }\n\n _destroyBackdropEl() {\n if (!this._isHidden) {\n document.querySelector('[modal-backdrop]').remove();\n }\n }\n\n _setupModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleOutsideClick(ev.target);\n };\n this._targetEl.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeModalCloseEventListeners() {\n if (this._options.backdrop === 'dynamic') {\n this._targetEl.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _handleOutsideClick(target: EventTarget) {\n if (\n target === this._targetEl ||\n (target === this._backdropEl && this.isVisible())\n ) {\n this.hide();\n }\n }\n\n _getPlacementClasses() {\n switch (this._options.placement) {\n // top\n case 'top-left':\n return ['justify-start', 'items-start'];\n case 'top-center':\n return ['justify-center', 'items-start'];\n case 'top-right':\n return ['justify-end', 'items-start'];\n\n // center\n case 'center-left':\n return ['justify-start', 'items-center'];\n case 'center':\n return ['justify-center', 'items-center'];\n case 'center-right':\n return ['justify-end', 'items-center'];\n\n // bottom\n case 'bottom-left':\n return ['justify-start', 'items-end'];\n case 'bottom-center':\n return ['justify-center', 'items-end'];\n case 'bottom-right':\n return ['justify-end', 'items-end'];\n\n default:\n return ['justify-center', 'items-center'];\n }\n }\n\n toggle() {\n if (this._isHidden) {\n this.show();\n } else {\n this.hide();\n }\n\n // callback function\n this._options.onToggle(this);\n }\n\n show() {\n if (this.isHidden) {\n this._targetEl.classList.add('flex');\n this._targetEl.classList.remove('hidden');\n this._targetEl.setAttribute('aria-modal', 'true');\n this._targetEl.setAttribute('role', 'dialog');\n this._targetEl.removeAttribute('aria-hidden');\n this._createBackdrop();\n this._isHidden = false;\n\n // prevent body scroll\n document.body.classList.add('overflow-hidden');\n\n // Add keyboard event listener to the document\n if (this._options.closable) {\n this._setupModalCloseEventListeners();\n }\n\n // callback function\n this._options.onShow(this);\n }\n }\n\n hide() {\n if (this.isVisible) {\n this._targetEl.classList.add('hidden');\n this._targetEl.classList.remove('flex');\n this._targetEl.setAttribute('aria-hidden', 'true');\n this._targetEl.removeAttribute('aria-modal');\n this._targetEl.removeAttribute('role');\n this._destroyBackdropEl();\n this._isHidden = true;\n\n // re-apply body scroll\n document.body.classList.remove('overflow-hidden');\n\n if (this._options.closable) {\n this._removeModalCloseEventListeners();\n }\n\n // callback function\n this._options.onHide(this);\n }\n }\n\n isVisible() {\n return !this._isHidden;\n }\n\n isHidden() {\n return this._isHidden;\n }\n}\n\nconst getModalInstance = (id: string, instances: ModalInstance[]) => {\n if (instances.some((modalInstance) => modalInstance.id === id)) {\n return instances.find((modalInstance) => modalInstance.id === id);\n }\n return null;\n};\n\nexport function initModals() {\n const modalInstances = [] as ModalInstance[];\n\n // initiate modal based on data-modal-target\n document.querySelectorAll('[data-modal-target]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-target');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n if (!getModalInstance(modalId, modalInstances)) {\n modalInstances.push({\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n });\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.`\n );\n }\n });\n\n // support pre v1.6.0 data-modal-toggle initialization\n document.querySelectorAll('[data-modal-toggle]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-toggle');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const placement = $modalEl.getAttribute('data-modal-placement');\n const backdrop = $modalEl.getAttribute('data-modal-backdrop');\n\n let modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (!modal) {\n modal = {\n id: modalId,\n object: new Modal(\n $modalEl as HTMLElement,\n {\n placement: placement\n ? placement\n : Default.placement,\n backdrop: backdrop ? backdrop : Default.backdrop,\n } as ModalOptions\n ),\n };\n modalInstances.push(modal);\n }\n\n $triggerEl.addEventListener('click', () => {\n modal.object.toggle();\n });\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?`\n );\n }\n });\n\n // show modal on click if exists based on id\n document.querySelectorAll('[data-modal-show]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-show');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isHidden) {\n modal.object.show();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?`\n );\n }\n });\n\n // hide modal on click if exists based on id\n document.querySelectorAll('[data-modal-hide]').forEach(($triggerEl) => {\n const modalId = $triggerEl.getAttribute('data-modal-hide');\n const $modalEl = document.getElementById(modalId);\n\n if ($modalEl) {\n const modal: ModalInstance = getModalInstance(\n modalId,\n modalInstances\n );\n\n if (modal) {\n $triggerEl.addEventListener('click', () => {\n if (modal.object.isVisible) {\n modal.object.hide();\n }\n });\n } else {\n console.error(\n `Modal with id ${modalId} has not been initialized. Please initialize it using the data-modal-target attribute.`\n );\n }\n } else {\n console.error(\n `Modal with id ${modalId} does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Modal = Modal;\n window.initModals = initModals;\n}\n\nexport default Modal;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { PopoverOptions } from './types';\nimport { PopoverInterface } from './interface';\n\nconst Default: PopoverOptions = {\n placement: 'top',\n offset: 10,\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Popover implements PopoverInterface {\n _targetEl: HTMLElement;\n _triggerEl: HTMLElement;\n _options: PopoverOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: PopoverOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n this._targetEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._targetEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n this._targetEl.addEventListener(ev, () => {\n setTimeout(() => {\n if (!this._triggerEl.matches(':hover')) {\n this.hide();\n }\n }, 100);\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, this._options.offset],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n this._options.onToggle(this);\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility to true\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility to false\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initPopovers() {\n document.querySelectorAll('[data-popover-target]').forEach(($triggerEl) => {\n const popoverID = $triggerEl.getAttribute('data-popover-target');\n const $popoverEl = document.getElementById(popoverID);\n\n if ($popoverEl) {\n const triggerType = $triggerEl.getAttribute('data-popover-trigger');\n const placement = $triggerEl.getAttribute('data-popover-placement');\n const offset = $triggerEl.getAttribute('data-popover-offset');\n\n new Popover(\n $popoverEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n offset: offset ? parseInt(offset) : Default.offset,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as PopoverOptions\n );\n } else {\n console.error(\n `The popover element with id \"${popoverID}\" does not exist. Please check the data-popover-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Popover = Popover;\n window.initPopovers = initPopovers;\n}\n\nexport default Popover;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { TabItem, TabsOptions } from './types';\nimport { TabsInterface } from './interface';\n\nconst Default: TabsOptions = {\n defaultTabId: null,\n activeClasses:\n 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500',\n inactiveClasses:\n 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300',\n onShow: () => {},\n};\n\nclass Tabs implements TabsInterface {\n _items: TabItem[];\n _activeTab: TabItem;\n _options: TabsOptions;\n\n constructor(items: TabItem[] = [], options: TabsOptions = Default) {\n this._items = items;\n this._activeTab = options ? this.getTab(options.defaultTabId) : null;\n this._options = { ...Default, ...options };\n this._init();\n }\n\n _init() {\n if (this._items.length) {\n // set the first tab as active if not set by explicitly\n if (!this._activeTab) {\n this._setActiveTab(this._items[0]);\n }\n\n // force show the first default tab\n this.show(this._activeTab.id, true);\n\n // show tab content based on click\n this._items.map((tab) => {\n tab.triggerEl.addEventListener('click', () => {\n this.show(tab.id);\n });\n });\n }\n }\n\n getActiveTab() {\n return this._activeTab;\n }\n\n _setActiveTab(tab: TabItem) {\n this._activeTab = tab;\n }\n\n getTab(id: string) {\n return this._items.filter((t) => t.id === id)[0];\n }\n\n show(id: string, forceShow = false) {\n const tab = this.getTab(id);\n\n // don't do anything if already active\n if (tab === this._activeTab && !forceShow) {\n return;\n }\n\n // hide other tabs\n this._items.map((t: TabItem) => {\n if (t !== tab) {\n t.triggerEl.classList.remove(\n ...this._options.activeClasses.split(' ')\n );\n t.triggerEl.classList.add(\n ...this._options.inactiveClasses.split(' ')\n );\n t.targetEl.classList.add('hidden');\n t.triggerEl.setAttribute('aria-selected', 'false');\n }\n });\n\n // show active tab\n tab.triggerEl.classList.add(...this._options.activeClasses.split(' '));\n tab.triggerEl.classList.remove(\n ...this._options.inactiveClasses.split(' ')\n );\n tab.triggerEl.setAttribute('aria-selected', 'true');\n tab.targetEl.classList.remove('hidden');\n\n this._setActiveTab(tab);\n\n // callback function\n this._options.onShow(this, tab);\n }\n}\n\nexport function initTabs() {\n document.querySelectorAll('[data-tabs-toggle]').forEach(($triggerEl) => {\n const tabItems: TabItem[] = [];\n let defaultTabId = null;\n $triggerEl\n .querySelectorAll('[role=\"tab\"]')\n .forEach(($triggerEl: HTMLElement) => {\n const isActive =\n $triggerEl.getAttribute('aria-selected') === 'true';\n const tab: TabItem = {\n id: $triggerEl.getAttribute('data-tabs-target'),\n triggerEl: $triggerEl,\n targetEl: document.querySelector(\n $triggerEl.getAttribute('data-tabs-target')\n ),\n };\n tabItems.push(tab);\n\n if (isActive) {\n defaultTabId = tab.id;\n }\n });\n new Tabs(tabItems, {\n defaultTabId: defaultTabId,\n } as TabsOptions);\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tabs = Tabs;\n window.initTabs = initTabs;\n}\n\nexport default Tabs;\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { createPopper } from '@popperjs/core';\nimport type {\n Options as PopperOptions,\n Instance as PopperInstance,\n} from '@popperjs/core';\nimport type { TooltipOptions } from './types';\nimport { TooltipInterface } from './interface';\n\nconst Default: TooltipOptions = {\n placement: 'top',\n triggerType: 'hover',\n onShow: () => {},\n onHide: () => {},\n onToggle: () => {},\n};\n\nclass Tooltip implements TooltipInterface {\n _targetEl: HTMLElement | null;\n _triggerEl: HTMLElement | null;\n _options: TooltipOptions;\n _popperInstance: PopperInstance;\n _clickOutsideEventListener: EventListenerOrEventListenerObject;\n _keydownEventListener: EventListenerOrEventListenerObject;\n _visible: boolean;\n\n constructor(\n targetEl: HTMLElement | null = null,\n triggerEl: HTMLElement | null = null,\n options: TooltipOptions = Default\n ) {\n this._targetEl = targetEl;\n this._triggerEl = triggerEl;\n this._options = { ...Default, ...options };\n this._popperInstance = this._createPopperInstance();\n this._visible = false;\n this._init();\n }\n\n _init() {\n if (this._triggerEl) {\n this._setupEventListeners();\n }\n }\n\n _setupEventListeners() {\n const triggerEvents = this._getTriggerEvents();\n triggerEvents.showEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.show();\n });\n });\n triggerEvents.hideEvents.forEach((ev) => {\n this._triggerEl.addEventListener(ev, () => {\n this.hide();\n });\n });\n }\n\n _createPopperInstance() {\n return createPopper(this._triggerEl, this._targetEl, {\n placement: this._options.placement,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n }\n\n _getTriggerEvents() {\n switch (this._options.triggerType) {\n case 'hover':\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n case 'click':\n return {\n showEvents: ['click', 'focus'],\n hideEvents: ['focusout', 'blur'],\n };\n case 'none':\n return {\n showEvents: [],\n hideEvents: [],\n };\n default:\n return {\n showEvents: ['mouseenter', 'focus'],\n hideEvents: ['mouseleave', 'blur'],\n };\n }\n }\n\n _setupKeydownListener() {\n this._keydownEventListener = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.hide();\n }\n };\n document.body.addEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _removeKeydownListener() {\n document.body.removeEventListener(\n 'keydown',\n this._keydownEventListener,\n true\n );\n }\n\n _setupClickOutsideListener() {\n this._clickOutsideEventListener = (ev: MouseEvent) => {\n this._handleClickOutside(ev, this._targetEl);\n };\n document.body.addEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _removeClickOutsideListener() {\n document.body.removeEventListener(\n 'click',\n this._clickOutsideEventListener,\n true\n );\n }\n\n _handleClickOutside(ev: Event, targetEl: HTMLElement) {\n const clickedEl = ev.target as Node;\n if (\n clickedEl !== targetEl &&\n !targetEl.contains(clickedEl) &&\n !this._triggerEl.contains(clickedEl) &&\n this.isVisible()\n ) {\n this.hide();\n }\n }\n\n isVisible() {\n return this._visible;\n }\n\n toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n show() {\n this._targetEl.classList.remove('opacity-0', 'invisible');\n this._targetEl.classList.add('opacity-100', 'visible');\n\n // Enable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: true },\n ],\n }));\n\n // handle click outside\n this._setupClickOutsideListener();\n\n // handle esc keydown\n this._setupKeydownListener();\n\n // Update its position\n this._popperInstance.update();\n\n // set visibility\n this._visible = true;\n\n // callback function\n this._options.onShow(this);\n }\n\n hide() {\n this._targetEl.classList.remove('opacity-100', 'visible');\n this._targetEl.classList.add('opacity-0', 'invisible');\n\n // Disable the event listeners\n this._popperInstance.setOptions((options: PopperOptions) => ({\n ...options,\n modifiers: [\n ...options.modifiers,\n { name: 'eventListeners', enabled: false },\n ],\n }));\n\n // handle click outside\n this._removeClickOutsideListener();\n\n // handle esc keydown\n this._removeKeydownListener();\n\n // set visibility\n this._visible = false;\n\n // callback function\n this._options.onHide(this);\n }\n}\n\nexport function initTooltips() {\n document.querySelectorAll('[data-tooltip-target]').forEach(($triggerEl) => {\n const tooltipId = $triggerEl.getAttribute('data-tooltip-target');\n const $tooltipEl = document.getElementById(tooltipId);\n\n if ($tooltipEl) {\n const triggerType = $triggerEl.getAttribute('data-tooltip-trigger');\n const placement = $triggerEl.getAttribute('data-tooltip-placement');\n\n new Tooltip(\n $tooltipEl as HTMLElement,\n $triggerEl as HTMLElement,\n {\n placement: placement ? placement : Default.placement,\n triggerType: triggerType\n ? triggerType\n : Default.triggerType,\n } as TooltipOptions\n );\n } else {\n console.error(\n `The tooltip element with id \"${tooltipId}\" does not exist. Please check the data-tooltip-target attribute.`\n );\n }\n });\n}\n\nif (typeof window !== 'undefined') {\n window.Tooltip = Tooltip;\n window.initTooltips = initTooltips;\n}\n\nexport default Tooltip;\n","class Events {\n private _eventType: string;\n private _eventFunctions: EventListener[];\n\n constructor(eventType: string, eventFunctions: EventListener[] = []) {\n this._eventType = eventType;\n this._eventFunctions = eventFunctions;\n }\n\n init() {\n this._eventFunctions.forEach((eventFunction) => {\n if (typeof window !== 'undefined') {\n window.addEventListener(this._eventType, eventFunction);\n }\n });\n }\n}\n\nexport default Events;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// core components\nimport Accordion, { initAccordions } from './components/accordion';\nimport Carousel, { initCarousels } from './components/carousel';\nimport Collapse, { initCollapses } from './components/collapse';\nimport Dial, { initDials } from './components/dial';\nimport Dismiss, { initDismisses } from './components/dismiss';\nimport Drawer, { initDrawers } from './components/drawer';\nimport Dropdown, { initDropdowns } from './components/dropdown';\nimport Modal, { initModals } from './components/modal';\nimport Popover, { initPopovers } from './components/popover';\nimport Tabs, { initTabs } from './components/tabs';\nimport Tooltip, { initTooltips } from './components/tooltip';\nimport './components/index';\nimport Events from './dom/events';\n\nconst turboLoadEvents = new Events('turbo:load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nturboLoadEvents.init();\n\nconst turboFrameLoadEvents = new Events('turbo:frame-load', [\n initAccordions,\n initCollapses,\n initCarousels,\n initDismisses,\n initDropdowns,\n initModals,\n initDrawers,\n initTabs,\n initTooltips,\n initPopovers,\n initDials,\n]);\nturboFrameLoadEvents.init();\n\nexport default {\n Accordion,\n Carousel,\n Collapse,\n Dial,\n Drawer,\n Dismiss,\n Dropdown,\n Modal,\n Popover,\n Tabs,\n Tooltip,\n Events,\n};\n"],"names":["root","factory","exports","module","define","amd","self","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases","getNodeName","element","nodeName","toLowerCase","getWindow","node","window","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","name","enabled","phase","fn","_ref","state","Object","keys","elements","forEach","style","styles","attributes","assign","value","removeAttribute","setAttribute","effect","_ref2","initialStyles","position","options","strategy","top","margin","arrow","hasOwnProperty","property","attribute","requires","getBasePlacement","split","Math","max","min","round","getUAString","uaData","navigator","userAgentData","brands","map","item","brand","version","join","userAgent","isLayoutViewport","test","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scaleX","scaleY","offsetWidth","width","offsetHeight","height","visualViewport","addVisualOffsets","x","offsetLeft","y","offsetTop","getLayoutRect","abs","contains","parent","child","rootNode","getRootNode","next","isSameNode","parentNode","host","getComputedStyle","isTableElement","indexOf","getDocumentElement","document","documentElement","getParentNode","assignedSlot","getTrueOffsetParent","offsetParent","getOffsetParent","isFirefox","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","getMainAxisFromPlacement","within","mergePaddingObject","paddingObject","expandToHashMap","hashMap","key","_state$modifiersData$","arrowElement","popperOffsets","modifiersData","basePlacement","axis","len","padding","rects","toPaddingObject","arrowRect","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","clientHeight","clientWidth","centerToReference","center","offset","axisProp","centerOffset","_options$element","querySelector","requiresIfExists","getVariation","unsetSides","mapToStyles","_Object$assign2","popperRect","variation","offsets","gpuAcceleration","adaptive","roundOffsets","isFixed","_offsets$x","_offsets$y","_ref3","hasX","hasY","sideX","sideY","win","heightProp","widthProp","_Object$assign","commonStyles","_ref4","dpr","devicePixelRatio","roundOffsetsByDPR","_ref5","_options$gpuAccelerat","_options$adaptive","_options$roundOffsets","data","passive","instance","_options$scroll","scroll","_options$resize","resize","scrollParents","scrollParent","addEventListener","update","removeEventListener","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","getWindowScroll","scrollLeft","pageXOffset","scrollTop","pageYOffset","getWindowScrollBarX","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getScrollParent","body","listScrollParents","list","_element$ownerDocumen","isBody","target","updatedList","rectToClientRect","rect","getClientRectFromMixedType","clippingParent","html","layoutViewport","getViewportRect","clientTop","clientLeft","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","computeOffsets","commonX","commonY","mainAxis","detectOverflow","_options","_options$placement","_options$strategy","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","altContext","clippingClientRect","contextElement","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","flipVariations","allowedAutoPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","placements","_options$allowedAutoP","allowedPlacements","length","overflows","sort","a","b","computeAutoPlacement","referenceRect","checksMap","Map","makeFallbackChecks","firstFittingPlacement","i","_basePlacement","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","push","every","check","set","_loop","_i","fittingPlacement","find","get","slice","reset","getSideOffsets","preventedOffsets","isAnySideFullyClipped","some","side","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","_options$offset","invertDistance","skidding","distance","distanceAndSkiddingToXY","_data$state$placement","_options$tether","tether","_options$tetherOffset","tetherOffset","isBasePlacement","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","_offsetModifierState$","mainSide","altSide","additive","minLen","maxLen","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","clientOffset","offsetModifierValue","tetherMax","preventedOffset","_offsetModifierState$2","_mainSide","_altSide","_offset","_len","_min","_max","isOriginSide","_offsetModifierValue","_tetherMin","_tetherMax","_preventedOffset","v","withinMaxClamp","getCompositeRect","elementOrVirtualElement","isOffsetParentAnElement","offsetParentIsScaled","isElementScaled","order","modifiers","visited","Set","result","modifier","add","dep","has","depModifier","DEFAULT_OPTIONS","areValidElements","arguments","args","Array","_key","popperGenerator","generatorOptions","_generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","pending","orderedModifiers","effectCleanupFns","isDestroyed","setOptions","setOptionsAction","cleanupModifierEffects","orderModifiers","merged","current","existing","mergeByName","m","_ref3$options","cleanupFn","noopFn","forceUpdate","_state$elements","index","_state$orderedModifie","_state$orderedModifie2","Promise","resolve","then","undefined","destroy","onFirstUpdate","createPopper","eventListeners","Default","alwaysOpen","activeClasses","inactiveClasses","onOpen","onClose","onToggle","items","this","_items","_init","active","open","id","triggerEl","toggle","getItem","classList","remove","targetEl","iconEl","close","initAccordions","querySelectorAll","$accordionEl","getAttribute","$triggerEl","closest","Accordion","defaultPosition","indicators","interval","onNext","onPrev","onChange","_activeItem","_indicators","_intervalDuration","_intervalInstance","el","_getActiveItem","slideTo","indicator","nextItem","rotationItems","middle","_rotate","_setActiveItem","pause","cycle","activeItem","prev","prevItem","setInterval","clearInterval","initCarousels","$carouselEl","slide","from","$carouselItemEl","$indicatorEl","parseInt","carousel","Carousel","carouselNextEl","carouselPrevEl","onCollapse","onExpand","_targetEl","_triggerEl","_visible","hasAttribute","collapse","expand","initCollapses","targetId","$targetEl","getElementById","Collapse","console","error","triggerType","onShow","onHide","parentEl","_parentEl","triggerEventTypes","_getTriggerEventTypes","showEvents","ev","show","hideEvents","matches","hide","isHidden","isVisible","initDials","$parentEl","dialId","$dialEl","Dial","transition","duration","timing","setTimeout","initDismisses","$dismissEl","Dismiss","bodyScrolling","backdrop","edge","edgeOffset","backdropClasses","_getPlacementClasses","base","c","event","inactive","_destroyBackdropEl","_createBackdrop","backdropEl","createElement","append","getDrawerInstance","instances","drawerInstance","initDrawers","drawerInstances","drawerId","$drawerEl","object","Drawer","offsetSkidding","offsetDistance","delay","ignoreClickOutsideClass","targetElement","triggerElement","_popperInstance","_createPopperInstance","_setupEventListeners","triggerEvents","_getTriggerEvents","_setupClickOutsideListener","_clickOutsideEventListener","_handleClickOutside","_removeClickOutsideListener","clickedEl","isIgnored","initDropdowns","dropdownId","$dropdownEl","Dropdown","initFlowbite","initModals","initTabs","initTooltips","initPopovers","closable","_isHidden","_backdropEl","_setupModalCloseEventListeners","_handleOutsideClick","_keydownEventListener","_removeModalCloseEventListeners","getModalInstance","modalInstance","modalInstances","modalId","$modalEl","Modal","_setupKeydownListener","_removeKeydownListener","popoverID","$popoverEl","Popover","defaultTabId","_activeTab","getTab","_setActiveTab","tab","getActiveTab","t","forceShow","tabItems","isActive","Tabs","tooltipId","$tooltipEl","Tooltip","eventType","eventFunctions","_eventType","_eventFunctions","init","eventFunction","Events","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","d","definition","o","defineProperty","enumerable","obj","prop","prototype","r","Symbol","toStringTag"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/index.d.ts b/node_modules/flowbite/lib/cjs/components/accordion/index.d.ts new file mode 100644 index 0000000..4ea151a --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/index.d.ts @@ -0,0 +1,15 @@ +import type { AccordionItem, AccordionOptions } from './types'; +import { AccordionInterface } from './interface'; +declare class Accordion implements AccordionInterface { + _items: AccordionItem[]; + _options: AccordionOptions; + constructor(items?: AccordionItem[], options?: AccordionOptions); + private _init; + getItem(id: string): AccordionItem; + open(id: string): void; + toggle(id: string): void; + close(id: string): void; +} +export declare function initAccordions(): void; +export default Accordion; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/accordion/index.d.ts.map new file mode 100644 index 0000000..a7f1f0f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAWjD,cAAM,SAAU,YAAW,kBAAkB;IACzC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;gBAGvB,KAAK,GAAE,aAAa,EAAO,EAC3B,OAAO,GAAE,gBAA0B;IAOvC,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,EAAE,EAAE,MAAM;IAIlB,IAAI,CAAC,EAAE,EAAE,MAAM;IA2Cf,MAAM,CAAC,EAAE,EAAE,MAAM;IAajB,KAAK,CAAC,EAAE,EAAE,MAAM;CAqBnB;AAED,wBAAgB,cAAc,SA2C7B;AAOD,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/index.js b/node_modules/flowbite/lib/cjs/components/accordion/index.js new file mode 100644 index 0000000..0089ea2 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/index.js @@ -0,0 +1,151 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initAccordions = void 0; +var Default = { + alwaysOpen: false, + activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white', + inactiveClasses: 'text-gray-500 dark:text-gray-400', + onOpen: function () { }, + onClose: function () { }, + onToggle: function () { }, +}; +var Accordion = /** @class */ (function () { + function Accordion(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Accordion.prototype._init = function () { + var _this = this; + if (this._items.length) { + // show accordion item based on click + this._items.map(function (item) { + if (item.active) { + _this.open(item.id); + } + item.triggerEl.addEventListener('click', function () { + _this.toggle(item.id); + }); + }); + } + }; + Accordion.prototype.getItem = function (id) { + return this._items.filter(function (item) { return item.id === id; })[0]; + }; + Accordion.prototype.open = function (id) { + var _a, _b; + var _this = this; + var item = this.getItem(id); + // don't hide other accordions if always open + if (!this._options.alwaysOpen) { + this._items.map(function (i) { + var _a, _b; + if (i !== item) { + (_a = i.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = i.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + i.targetEl.classList.add('hidden'); + i.triggerEl.setAttribute('aria-expanded', 'false'); + i.active = false; + // rotate icon if set + if (i.iconEl) { + i.iconEl.classList.remove('rotate-180'); + } + } + }); + } + // show active item + (_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + item.triggerEl.setAttribute('aria-expanded', 'true'); + item.targetEl.classList.remove('hidden'); + item.active = true; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.add('rotate-180'); + } + // callback function + this._options.onOpen(this, item); + }; + Accordion.prototype.toggle = function (id) { + var item = this.getItem(id); + if (item.active) { + this.close(id); + } + else { + this.open(id); + } + // callback function + this._options.onToggle(this, item); + }; + Accordion.prototype.close = function (id) { + var _a, _b; + var item = this.getItem(id); + (_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(' ')); + item.targetEl.classList.add('hidden'); + item.triggerEl.setAttribute('aria-expanded', 'false'); + item.active = false; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.remove('rotate-180'); + } + // callback function + this._options.onClose(this, item); + }; + return Accordion; +}()); +function initAccordions() { + document.querySelectorAll('[data-accordion]').forEach(function ($accordionEl) { + var alwaysOpen = $accordionEl.getAttribute('data-accordion'); + var activeClasses = $accordionEl.getAttribute('data-active-classes'); + var inactiveClasses = $accordionEl.getAttribute('data-inactive-classes'); + var items = []; + $accordionEl + .querySelectorAll('[data-accordion-target]') + .forEach(function ($triggerEl) { + // Consider only items that directly belong to $accordionEl + // (to make nested accordions work). + if ($triggerEl.closest('[data-accordion]') === $accordionEl) { + var item = { + id: $triggerEl.getAttribute('data-accordion-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-accordion-target')), + iconEl: $triggerEl.querySelector('[data-accordion-icon]'), + active: $triggerEl.getAttribute('aria-expanded') === 'true' + ? true + : false, + }; + items.push(item); + } + }); + new Accordion(items, { + alwaysOpen: alwaysOpen === 'open' ? true : false, + activeClasses: activeClasses + ? activeClasses + : Default.activeClasses, + inactiveClasses: inactiveClasses + ? inactiveClasses + : Default.inactiveClasses, + }); + }); +} +exports.initAccordions = initAccordions; +if (typeof window !== 'undefined') { + window.Accordion = Accordion; + window.initAccordions = initAccordions; +} +exports.default = Accordion; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/index.js.map b/node_modules/flowbite/lib/cjs/components/accordion/index.js.map new file mode 100644 index 0000000..b35b518 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/accordion/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAqB;IAC9B,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,4DAA4D;IAC3E,eAAe,EAAE,kCAAkC;IACnD,MAAM,EAAE,cAAO,CAAC;IAChB,OAAO,EAAE,cAAO,CAAC;IACjB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAII,mBACI,KAA2B,EAC3B,OAAmC;Q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,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC;AA3CD,wCA2CC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC;CAC1C;AAED,kBAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts b/node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts new file mode 100644 index 0000000..ebeacd9 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts @@ -0,0 +1,10 @@ +import { AccordionItem, AccordionOptions } from './types'; +export declare interface AccordionInterface { + _items: AccordionItem[]; + _options: AccordionOptions; + getItem(id: string): AccordionItem | undefined; + open(id: string): void; + toggle(id: string): void; + close(id: string): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts.map new file mode 100644 index 0000000..cfc63e5 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/interface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACvC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAC/C,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/interface.js b/node_modules/flowbite/lib/cjs/components/accordion/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/interface.js.map b/node_modules/flowbite/lib/cjs/components/accordion/interface.js.map new file mode 100644 index 0000000..a7ef24a --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/accordion/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/types.d.ts b/node_modules/flowbite/lib/cjs/components/accordion/types.d.ts new file mode 100644 index 0000000..c8fb43a --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/types.d.ts @@ -0,0 +1,17 @@ +import { AccordionInterface } from './interface'; +export declare type AccordionItem = { + id: string; + triggerEl: HTMLElement; + targetEl: HTMLElement; + iconEl?: HTMLElement | null; + active?: boolean; +}; +export declare type AccordionOptions = { + alwaysOpen?: boolean; + activeClasses?: string; + inactiveClasses?: string; + onOpen?: (accordion: AccordionInterface, item: AccordionItem) => void; + onClose?: (accordion: AccordionInterface, item: AccordionItem) => void; + onToggle?: (accordion: AccordionInterface, item: AccordionItem) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/accordion/types.d.ts.map new file mode 100644 index 0000000..c130ff7 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3E,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/types.js b/node_modules/flowbite/lib/cjs/components/accordion/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/accordion/types.js.map b/node_modules/flowbite/lib/cjs/components/accordion/types.js.map new file mode 100644 index 0000000..e0f0c46 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/accordion/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/accordion/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/index.d.ts b/node_modules/flowbite/lib/cjs/components/carousel/index.d.ts new file mode 100644 index 0000000..0361e3e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/index.d.ts @@ -0,0 +1,54 @@ +import type { CarouselOptions, CarouselItem, IndicatorItem, RotationItems } from './types'; +import { CarouselInterface } from './interface'; +declare class Carousel implements CarouselInterface { + _items: CarouselItem[]; + _indicators: IndicatorItem[]; + _activeItem: CarouselItem; + _intervalDuration: number; + _intervalInstance: number; + _options: CarouselOptions; + constructor(items?: CarouselItem[], options?: CarouselOptions); + /** + * initialize carousel and items based on active one + */ + _init(): void; + getItem(position: number): CarouselItem; + /** + * Slide to the element based on id + * @param {*} position + */ + slideTo(position: number): void; + /** + * Based on the currently active item it will go to the next position + */ + next(): void; + /** + * Based on the currently active item it will go to the previous position + */ + prev(): void; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + _rotate(rotationItems: RotationItems): void; + /** + * Set an interval to cycle through the carousel items + */ + cycle(): void; + /** + * Clears the cycling interval + */ + pause(): void; + /** + * Get the currently active item + */ + _getActiveItem(): CarouselItem; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + _setActiveItem(item: CarouselItem): void; +} +export declare function initCarousels(): void; +export default Carousel; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/carousel/index.d.ts.map new file mode 100644 index 0000000..76e86e7 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAgBhD,cAAM,QAAS,YAAW,iBAAiB;IACvC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;gBAGtB,KAAK,GAAE,YAAY,EAAO,EAC1B,OAAO,GAAE,eAAyB;IAetC;;OAEG;IACH,KAAK;IAwBL,OAAO,CAAC,QAAQ,EAAE,MAAM;IAIxB;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM;IAuBxB;;OAEG;IACH,IAAI;IAiBJ;;OAEG;IACH,IAAI;IAiBJ;;;OAGG;IACH,OAAO,CAAC,aAAa,EAAE,aAAa;IAqCpC;;OAEG;IACH,KAAK;IAQL;;OAEG;IACH,KAAK;IAIL;;OAEG;IACH,cAAc;IAId;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,YAAY;CAwBpC;AAED,wBAAgB,aAAa,SA0E5B;AAOD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/index.js b/node_modules/flowbite/lib/cjs/components/carousel/index.js new file mode 100644 index 0000000..db90e01 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/index.js @@ -0,0 +1,246 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initCarousels = void 0; +var Default = { + defaultPosition: 0, + indicators: { + items: [], + activeClasses: 'bg-white dark:bg-gray-800', + inactiveClasses: 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800', + }, + interval: 3000, + onNext: function () { }, + onPrev: function () { }, + onChange: function () { }, +}; +var Carousel = /** @class */ (function () { + function Carousel(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign(__assign({}, Default), options), { indicators: __assign(__assign({}, Default.indicators), options.indicators) }); + this._activeItem = this.getItem(this._options.defaultPosition); + this._indicators = this._options.indicators.items; + this._intervalDuration = this._options.interval; + this._intervalInstance = null; + this._init(); + } + /** + * initialize carousel and items based on active one + */ + Carousel.prototype._init = function () { + var _this = this; + this._items.map(function (item) { + item.el.classList.add('absolute', 'inset-0', 'transition-transform', 'transform'); + }); + // if no active item is set then first position is default + if (this._getActiveItem()) { + this.slideTo(this._getActiveItem().position); + } + else { + this.slideTo(0); + } + this._indicators.map(function (indicator, position) { + indicator.el.addEventListener('click', function () { + _this.slideTo(position); + }); + }); + }; + Carousel.prototype.getItem = function (position) { + return this._items[position]; + }; + /** + * Slide to the element based on id + * @param {*} position + */ + Carousel.prototype.slideTo = function (position) { + var nextItem = this._items[position]; + var rotationItems = { + left: nextItem.position === 0 + ? this._items[this._items.length - 1] + : this._items[nextItem.position - 1], + middle: nextItem, + right: nextItem.position === this._items.length - 1 + ? this._items[0] + : this._items[nextItem.position + 1], + }; + this._rotate(rotationItems); + this._setActiveItem(nextItem); + if (this._intervalInstance) { + this.pause(); + this.cycle(); + } + this._options.onChange(this); + }; + /** + * Based on the currently active item it will go to the next position + */ + Carousel.prototype.next = function () { + var activeItem = this._getActiveItem(); + var nextItem = null; + // check if last item + if (activeItem.position === this._items.length - 1) { + nextItem = this._items[0]; + } + else { + nextItem = this._items[activeItem.position + 1]; + } + this.slideTo(nextItem.position); + // callback function + this._options.onNext(this); + }; + /** + * Based on the currently active item it will go to the previous position + */ + Carousel.prototype.prev = function () { + var activeItem = this._getActiveItem(); + var prevItem = null; + // check if first item + if (activeItem.position === 0) { + prevItem = this._items[this._items.length - 1]; + } + else { + prevItem = this._items[activeItem.position - 1]; + } + this.slideTo(prevItem.position); + // callback function + this._options.onPrev(this); + }; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + Carousel.prototype._rotate = function (rotationItems) { + // reset + this._items.map(function (item) { + item.el.classList.add('hidden'); + }); + // left item (previously active) + rotationItems.left.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.left.el.classList.add('-translate-x-full', 'z-10'); + // currently active item + rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10'); + rotationItems.middle.el.classList.add('translate-x-0', 'z-20'); + // right item (upcoming active) + rotationItems.right.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.right.el.classList.add('translate-x-full', 'z-10'); + }; + /** + * Set an interval to cycle through the carousel items + */ + Carousel.prototype.cycle = function () { + var _this = this; + if (typeof window !== 'undefined') { + this._intervalInstance = window.setInterval(function () { + _this.next(); + }, this._intervalDuration); + } + }; + /** + * Clears the cycling interval + */ + Carousel.prototype.pause = function () { + clearInterval(this._intervalInstance); + }; + /** + * Get the currently active item + */ + Carousel.prototype._getActiveItem = function () { + return this._activeItem; + }; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + Carousel.prototype._setActiveItem = function (item) { + var _a, _b; + var _this = this; + this._activeItem = item; + var position = item.position; + // update the indicators if available + if (this._indicators.length) { + this._indicators.map(function (indicator) { + var _a, _b; + indicator.el.setAttribute('aria-current', 'false'); + (_a = indicator.el.classList).remove.apply(_a, _this._options.indicators.activeClasses.split(' ')); + (_b = indicator.el.classList).add.apply(_b, _this._options.indicators.inactiveClasses.split(' ')); + }); + (_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(' ')); + (_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(' ')); + this._indicators[position].el.setAttribute('aria-current', 'true'); + } + }; + return Carousel; +}()); +function initCarousels() { + document.querySelectorAll('[data-carousel]').forEach(function ($carouselEl) { + var interval = $carouselEl.getAttribute('data-carousel-interval'); + var slide = $carouselEl.getAttribute('data-carousel') === 'slide' + ? true + : false; + var items = []; + var defaultPosition = 0; + if ($carouselEl.querySelectorAll('[data-carousel-item]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-item]')).map(function ($carouselItemEl, position) { + items.push({ + position: position, + el: $carouselItemEl, + }); + if ($carouselItemEl.getAttribute('data-carousel-item') === + 'active') { + defaultPosition = position; + } + }); + } + var indicators = []; + if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-slide-to]')).map(function ($indicatorEl) { + indicators.push({ + position: parseInt($indicatorEl.getAttribute('data-carousel-slide-to')), + el: $indicatorEl, + }); + }); + } + var carousel = new Carousel(items, { + defaultPosition: defaultPosition, + indicators: { + items: indicators, + }, + interval: interval ? interval : Default.interval, + }); + if (slide) { + carousel.cycle(); + } + // check for controls + var carouselNextEl = $carouselEl.querySelector('[data-carousel-next]'); + var carouselPrevEl = $carouselEl.querySelector('[data-carousel-prev]'); + if (carouselNextEl) { + carouselNextEl.addEventListener('click', function () { + carousel.next(); + }); + } + if (carouselPrevEl) { + carouselPrevEl.addEventListener('click', function () { + carousel.prev(); + }); + } + }); +} +exports.initCarousels = initCarousels; +if (typeof window !== 'undefined') { + window.Carousel = Carousel; + window.initCarousels = initCarousels; +} +exports.default = Carousel; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/index.js.map b/node_modules/flowbite/lib/cjs/components/carousel/index.js.map new file mode 100644 index 0000000..9b08e6a --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/carousel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,IAAM,OAAO,GAAoB;IAC7B,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,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE;YACjC,eAAe,EAAE,eAAe;YAChC,UAAU,EAAE;gBACR,KAAK,EAAE,UAAU;aACpB;YACD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ;SAChC,CAAC,CAAC;QAEtB,IAAI,KAAK,EAAE;YACP,QAAQ,CAAC,KAAK,EAAE,CAAC;SACpB;QAED,qBAAqB;QACrB,IAAM,cAAc,GAAG,WAAW,CAAC,aAAa,CAC5C,sBAAsB,CACzB,CAAC;QACF,IAAM,cAAc,GAAG,WAAW,CAAC,aAAa,CAC5C,sBAAsB,CACzB,CAAC;QAEF,IAAI,cAAc,EAAE;YAChB,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE;gBACrC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpB,CAAC,CAAC,CAAC;SACN;QAED,IAAI,cAAc,EAAE;YAChB,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE;gBACrC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpB,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AA1ED,sCA0EC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,kBAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts b/node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts new file mode 100644 index 0000000..edb6114 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts @@ -0,0 +1,20 @@ +import { CarouselOptions, CarouselItem, IndicatorItem, RotationItems } from './types'; +export declare interface CarouselInterface { + _items: CarouselItem[]; + _indicators: IndicatorItem[]; + _activeItem: CarouselItem; + _intervalDuration: number; + _intervalInstance: number; + _options: CarouselOptions; + _init(): void; + getItem(position: number): CarouselItem; + _getActiveItem(): CarouselItem; + _setActiveItem(item: CarouselItem): void; + slideTo(position: number): void; + next(): void; + prev(): void; + _rotate(rotationItems: RotationItems): void; + cycle(): void; + pause(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts.map new file mode 100644 index 0000000..423a855 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAE1B,KAAK,IAAI,IAAI,CAAC;IAEd,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAAC;IAExC,cAAc,IAAI,YAAY,CAAC;IAC/B,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAEzC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IAEb,OAAO,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5C,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;CACjB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/interface.js b/node_modules/flowbite/lib/cjs/components/carousel/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/interface.js.map b/node_modules/flowbite/lib/cjs/components/carousel/interface.js.map new file mode 100644 index 0000000..3c63595 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/carousel/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/types.d.ts b/node_modules/flowbite/lib/cjs/components/carousel/types.d.ts new file mode 100644 index 0000000..8ae7d3d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/types.d.ts @@ -0,0 +1,27 @@ +import { CarouselInterface } from './interface'; +export declare type CarouselItem = { + position: number; + el: HTMLElement; +}; +export declare type IndicatorItem = { + position: number; + el: HTMLElement; +}; +export declare type RotationItems = { + left: CarouselItem; + middle: CarouselItem; + right: CarouselItem; +}; +export declare type CarouselOptions = { + defaultPosition?: number; + indicators?: { + items?: IndicatorItem[]; + activeClasses?: string; + inactiveClasses?: string; + }; + interval?: number; + onNext?: (carousel: CarouselInterface) => void; + onPrev?: (carousel: CarouselInterface) => void; + onChange?: (carousel: CarouselInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/carousel/types.d.ts.map new file mode 100644 index 0000000..8cb376d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,YAAY,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/types.js b/node_modules/flowbite/lib/cjs/components/carousel/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/carousel/types.js.map b/node_modules/flowbite/lib/cjs/components/carousel/types.js.map new file mode 100644 index 0000000..72b8fbd --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/carousel/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/carousel/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/index.d.ts b/node_modules/flowbite/lib/cjs/components/collapse/index.d.ts new file mode 100644 index 0000000..5e9ce95 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/index.d.ts @@ -0,0 +1,16 @@ +import type { CollapseOptions } from './types'; +import { CollapseInterface } from './interface'; +declare class Collapse implements CollapseInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: CollapseOptions; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: CollapseOptions); + _init(): void; + collapse(): void; + expand(): void; + toggle(): void; +} +export declare function initCollapses(): void; +export default Collapse; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/collapse/index.d.ts.map new file mode 100644 index 0000000..a530d7f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQhD,cAAM,QAAS,YAAW,iBAAiB;IACvC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,eAAyB;IAStC,KAAK;IAgBL,QAAQ;IAWR,MAAM;IAWN,MAAM;CAST;AAED,wBAAgB,aAAa,SAmB5B;AAOD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/index.js b/node_modules/flowbite/lib/cjs/components/collapse/index.js new file mode 100644 index 0000000..2ff4a0d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/index.js @@ -0,0 +1,98 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initCollapses = void 0; +var Default = { + onCollapse: function () { }, + onExpand: function () { }, + onToggle: function () { }, +}; +var Collapse = /** @class */ (function () { + function Collapse(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Collapse.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + if (this._triggerEl.hasAttribute('aria-expanded')) { + this._visible = + this._triggerEl.getAttribute('aria-expanded') === 'true'; + } + else { + // fix until v2 not to break previous single collapses which became dismiss + this._visible = !this._targetEl.classList.contains('hidden'); + } + this._triggerEl.addEventListener('click', function () { + _this.toggle(); + }); + } + }; + Collapse.prototype.collapse = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onCollapse(this); + }; + Collapse.prototype.expand = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onExpand(this); + }; + Collapse.prototype.toggle = function () { + if (this._visible) { + this.collapse(); + } + else { + this.expand(); + } + // callback function + this._options.onToggle(this); + }; + return Collapse; +}()); +function initCollapses() { + document + .querySelectorAll('[data-collapse-toggle]') + .forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-collapse-toggle'); + var $targetEl = document.getElementById(targetId); + // check if the target element exists + if ($targetEl) { + new Collapse($targetEl, $triggerEl); + } + else { + console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-collapse-toggle attribute.")); + } + }); +} +exports.initCollapses = initCollapses; +if (typeof window !== 'undefined') { + window.Collapse = Collapse; + window.initCollapses = initCollapses; +} +exports.default = Collapse; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/index.js.map b/node_modules/flowbite/lib/cjs/components/collapse/index.js.map new file mode 100644 index 0000000..d16391e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/collapse/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAoB;IAC7B,UAAU,EAAE,cAAO,CAAC;IACpB,QAAQ,EAAE,cAAO,CAAC;IAClB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAMI,kBACI,QAAmC,EACnC,SAAoC,EACpC,OAAkC;QAFlC,yBAAA,EAAA,eAAmC;QACnC,0BAAA,EAAA,gBAAoC;QACpC,wBAAA,EAAA,iBAAkC;QAElC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,KAAK,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AI,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,QAAQ,EAAE,CAAC;SACnB;aAAM;YACH,IAAI,CAAC,MAAM,EAAE,CAAC;SACjB;QACD,oBAAoB;QACpB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACL,eAAC;AAAD,CAAC,AAjED,IAiEC;AAED,SAAgB,aAAa;IACzB,QAAQ;SACH,gBAAgB,CAAC,wBAAwB,CAAC;SAC1C,OAAO,CAAC,UAAC,UAAU;QAChB,IAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;QACjE,IAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAEpD,qCAAqC;QACrC,IAAI,SAAS,EAAE;YACX,IAAI,QAAQ,CACR,SAAwB,EACxB,UAAyB,CAC5B,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,uCAA+B,QAAQ,wEAAoE,CAC9G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AAnBD,sCAmBC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,kBAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts b/node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts new file mode 100644 index 0000000..326fc39 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts @@ -0,0 +1,12 @@ +import { CollapseOptions } from './types'; +export declare interface CollapseInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: CollapseOptions; + _visible: boolean; + _init(): void; + collapse(): void; + expand(): void; + toggle(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts.map new file mode 100644 index 0000000..cdf74c2 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAElB,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/interface.js b/node_modules/flowbite/lib/cjs/components/collapse/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/interface.js.map b/node_modules/flowbite/lib/cjs/components/collapse/interface.js.map new file mode 100644 index 0000000..b82a2f4 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/collapse/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/types.d.ts b/node_modules/flowbite/lib/cjs/components/collapse/types.d.ts new file mode 100644 index 0000000..3f3094e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/types.d.ts @@ -0,0 +1,7 @@ +import { CollapseInterface } from './interface'; +export declare type CollapseOptions = { + onCollapse?: (collapse: CollapseInterface) => void; + onExpand?: (collapse: CollapseInterface) => void; + onToggle?: (collapse: CollapseInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/collapse/types.d.ts.map new file mode 100644 index 0000000..ba058f8 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/types.js b/node_modules/flowbite/lib/cjs/components/collapse/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/collapse/types.js.map b/node_modules/flowbite/lib/cjs/components/collapse/types.js.map new file mode 100644 index 0000000..c1e2361 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/collapse/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/collapse/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/index.d.ts b/node_modules/flowbite/lib/cjs/components/dial/index.d.ts new file mode 100644 index 0000000..c333938 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/index.d.ts @@ -0,0 +1,23 @@ +import type { DialOptions, DialTriggerType } from './types'; +import { DialInterface } from './interface'; +declare class Dial implements DialInterface { + _parentEl: HTMLElement; + _triggerEl: HTMLElement; + _targetEl: HTMLElement; + _options: DialOptions; + _visible: boolean; + constructor(parentEl?: HTMLElement | null, triggerEl?: HTMLElement | null, targetEl?: HTMLElement | null, options?: DialOptions); + _init(): void; + hide(): void; + show(): void; + toggle(): void; + isHidden(): boolean; + isVisible(): boolean; + _getTriggerEventTypes(triggerType: DialTriggerType): { + showEvents: string[]; + hideEvents: string[]; + }; +} +export declare function initDials(): void; +export default Dial; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/dial/index.d.ts.map new file mode 100644 index 0000000..1b1cd71 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,cAAM,IAAK,YAAW,aAAa;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,WAAqB;IAUlC,KAAK;IAuBL,IAAI;IAWJ,IAAI;IAWJ,MAAM;IAQN,QAAQ;IAIR,SAAS;IAIT,qBAAqB,CAAC,WAAW,EAAE,eAAe;;;;CAwBrD;AAED,wBAAgB,SAAS,SAgCxB;AAOD,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/index.js b/node_modules/flowbite/lib/cjs/components/dial/index.js new file mode 100644 index 0000000..7d78f95 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/index.js @@ -0,0 +1,142 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initDials = void 0; +var Default = { + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dial = /** @class */ (function () { + function Dial(parentEl, triggerEl, targetEl, options) { + if (parentEl === void 0) { parentEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._parentEl = parentEl; + this._triggerEl = triggerEl; + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Dial.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType); + triggerEventTypes.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEventTypes.hideEvents.forEach(function (ev) { + _this._parentEl.addEventListener(ev, function () { + if (!_this._parentEl.matches(':hover')) { + _this.hide(); + } + }); + }); + } + }; + Dial.prototype.hide = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Dial.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dial.prototype.toggle = function () { + if (this._visible) { + this.hide(); + } + else { + this.show(); + } + }; + Dial.prototype.isHidden = function () { + return !this._visible; + }; + Dial.prototype.isVisible = function () { + return this._visible; + }; + Dial.prototype._getTriggerEventTypes = function (triggerType) { + switch (triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + return Dial; +}()); +function initDials() { + document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) { + var $triggerEl = $parentEl.querySelector('[data-dial-toggle]'); + if ($triggerEl) { + var dialId = $triggerEl.getAttribute('data-dial-toggle'); + var $dialEl = document.getElementById(dialId); + if ($dialEl) { + var triggerType = $triggerEl.getAttribute('data-dial-trigger'); + new Dial($parentEl, $triggerEl, $dialEl, { + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?")); + } + } + else { + console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?")); + } + }); +} +exports.initDials = initDials; +if (typeof window !== 'undefined') { + window.Dial = Dial; + window.initDials = initDials; +} +exports.default = Dial; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/index.js.map b/node_modules/flowbite/lib/cjs/components/dial/index.js.map new file mode 100644 index 0000000..89a3d09 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dial/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAgB;IACzB,WAAW,EAAE,OAAO;IACpB,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAOI,cACI,QAAmC,EACnC,SAAoC,EACpC,QAAmC,EACnC,OAA8B;QAH9B,yBAAA,EAAA,eAAmC;QACnC,0BAAA,EAAA,gBAAoC;QACpC,yBAAA,EAAA,eAAmC;QACnC,wBAAA,EAAA,iBAA8B;QAE9B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,oBAAK,GAAL;QAAA,iBAqBC;QApBG,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,CAChD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAC5B,CAAC;YACF,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,EAAU;gBAC5C,KAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,EAAE;oBACjC,KAAI,CAAC,IAAI,EAAE,CAAC;gBAChB,CAAC,CAAC,CAAC;gBACH,KAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE;oBAChC,KAAI,CAAC,IAAI,EAAE,CAAC;gBA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AC,CAAC,OAAO,CAAC,WAAW;iBACb,CACnB,CAAC;aACL;iBAAM;gBACH,OAAO,CAAC,KAAK,CACT,uBAAgB,MAAM,sGAAmG,CAC5H,CAAC;aACL;SACJ;aAAM;YACH,OAAO,CAAC,KAAK,CACT,uBAAgB,SAAS,CAAC,EAAE,+FAA4F,CAC3H,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAhCD,8BAgCC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;CAChC;AAED,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/interface.d.ts b/node_modules/flowbite/lib/cjs/components/dial/interface.d.ts new file mode 100644 index 0000000..de0133b --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/interface.d.ts @@ -0,0 +1,16 @@ +import { DialOptions, DialTriggerEventTypes, DialTriggerType } from './types'; +export declare interface DialInterface { + _parentEl: HTMLElement; + _triggerEl: HTMLElement; + _targetEl: HTMLElement; + _options: DialOptions; + _visible: boolean; + _init(): void; + isVisible(): boolean; + isHidden(): boolean; + hide(): void; + show(): void; + toggle(): void; + _getTriggerEventTypes(triggerType: DialTriggerType): DialTriggerEventTypes; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/dial/interface.d.ts.map new file mode 100644 index 0000000..cfa626e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9E,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;IACf,qBAAqB,CAAC,WAAW,EAAE,eAAe,GAAG,qBAAqB,CAAC;CAC9E"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/interface.js b/node_modules/flowbite/lib/cjs/components/dial/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/interface.js.map b/node_modules/flowbite/lib/cjs/components/dial/interface.js.map new file mode 100644 index 0000000..83f6457 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/types.d.ts b/node_modules/flowbite/lib/cjs/components/dial/types.d.ts new file mode 100644 index 0000000..2f4877c --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/types.d.ts @@ -0,0 +1,13 @@ +import { DialInterface } from './interface'; +export declare type DialTriggerType = 'click' | 'hover' | 'none'; +export declare type DialTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type DialOptions = { + triggerType?: DialTriggerType; + onShow?: (dial: DialInterface) => void; + onHide?: (dial: DialInterface) => void; + onToggle?: (dial: DialInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/dial/types.d.ts.map new file mode 100644 index 0000000..da04793 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG;IAC9B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC5C,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/types.js b/node_modules/flowbite/lib/cjs/components/dial/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dial/types.js.map b/node_modules/flowbite/lib/cjs/components/dial/types.js.map new file mode 100644 index 0000000..0613f16 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dial/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts b/node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts new file mode 100644 index 0000000..ac75c1d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts @@ -0,0 +1,13 @@ +import type { DismissOptions } from './types'; +import { DismissInterface } from './interface'; +declare class Dismiss implements DismissInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: DismissOptions; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: DismissOptions); + _init(): void; + hide(): void; +} +export declare function initDismisses(): void; +export default Dismiss; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts.map new file mode 100644 index 0000000..5df9d15 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAS/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;gBAGrB,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB;IAQrC,KAAK;IAQL,IAAI;CAcP;AAED,wBAAgB,aAAa,SAa5B;AAOD,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/index.js b/node_modules/flowbite/lib/cjs/components/dismiss/index.js new file mode 100644 index 0000000..eb71eb9 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/index.js @@ -0,0 +1,68 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initDismisses = void 0; +var Default = { + transition: 'transition-opacity', + duration: 300, + timing: 'ease-out', + onHide: function () { }, +}; +var Dismiss = /** @class */ (function () { + function Dismiss(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Dismiss.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + this._triggerEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Dismiss.prototype.hide = function () { + var _this = this; + this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, 'opacity-0'); + setTimeout(function () { + _this._targetEl.classList.add('hidden'); + }, this._options.duration); + // callback function + this._options.onHide(this, this._targetEl); + }; + return Dismiss; +}()); +function initDismisses() { + document.querySelectorAll('[data-dismiss-target]').forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-dismiss-target'); + var $dismissEl = document.querySelector(targetId); + if ($dismissEl) { + new Dismiss($dismissEl, $triggerEl); + } + else { + console.error("The dismiss element with id \"".concat(targetId, "\" does not exist. Please check the data-dismiss-target attribute.")); + } + }); +} +exports.initDismisses = initDismisses; +if (typeof window !== 'undefined') { + window.Dismiss = Dismiss; + window.initDismisses = initDismisses; +} +exports.default = Dismiss; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/index.js.map b/node_modules/flowbite/lib/cjs/components/dismiss/index.js.map new file mode 100644 index 0000000..080b679 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dismiss/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAmB;IAC5B,UAAU,EAAE,oBAAoB;IAChC,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,cAAO,CAAC;CACnB,CAAC;AAEF;IAKI,iBACI,QAAmC,EACnC,SAAoC,EACpC,OAAiC;QAFjC,yBAAA,EAAA,eAAmC;QACnC,0BAAA,EAAA,gBAAoC;QACpC,wBAAA,EAAA,iBAAiC;QAEjC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,uBAAK,GAAL;QAAA,iBAMC;QALG,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE;gBACtC,KAAI,CAAC,IAAI,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAED,sBAAI,GAAJ;QAAA,iBAaC;QAZG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CACxB,IAAI,CAAC,QAAQ,CAAC,UAAU,EACxB,mBAAY,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAE,EACpC,IAAI,CAAC,QAAQ,CAAC,MAAM,EACpB,WAAW,CACd,CAAC;QACF,UAAU,CAAC;YACP,KAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAE3B,oBAAoB;QACpB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IACL,cAAC;AAAD,CAAC,AAtCD,IAsCC;AAED,SAAgB,aAAa;IACzB,QAAQ,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,UAAC,UAAU;QAClE,IAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;QAChE,IAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAEpD,IAAI,UAAU,EAAE;YACZ,IAAI,OAAO,CAAC,UAAyB,EAAE,UAAyB,CAAC,CAAC;SACrE;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wCAAgC,QAAQ,uEAAmE,CAC9G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,sCAaC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,kBAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts b/node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts new file mode 100644 index 0000000..e9b8f51 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts @@ -0,0 +1,9 @@ +import { DismissOptions } from './types'; +export declare interface DismissInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: DismissOptions; + _init(): void; + hide(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts.map new file mode 100644 index 0000000..c9c3828 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IAEzB,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/interface.js b/node_modules/flowbite/lib/cjs/components/dismiss/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/interface.js.map b/node_modules/flowbite/lib/cjs/components/dismiss/interface.js.map new file mode 100644 index 0000000..6b664d5 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dismiss/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts b/node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts new file mode 100644 index 0000000..c659c00 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts @@ -0,0 +1,8 @@ +import { DismissInterface } from './interface'; +export declare type DismissOptions = { + transition?: string; + duration?: number; + timing?: string; + onHide?: (dismiss: DismissInterface, targetEl: HTMLElement) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts.map new file mode 100644 index 0000000..2ccb43e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CACvE,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/types.js b/node_modules/flowbite/lib/cjs/components/dismiss/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dismiss/types.js.map b/node_modules/flowbite/lib/cjs/components/dismiss/types.js.map new file mode 100644 index 0000000..8ceeeb5 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dismiss/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dismiss/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/index.d.ts b/node_modules/flowbite/lib/cjs/components/drawer/index.d.ts new file mode 100644 index 0000000..eecffb5 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/index.d.ts @@ -0,0 +1,21 @@ +import type { DrawerOptions, PlacementClasses } from './types'; +import { DrawerInterface } from './interface'; +declare class Drawer implements DrawerInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DrawerOptions; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, options?: DrawerOptions); + _init(): void; + hide(): void; + show(): void; + toggle(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _getPlacementClasses(placement: string): PlacementClasses; + isHidden(): boolean; + isVisible(): boolean; +} +export declare function initDrawers(): void; +export default Drawer; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/drawer/index.d.ts.map new file mode 100644 index 0000000..9776f54 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAe9C,cAAM,MAAO,YAAW,eAAe;IACnC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,aAAuB;IAQpC,KAAK;IAwBL,IAAI;IA+CJ,IAAI;IA8CJ,MAAM;IAQN,eAAe;IAcf,kBAAkB;IAMlB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAyCzD,QAAQ;IAIR,SAAS;CAGZ;AAQD,wBAAgB,WAAW,SA+H1B;AAOD,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/index.js b/node_modules/flowbite/lib/cjs/components/drawer/index.js new file mode 100644 index 0000000..e57682d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/index.js @@ -0,0 +1,314 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initDrawers = void 0; +var Default = { + placement: 'left', + bodyScrolling: false, + backdrop: true, + edge: false, + edgeOffset: 'bottom-[60px]', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Drawer = /** @class */ (function () { + function Drawer(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Drawer.prototype._init = function () { + var _this = this; + // set initial accessibility attributes + if (this._targetEl) { + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.classList.add('transition-transform'); + } + // set base placement classes + this._getPlacementClasses(this._options.placement).base.map(function (c) { + _this._targetEl.classList.add(c); + }); + // add keyboard event listener to document + document.addEventListener('keydown', function (event) { + if (event.key === 'Escape') { + // if 'Escape' key is pressed + if (_this.isVisible()) { + // if the Drawer is visible + _this.hide(); // hide the Drawer + } + } + }); + }; + Drawer.prototype.hide = function () { + var _this = this; + // based on the edge option show placement classes + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + // enable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.remove('overflow-hidden'); + } + // destroy backdrop + if (this._options.backdrop) { + this._destroyBackdropEl(); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Drawer.prototype.show = function () { + var _this = this; + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + // disable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.add('overflow-hidden'); + } + // show backdrop + if (this._options.backdrop) { + this._createBackdrop(); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Drawer.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Drawer.prototype._createBackdrop = function () { + var _a; + var _this = this; + if (!this._visible) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('drawer-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + backdropEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Drawer.prototype._destroyBackdropEl = function () { + if (this._visible) { + document.querySelector('[drawer-backdrop]').remove(); + } + }; + Drawer.prototype._getPlacementClasses = function (placement) { + switch (placement) { + case 'top': + return { + base: ['top-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['-translate-y-full'], + }; + case 'right': + return { + base: ['right-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-x-full'], + }; + case 'bottom': + return { + base: ['bottom-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['translate-y-full'], + }; + case 'left': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + case 'bottom-edge': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-y-full', this._options.edgeOffset], + }; + default: + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + } + }; + Drawer.prototype.isHidden = function () { + return !this._visible; + }; + Drawer.prototype.isVisible = function () { + return this._visible; + }; + return Drawer; +}()); +var getDrawerInstance = function (id, instances) { + if (instances.some(function (drawerInstance) { return drawerInstance.id === id; })) { + return instances.find(function (drawerInstance) { return drawerInstance.id === id; }); + } +}; +function initDrawers() { + var drawerInstances = []; + document.querySelectorAll('[data-drawer-target]').forEach(function ($triggerEl) { + // mandatory + var drawerId = $triggerEl.getAttribute('data-drawer-target'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + // optional + var placement = $triggerEl.getAttribute('data-drawer-placement'); + var bodyScrolling = $triggerEl.getAttribute('data-drawer-body-scrolling'); + var backdrop = $triggerEl.getAttribute('data-drawer-backdrop'); + var edge = $triggerEl.getAttribute('data-drawer-edge'); + var edgeOffset = $triggerEl.getAttribute('data-drawer-edge-offset'); + if (!getDrawerInstance(drawerId, drawerInstances)) { + drawerInstances.push({ + id: drawerId, + object: new Drawer($drawerEl, { + placement: placement ? placement : Default.placement, + bodyScrolling: bodyScrolling + ? bodyScrolling === 'true' + ? true + : false + : Default.bodyScrolling, + backdrop: backdrop + ? backdrop === 'true' + ? true + : false + : Default.backdrop, + edge: edge + ? edge === 'true' + ? true + : false + : Default.edge, + edgeOffset: edgeOffset + ? edgeOffset + : Default.edgeOffset, + }), + }); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document.querySelectorAll('[data-drawer-toggle]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-toggle'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_1 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_1) { + $triggerEl.addEventListener('click', function () { + drawer_1.object.toggle(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document + .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]') + .forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-dismiss') + ? $triggerEl.getAttribute('data-drawer-dismiss') + : $triggerEl.getAttribute('data-drawer-hide'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_2 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_2) { + $triggerEl.addEventListener('click', function () { + drawer_2.object.hide(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id")); + } + }); + document.querySelectorAll('[data-drawer-show]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-show'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_3 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_3) { + $triggerEl.addEventListener('click', function () { + drawer_3.object.show(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); +} +exports.initDrawers = initDrawers; +if (typeof window !== 'undefined') { + window.Drawer = Drawer; + window.initDrawers = initDrawers; +} +exports.default = Drawer; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/index.js.map b/node_modules/flowbite/lib/cjs/components/drawer/index.js.map new file mode 100644 index 0000000..14dfd5f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/drawer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAkB;IAC3B,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,eAAe;IAC3B,eAAe,EACX,iEAAiE;IACrE,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAMI,gBACI,QAAmC,EACnC,OAAgC;QADhC,yBAAA,EAAA,eAAmC;QACnC,wBAAA,EAAA,iBAAgC;QAEhC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,sBAAK,GAAL;QAAA,iBAsBC;QArBG,uCAAuC;QACvC,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YACnD,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;SACxD;QAED,6BAA6B;Q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,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;CACpC;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts b/node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts new file mode 100644 index 0000000..a69c8f1 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts @@ -0,0 +1,17 @@ +import { DrawerOptions, PlacementClasses } from './types'; +export declare interface DrawerInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DrawerOptions; + _visible: boolean; + _init(): void; + isVisible(): boolean; + isHidden(): boolean; + hide(): void; + show(): void; + toggle(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _getPlacementClasses(placement: string): PlacementClasses; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts.map new file mode 100644 index 0000000..367b357 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,CAAC,OAAO,WAAW,eAAe;IAEpC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAGlB,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;IACf,eAAe,IAAI,IAAI,CAAC;IACxB,kBAAkB,IAAI,IAAI,CAAC;IAC3B,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC7D"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/interface.js b/node_modules/flowbite/lib/cjs/components/drawer/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/interface.js.map b/node_modules/flowbite/lib/cjs/components/drawer/interface.js.map new file mode 100644 index 0000000..91cef96 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/drawer/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/types.d.ts b/node_modules/flowbite/lib/cjs/components/drawer/types.d.ts new file mode 100644 index 0000000..abc766f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/types.d.ts @@ -0,0 +1,22 @@ +import { DrawerInterface } from './interface'; +export declare type DrawerOptions = { + placement?: string; + bodyScrolling?: boolean; + backdrop?: boolean; + edge?: boolean; + edgeOffset?: string; + backdropClasses?: string; + onShow?: (drawer: DrawerInterface) => void; + onHide?: (drawer: DrawerInterface) => void; + onToggle?: (drawer: DrawerInterface) => void; +}; +export declare type PlacementClasses = { + base: string[]; + active: string[]; + inactive: string[]; +}; +export declare type DrawerInstance = { + id: string; + object: DrawerInterface; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/drawer/types.d.ts.map new file mode 100644 index 0000000..ee84e44 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG;IACnC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/types.js b/node_modules/flowbite/lib/cjs/components/drawer/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/drawer/types.js.map b/node_modules/flowbite/lib/cjs/components/drawer/types.js.map new file mode 100644 index 0000000..b9d5343 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/drawer/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/drawer/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts b/node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts new file mode 100644 index 0000000..d0efbf5 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts @@ -0,0 +1,29 @@ +import type { Instance as PopperInstance } from '@popperjs/core'; +import type { DropdownOptions } from './types'; +import { DropdownInterface } from './interface'; +declare class Dropdown implements DropdownInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DropdownOptions; + _visible: boolean; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + constructor(targetElement?: HTMLElement | null, triggerElement?: HTMLElement | null, options?: DropdownOptions); + _init(): void; + _setupEventListeners(): void; + _createPopperInstance(): PopperInstance; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(): { + showEvents: string[]; + hideEvents: string[]; + }; + toggle(): void; + isVisible(): boolean; + show(): void; + hide(): void; +} +export declare function initDropdowns(): void; +export default Dropdown; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts.map new file mode 100644 index 0000000..51a311c --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,QAAQ,IAAI,cAAc,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAchD,cAAM,QAAS,YAAW,iBAAiB;IACvC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;gBAG3D,aAAa,GAAE,WAAW,GAAG,IAAW,EACxC,cAAc,GAAE,WAAW,GAAG,IAAW,EACzC,OAAO,GAAE,eAAyB;IAUtC,KAAK;IAML,oBAAoB;IA+CpB,qBAAqB;IAiBrB,0BAA0B;IAW1B,2BAA2B;IAQ3B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW;IA+BpD,iBAAiB;;;;IAyBjB,MAAM;IASN,SAAS;IAIT,IAAI;IAuBJ,IAAI;CAoBP;AAED,wBAAgB,aAAa,SAmD5B;AAOD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/index.js b/node_modules/flowbite/lib/cjs/components/dropdown/index.js new file mode 100644 index 0000000..1278c0c --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/index.js @@ -0,0 +1,254 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initDropdowns = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = require("@popperjs/core"); +var Default = { + placement: 'bottom', + triggerType: 'click', + offsetSkidding: 0, + offsetDistance: 10, + delay: 300, + ignoreClickOutsideClass: false, + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dropdown = /** @class */ (function () { + function Dropdown(targetElement, triggerElement, options) { + if (targetElement === void 0) { targetElement = null; } + if (triggerElement === void 0) { triggerElement = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetElement; + this._triggerEl = triggerElement; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Dropdown.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Dropdown.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + // click event handling for trigger element + if (this._options.triggerType === 'click') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.toggle(); + }); + }); + } + // hover event handling for trigger element + if (this._options.triggerType === 'hover') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + if (ev === 'click') { + _this.toggle(); + } + else { + setTimeout(function () { + _this.show(); + }, _this._options.delay); + } + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + }); + } + }; + Dropdown.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [ + this._options.offsetSkidding, + this._options.offsetDistance, + ], + }, + }, + ], + }); + }; + Dropdown.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + // Ignore clicks on the trigger element (ie. a datepicker input) + var ignoreClickOutsideClass = this._options.ignoreClickOutsideClass; + var isIgnored = false; + if (ignoreClickOutsideClass) { + var ignoredClickOutsideEls = document.querySelectorAll(".".concat(ignoreClickOutsideClass)); + ignoredClickOutsideEls.forEach(function (el) { + if (el.contains(clickedEl)) { + isIgnored = true; + return; + } + }); + } + // Ignore clicks on the target element (ie. dropdown itself) + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + !isIgnored && + this.isVisible()) { + this.hide(); + } + }; + Dropdown.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'click'], + hideEvents: ['mouseleave'], + }; + case 'click': + return { + showEvents: ['click'], + hideEvents: [], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['click'], + hideEvents: [], + }; + } + }; + Dropdown.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Dropdown.prototype.isVisible = function () { + return this._visible; + }; + Dropdown.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + this._targetEl.classList.add('block'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + this._setupClickOutsideListener(); + // Update its position + this._popperInstance.update(); + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dropdown.prototype.hide = function () { + this._targetEl.classList.remove('block'); + this._targetEl.classList.add('hidden'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + this._visible = false; + this._removeClickOutsideListener(); + // callback function + this._options.onHide(this); + }; + return Dropdown; +}()); +function initDropdowns() { + document + .querySelectorAll('[data-dropdown-toggle]') + .forEach(function ($triggerEl) { + var dropdownId = $triggerEl.getAttribute('data-dropdown-toggle'); + var $dropdownEl = document.getElementById(dropdownId); + if ($dropdownEl) { + var placement = $triggerEl.getAttribute('data-dropdown-placement'); + var offsetSkidding = $triggerEl.getAttribute('data-dropdown-offset-skidding'); + var offsetDistance = $triggerEl.getAttribute('data-dropdown-offset-distance'); + var triggerType = $triggerEl.getAttribute('data-dropdown-trigger'); + var delay = $triggerEl.getAttribute('data-dropdown-delay'); + var ignoreClickOutsideClass = $triggerEl.getAttribute('data-dropdown-ignore-click-outside-class'); + new Dropdown($dropdownEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + offsetSkidding: offsetSkidding + ? parseInt(offsetSkidding) + : Default.offsetSkidding, + offsetDistance: offsetDistance + ? parseInt(offsetDistance) + : Default.offsetDistance, + delay: delay ? parseInt(delay) : Default.delay, + ignoreClickOutsideClass: ignoreClickOutsideClass + ? ignoreClickOutsideClass + : Default.ignoreClickOutsideClass, + }); + } + else { + console.error("The dropdown element with id \"".concat(dropdownId, "\" does not exist. Please check the data-dropdown-toggle attribute.")); + } + }); +} +exports.initDropdowns = initDropdowns; +if (typeof window !== 'undefined') { + window.Dropdown = Dropdown; + window.initDropdowns = initDropdowns; +} +exports.default = Dropdown; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/index.js.map b/node_modules/flowbite/lib/cjs/components/dropdown/index.js.map new file mode 100644 index 0000000..e52532f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dropdown/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,uCAA8C;AAQ9C,IAAM,OAAO,GAAoB;IAC7B,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,OAAO;IACpB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,GAAG;IACV,uBAAuB,EAAE,KAAK;IAC9B,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAQI,kBACI,aAAwC,EACxC,cAAyC,EACzC,OAAkC;QAFlC,8BAAA,EAAA,oBAAwC;QACxC,+BAAA,EAAA,qBAAyC;QACzC,wBAAA,EAAA,iBAAkC;QAElC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED,wBAAK,GAAL;QACI,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,oBAAoB,EAAE,CAAC;SAC/B;IACL,CAAC;IAED,uCAAoB,GAApB;QAAA,iBA6CC;QA5CG,IAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAE/C,2CAA2C;QAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,KAAK,OAAO,EAAE;YACvC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,EA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,KAAK;gBAC9C,uBAAuB,EAAE,uBAAuB;oBAC5C,CAAC,CAAC,uBAAuB;oBACzB,CAAC,CAAC,OAAO,CAAC,uBAAuB;aACrB,CACvB,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,yCAAiC,UAAU,wEAAoE,CAClH,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AAnDD,sCAmDC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,kBAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts b/node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts new file mode 100644 index 0000000..95a1241 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts @@ -0,0 +1,22 @@ +import { DropdownOptions, DropdownTriggerType, DropdownTriggerEventTypes } from './types'; +import type { Instance as PopperInstance } from '@popperjs/core'; +export declare interface DropdownInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DropdownOptions; + _visible: boolean; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _init(): void; + _createPopperInstance(): PopperInstance; + _setupEventListeners(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(triggerType: DropdownTriggerType): DropdownTriggerEventTypes; + isVisible(): boolean; + toggle(): void; + show(): void; + hide(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts.map new file mode 100644 index 0000000..eef9c76 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAE/D,KAAK,IAAI,IAAI,CAAC;IACd,qBAAqB,IAAI,cAAc,CAAC;IACxC,oBAAoB,IAAI,IAAI,CAAC;IAC7B,0BAA0B,IAAI,IAAI,CAAC;IACnC,2BAA2B,IAAI,IAAI,CAAC;IACpC,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,iBAAiB,CACb,WAAW,EAAE,mBAAmB,GACjC,yBAAyB,CAAC;IAC7B,SAAS,IAAI,OAAO,CAAC;IACrB,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/interface.js b/node_modules/flowbite/lib/cjs/components/dropdown/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/interface.js.map b/node_modules/flowbite/lib/cjs/components/dropdown/interface.js.map new file mode 100644 index 0000000..d4c8eb1 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dropdown/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts b/node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts new file mode 100644 index 0000000..47c79fb --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts @@ -0,0 +1,19 @@ +import { DropdownInterface } from './interface'; +import type { Placement } from '@popperjs/core'; +export declare type DropdownTriggerType = 'click' | 'hover' | 'none'; +export declare type DropdownTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type DropdownOptions = { + placement?: Placement; + triggerType?: DropdownTriggerType; + offsetSkidding?: number; + offsetDistance?: number; + ignoreClickOutsideClass?: string | boolean; + delay?: number; + onShow?: (tooltip: DropdownInterface) => void; + onHide?: (tooltip: DropdownInterface) => void; + onToggle?: (tooltip: DropdownInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts.map new file mode 100644 index 0000000..f74ca43 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAErE,MAAM,CAAC,OAAO,MAAM,yBAAyB,GAAG;IAC5C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACnD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/types.js b/node_modules/flowbite/lib/cjs/components/dropdown/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/dropdown/types.js.map b/node_modules/flowbite/lib/cjs/components/dropdown/types.js.map new file mode 100644 index 0000000..de3d7a3 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/dropdown/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dropdown/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/index.d.ts b/node_modules/flowbite/lib/cjs/components/index.d.ts new file mode 100644 index 0000000..3d22df6 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/index.d.ts @@ -0,0 +1,2 @@ +export declare function initFlowbite(): void; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/index.d.ts.map new file mode 100644 index 0000000..69c6ef6 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAYA,wBAAgB,YAAY,SAY3B"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/index.js b/node_modules/flowbite/lib/cjs/components/index.js new file mode 100644 index 0000000..b099106 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initFlowbite = void 0; +var accordion_1 = require("./accordion"); +var carousel_1 = require("./carousel"); +var collapse_1 = require("./collapse"); +var dial_1 = require("./dial"); +var dismiss_1 = require("./dismiss"); +var drawer_1 = require("./drawer"); +var dropdown_1 = require("./dropdown"); +var modal_1 = require("./modal"); +var popover_1 = require("./popover"); +var tabs_1 = require("./tabs"); +var tooltip_1 = require("./tooltip"); +function initFlowbite() { + (0, accordion_1.initAccordions)(); + (0, collapse_1.initCollapses)(); + (0, carousel_1.initCarousels)(); + (0, dismiss_1.initDismisses)(); + (0, dropdown_1.initDropdowns)(); + (0, modal_1.initModals)(); + (0, drawer_1.initDrawers)(); + (0, tabs_1.initTabs)(); + (0, tooltip_1.initTooltips)(); + (0, popover_1.initPopovers)(); + (0, dial_1.initDials)(); +} +exports.initFlowbite = initFlowbite; +if (typeof window !== 'undefined') { + window.initFlowbite = initFlowbite; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/index.js.map b/node_modules/flowbite/lib/cjs/components/index.js.map new file mode 100644 index 0000000..2d35df4 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAC7C,uCAA2C;AAC3C,uCAA2C;AAC3C,+BAAmC;AACnC,qCAA0C;AAC1C,mCAAuC;AACvC,uCAA2C;AAC3C,iCAAqC;AACrC,qCAAyC;AACzC,+BAAkC;AAClC,qCAAyC;AAEzC,SAAgB,YAAY;IACxB,IAAA,0BAAc,GAAE,CAAC;IACjB,IAAA,wBAAa,GAAE,CAAC;IAChB,IAAA,wBAAa,GAAE,CAAC;IAChB,IAAA,uBAAa,GAAE,CAAC;IAChB,IAAA,wBAAa,GAAE,CAAC;IAChB,IAAA,kBAAU,GAAE,CAAC;IACb,IAAA,oBAAW,GAAE,CAAC;IACd,IAAA,eAAQ,GAAE,CAAC;IACX,IAAA,sBAAY,GAAE,CAAC;IACf,IAAA,sBAAY,GAAE,CAAC;IACf,IAAA,gBAAS,GAAE,CAAC;AAChB,CAAC;AAZD,oCAYC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;CACtC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/index.d.ts b/node_modules/flowbite/lib/cjs/components/modal/index.d.ts new file mode 100644 index 0000000..be91df7 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/index.d.ts @@ -0,0 +1,26 @@ +import type { ModalOptions } from './types'; +import { ModalInterface } from './interface'; +declare class Modal implements ModalInterface { + _targetEl: HTMLElement | null; + _options: ModalOptions; + _isHidden: boolean; + _backdropEl: HTMLElement | null; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + constructor(targetEl?: HTMLElement | null, options?: ModalOptions); + _init(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _setupModalCloseEventListeners(): void; + _removeModalCloseEventListeners(): void; + _handleOutsideClick(target: EventTarget): void; + _getPlacementClasses(): string[]; + toggle(): void; + show(): void; + hide(): void; + isVisible(): boolean; + isHidden(): boolean; +} +export declare function initModals(): void; +export default Modal; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/modal/index.d.ts.map new file mode 100644 index 0000000..8c64578 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAa7C,cAAM,KAAM,YAAW,cAAc;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;gBAGtD,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,YAAsB;IASnC,KAAK;IAQL,eAAe;IAYf,kBAAkB;IAMlB,8BAA8B;IAwB9B,+BAA+B;IAe/B,mBAAmB,CAAC,MAAM,EAAE,WAAW;IASvC,oBAAoB;IA+BpB,MAAM;IAWN,IAAI;IAuBJ,IAAI;IAsBJ,SAAS;IAIT,QAAQ;CAGX;AASD,wBAAgB,UAAU,SAgIzB;AAOD,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/index.js b/node_modules/flowbite/lib/cjs/components/modal/index.js new file mode 100644 index 0000000..b4e98f0 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/index.js @@ -0,0 +1,274 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initModals = void 0; +var Default = { + placement: 'center', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', + backdrop: 'dynamic', + closable: true, + onHide: function () { }, + onShow: function () { }, + onToggle: function () { }, +}; +var Modal = /** @class */ (function () { + function Modal(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._isHidden = true; + this._backdropEl = null; + this._init(); + } + Modal.prototype._init = function () { + var _this = this; + if (this._targetEl) { + this._getPlacementClasses().map(function (c) { + _this._targetEl.classList.add(c); + }); + } + }; + Modal.prototype._createBackdrop = function () { + var _a; + if (this._isHidden) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('modal-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + this._backdropEl = backdropEl; + } + }; + Modal.prototype._destroyBackdropEl = function () { + if (!this._isHidden) { + document.querySelector('[modal-backdrop]').remove(); + } + }; + Modal.prototype._setupModalCloseEventListeners = function () { + var _this = this; + if (this._options.backdrop === 'dynamic') { + this._clickOutsideEventListener = function (ev) { + _this._handleOutsideClick(ev.target); + }; + this._targetEl.addEventListener('click', this._clickOutsideEventListener, true); + } + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._removeModalCloseEventListeners = function () { + if (this._options.backdrop === 'dynamic') { + this._targetEl.removeEventListener('click', this._clickOutsideEventListener, true); + } + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._handleOutsideClick = function (target) { + if (target === this._targetEl || + (target === this._backdropEl && this.isVisible())) { + this.hide(); + } + }; + Modal.prototype._getPlacementClasses = function () { + switch (this._options.placement) { + // top + case 'top-left': + return ['justify-start', 'items-start']; + case 'top-center': + return ['justify-center', 'items-start']; + case 'top-right': + return ['justify-end', 'items-start']; + // center + case 'center-left': + return ['justify-start', 'items-center']; + case 'center': + return ['justify-center', 'items-center']; + case 'center-right': + return ['justify-end', 'items-center']; + // bottom + case 'bottom-left': + return ['justify-start', 'items-end']; + case 'bottom-center': + return ['justify-center', 'items-end']; + case 'bottom-right': + return ['justify-end', 'items-end']; + default: + return ['justify-center', 'items-center']; + } + }; + Modal.prototype.toggle = function () { + if (this._isHidden) { + this.show(); + } + else { + this.hide(); + } + // callback function + this._options.onToggle(this); + }; + Modal.prototype.show = function () { + if (this.isHidden) { + this._targetEl.classList.add('flex'); + this._targetEl.classList.remove('hidden'); + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + this._createBackdrop(); + this._isHidden = false; + // prevent body scroll + document.body.classList.add('overflow-hidden'); + // Add keyboard event listener to the document + if (this._options.closable) { + this._setupModalCloseEventListeners(); + } + // callback function + this._options.onShow(this); + } + }; + Modal.prototype.hide = function () { + if (this.isVisible) { + this._targetEl.classList.add('hidden'); + this._targetEl.classList.remove('flex'); + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + this._destroyBackdropEl(); + this._isHidden = true; + // re-apply body scroll + document.body.classList.remove('overflow-hidden'); + if (this._options.closable) { + this._removeModalCloseEventListeners(); + } + // callback function + this._options.onHide(this); + } + }; + Modal.prototype.isVisible = function () { + return !this._isHidden; + }; + Modal.prototype.isHidden = function () { + return this._isHidden; + }; + return Modal; +}()); +var getModalInstance = function (id, instances) { + if (instances.some(function (modalInstance) { return modalInstance.id === id; })) { + return instances.find(function (modalInstance) { return modalInstance.id === id; }); + } + return null; +}; +function initModals() { + var modalInstances = []; + // initiate modal based on data-modal-target + document.querySelectorAll('[data-modal-target]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-target'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + if (!getModalInstance(modalId, modalInstances)) { + modalInstances.push({ + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.")); + } + }); + // support pre v1.6.0 data-modal-toggle initialization + document.querySelectorAll('[data-modal-toggle]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-toggle'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + var modal_1 = getModalInstance(modalId, modalInstances); + if (!modal_1) { + modal_1 = { + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }; + modalInstances.push(modal_1); + } + $triggerEl.addEventListener('click', function () { + modal_1.object.toggle(); + }); + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?")); + } + }); + // show modal on click if exists based on id + document.querySelectorAll('[data-modal-show]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-show'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_2 = getModalInstance(modalId, modalInstances); + if (modal_2) { + $triggerEl.addEventListener('click', function () { + if (modal_2.object.isHidden) { + modal_2.object.show(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?")); + } + }); + // hide modal on click if exists based on id + document.querySelectorAll('[data-modal-hide]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-hide'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_3 = getModalInstance(modalId, modalInstances); + if (modal_3) { + $triggerEl.addEventListener('click', function () { + if (modal_3.object.isVisible) { + modal_3.object.hide(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?")); + } + }); +} +exports.initModals = initModals; +if (typeof window !== 'undefined') { + window.Modal = Modal; + window.initModals = initModals; +} +exports.default = Modal; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/index.js.map b/node_modules/flowbite/lib/cjs/components/modal/index.js.map new file mode 100644 index 0000000..716af94 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/modal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAiB;IAC1B,SAAS,EAAE,QAAQ;IACnB,eAAe,EACX,iEAAiE;IACrE,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAQI,eACI,QAAmC,EACnC,OAA+B;QAD/B,yBAAA,EAAA,eAAmC;QACnC,wBAAA,EAAA,iBAA+B;QAE/B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAC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KAAK,CAAC;IACrB,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;CAClC;AAED,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/interface.d.ts b/node_modules/flowbite/lib/cjs/components/modal/interface.d.ts new file mode 100644 index 0000000..2df722b --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/interface.d.ts @@ -0,0 +1,21 @@ +import { ModalOptions } from './types'; +export declare interface ModalInterface { + _targetEl: HTMLElement | null; + _options: ModalOptions; + _isHidden: boolean; + _backdropEl: HTMLElement | null; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _init(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _setupModalCloseEventListeners(): void; + _handleOutsideClick(target: EventTarget): void; + _getPlacementClasses(): string[]; + toggle(): void; + show(): void; + hide(): void; + isHidden(): boolean; + isVisible(): boolean; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/modal/interface.d.ts.map new file mode 100644 index 0000000..6fa46f7 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,OAAO,WAAW,cAAc;IAEnC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAG9B,QAAQ,EAAE,YAAY,CAAC;IAGvB,SAAS,EAAE,OAAO,CAAC;IAGnB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAEhC,0BAA0B,EAAE,kCAAkC,CAAC;IAE/D,qBAAqB,EAAE,kCAAkC,CAAC;IAG1D,KAAK,IAAI,IAAI,CAAC;IAGd,eAAe,IAAI,IAAI,CAAC;IAGxB,kBAAkB,IAAI,IAAI,CAAC;IAG3B,8BAA8B,IAAI,IAAI,CAAC;IAGvC,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAG/C,oBAAoB,IAAI,MAAM,EAAE,CAAC;IAGjC,MAAM,IAAI,IAAI,CAAC;IAGf,IAAI,IAAI,IAAI,CAAC;IAGb,IAAI,IAAI,IAAI,CAAC;IAGb,QAAQ,IAAI,OAAO,CAAC;IAGpB,SAAS,IAAI,OAAO,CAAC;CACxB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/interface.js b/node_modules/flowbite/lib/cjs/components/modal/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/interface.js.map b/node_modules/flowbite/lib/cjs/components/modal/interface.js.map new file mode 100644 index 0000000..5de1079 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/modal/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/types.d.ts b/node_modules/flowbite/lib/cjs/components/modal/types.d.ts new file mode 100644 index 0000000..5dccfb1 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/types.d.ts @@ -0,0 +1,17 @@ +import { ModalInterface } from './interface'; +export declare type modalBackdrop = 'static' | 'dynamic'; +export declare type modalPlacement = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; +export declare type ModalOptions = { + placement?: modalPlacement; + backdropClasses?: string; + backdrop?: modalBackdrop; + closable?: boolean; + onShow?: (modal: ModalInterface) => void; + onHide?: (modal: ModalInterface) => void; + onToggle?: (modal: ModalInterface) => void; +}; +export declare type ModalInstance = { + id: string; + object: ModalInterface; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/modal/types.d.ts.map new file mode 100644 index 0000000..2754732 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AACzD,MAAM,CAAC,OAAO,MAAM,cAAc,GAC5B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,QAAQ,GACR,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAErB,MAAM,CAAC,OAAO,MAAM,YAAY,GAAG;IAC/B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,cAAc,CAAC;CAC1B,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/types.js b/node_modules/flowbite/lib/cjs/components/modal/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/modal/types.js.map b/node_modules/flowbite/lib/cjs/components/modal/types.js.map new file mode 100644 index 0000000..e049979 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/modal/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/modal/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/index.d.ts b/node_modules/flowbite/lib/cjs/components/popover/index.d.ts new file mode 100644 index 0000000..33732b6 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/index.d.ts @@ -0,0 +1,32 @@ +import type { Instance as PopperInstance } from '@popperjs/core'; +import type { PopoverOptions } from './types'; +import { PopoverInterface } from './interface'; +declare class Popover implements PopoverInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: PopoverOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: PopoverOptions); + _init(): void; + _setupEventListeners(): void; + _createPopperInstance(): PopperInstance; + _getTriggerEvents(): { + showEvents: string[]; + hideEvents: string[]; + }; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + isVisible(): boolean; + toggle(): void; + show(): void; + hide(): void; +} +export declare function initPopovers(): void; +export default Popover; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/popover/index.d.ts.map new file mode 100644 index 0000000..67e916e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/popover/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,QAAQ,IAAI,cAAc,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAW/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAC1D,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB;IAUrC,KAAK;IAML,oBAAoB;IA6BpB,qBAAqB;IAcrB,iBAAiB;;;;IAyBjB,qBAAqB;IAarB,sBAAsB;IAQtB,0BAA0B;IAW1B,2BAA2B;IAQ3B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW;IAYpD,SAAS;IAIT,MAAM;IASN,IAAI;IA6BJ,IAAI;CAyBP;AAED,wBAAgB,YAAY,SA2B3B;AAOD,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/index.js b/node_modules/flowbite/lib/cjs/components/popover/index.js new file mode 100644 index 0000000..fa0f48a --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/index.js @@ -0,0 +1,222 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initPopovers = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = require("@popperjs/core"); +var Default = { + placement: 'top', + offset: 10, + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Popover = /** @class */ (function () { + function Popover(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Popover.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Popover.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + }); + }; + Popover.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, this._options.offset], + }, + }, + ], + }); + }; + Popover.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Popover.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Popover.prototype.isVisible = function () { + return this._visible; + }; + Popover.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Popover.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility to true + this._visible = true; + // callback function + this._options.onShow(this); + }; + Popover.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility to false + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Popover; +}()); +function initPopovers() { + document.querySelectorAll('[data-popover-target]').forEach(function ($triggerEl) { + var popoverID = $triggerEl.getAttribute('data-popover-target'); + var $popoverEl = document.getElementById(popoverID); + if ($popoverEl) { + var triggerType = $triggerEl.getAttribute('data-popover-trigger'); + var placement = $triggerEl.getAttribute('data-popover-placement'); + var offset = $triggerEl.getAttribute('data-popover-offset'); + new Popover($popoverEl, $triggerEl, { + placement: placement ? placement : Default.placement, + offset: offset ? parseInt(offset) : Default.offset, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The popover element with id \"".concat(popoverID, "\" does not exist. Please check the data-popover-target attribute.")); + } + }); +} +exports.initPopovers = initPopovers; +if (typeof window !== 'undefined') { + window.Popover = Popover; + window.initPopovers = initPopovers; +} +exports.default = Popover; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/index.js.map b/node_modules/flowbite/lib/cjs/components/popover/index.js.map new file mode 100644 index 0000000..54e2d46 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/popover/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,uCAA8C;AAQ9C,IAAM,OAAO,GAAmB;IAC5B,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,EAAE;IACV,WAAW,EAAE,OA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,CAAC,OAAO,CAAC,MAAM;gBAClD,WAAW,EAAE,WAAW;oBACpB,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,OAAO,CAAC,WAAW;aACV,CACtB,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wCAAgC,SAAS,uEAAmE,CAC/G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AA3BD,oCA2BC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;CACtC;AAED,kBAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/interface.d.ts b/node_modules/flowbite/lib/cjs/components/popover/interface.d.ts new file mode 100644 index 0000000..851a5a9 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/interface.d.ts @@ -0,0 +1,22 @@ +import { PopoverOptions, PopoverTriggerType, PopoverTriggerEventTypes } from './types'; +import type { Instance as PopperInstance } from '@popperjs/core'; +export declare interface PopoverInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: PopoverOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _setupEventListeners(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(triggerType: PopoverTriggerType): PopoverTriggerEventTypes; + isVisible(): boolean; + show(): void; + hide(): void; + toggle(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/popover/interface.d.ts.map new file mode 100644 index 0000000..8527eea --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/popover/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAE1D,oBAAoB,IAAI,IAAI,CAAC;IAC7B,0BAA0B,IAAI,IAAI,CAAC;IACnC,2BAA2B,IAAI,IAAI,CAAC;IACpC,qBAAqB,IAAI,IAAI,CAAC;IAC9B,sBAAsB,IAAI,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,iBAAiB,CACb,WAAW,EAAE,kBAAkB,GAChC,wBAAwB,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/interface.js b/node_modules/flowbite/lib/cjs/components/popover/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/interface.js.map b/node_modules/flowbite/lib/cjs/components/popover/interface.js.map new file mode 100644 index 0000000..495553d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/popover/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/types.d.ts b/node_modules/flowbite/lib/cjs/components/popover/types.d.ts new file mode 100644 index 0000000..1b8512f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/types.d.ts @@ -0,0 +1,16 @@ +import { PopoverInterface } from './interface'; +import type { Placement } from '@popperjs/core'; +export declare type PopoverTriggerType = 'click' | 'hover' | 'none'; +export declare type PopoverTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type PopoverOptions = { + placement?: Placement; + offset?: number; + triggerType?: PopoverTriggerType; + onShow?: (tooltip: PopoverInterface) => void; + onHide?: (tooltip: PopoverInterface) => void; + onToggle?: (tooltip: PopoverInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/popover/types.d.ts.map new file mode 100644 index 0000000..83d1cf6 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/popover/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,CAAC,OAAO,MAAM,wBAAwB,GAAG;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAClD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/types.js b/node_modules/flowbite/lib/cjs/components/popover/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/popover/types.js.map b/node_modules/flowbite/lib/cjs/components/popover/types.js.map new file mode 100644 index 0000000..8f2e0e4 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/popover/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/popover/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/index.d.ts b/node_modules/flowbite/lib/cjs/components/tabs/index.d.ts new file mode 100644 index 0000000..fd62e63 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/index.d.ts @@ -0,0 +1,16 @@ +import type { TabItem, TabsOptions } from './types'; +import { TabsInterface } from './interface'; +declare class Tabs implements TabsInterface { + _items: TabItem[]; + _activeTab: TabItem; + _options: TabsOptions; + constructor(items?: TabItem[], options?: TabsOptions); + _init(): void; + getActiveTab(): TabItem; + _setActiveTab(tab: TabItem): void; + getTab(id: string): TabItem; + show(id: string, forceShow?: boolean): void; +} +export declare function initTabs(): void; +export default Tabs; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/tabs/index.d.ts.map new file mode 100644 index 0000000..bafbd71 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAW5C,cAAM,IAAK,YAAW,aAAa;IAC/B,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;gBAEV,KAAK,GAAE,OAAO,EAAO,EAAE,OAAO,GAAE,WAAqB;IAOjE,KAAK;IAmBL,YAAY;IAIZ,aAAa,CAAC,GAAG,EAAE,OAAO;IAI1B,MAAM,CAAC,EAAE,EAAE,MAAM;IAIjB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,UAAQ;CAmCrC;AAED,wBAAgB,QAAQ,SA0BvB;AAOD,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/index.js b/node_modules/flowbite/lib/cjs/components/tabs/index.js new file mode 100644 index 0000000..94c6a31 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/index.js @@ -0,0 +1,115 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initTabs = void 0; +var Default = { + defaultTabId: null, + activeClasses: 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500', + inactiveClasses: 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300', + onShow: function () { }, +}; +var Tabs = /** @class */ (function () { + function Tabs(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._activeTab = options ? this.getTab(options.defaultTabId) : null; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Tabs.prototype._init = function () { + var _this = this; + if (this._items.length) { + // set the first tab as active if not set by explicitly + if (!this._activeTab) { + this._setActiveTab(this._items[0]); + } + // force show the first default tab + this.show(this._activeTab.id, true); + // show tab content based on click + this._items.map(function (tab) { + tab.triggerEl.addEventListener('click', function () { + _this.show(tab.id); + }); + }); + } + }; + Tabs.prototype.getActiveTab = function () { + return this._activeTab; + }; + Tabs.prototype._setActiveTab = function (tab) { + this._activeTab = tab; + }; + Tabs.prototype.getTab = function (id) { + return this._items.filter(function (t) { return t.id === id; })[0]; + }; + Tabs.prototype.show = function (id, forceShow) { + var _a, _b; + var _this = this; + if (forceShow === void 0) { forceShow = false; } + var tab = this.getTab(id); + // don't do anything if already active + if (tab === this._activeTab && !forceShow) { + return; + } + // hide other tabs + this._items.map(function (t) { + var _a, _b; + if (t !== tab) { + (_a = t.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = t.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + t.targetEl.classList.add('hidden'); + t.triggerEl.setAttribute('aria-selected', 'false'); + } + }); + // show active tab + (_a = tab.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = tab.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + tab.triggerEl.setAttribute('aria-selected', 'true'); + tab.targetEl.classList.remove('hidden'); + this._setActiveTab(tab); + // callback function + this._options.onShow(this, tab); + }; + return Tabs; +}()); +function initTabs() { + document.querySelectorAll('[data-tabs-toggle]').forEach(function ($triggerEl) { + var tabItems = []; + var defaultTabId = null; + $triggerEl + .querySelectorAll('[role="tab"]') + .forEach(function ($triggerEl) { + var isActive = $triggerEl.getAttribute('aria-selected') === 'true'; + var tab = { + id: $triggerEl.getAttribute('data-tabs-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-tabs-target')), + }; + tabItems.push(tab); + if (isActive) { + defaultTabId = tab.id; + } + }); + new Tabs(tabItems, { + defaultTabId: defaultTabId, + }); + }); +} +exports.initTabs = initTabs; +if (typeof window !== 'undefined') { + window.Tabs = Tabs; + window.initTabs = initTabs; +} +exports.default = Tabs; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/index.js.map b/node_modules/flowbite/lib/cjs/components/tabs/index.js.map new file mode 100644 index 0000000..ddb8dff --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/tabs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,IAAM,OAAO,GAAgB;IACzB,YAAY,EAAE,IAAI;IAClB,aAAa,EACT,oHAAoH;IACxH,eAAe,EACX,kKAAkK;IACtK,MAAM,EAAE,cAAO,CAAC;CACnB,CAAC;AAEF;IAKI,cAAY,KAAqB,EAAE,OAA8B;QAArD,sBAAA,EAAA,UAAqB;QAAE,wBAAA,EAAA,iBAA8B;QAC7D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAA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AgB,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,UAAC,UAAU;QAC/D,IAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,UAAU;aACL,gBAAgB,CAAC,cAAc,CAAC;aAChC,OAAO,CAAC,UAAC,UAAuB;YAC7B,IAAM,QAAQ,GACV,UAAU,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM,CAAC;YACxD,IAAM,GAAG,GAAY;gBACjB,EAAE,EAAE,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC;gBAC/C,SAAS,EAAE,UAAU;gBACrB,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAC5B,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAC9C;aACJ,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEnB,IAAI,QAAQ,EAAE;gBACV,YAAY,GAAG,GAAG,CAAC,EAAE,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;QACP,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,YAAY,EAAE,YAAY;SACd,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACP,CAAC;AA1BD,4BA0BC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;CAC9B;AAED,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts b/node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts new file mode 100644 index 0000000..9e07566 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts @@ -0,0 +1,12 @@ +import { TabItem, TabsOptions } from './types'; +export declare interface TabsInterface { + _items: TabItem[]; + _activeTab: TabItem; + _options: TabsOptions; + _init(): void; + _setActiveTab(tab: TabItem): void; + getActiveTab(): TabItem; + getTab(id: string): TabItem; + show(id: string, forceShow?: boolean): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts.map new file mode 100644 index 0000000..3cd72bd --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;IAEtB,KAAK,IAAI,IAAI,CAAC;IACd,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,YAAY,IAAI,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/interface.js b/node_modules/flowbite/lib/cjs/components/tabs/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/interface.js.map b/node_modules/flowbite/lib/cjs/components/tabs/interface.js.map new file mode 100644 index 0000000..6fc7bb2 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/tabs/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/types.d.ts b/node_modules/flowbite/lib/cjs/components/tabs/types.d.ts new file mode 100644 index 0000000..342be0d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/types.d.ts @@ -0,0 +1,13 @@ +import { TabsInterface } from './interface'; +export declare type TabsOptions = { + defaultTabId?: string; + activeClasses?: string; + inactiveClasses?: string; + onShow?: (tabs: TabsInterface, tab: TabItem) => void; +}; +export declare type TabItem = { + id: string; + triggerEl: HTMLElement; + targetEl: HTMLElement; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/tabs/types.d.ts.map new file mode 100644 index 0000000..da457a9 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,OAAO,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;CACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/types.js b/node_modules/flowbite/lib/cjs/components/tabs/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tabs/types.js.map b/node_modules/flowbite/lib/cjs/components/tabs/types.js.map new file mode 100644 index 0000000..a4a4aff --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tabs/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/tabs/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts b/node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts new file mode 100644 index 0000000..041a7da --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts @@ -0,0 +1,32 @@ +import type { Instance as PopperInstance } from '@popperjs/core'; +import type { TooltipOptions } from './types'; +import { TooltipInterface } from './interface'; +declare class Tooltip implements TooltipInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: TooltipOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: TooltipOptions); + _init(): void; + _setupEventListeners(): void; + _createPopperInstance(): PopperInstance; + _getTriggerEvents(): { + showEvents: string[]; + hideEvents: string[]; + }; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + isVisible(): boolean; + toggle(): void; + show(): void; + hide(): void; +} +export declare function initTooltips(): void; +export default Tooltip; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts.map b/node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts.map new file mode 100644 index 0000000..fc88084 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,QAAQ,IAAI,cAAc,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAU/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAC1D,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB;IAUrC,KAAK;IAML,oBAAoB;IAcpB,qBAAqB;IAcrB,iBAAiB;;;;IAyBjB,qBAAqB;IAarB,sBAAsB;IAQtB,0BAA0B;IAW1B,2BAA2B;IAQ3B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW;IAYpD,SAAS;IAIT,MAAM;IAQN,IAAI;IA6BJ,IAAI;CAyBP;AAED,wBAAgB,YAAY,SAyB3B;AAOD,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/index.js b/node_modules/flowbite/lib/cjs/components/tooltip/index.js new file mode 100644 index 0000000..9371df2 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/index.js @@ -0,0 +1,204 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initTooltips = void 0; +/* eslint-disable @typescript-eslint/no-empty-function */ +var core_1 = require("@popperjs/core"); +var Default = { + placement: 'top', + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Tooltip = /** @class */ (function () { + function Tooltip(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Tooltip.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Tooltip.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.hide(); + }); + }); + }; + Tooltip.prototype._createPopperInstance = function () { + return (0, core_1.createPopper)(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, 8], + }, + }, + ], + }); + }; + Tooltip.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Tooltip.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Tooltip.prototype.isVisible = function () { + return this._visible; + }; + Tooltip.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Tooltip.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility + this._visible = true; + // callback function + this._options.onShow(this); + }; + Tooltip.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Tooltip; +}()); +function initTooltips() { + document.querySelectorAll('[data-tooltip-target]').forEach(function ($triggerEl) { + var tooltipId = $triggerEl.getAttribute('data-tooltip-target'); + var $tooltipEl = document.getElementById(tooltipId); + if ($tooltipEl) { + var triggerType = $triggerEl.getAttribute('data-tooltip-trigger'); + var placement = $triggerEl.getAttribute('data-tooltip-placement'); + new Tooltip($tooltipEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The tooltip element with id \"".concat(tooltipId, "\" does not exist. Please check the data-tooltip-target attribute.")); + } + }); +} +exports.initTooltips = initTooltips; +if (typeof window !== 'undefined') { + window.Tooltip = Tooltip; + window.initTooltips = initTooltips; +} +exports.default = Tooltip; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/index.js.map b/node_modules/flowbite/lib/cjs/components/tooltip/index.js.map new file mode 100644 index 0000000..7cc12c6 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/tooltip/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,uCAA8C;AAQ9C,IAAM,OAAO,GAAmB;IAC5B,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,OAAO;IACpB,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IASI,iBACI,QAAmC,EACnC,SAAoC,EACpC,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QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAEtD,IAAI,UAAU,EAAE;YACZ,IAAM,WAAW,GAAG,UAAU,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;YACpE,IAAM,SAAS,GAAG,UAAU,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;YAEpE,IAAI,OAAO,CACP,UAAyB,EACzB,UAAyB,EACzB;gBACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS;gBACpD,WAAW,EAAE,WAAW;oBACpB,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,OAAO,CAAC,WAAW;aACV,CACtB,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wCAAgC,SAAS,uEAAmE,CAC/G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAzBD,oCAyBC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;CACtC;AAED,kBAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts b/node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts new file mode 100644 index 0000000..f081b33 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts @@ -0,0 +1,23 @@ +import { TooltipOptions, TooltipTriggerType, TooltipTriggerEventTypes } from './types'; +import type { Instance as PopperInstance } from '@popperjs/core'; +export declare interface TooltipInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: TooltipOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _init(): void; + _setupEventListeners(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(triggerType: TooltipTriggerType): TooltipTriggerEventTypes; + isVisible(): boolean; + show(): void; + hide(): void; + toggle(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts.map b/node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts.map new file mode 100644 index 0000000..b395e6b --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAE1D,KAAK,IAAI,IAAI,CAAC;IACd,oBAAoB,IAAI,IAAI,CAAC;IAC7B,0BAA0B,IAAI,IAAI,CAAC;IACnC,2BAA2B,IAAI,IAAI,CAAC;IACpC,qBAAqB,IAAI,IAAI,CAAC;IAC9B,sBAAsB,IAAI,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,iBAAiB,CACb,WAAW,EAAE,kBAAkB,GAChC,wBAAwB,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/interface.js b/node_modules/flowbite/lib/cjs/components/tooltip/interface.js new file mode 100644 index 0000000..d549d1f --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/interface.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/interface.js.map b/node_modules/flowbite/lib/cjs/components/tooltip/interface.js.map new file mode 100644 index 0000000..8a5f072 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/tooltip/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts b/node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts new file mode 100644 index 0000000..1ba5bb3 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts @@ -0,0 +1,15 @@ +import { TooltipInterface } from './interface'; +import type { Placement } from '@popperjs/core'; +export declare type TooltipTriggerType = 'click' | 'hover' | 'none'; +export declare type TooltipTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type TooltipOptions = { + placement?: Placement; + triggerType?: TooltipTriggerType; + onShow?: (tooltip: TooltipInterface) => void; + onHide?: (tooltip: TooltipInterface) => void; + onToggle?: (tooltip: TooltipInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts.map b/node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts.map new file mode 100644 index 0000000..048bf1d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,CAAC,OAAO,MAAM,wBAAwB,GAAG;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAClD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/types.js b/node_modules/flowbite/lib/cjs/components/tooltip/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/components/tooltip/types.js.map b/node_modules/flowbite/lib/cjs/components/tooltip/types.js.map new file mode 100644 index 0000000..cd09cf9 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/components/tooltip/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/tooltip/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/config/global.d.ts b/node_modules/flowbite/lib/cjs/config/global.d.ts new file mode 100644 index 0000000..8937b76 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/config/global.d.ts @@ -0,0 +1,39 @@ +import Accordion from '../components/accordion'; +import Carousel from '../components/carousel'; +import Collapse from '../components/collapse'; +import Dial from '../components/dial'; +import Dismiss from '../components/dismiss'; +import Drawer from '../components/drawer'; +import Dropdown from '../components/dropdown'; +import Modal from '../components/modal'; +import Popover from '../components/popover'; +import Tabs from '../components/tabs'; +import Tooltip from '../components/tooltip'; +declare global { + interface Window { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Dismiss: typeof Dismiss; + Drawer: typeof Drawer; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + initAccordions: () => void; + initCarousels: () => void; + initCollapses: () => void; + initDials: () => void; + initDismisses: () => void; + initDrawers: () => void; + initDropdowns: () => void; + initModals: () => void; + initPopovers: () => void; + initTabs: () => void; + initTooltips: () => void; + initFlowbite: () => void; + } +} +//# sourceMappingURL=global.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/config/global.d.ts.map b/node_modules/flowbite/lib/cjs/config/global.d.ts.map new file mode 100644 index 0000000..b57ae87 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/config/global.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/config/global.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,OAAO,SAAS,CAAC;QAC5B,QAAQ,EAAE,OAAO,QAAQ,CAAC;QAC1B,QAAQ,EAAE,OAAO,QAAQ,CAAC;QAC1B,IAAI,EAAE,OAAO,IAAI,CAAC;QAClB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,QAAQ,EAAE,OAAO,QAAQ,CAAC;QAC1B,KAAK,EAAE,OAAO,KAAK,CAAC;QACpB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,IAAI,EAAE,OAAO,IAAI,CAAC;QAClB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,cAAc,EAAE,MAAM,IAAI,CAAC;QAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;QACtB,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;QACxB,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;QACrB,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,YAAY,EAAE,MAAM,IAAI,CAAC;KAC5B;CACJ"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/config/global.js b/node_modules/flowbite/lib/cjs/config/global.js new file mode 100644 index 0000000..74429bb --- /dev/null +++ b/node_modules/flowbite/lib/cjs/config/global.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/config/global.js.map b/node_modules/flowbite/lib/cjs/config/global.js.map new file mode 100644 index 0000000..52ccc1e --- /dev/null +++ b/node_modules/flowbite/lib/cjs/config/global.js.map @@ -0,0 +1 @@ +{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/config/global.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/dom/events.d.ts b/node_modules/flowbite/lib/cjs/dom/events.d.ts new file mode 100644 index 0000000..3bbb83b --- /dev/null +++ b/node_modules/flowbite/lib/cjs/dom/events.d.ts @@ -0,0 +1,8 @@ +declare class Events { + private _eventType; + private _eventFunctions; + constructor(eventType: string, eventFunctions?: EventListener[]); + init(): void; +} +export default Events; +//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/dom/events.d.ts.map b/node_modules/flowbite/lib/cjs/dom/events.d.ts.map new file mode 100644 index 0000000..de90c16 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/dom/events.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/dom/events.ts"],"names":[],"mappings":"AAAA,cAAM,MAAM;IACR,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,SAAS,EAAE,MAAM,EAAE,cAAc,GAAE,aAAa,EAAO;IAKnE,IAAI;CAOP;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/dom/events.js b/node_modules/flowbite/lib/cjs/dom/events.js new file mode 100644 index 0000000..3d7d94c --- /dev/null +++ b/node_modules/flowbite/lib/cjs/dom/events.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Events = /** @class */ (function () { + function Events(eventType, eventFunctions) { + if (eventFunctions === void 0) { eventFunctions = []; } + this._eventType = eventType; + this._eventFunctions = eventFunctions; + } + Events.prototype.init = function () { + var _this = this; + this._eventFunctions.forEach(function (eventFunction) { + if (typeof window !== 'undefined') { + window.addEventListener(_this._eventType, eventFunction); + } + }); + }; + return Events; +}()); +exports.default = Events; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/dom/events.js.map b/node_modules/flowbite/lib/cjs/dom/events.js.map new file mode 100644 index 0000000..369511c --- /dev/null +++ b/node_modules/flowbite/lib/cjs/dom/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/dom/events.ts"],"names":[],"mappings":";;AAAA;IAII,gBAAY,SAAiB,EAAE,cAAoC;QAApC,+BAAA,EAAA,mBAAoC;QAC/D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IAC1C,CAAC;IAED,qBAAI,GAAJ;QAAA,iBAMC;QALG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAC,aAAa;YACvC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;gBAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;aAC3D;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IACL,aAAC;AAAD,CAAC,AAhBD,IAgBC;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.d.ts b/node_modules/flowbite/lib/cjs/index.d.ts new file mode 100644 index 0000000..5660236 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.d.ts @@ -0,0 +1,47 @@ +import './components/index'; +export { default as Accordion } from './components/accordion'; +export { default as Carousel } from './components/carousel'; +export { default as Collapse } from './components/collapse'; +export { default as Dial } from './components/dial'; +export { default as Dismiss } from './components/dismiss'; +export { default as Drawer } from './components/drawer'; +export { default as Dropdown } from './components/dropdown'; +export { default as Modal } from './components/modal'; +export { default as Popover } from './components/popover'; +export { default as Tabs } from './components/tabs'; +export { default as Tooltip } from './components/tooltip'; +export * from './components/accordion/types'; +export * from './components/carousel/types'; +export * from './components/collapse/types'; +export * from './components/dial/types'; +export * from './components/dismiss/types'; +export * from './components/drawer/types'; +export * from './components/dropdown/types'; +export * from './components/modal/types'; +export * from './components/popover/types'; +export * from './components/tabs/types'; +export * from './components/tooltip/types'; +export * from './components/accordion/interface'; +export * from './components/carousel/interface'; +export * from './components/collapse/interface'; +export * from './components/dial/interface'; +export * from './components/dismiss/interface'; +export * from './components/drawer/interface'; +export * from './components/dropdown/interface'; +export * from './components/modal/interface'; +export * from './components/popover/interface'; +export * from './components/tabs/interface'; +export * from './components/tooltip/interface'; +export { initAccordions } from './components/accordion'; +export { initCarousels } from './components/carousel'; +export { initCollapses } from './components/collapse'; +export { initDials } from './components/dial'; +export { initDismisses } from './components/dismiss'; +export { initDrawers } from './components/drawer'; +export { initDropdowns } from './components/dropdown'; +export { initModals } from './components/modal'; +export { initPopovers } from './components/popover'; +export { initTabs } from './components/tabs'; +export { initTooltips } from './components/tooltip'; +export { initFlowbite } from './components/index'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.d.ts.map b/node_modules/flowbite/lib/cjs/index.d.ts.map new file mode 100644 index 0000000..8997bca --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,oBAAoB,CAAC;AAmB5B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CA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AAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.js b/node_modules/flowbite/lib/cjs/index.js new file mode 100644 index 0000000..35c567d --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.js @@ -0,0 +1,119 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initFlowbite = exports.initTooltips = exports.initTabs = exports.initPopovers = exports.initModals = exports.initDropdowns = exports.initDrawers = exports.initDismisses = exports.initDials = exports.initCollapses = exports.initCarousels = exports.initAccordions = exports.Tooltip = exports.Tabs = exports.Popover = exports.Modal = exports.Dropdown = exports.Drawer = exports.Dismiss = exports.Dial = exports.Collapse = exports.Carousel = exports.Accordion = void 0; +var events_1 = require("./dom/events"); +var accordion_1 = require("./components/accordion"); +var collapse_1 = require("./components/collapse"); +var carousel_1 = require("./components/carousel"); +var dismiss_1 = require("./components/dismiss"); +var dropdown_1 = require("./components/dropdown"); +var modal_1 = require("./components/modal"); +var drawer_1 = require("./components/drawer"); +var tabs_1 = require("./components/tabs"); +var tooltip_1 = require("./components/tooltip"); +var popover_1 = require("./components/popover"); +var dial_1 = require("./components/dial"); +require("./components/index"); +// setup events for data attributes +var events = new events_1.default('load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +events.init(); +// export all components +var accordion_2 = require("./components/accordion"); +Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return accordion_2.default; } }); +var carousel_2 = require("./components/carousel"); +Object.defineProperty(exports, "Carousel", { enumerable: true, get: function () { return carousel_2.default; } }); +var collapse_2 = require("./components/collapse"); +Object.defineProperty(exports, "Collapse", { enumerable: true, get: function () { return collapse_2.default; } }); +var dial_2 = require("./components/dial"); +Object.defineProperty(exports, "Dial", { enumerable: true, get: function () { return dial_2.default; } }); +var dismiss_2 = require("./components/dismiss"); +Object.defineProperty(exports, "Dismiss", { enumerable: true, get: function () { return dismiss_2.default; } }); +var drawer_2 = require("./components/drawer"); +Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return drawer_2.default; } }); +var dropdown_2 = require("./components/dropdown"); +Object.defineProperty(exports, "Dropdown", { enumerable: true, get: function () { return dropdown_2.default; } }); +var modal_2 = require("./components/modal"); +Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return modal_2.default; } }); +var popover_2 = require("./components/popover"); +Object.defineProperty(exports, "Popover", { enumerable: true, get: function () { return popover_2.default; } }); +var tabs_2 = require("./components/tabs"); +Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return tabs_2.default; } }); +var tooltip_2 = require("./components/tooltip"); +Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return tooltip_2.default; } }); +// export all types +__exportStar(require("./components/accordion/types"), exports); +__exportStar(require("./components/carousel/types"), exports); +__exportStar(require("./components/collapse/types"), exports); +__exportStar(require("./components/dial/types"), exports); +__exportStar(require("./components/dismiss/types"), exports); +__exportStar(require("./components/drawer/types"), exports); +__exportStar(require("./components/dropdown/types"), exports); +__exportStar(require("./components/modal/types"), exports); +__exportStar(require("./components/popover/types"), exports); +__exportStar(require("./components/tabs/types"), exports); +__exportStar(require("./components/tooltip/types"), exports); +// export all interfaces +__exportStar(require("./components/accordion/interface"), exports); +__exportStar(require("./components/carousel/interface"), exports); +__exportStar(require("./components/collapse/interface"), exports); +__exportStar(require("./components/dial/interface"), exports); +__exportStar(require("./components/dismiss/interface"), exports); +__exportStar(require("./components/drawer/interface"), exports); +__exportStar(require("./components/dropdown/interface"), exports); +__exportStar(require("./components/modal/interface"), exports); +__exportStar(require("./components/popover/interface"), exports); +__exportStar(require("./components/tabs/interface"), exports); +__exportStar(require("./components/tooltip/interface"), exports); +// export init functions +var accordion_3 = require("./components/accordion"); +Object.defineProperty(exports, "initAccordions", { enumerable: true, get: function () { return accordion_3.initAccordions; } }); +var carousel_3 = require("./components/carousel"); +Object.defineProperty(exports, "initCarousels", { enumerable: true, get: function () { return carousel_3.initCarousels; } }); +var collapse_3 = require("./components/collapse"); +Object.defineProperty(exports, "initCollapses", { enumerable: true, get: function () { return collapse_3.initCollapses; } }); +var dial_3 = require("./components/dial"); +Object.defineProperty(exports, "initDials", { enumerable: true, get: function () { return dial_3.initDials; } }); +var dismiss_3 = require("./components/dismiss"); +Object.defineProperty(exports, "initDismisses", { enumerable: true, get: function () { return dismiss_3.initDismisses; } }); +var drawer_3 = require("./components/drawer"); +Object.defineProperty(exports, "initDrawers", { enumerable: true, get: function () { return drawer_3.initDrawers; } }); +var dropdown_3 = require("./components/dropdown"); +Object.defineProperty(exports, "initDropdowns", { enumerable: true, get: function () { return dropdown_3.initDropdowns; } }); +var modal_3 = require("./components/modal"); +Object.defineProperty(exports, "initModals", { enumerable: true, get: function () { return modal_3.initModals; } }); +var popover_3 = require("./components/popover"); +Object.defineProperty(exports, "initPopovers", { enumerable: true, get: function () { return popover_3.initPopovers; } }); +var tabs_3 = require("./components/tabs"); +Object.defineProperty(exports, "initTabs", { enumerable: true, get: function () { return tabs_3.initTabs; } }); +var tooltip_3 = require("./components/tooltip"); +Object.defineProperty(exports, "initTooltips", { enumerable: true, get: function () { return tooltip_3.initTooltips; } }); +// export all init functions +var index_1 = require("./components/index"); +Object.defineProperty(exports, "initFlowbite", { enumerable: true, get: function () { return index_1.initFlowbite; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.js.map b/node_modules/flowbite/lib/cjs/index.js.map new file mode 100644 index 0000000..fbee404 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAkC;AAClC,oDAAwD;AACxD,kDAAsD;AACtD,kDAAsD;AACtD,gDAAqD;AACrD,kDAAsD;AACtD,4CAAgD;AAChD,8CAAkD;AAClD,0CAA6C;AAC7C,gDAAoD;AACpD,gDAAoD;AACpD,0CAA8C;AAC9C,8BAA4B;AAE5B,mCAAmC;AACnC,IAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,MAAM,EAAE;IAC9B,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,MAAM,CAAC,IAAI,EAAE,CAAC;AAEd,wBAAwB;AACxB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AQ,OAAA;AACjB,gDAAoD;AAA3C,uGAAA,YAAY,OAAA;AAErB,4BAA4B;AAC5B,4CAAkD;AAAzC,qGAAA,YAAY,OAAA"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.phoenix.d.ts b/node_modules/flowbite/lib/cjs/index.phoenix.d.ts new file mode 100644 index 0000000..9bec6d4 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.phoenix.d.ts @@ -0,0 +1,29 @@ +import Accordion from './components/accordion'; +import Carousel from './components/carousel'; +import Collapse from './components/collapse'; +import Dial from './components/dial'; +import Dismiss from './components/dismiss'; +import Drawer from './components/drawer'; +import Dropdown from './components/dropdown'; +import Modal from './components/modal'; +import Popover from './components/popover'; +import Tabs from './components/tabs'; +import Tooltip from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +declare const _default: { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Drawer: typeof Drawer; + Dismiss: typeof Dismiss; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + Events: typeof Events; +}; +export default _default; +//# sourceMappingURL=index.phoenix.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.phoenix.d.ts.map b/node_modules/flowbite/lib/cjs/index.phoenix.d.ts.map new file mode 100644 index 0000000..0e05cf0 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.phoenix.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.phoenix.d.ts","sourceRoot":"","sources":["../../src/index.phoenix.ts"],"names":[],"mappings":"AACA,OAAO,SAA6B,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAuB,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAkB,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;AAgClC,wBAaE"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.phoenix.js b/node_modules/flowbite/lib/cjs/index.phoenix.js new file mode 100644 index 0000000..4fcfed0 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.phoenix.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// core components +var accordion_1 = require("./components/accordion"); +var carousel_1 = require("./components/carousel"); +var collapse_1 = require("./components/collapse"); +var dial_1 = require("./components/dial"); +var dismiss_1 = require("./components/dismiss"); +var drawer_1 = require("./components/drawer"); +var dropdown_1 = require("./components/dropdown"); +var modal_1 = require("./components/modal"); +var popover_1 = require("./components/popover"); +var tabs_1 = require("./components/tabs"); +var tooltip_1 = require("./components/tooltip"); +require("./components/index"); +var events_1 = require("./dom/events"); +var liveViewLoadEvents = new events_1.default('phx:page-loading-stop', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +liveViewLoadEvents.init(); +var regularViewLoadEvents = new events_1.default('load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +regularViewLoadEvents.init(); +exports.default = { + Accordion: accordion_1.default, + Carousel: carousel_1.default, + Collapse: collapse_1.default, + Dial: dial_1.default, + Drawer: drawer_1.default, + Dismiss: dismiss_1.default, + Dropdown: dropdown_1.default, + Modal: modal_1.default, + Popover: popover_1.default, + Tabs: tabs_1.default, + Tooltip: tooltip_1.default, + Events: events_1.default, +}; +//# sourceMappingURL=index.phoenix.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.phoenix.js.map b/node_modules/flowbite/lib/cjs/index.phoenix.js.map new file mode 100644 index 0000000..ce03836 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.phoenix.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.phoenix.js","sourceRoot":"","sources":["../../src/index.phoenix.ts"],"names":[],"mappings":";;AAAA,kBAAkB;AAClB,oDAAmE;AACnE,kDAAgE;AAChE,kDAAgE;AAChE,0CAAoD;AACpD,gDAA8D;AAC9D,8CAA0D;AAC1D,kDAAgE;AAChE,4CAAuD;AACvD,gDAA6D;AAC7D,0CAAmD;AACnD,gDAA6D;AAC7D,8BAA4B;AAC5B,uCAAkC;AAElC,IAAM,kBAAkB,GAAG,IAAI,gBAAM,CAAC,uBAAuB,EAAE;IAC3D,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,kBAAkB,CAAC,IAAI,EAAE,CAAC;AAE1B,IAAM,qBAAqB,GAAG,IAAI,gBAAM,CAAC,MAAM,EAAE;IAC7C,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAE7B,kBAAe;IACX,SAAS,qBAAA;IACT,QAAQ,oBAAA;IACR,QAAQ,oBAAA;IACR,IAAI,gBAAA;IACJ,MAAM,kBAAA;IACN,OAAO,mBAAA;IACP,QAAQ,oBAAA;IACR,KAAK,iBAAA;IACL,OAAO,mBAAA;IACP,IAAI,gBAAA;IACJ,OAAO,mBAAA;IACP,MAAM,kBAAA;CACT,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.turbo.d.ts b/node_modules/flowbite/lib/cjs/index.turbo.d.ts new file mode 100644 index 0000000..413a593 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.turbo.d.ts @@ -0,0 +1,29 @@ +import Accordion from './components/accordion'; +import Carousel from './components/carousel'; +import Collapse from './components/collapse'; +import Dial from './components/dial'; +import Dismiss from './components/dismiss'; +import Drawer from './components/drawer'; +import Dropdown from './components/dropdown'; +import Modal from './components/modal'; +import Popover from './components/popover'; +import Tabs from './components/tabs'; +import Tooltip from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +declare const _default: { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Drawer: typeof Drawer; + Dismiss: typeof Dismiss; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + Events: typeof Events; +}; +export default _default; +//# sourceMappingURL=index.turbo.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.turbo.d.ts.map b/node_modules/flowbite/lib/cjs/index.turbo.d.ts.map new file mode 100644 index 0000000..4b913c1 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.turbo.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.turbo.d.ts","sourceRoot":"","sources":["../../src/index.turbo.ts"],"names":[],"mappings":"AACA,OAAO,SAA6B,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAuB,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAkB,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;AAgClC,wBAaE"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.turbo.js b/node_modules/flowbite/lib/cjs/index.turbo.js new file mode 100644 index 0000000..b55d5d7 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.turbo.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// core components +var accordion_1 = require("./components/accordion"); +var carousel_1 = require("./components/carousel"); +var collapse_1 = require("./components/collapse"); +var dial_1 = require("./components/dial"); +var dismiss_1 = require("./components/dismiss"); +var drawer_1 = require("./components/drawer"); +var dropdown_1 = require("./components/dropdown"); +var modal_1 = require("./components/modal"); +var popover_1 = require("./components/popover"); +var tabs_1 = require("./components/tabs"); +var tooltip_1 = require("./components/tooltip"); +require("./components/index"); +var events_1 = require("./dom/events"); +var turboLoadEvents = new events_1.default('turbo:load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +turboLoadEvents.init(); +var turboFrameLoadEvents = new events_1.default('turbo:frame-load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +turboFrameLoadEvents.init(); +exports.default = { + Accordion: accordion_1.default, + Carousel: carousel_1.default, + Collapse: collapse_1.default, + Dial: dial_1.default, + Drawer: drawer_1.default, + Dismiss: dismiss_1.default, + Dropdown: dropdown_1.default, + Modal: modal_1.default, + Popover: popover_1.default, + Tabs: tabs_1.default, + Tooltip: tooltip_1.default, + Events: events_1.default, +}; +//# sourceMappingURL=index.turbo.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.turbo.js.map b/node_modules/flowbite/lib/cjs/index.turbo.js.map new file mode 100644 index 0000000..5bb7dff --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.turbo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.turbo.js","sourceRoot":"","sources":["../../src/index.turbo.ts"],"names":[],"mappings":";;AAAA,kBAAkB;AAClB,oDAAmE;AACnE,kDAAgE;AAChE,kDAAgE;AAChE,0CAAoD;AACpD,gDAA8D;AAC9D,8CAA0D;AAC1D,kDAAgE;AAChE,4CAAuD;AACvD,gDAA6D;AAC7D,0CAAmD;AACnD,gDAA6D;AAC7D,8BAA4B;AAC5B,uCAAkC;AAElC,IAAM,eAAe,GAAG,IAAI,gBAAM,CAAC,YAAY,EAAE;IAC7C,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,eAAe,CAAC,IAAI,EAAE,CAAC;AAEvB,IAAM,oBAAoB,GAAG,IAAI,gBAAM,CAAC,kBAAkB,EAAE;IACxD,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,oBAAoB,CAAC,IAAI,EAAE,CAAC;AAE5B,kBAAe;IACX,SAAS,qBAAA;IACT,QAAQ,oBAAA;IACR,QAAQ,oBAAA;IACR,IAAI,gBAAA;IACJ,MAAM,kBAAA;IACN,OAAO,mBAAA;IACP,QAAQ,oBAAA;IACR,KAAK,iBAAA;IACL,OAAO,mBAAA;IACP,IAAI,gBAAA;IACJ,OAAO,mBAAA;IACP,MAAM,kBAAA;CACT,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.umd.d.ts b/node_modules/flowbite/lib/cjs/index.umd.d.ts new file mode 100644 index 0000000..98f6048 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.umd.d.ts @@ -0,0 +1,30 @@ +import './flowbite.css'; +import Accordion from './components/accordion'; +import Carousel from './components/carousel'; +import Collapse from './components/collapse'; +import Dial from './components/dial'; +import Dismiss from './components/dismiss'; +import Drawer from './components/drawer'; +import Dropdown from './components/dropdown'; +import Modal from './components/modal'; +import Popover from './components/popover'; +import Tabs from './components/tabs'; +import Tooltip from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +declare const _default: { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Drawer: typeof Drawer; + Dismiss: typeof Dismiss; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + Events: typeof Events; +}; +export default _default; +//# sourceMappingURL=index.umd.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.umd.d.ts.map b/node_modules/flowbite/lib/cjs/index.umd.d.ts.map new file mode 100644 index 0000000..60b4ec2 --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.umd.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../src/index.umd.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,SAA6B,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAuB,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAkB,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;AAiBlC,wBAaE"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.umd.js b/node_modules/flowbite/lib/cjs/index.umd.js new file mode 100644 index 0000000..a8352da --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.umd.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("./flowbite.css"); +// core components +var accordion_1 = require("./components/accordion"); +var carousel_1 = require("./components/carousel"); +var collapse_1 = require("./components/collapse"); +var dial_1 = require("./components/dial"); +var dismiss_1 = require("./components/dismiss"); +var drawer_1 = require("./components/drawer"); +var dropdown_1 = require("./components/dropdown"); +var modal_1 = require("./components/modal"); +var popover_1 = require("./components/popover"); +var tabs_1 = require("./components/tabs"); +var tooltip_1 = require("./components/tooltip"); +require("./components/index"); +var events_1 = require("./dom/events"); +var events = new events_1.default('load', [ + accordion_1.initAccordions, + collapse_1.initCollapses, + carousel_1.initCarousels, + dismiss_1.initDismisses, + dropdown_1.initDropdowns, + modal_1.initModals, + drawer_1.initDrawers, + tabs_1.initTabs, + tooltip_1.initTooltips, + popover_1.initPopovers, + dial_1.initDials, +]); +events.init(); +exports.default = { + Accordion: accordion_1.default, + Carousel: carousel_1.default, + Collapse: collapse_1.default, + Dial: dial_1.default, + Drawer: drawer_1.default, + Dismiss: dismiss_1.default, + Dropdown: dropdown_1.default, + Modal: modal_1.default, + Popover: popover_1.default, + Tabs: tabs_1.default, + Tooltip: tooltip_1.default, + Events: events_1.default, +}; +//# sourceMappingURL=index.umd.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/cjs/index.umd.js.map b/node_modules/flowbite/lib/cjs/index.umd.js.map new file mode 100644 index 0000000..f1c353a --- /dev/null +++ b/node_modules/flowbite/lib/cjs/index.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.js","sourceRoot":"","sources":["../../src/index.umd.ts"],"names":[],"mappings":";;AAAA,0BAAwB;AAExB,kBAAkB;AAClB,oDAAmE;AACnE,kDAAgE;AAChE,kDAAgE;AAChE,0CAAoD;AACpD,gDAA8D;AAC9D,8CAA0D;AAC1D,kDAAgE;AAChE,4CAAuD;AACvD,gDAA6D;AAC7D,0CAAmD;AACnD,gDAA6D;AAC7D,8BAA4B;AAC5B,uCAAkC;AAElC,IAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,MAAM,EAAE;IAC9B,0BAAc;IACd,wBAAa;IACb,wBAAa;IACb,uBAAa;IACb,wBAAa;IACb,kBAAU;IACV,oBAAW;IACX,eAAQ;IACR,sBAAY;IACZ,sBAAY;IACZ,gBAAS;CACZ,CAAC,CAAC;AACH,MAAM,CAAC,IAAI,EAAE,CAAC;AAEd,kBAAe;IACX,SAAS,qBAAA;IACT,QAAQ,oBAAA;IACR,QAAQ,oBAAA;IACR,IAAI,gBAAA;IACJ,MAAM,kBAAA;IACN,OAAO,mBAAA;IACP,QAAQ,oBAAA;IACR,KAAK,iBAAA;IACL,OAAO,mBAAA;IACP,IAAI,gBAAA;IACJ,OAAO,mBAAA;IACP,MAAM,kBAAA;CACT,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/index.d.ts b/node_modules/flowbite/lib/esm/components/accordion/index.d.ts new file mode 100644 index 0000000..4ea151a --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/index.d.ts @@ -0,0 +1,15 @@ +import type { AccordionItem, AccordionOptions } from './types'; +import { AccordionInterface } from './interface'; +declare class Accordion implements AccordionInterface { + _items: AccordionItem[]; + _options: AccordionOptions; + constructor(items?: AccordionItem[], options?: AccordionOptions); + private _init; + getItem(id: string): AccordionItem; + open(id: string): void; + toggle(id: string): void; + close(id: string): void; +} +export declare function initAccordions(): void; +export default Accordion; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/index.d.ts.map b/node_modules/flowbite/lib/esm/components/accordion/index.d.ts.map new file mode 100644 index 0000000..a7f1f0f --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAWjD,cAAM,SAAU,YAAW,kBAAkB;IACzC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;gBAGvB,KAAK,GAAE,aAAa,EAAO,EAC3B,OAAO,GAAE,gBAA0B;IAOvC,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,EAAE,EAAE,MAAM;IAIlB,IAAI,CAAC,EAAE,EAAE,MAAM;IA2Cf,MAAM,CAAC,EAAE,EAAE,MAAM;IAajB,KAAK,CAAC,EAAE,EAAE,MAAM;CAqBnB;AAED,wBAAgB,cAAc,SA2C7B;AAOD,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/index.js b/node_modules/flowbite/lib/esm/components/accordion/index.js new file mode 100644 index 0000000..a82f735 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/index.js @@ -0,0 +1,147 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + alwaysOpen: false, + activeClasses: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white', + inactiveClasses: 'text-gray-500 dark:text-gray-400', + onOpen: function () { }, + onClose: function () { }, + onToggle: function () { }, +}; +var Accordion = /** @class */ (function () { + function Accordion(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Accordion.prototype._init = function () { + var _this = this; + if (this._items.length) { + // show accordion item based on click + this._items.map(function (item) { + if (item.active) { + _this.open(item.id); + } + item.triggerEl.addEventListener('click', function () { + _this.toggle(item.id); + }); + }); + } + }; + Accordion.prototype.getItem = function (id) { + return this._items.filter(function (item) { return item.id === id; })[0]; + }; + Accordion.prototype.open = function (id) { + var _a, _b; + var _this = this; + var item = this.getItem(id); + // don't hide other accordions if always open + if (!this._options.alwaysOpen) { + this._items.map(function (i) { + var _a, _b; + if (i !== item) { + (_a = i.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = i.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + i.targetEl.classList.add('hidden'); + i.triggerEl.setAttribute('aria-expanded', 'false'); + i.active = false; + // rotate icon if set + if (i.iconEl) { + i.iconEl.classList.remove('rotate-180'); + } + } + }); + } + // show active item + (_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + item.triggerEl.setAttribute('aria-expanded', 'true'); + item.targetEl.classList.remove('hidden'); + item.active = true; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.add('rotate-180'); + } + // callback function + this._options.onOpen(this, item); + }; + Accordion.prototype.toggle = function (id) { + var item = this.getItem(id); + if (item.active) { + this.close(id); + } + else { + this.open(id); + } + // callback function + this._options.onToggle(this, item); + }; + Accordion.prototype.close = function (id) { + var _a, _b; + var item = this.getItem(id); + (_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(' ')); + (_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(' ')); + item.targetEl.classList.add('hidden'); + item.triggerEl.setAttribute('aria-expanded', 'false'); + item.active = false; + // rotate icon if set + if (item.iconEl) { + item.iconEl.classList.remove('rotate-180'); + } + // callback function + this._options.onClose(this, item); + }; + return Accordion; +}()); +export function initAccordions() { + document.querySelectorAll('[data-accordion]').forEach(function ($accordionEl) { + var alwaysOpen = $accordionEl.getAttribute('data-accordion'); + var activeClasses = $accordionEl.getAttribute('data-active-classes'); + var inactiveClasses = $accordionEl.getAttribute('data-inactive-classes'); + var items = []; + $accordionEl + .querySelectorAll('[data-accordion-target]') + .forEach(function ($triggerEl) { + // Consider only items that directly belong to $accordionEl + // (to make nested accordions work). + if ($triggerEl.closest('[data-accordion]') === $accordionEl) { + var item = { + id: $triggerEl.getAttribute('data-accordion-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-accordion-target')), + iconEl: $triggerEl.querySelector('[data-accordion-icon]'), + active: $triggerEl.getAttribute('aria-expanded') === 'true' + ? true + : false, + }; + items.push(item); + } + }); + new Accordion(items, { + alwaysOpen: alwaysOpen === 'open' ? true : false, + activeClasses: activeClasses + ? activeClasses + : Default.activeClasses, + inactiveClasses: inactiveClasses + ? inactiveClasses + : Default.inactiveClasses, + }); + }); +} +if (typeof window !== 'undefined') { + window.Accordion = Accordion; + window.initAccordions = initAccordions; +} +export default Accordion; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/index.js.map b/node_modules/flowbite/lib/esm/components/accordion/index.js.map new file mode 100644 index 0000000..2cd99c7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/accordion/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAM,OAAO,GAAqB;IAC9B,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,4DAA4D;IAC3E,eAAe,EAAE,kCAAkC;IACnD,MAAM,EAAE,cAAO,CAAC;IAChB,OAAO,EAAE,cAAO,CAAC;IACjB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAII,mBACI,KAA2B,EAC3B,OAAmC;QADnC,sBAAA,EAAA,UAA2B;QAC3B,wBAAA,EAAA,iBAAmC;QAEnC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,yBAAQ,OAAO,GAAK,OAAO,CAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAEO,yBAAK,GAAb;QAAA,iBAaC;QAZG,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACpB,qCAAqC;YACrC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,IAAI;gBACjB,IAAI,IAAI,CAAC,MAAM,EAAE;oBACb,KAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;iBACtB;gBAED,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE;oBACrC,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACzB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAED,2BAAO,GAAP,UAAQ,EAAU;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAC,IAA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ACD,MAAM,EACF,UAAU,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;wBAC/C,CAAC,CAAC,IAAI;wBACN,CAAC,CAAC,KAAK;iBACD,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACpB;QACL,CAAC,CAAC,CAAC;QAEP,IAAI,SAAS,CAAC,KAAK,EAAE;YACjB,UAAU,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAChD,aAAa,EAAE,aAAa;gBACxB,CAAC,CAAC,aAAa;gBACf,CAAC,CAAC,OAAO,CAAC,aAAa;YAC3B,eAAe,EAAE,eAAe;gBAC5B,CAAC,CAAC,eAAe;gBACjB,CAAC,CAAC,OAAO,CAAC,eAAe;SACZ,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC;CAC1C;AAED,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/interface.d.ts b/node_modules/flowbite/lib/esm/components/accordion/interface.d.ts new file mode 100644 index 0000000..ebeacd9 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/interface.d.ts @@ -0,0 +1,10 @@ +import { AccordionItem, AccordionOptions } from './types'; +export declare interface AccordionInterface { + _items: AccordionItem[]; + _options: AccordionOptions; + getItem(id: string): AccordionItem | undefined; + open(id: string): void; + toggle(id: string): void; + close(id: string): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/accordion/interface.d.ts.map new file mode 100644 index 0000000..cfc63e5 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/interface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACvC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAC/C,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/interface.js b/node_modules/flowbite/lib/esm/components/accordion/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/interface.js.map b/node_modules/flowbite/lib/esm/components/accordion/interface.js.map new file mode 100644 index 0000000..a7ef24a --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/accordion/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/types.d.ts b/node_modules/flowbite/lib/esm/components/accordion/types.d.ts new file mode 100644 index 0000000..c8fb43a --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/types.d.ts @@ -0,0 +1,17 @@ +import { AccordionInterface } from './interface'; +export declare type AccordionItem = { + id: string; + triggerEl: HTMLElement; + targetEl: HTMLElement; + iconEl?: HTMLElement | null; + active?: boolean; +}; +export declare type AccordionOptions = { + alwaysOpen?: boolean; + activeClasses?: string; + inactiveClasses?: string; + onOpen?: (accordion: AccordionInterface, item: AccordionItem) => void; + onClose?: (accordion: AccordionInterface, item: AccordionItem) => void; + onToggle?: (accordion: AccordionInterface, item: AccordionItem) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/types.d.ts.map b/node_modules/flowbite/lib/esm/components/accordion/types.d.ts.map new file mode 100644 index 0000000..c130ff7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3E,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/types.js b/node_modules/flowbite/lib/esm/components/accordion/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/accordion/types.js.map b/node_modules/flowbite/lib/esm/components/accordion/types.js.map new file mode 100644 index 0000000..e0f0c46 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/accordion/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/accordion/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/index.d.ts b/node_modules/flowbite/lib/esm/components/carousel/index.d.ts new file mode 100644 index 0000000..0361e3e --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/index.d.ts @@ -0,0 +1,54 @@ +import type { CarouselOptions, CarouselItem, IndicatorItem, RotationItems } from './types'; +import { CarouselInterface } from './interface'; +declare class Carousel implements CarouselInterface { + _items: CarouselItem[]; + _indicators: IndicatorItem[]; + _activeItem: CarouselItem; + _intervalDuration: number; + _intervalInstance: number; + _options: CarouselOptions; + constructor(items?: CarouselItem[], options?: CarouselOptions); + /** + * initialize carousel and items based on active one + */ + _init(): void; + getItem(position: number): CarouselItem; + /** + * Slide to the element based on id + * @param {*} position + */ + slideTo(position: number): void; + /** + * Based on the currently active item it will go to the next position + */ + next(): void; + /** + * Based on the currently active item it will go to the previous position + */ + prev(): void; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + _rotate(rotationItems: RotationItems): void; + /** + * Set an interval to cycle through the carousel items + */ + cycle(): void; + /** + * Clears the cycling interval + */ + pause(): void; + /** + * Get the currently active item + */ + _getActiveItem(): CarouselItem; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + _setActiveItem(item: CarouselItem): void; +} +export declare function initCarousels(): void; +export default Carousel; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/index.d.ts.map b/node_modules/flowbite/lib/esm/components/carousel/index.d.ts.map new file mode 100644 index 0000000..76e86e7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAgBhD,cAAM,QAAS,YAAW,iBAAiB;IACvC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;gBAGtB,KAAK,GAAE,YAAY,EAAO,EAC1B,OAAO,GAAE,eAAyB;IAetC;;OAEG;IACH,KAAK;IAwBL,OAAO,CAAC,QAAQ,EAAE,MAAM;IAIxB;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM;IAuBxB;;OAEG;IACH,IAAI;IAiBJ;;OAEG;IACH,IAAI;IAiBJ;;;OAGG;IACH,OAAO,CAAC,aAAa,EAAE,aAAa;IAqCpC;;OAEG;IACH,KAAK;IAQL;;OAEG;IACH,KAAK;IAIL;;OAEG;IACH,cAAc;IAId;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,YAAY;CAwBpC;AAED,wBAAgB,aAAa,SA0E5B;AAOD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/index.js b/node_modules/flowbite/lib/esm/components/carousel/index.js new file mode 100644 index 0000000..48181f2 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/index.js @@ -0,0 +1,242 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + defaultPosition: 0, + indicators: { + items: [], + activeClasses: 'bg-white dark:bg-gray-800', + inactiveClasses: 'bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800', + }, + interval: 3000, + onNext: function () { }, + onPrev: function () { }, + onChange: function () { }, +}; +var Carousel = /** @class */ (function () { + function Carousel(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._options = __assign(__assign(__assign({}, Default), options), { indicators: __assign(__assign({}, Default.indicators), options.indicators) }); + this._activeItem = this.getItem(this._options.defaultPosition); + this._indicators = this._options.indicators.items; + this._intervalDuration = this._options.interval; + this._intervalInstance = null; + this._init(); + } + /** + * initialize carousel and items based on active one + */ + Carousel.prototype._init = function () { + var _this = this; + this._items.map(function (item) { + item.el.classList.add('absolute', 'inset-0', 'transition-transform', 'transform'); + }); + // if no active item is set then first position is default + if (this._getActiveItem()) { + this.slideTo(this._getActiveItem().position); + } + else { + this.slideTo(0); + } + this._indicators.map(function (indicator, position) { + indicator.el.addEventListener('click', function () { + _this.slideTo(position); + }); + }); + }; + Carousel.prototype.getItem = function (position) { + return this._items[position]; + }; + /** + * Slide to the element based on id + * @param {*} position + */ + Carousel.prototype.slideTo = function (position) { + var nextItem = this._items[position]; + var rotationItems = { + left: nextItem.position === 0 + ? this._items[this._items.length - 1] + : this._items[nextItem.position - 1], + middle: nextItem, + right: nextItem.position === this._items.length - 1 + ? this._items[0] + : this._items[nextItem.position + 1], + }; + this._rotate(rotationItems); + this._setActiveItem(nextItem); + if (this._intervalInstance) { + this.pause(); + this.cycle(); + } + this._options.onChange(this); + }; + /** + * Based on the currently active item it will go to the next position + */ + Carousel.prototype.next = function () { + var activeItem = this._getActiveItem(); + var nextItem = null; + // check if last item + if (activeItem.position === this._items.length - 1) { + nextItem = this._items[0]; + } + else { + nextItem = this._items[activeItem.position + 1]; + } + this.slideTo(nextItem.position); + // callback function + this._options.onNext(this); + }; + /** + * Based on the currently active item it will go to the previous position + */ + Carousel.prototype.prev = function () { + var activeItem = this._getActiveItem(); + var prevItem = null; + // check if first item + if (activeItem.position === 0) { + prevItem = this._items[this._items.length - 1]; + } + else { + prevItem = this._items[activeItem.position - 1]; + } + this.slideTo(prevItem.position); + // callback function + this._options.onPrev(this); + }; + /** + * This method applies the transform classes based on the left, middle, and right rotation carousel items + * @param {*} rotationItems + */ + Carousel.prototype._rotate = function (rotationItems) { + // reset + this._items.map(function (item) { + item.el.classList.add('hidden'); + }); + // left item (previously active) + rotationItems.left.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.left.el.classList.add('-translate-x-full', 'z-10'); + // currently active item + rotationItems.middle.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-10'); + rotationItems.middle.el.classList.add('translate-x-0', 'z-20'); + // right item (upcoming active) + rotationItems.right.el.classList.remove('-translate-x-full', 'translate-x-full', 'translate-x-0', 'hidden', 'z-20'); + rotationItems.right.el.classList.add('translate-x-full', 'z-10'); + }; + /** + * Set an interval to cycle through the carousel items + */ + Carousel.prototype.cycle = function () { + var _this = this; + if (typeof window !== 'undefined') { + this._intervalInstance = window.setInterval(function () { + _this.next(); + }, this._intervalDuration); + } + }; + /** + * Clears the cycling interval + */ + Carousel.prototype.pause = function () { + clearInterval(this._intervalInstance); + }; + /** + * Get the currently active item + */ + Carousel.prototype._getActiveItem = function () { + return this._activeItem; + }; + /** + * Set the currently active item and data attribute + * @param {*} position + */ + Carousel.prototype._setActiveItem = function (item) { + var _a, _b; + var _this = this; + this._activeItem = item; + var position = item.position; + // update the indicators if available + if (this._indicators.length) { + this._indicators.map(function (indicator) { + var _a, _b; + indicator.el.setAttribute('aria-current', 'false'); + (_a = indicator.el.classList).remove.apply(_a, _this._options.indicators.activeClasses.split(' ')); + (_b = indicator.el.classList).add.apply(_b, _this._options.indicators.inactiveClasses.split(' ')); + }); + (_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(' ')); + (_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(' ')); + this._indicators[position].el.setAttribute('aria-current', 'true'); + } + }; + return Carousel; +}()); +export function initCarousels() { + document.querySelectorAll('[data-carousel]').forEach(function ($carouselEl) { + var interval = $carouselEl.getAttribute('data-carousel-interval'); + var slide = $carouselEl.getAttribute('data-carousel') === 'slide' + ? true + : false; + var items = []; + var defaultPosition = 0; + if ($carouselEl.querySelectorAll('[data-carousel-item]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-item]')).map(function ($carouselItemEl, position) { + items.push({ + position: position, + el: $carouselItemEl, + }); + if ($carouselItemEl.getAttribute('data-carousel-item') === + 'active') { + defaultPosition = position; + } + }); + } + var indicators = []; + if ($carouselEl.querySelectorAll('[data-carousel-slide-to]').length) { + Array.from($carouselEl.querySelectorAll('[data-carousel-slide-to]')).map(function ($indicatorEl) { + indicators.push({ + position: parseInt($indicatorEl.getAttribute('data-carousel-slide-to')), + el: $indicatorEl, + }); + }); + } + var carousel = new Carousel(items, { + defaultPosition: defaultPosition, + indicators: { + items: indicators, + }, + interval: interval ? interval : Default.interval, + }); + if (slide) { + carousel.cycle(); + } + // check for controls + var carouselNextEl = $carouselEl.querySelector('[data-carousel-next]'); + var carouselPrevEl = $carouselEl.querySelector('[data-carousel-prev]'); + if (carouselNextEl) { + carouselNextEl.addEventListener('click', function () { + carousel.next(); + }); + } + if (carouselPrevEl) { + carouselPrevEl.addEventListener('click', function () { + carousel.prev(); + }); + } + }); +} +if (typeof window !== 'undefined') { + window.Carousel = Carousel; + window.initCarousels = initCarousels; +} +export default Carousel; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/index.js.map b/node_modules/flowbite/lib/esm/components/carousel/index.js.map new file mode 100644 index 0000000..116a49d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/carousel/index.ts"],"names":[],"mappings":";;;;;;;;;;;AASA,IAAM,OAAO,GAAoB;IAC7B,eAAe,EAAE,CAAC;IAClB,UAAU,EAAE;QACR,KAAK,EAAE,EAAE;QACT,aAAa,EAAE,2BAA2B;QAC1C,eAAe,EACX,uEAAuE;KAC9E;IACD,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAQI,kBACI,KAA0B,EAC1B,OAAkC;QADlC,sBAAA,EAAA,UAA0B;QAC1B,wBAAA,EAAA,iBAAkC;QAElC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,kCACN,OAAO,GACP,OAAO,KACV,UAAU,wBAAO,OAAO,CAAC,UAAU,GAAK,OAAO,CAAC,UAAU,IAC7D,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC/D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAChD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,wBAAK,GAAL;QAAA,iBAsBC;QArBG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,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ib/esm/components/carousel/interface.d.ts b/node_modules/flowbite/lib/esm/components/carousel/interface.d.ts new file mode 100644 index 0000000..edb6114 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/interface.d.ts @@ -0,0 +1,20 @@ +import { CarouselOptions, CarouselItem, IndicatorItem, RotationItems } from './types'; +export declare interface CarouselInterface { + _items: CarouselItem[]; + _indicators: IndicatorItem[]; + _activeItem: CarouselItem; + _intervalDuration: number; + _intervalInstance: number; + _options: CarouselOptions; + _init(): void; + getItem(position: number): CarouselItem; + _getActiveItem(): CarouselItem; + _setActiveItem(item: CarouselItem): void; + slideTo(position: number): void; + next(): void; + prev(): void; + _rotate(rotationItems: RotationItems): void; + cycle(): void; + pause(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/carousel/interface.d.ts.map new file mode 100644 index 0000000..423a855 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAE1B,KAAK,IAAI,IAAI,CAAC;IAEd,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAAC;IAExC,cAAc,IAAI,YAAY,CAAC;IAC/B,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAEzC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IAEb,OAAO,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5C,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;CACjB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/interface.js b/node_modules/flowbite/lib/esm/components/carousel/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/interface.js.map b/node_modules/flowbite/lib/esm/components/carousel/interface.js.map new file mode 100644 index 0000000..3c63595 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/carousel/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/types.d.ts b/node_modules/flowbite/lib/esm/components/carousel/types.d.ts new file mode 100644 index 0000000..8ae7d3d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/types.d.ts @@ -0,0 +1,27 @@ +import { CarouselInterface } from './interface'; +export declare type CarouselItem = { + position: number; + el: HTMLElement; +}; +export declare type IndicatorItem = { + position: number; + el: HTMLElement; +}; +export declare type RotationItems = { + left: CarouselItem; + middle: CarouselItem; + right: CarouselItem; +}; +export declare type CarouselOptions = { + defaultPosition?: number; + indicators?: { + items?: IndicatorItem[]; + activeClasses?: string; + inactiveClasses?: string; + }; + interval?: number; + onNext?: (carousel: CarouselInterface) => void; + onPrev?: (carousel: CarouselInterface) => void; + onChange?: (carousel: CarouselInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/types.d.ts.map b/node_modules/flowbite/lib/esm/components/carousel/types.d.ts.map new file mode 100644 index 0000000..8cb376d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/carousel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,YAAY,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/types.js b/node_modules/flowbite/lib/esm/components/carousel/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/carousel/types.js.map b/node_modules/flowbite/lib/esm/components/carousel/types.js.map new file mode 100644 index 0000000..72b8fbd --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/carousel/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/carousel/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/index.d.ts b/node_modules/flowbite/lib/esm/components/collapse/index.d.ts new file mode 100644 index 0000000..5e9ce95 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/index.d.ts @@ -0,0 +1,16 @@ +import type { CollapseOptions } from './types'; +import { CollapseInterface } from './interface'; +declare class Collapse implements CollapseInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: CollapseOptions; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: CollapseOptions); + _init(): void; + collapse(): void; + expand(): void; + toggle(): void; +} +export declare function initCollapses(): void; +export default Collapse; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/index.d.ts.map b/node_modules/flowbite/lib/esm/components/collapse/index.d.ts.map new file mode 100644 index 0000000..a530d7f --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQhD,cAAM,QAAS,YAAW,iBAAiB;IACvC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,eAAyB;IAStC,KAAK;IAgBL,QAAQ;IAWR,MAAM;IAWN,MAAM;CAST;AAED,wBAAgB,aAAa,SAmB5B;AAOD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/index.js b/node_modules/flowbite/lib/esm/components/collapse/index.js new file mode 100644 index 0000000..873e5ce --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/index.js @@ -0,0 +1,94 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + onCollapse: function () { }, + onExpand: function () { }, + onToggle: function () { }, +}; +var Collapse = /** @class */ (function () { + function Collapse(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Collapse.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + if (this._triggerEl.hasAttribute('aria-expanded')) { + this._visible = + this._triggerEl.getAttribute('aria-expanded') === 'true'; + } + else { + // fix until v2 not to break previous single collapses which became dismiss + this._visible = !this._targetEl.classList.contains('hidden'); + } + this._triggerEl.addEventListener('click', function () { + _this.toggle(); + }); + } + }; + Collapse.prototype.collapse = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onCollapse(this); + }; + Collapse.prototype.expand = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onExpand(this); + }; + Collapse.prototype.toggle = function () { + if (this._visible) { + this.collapse(); + } + else { + this.expand(); + } + // callback function + this._options.onToggle(this); + }; + return Collapse; +}()); +export function initCollapses() { + document + .querySelectorAll('[data-collapse-toggle]') + .forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-collapse-toggle'); + var $targetEl = document.getElementById(targetId); + // check if the target element exists + if ($targetEl) { + new Collapse($targetEl, $triggerEl); + } + else { + console.error("The target element with id \"".concat(targetId, "\" does not exist. Please check the data-collapse-toggle attribute.")); + } + }); +} +if (typeof window !== 'undefined') { + window.Collapse = Collapse; + window.initCollapses = initCollapses; +} +export default Collapse; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/index.js.map b/node_modules/flowbite/lib/esm/components/collapse/index.js.map new file mode 100644 index 0000000..62f86e4 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/collapse/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAM,OAAO,GAAoB;IAC7B,UAAU,EAAE,cAAO,CAAC;IACpB,QAAQ,EAAE,cAAO,CAAC;IAClB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAMI,kBACI,QAAmC,EACnC,SAAoC,EACpC,OAAkC;QAFlC,yBAAA,EAAA,eAAmC;QACnC,0BAAA,EAAA,gBAAoC;QACpC,wBAAA,EAAA,iBAAkC;QAElC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,yBAAQ,OAAO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IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,yBAAM,GAAN;QACI,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,QAAQ,EAAE,CAAC;SACnB;aAAM;YACH,IAAI,CAAC,MAAM,EAAE,CAAC;SACjB;QACD,oBAAoB;QACpB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACL,eAAC;AAAD,CAAC,AAjED,IAiEC;AAED,MAAM,UAAU,aAAa;IACzB,QAAQ;SACH,gBAAgB,CAAC,wBAAwB,CAAC;SAC1C,OAAO,CAAC,UAAC,UAAU;QAChB,IAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;QACjE,IAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAEpD,qCAAqC;QACrC,IAAI,SAAS,EAAE;YACX,IAAI,QAAQ,CACR,SAAwB,EACxB,UAAyB,CAC5B,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,uCAA+B,QAAQ,wEAAoE,CAC9G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/interface.d.ts b/node_modules/flowbite/lib/esm/components/collapse/interface.d.ts new file mode 100644 index 0000000..326fc39 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/interface.d.ts @@ -0,0 +1,12 @@ +import { CollapseOptions } from './types'; +export declare interface CollapseInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: CollapseOptions; + _visible: boolean; + _init(): void; + collapse(): void; + expand(): void; + toggle(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/collapse/interface.d.ts.map new file mode 100644 index 0000000..cdf74c2 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAElB,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/interface.js b/node_modules/flowbite/lib/esm/components/collapse/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/interface.js.map b/node_modules/flowbite/lib/esm/components/collapse/interface.js.map new file mode 100644 index 0000000..b82a2f4 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/collapse/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/types.d.ts b/node_modules/flowbite/lib/esm/components/collapse/types.d.ts new file mode 100644 index 0000000..3f3094e --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/types.d.ts @@ -0,0 +1,7 @@ +import { CollapseInterface } from './interface'; +export declare type CollapseOptions = { + onCollapse?: (collapse: CollapseInterface) => void; + onExpand?: (collapse: CollapseInterface) => void; + onToggle?: (collapse: CollapseInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/types.d.ts.map b/node_modules/flowbite/lib/esm/components/collapse/types.d.ts.map new file mode 100644 index 0000000..ba058f8 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/collapse/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/types.js b/node_modules/flowbite/lib/esm/components/collapse/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/collapse/types.js.map b/node_modules/flowbite/lib/esm/components/collapse/types.js.map new file mode 100644 index 0000000..c1e2361 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/collapse/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/collapse/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/index.d.ts b/node_modules/flowbite/lib/esm/components/dial/index.d.ts new file mode 100644 index 0000000..c333938 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/index.d.ts @@ -0,0 +1,23 @@ +import type { DialOptions, DialTriggerType } from './types'; +import { DialInterface } from './interface'; +declare class Dial implements DialInterface { + _parentEl: HTMLElement; + _triggerEl: HTMLElement; + _targetEl: HTMLElement; + _options: DialOptions; + _visible: boolean; + constructor(parentEl?: HTMLElement | null, triggerEl?: HTMLElement | null, targetEl?: HTMLElement | null, options?: DialOptions); + _init(): void; + hide(): void; + show(): void; + toggle(): void; + isHidden(): boolean; + isVisible(): boolean; + _getTriggerEventTypes(triggerType: DialTriggerType): { + showEvents: string[]; + hideEvents: string[]; + }; +} +export declare function initDials(): void; +export default Dial; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/index.d.ts.map b/node_modules/flowbite/lib/esm/components/dial/index.d.ts.map new file mode 100644 index 0000000..1b1cd71 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,cAAM,IAAK,YAAW,aAAa;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,WAAqB;IAUlC,KAAK;IAuBL,IAAI;IAWJ,IAAI;IAWJ,MAAM;IAQN,QAAQ;IAIR,SAAS;IAIT,qBAAqB,CAAC,WAAW,EAAE,eAAe;;;;CAwBrD;AAED,wBAAgB,SAAS,SAgCxB;AAOD,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/index.js b/node_modules/flowbite/lib/esm/components/dial/index.js new file mode 100644 index 0000000..8c8d9ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/index.js @@ -0,0 +1,138 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dial = /** @class */ (function () { + function Dial(parentEl, triggerEl, targetEl, options) { + if (parentEl === void 0) { parentEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._parentEl = parentEl; + this._triggerEl = triggerEl; + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Dial.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType); + triggerEventTypes.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEventTypes.hideEvents.forEach(function (ev) { + _this._parentEl.addEventListener(ev, function () { + if (!_this._parentEl.matches(':hover')) { + _this.hide(); + } + }); + }); + } + }; + Dial.prototype.hide = function () { + this._targetEl.classList.add('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'false'); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Dial.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + if (this._triggerEl) { + this._triggerEl.setAttribute('aria-expanded', 'true'); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dial.prototype.toggle = function () { + if (this._visible) { + this.hide(); + } + else { + this.show(); + } + }; + Dial.prototype.isHidden = function () { + return !this._visible; + }; + Dial.prototype.isVisible = function () { + return this._visible; + }; + Dial.prototype._getTriggerEventTypes = function (triggerType) { + switch (triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + return Dial; +}()); +export function initDials() { + document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) { + var $triggerEl = $parentEl.querySelector('[data-dial-toggle]'); + if ($triggerEl) { + var dialId = $triggerEl.getAttribute('data-dial-toggle'); + var $dialEl = document.getElementById(dialId); + if ($dialEl) { + var triggerType = $triggerEl.getAttribute('data-dial-trigger'); + new Dial($parentEl, $triggerEl, $dialEl, { + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?")); + } + } + else { + console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?")); + } + }); +} +if (typeof window !== 'undefined') { + window.Dial = Dial; + window.initDials = initDials; +} +export default Dial; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/index.js.map b/node_modules/flowbite/lib/esm/components/dial/index.js.map new file mode 100644 index 0000000..a98ad1c --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/index.js.map @@ -0,0 +1 @@ +{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,MAAM,sGAAmG,CAC5H,CAAC;aACL;SACJ;aAAM;YACH,OAAO,CAAC,KAAK,CACT,uBAAgB,SAAS,CAAC,EAAE,+FAA4F,CAC3H,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;CAChC;AAED,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/interface.d.ts b/node_modules/flowbite/lib/esm/components/dial/interface.d.ts new file mode 100644 index 0000000..de0133b --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/interface.d.ts @@ -0,0 +1,16 @@ +import { DialOptions, DialTriggerEventTypes, DialTriggerType } from './types'; +export declare interface DialInterface { + _parentEl: HTMLElement; + _triggerEl: HTMLElement; + _targetEl: HTMLElement; + _options: DialOptions; + _visible: boolean; + _init(): void; + isVisible(): boolean; + isHidden(): boolean; + hide(): void; + show(): void; + toggle(): void; + _getTriggerEventTypes(triggerType: DialTriggerType): DialTriggerEventTypes; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/dial/interface.d.ts.map new file mode 100644 index 0000000..cfa626e --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9E,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;IACf,qBAAqB,CAAC,WAAW,EAAE,eAAe,GAAG,qBAAqB,CAAC;CAC9E"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/interface.js b/node_modules/flowbite/lib/esm/components/dial/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/interface.js.map b/node_modules/flowbite/lib/esm/components/dial/interface.js.map new file mode 100644 index 0000000..83f6457 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/types.d.ts b/node_modules/flowbite/lib/esm/components/dial/types.d.ts new file mode 100644 index 0000000..2f4877c --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/types.d.ts @@ -0,0 +1,13 @@ +import { DialInterface } from './interface'; +export declare type DialTriggerType = 'click' | 'hover' | 'none'; +export declare type DialTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type DialOptions = { + triggerType?: DialTriggerType; + onShow?: (dial: DialInterface) => void; + onHide?: (dial: DialInterface) => void; + onToggle?: (dial: DialInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/types.d.ts.map b/node_modules/flowbite/lib/esm/components/dial/types.d.ts.map new file mode 100644 index 0000000..da04793 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG;IAC9B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC5C,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/types.js b/node_modules/flowbite/lib/esm/components/dial/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dial/types.js.map b/node_modules/flowbite/lib/esm/components/dial/types.js.map new file mode 100644 index 0000000..0613f16 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dial/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/index.d.ts b/node_modules/flowbite/lib/esm/components/dismiss/index.d.ts new file mode 100644 index 0000000..ac75c1d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/index.d.ts @@ -0,0 +1,13 @@ +import type { DismissOptions } from './types'; +import { DismissInterface } from './interface'; +declare class Dismiss implements DismissInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: DismissOptions; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: DismissOptions); + _init(): void; + hide(): void; +} +export declare function initDismisses(): void; +export default Dismiss; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/index.d.ts.map b/node_modules/flowbite/lib/esm/components/dismiss/index.d.ts.map new file mode 100644 index 0000000..5df9d15 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAS/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;gBAGrB,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB;IAQrC,KAAK;IAQL,IAAI;CAcP;AAED,wBAAgB,aAAa,SAa5B;AAOD,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/index.js b/node_modules/flowbite/lib/esm/components/dismiss/index.js new file mode 100644 index 0000000..8538787 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/index.js @@ -0,0 +1,64 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + transition: 'transition-opacity', + duration: 300, + timing: 'ease-out', + onHide: function () { }, +}; +var Dismiss = /** @class */ (function () { + function Dismiss(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Dismiss.prototype._init = function () { + var _this = this; + if (this._triggerEl) { + this._triggerEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Dismiss.prototype.hide = function () { + var _this = this; + this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, 'opacity-0'); + setTimeout(function () { + _this._targetEl.classList.add('hidden'); + }, this._options.duration); + // callback function + this._options.onHide(this, this._targetEl); + }; + return Dismiss; +}()); +export function initDismisses() { + document.querySelectorAll('[data-dismiss-target]').forEach(function ($triggerEl) { + var targetId = $triggerEl.getAttribute('data-dismiss-target'); + var $dismissEl = document.querySelector(targetId); + if ($dismissEl) { + new Dismiss($dismissEl, $triggerEl); + } + else { + console.error("The dismiss element with id \"".concat(targetId, "\" does not exist. Please check the data-dismiss-target attribute.")); + } + }); +} +if (typeof window !== 'undefined') { + window.Dismiss = Dismiss; + window.initDismisses = initDismisses; +} +export default Dismiss; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/index.js.map b/node_modules/flowbite/lib/esm/components/dismiss/index.js.map new file mode 100644 index 0000000..1efc3f0 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dismiss/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,I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zB,QAAQ,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,UAAC,UAAU;QAClE,IAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;QAChE,IAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAEpD,IAAI,UAAU,EAAE;YACZ,IAAI,OAAO,CAAC,UAAyB,EAAE,UAAyB,CAAC,CAAC;SACrE;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wCAAgC,QAAQ,uEAAmE,CAC9G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts b/node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts new file mode 100644 index 0000000..e9b8f51 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts @@ -0,0 +1,9 @@ +import { DismissOptions } from './types'; +export declare interface DismissInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: DismissOptions; + _init(): void; + hide(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts.map new file mode 100644 index 0000000..c9c3828 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IAEzB,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/interface.js b/node_modules/flowbite/lib/esm/components/dismiss/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/interface.js.map b/node_modules/flowbite/lib/esm/components/dismiss/interface.js.map new file mode 100644 index 0000000..6b664d5 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dismiss/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/types.d.ts b/node_modules/flowbite/lib/esm/components/dismiss/types.d.ts new file mode 100644 index 0000000..c659c00 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/types.d.ts @@ -0,0 +1,8 @@ +import { DismissInterface } from './interface'; +export declare type DismissOptions = { + transition?: string; + duration?: number; + timing?: string; + onHide?: (dismiss: DismissInterface, targetEl: HTMLElement) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/types.d.ts.map b/node_modules/flowbite/lib/esm/components/dismiss/types.d.ts.map new file mode 100644 index 0000000..2ccb43e --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dismiss/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CACvE,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/types.js b/node_modules/flowbite/lib/esm/components/dismiss/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dismiss/types.js.map b/node_modules/flowbite/lib/esm/components/dismiss/types.js.map new file mode 100644 index 0000000..8ceeeb5 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dismiss/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dismiss/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/index.d.ts b/node_modules/flowbite/lib/esm/components/drawer/index.d.ts new file mode 100644 index 0000000..eecffb5 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/index.d.ts @@ -0,0 +1,21 @@ +import type { DrawerOptions, PlacementClasses } from './types'; +import { DrawerInterface } from './interface'; +declare class Drawer implements DrawerInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DrawerOptions; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, options?: DrawerOptions); + _init(): void; + hide(): void; + show(): void; + toggle(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _getPlacementClasses(placement: string): PlacementClasses; + isHidden(): boolean; + isVisible(): boolean; +} +export declare function initDrawers(): void; +export default Drawer; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/index.d.ts.map b/node_modules/flowbite/lib/esm/components/drawer/index.d.ts.map new file mode 100644 index 0000000..9776f54 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAe9C,cAAM,MAAO,YAAW,eAAe;IACnC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,aAAuB;IAQpC,KAAK;IAwBL,IAAI;IA+CJ,IAAI;IA8CJ,MAAM;IAQN,eAAe;IAcf,kBAAkB;IAMlB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAyCzD,QAAQ;IAIR,SAAS;CAGZ;AAQD,wBAAgB,WAAW,SA+H1B;AAOD,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/index.js b/node_modules/flowbite/lib/esm/components/drawer/index.js new file mode 100644 index 0000000..0f063f0 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/index.js @@ -0,0 +1,310 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + placement: 'left', + bodyScrolling: false, + backdrop: true, + edge: false, + edgeOffset: 'bottom-[60px]', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Drawer = /** @class */ (function () { + function Drawer(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._visible = false; + this._init(); + } + Drawer.prototype._init = function () { + var _this = this; + // set initial accessibility attributes + if (this._targetEl) { + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.classList.add('transition-transform'); + } + // set base placement classes + this._getPlacementClasses(this._options.placement).base.map(function (c) { + _this._targetEl.classList.add(c); + }); + // add keyboard event listener to document + document.addEventListener('keydown', function (event) { + if (event.key === 'Escape') { + // if 'Escape' key is pressed + if (_this.isVisible()) { + // if the Drawer is visible + _this.hide(); // hide the Drawer + } + } + }); + }; + Drawer.prototype.hide = function () { + var _this = this; + // based on the edge option show placement classes + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.remove(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.add(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + // enable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.remove('overflow-hidden'); + } + // destroy backdrop + if (this._options.backdrop) { + this._destroyBackdropEl(); + } + this._visible = false; + // callback function + this._options.onHide(this); + }; + Drawer.prototype.show = function () { + var _this = this; + if (this._options.edge) { + this._getPlacementClasses(this._options.placement + '-edge').active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement + '-edge').inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + else { + this._getPlacementClasses(this._options.placement).active.map(function (c) { + _this._targetEl.classList.add(c); + }); + this._getPlacementClasses(this._options.placement).inactive.map(function (c) { + _this._targetEl.classList.remove(c); + }); + } + // set accessibility attributes + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + // disable body scroll + if (!this._options.bodyScrolling) { + document.body.classList.add('overflow-hidden'); + } + // show backdrop + if (this._options.backdrop) { + this._createBackdrop(); + } + this._visible = true; + // callback function + this._options.onShow(this); + }; + Drawer.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Drawer.prototype._createBackdrop = function () { + var _a; + var _this = this; + if (!this._visible) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('drawer-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + backdropEl.addEventListener('click', function () { + _this.hide(); + }); + } + }; + Drawer.prototype._destroyBackdropEl = function () { + if (this._visible) { + document.querySelector('[drawer-backdrop]').remove(); + } + }; + Drawer.prototype._getPlacementClasses = function (placement) { + switch (placement) { + case 'top': + return { + base: ['top-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['-translate-y-full'], + }; + case 'right': + return { + base: ['right-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-x-full'], + }; + case 'bottom': + return { + base: ['bottom-0', 'left-0', 'right-0'], + active: ['transform-none'], + inactive: ['translate-y-full'], + }; + case 'left': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + case 'bottom-edge': + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['translate-y-full', this._options.edgeOffset], + }; + default: + return { + base: ['left-0', 'top-0'], + active: ['transform-none'], + inactive: ['-translate-x-full'], + }; + } + }; + Drawer.prototype.isHidden = function () { + return !this._visible; + }; + Drawer.prototype.isVisible = function () { + return this._visible; + }; + return Drawer; +}()); +var getDrawerInstance = function (id, instances) { + if (instances.some(function (drawerInstance) { return drawerInstance.id === id; })) { + return instances.find(function (drawerInstance) { return drawerInstance.id === id; }); + } +}; +export function initDrawers() { + var drawerInstances = []; + document.querySelectorAll('[data-drawer-target]').forEach(function ($triggerEl) { + // mandatory + var drawerId = $triggerEl.getAttribute('data-drawer-target'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + // optional + var placement = $triggerEl.getAttribute('data-drawer-placement'); + var bodyScrolling = $triggerEl.getAttribute('data-drawer-body-scrolling'); + var backdrop = $triggerEl.getAttribute('data-drawer-backdrop'); + var edge = $triggerEl.getAttribute('data-drawer-edge'); + var edgeOffset = $triggerEl.getAttribute('data-drawer-edge-offset'); + if (!getDrawerInstance(drawerId, drawerInstances)) { + drawerInstances.push({ + id: drawerId, + object: new Drawer($drawerEl, { + placement: placement ? placement : Default.placement, + bodyScrolling: bodyScrolling + ? bodyScrolling === 'true' + ? true + : false + : Default.bodyScrolling, + backdrop: backdrop + ? backdrop === 'true' + ? true + : false + : Default.backdrop, + edge: edge + ? edge === 'true' + ? true + : false + : Default.edge, + edgeOffset: edgeOffset + ? edgeOffset + : Default.edgeOffset, + }), + }); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document.querySelectorAll('[data-drawer-toggle]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-toggle'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_1 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_1) { + $triggerEl.addEventListener('click', function () { + drawer_1.object.toggle(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); + document + .querySelectorAll('[data-drawer-dismiss], [data-drawer-hide]') + .forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-dismiss') + ? $triggerEl.getAttribute('data-drawer-dismiss') + : $triggerEl.getAttribute('data-drawer-hide'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_2 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_2) { + $triggerEl.addEventListener('click', function () { + drawer_2.object.hide(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id")); + } + }); + document.querySelectorAll('[data-drawer-show]').forEach(function ($triggerEl) { + var drawerId = $triggerEl.getAttribute('data-drawer-show'); + var $drawerEl = document.getElementById(drawerId); + if ($drawerEl) { + var drawer_3 = getDrawerInstance(drawerId, drawerInstances); + if (drawer_3) { + $triggerEl.addEventListener('click', function () { + drawer_3.object.show(); + }); + } + else { + console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute.")); + } + } + else { + console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?")); + } + }); +} +if (typeof window !== 'undefined') { + window.Drawer = Drawer; + window.initDrawers = initDrawers; +} +export default Drawer; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/index.js.map b/node_modules/flowbite/lib/esm/components/drawer/index.js.map new file mode 100644 index 0000000..91d007a --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/drawer/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAM,OAAO,GAAkB;IAC3B,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,KAAK;IACpB,QAAQ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ACL,CAAC,CAAC,CAAC;IAEP,QAAQ,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,UAAC,UAAU;QAC/D,IAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAEpD,IAAI,SAAS,EAAE;YACX,IAAM,QAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;YAE5D,IAAI,QAAM,EAAE;gBACR,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE;oBACjC,QAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACzB,CAAC,CAAC,CAAC;aACN;iBAAM;gBACH,OAAO,CAAC,KAAK,CACT,yBAAkB,QAAQ,4FAAyF,CACtH,CAAC;aACL;SACJ;aAAM;YACH,OAAO,CAAC,KAAK,CACT,yBAAkB,QAAQ,oGAAiG,CAC9H,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;CACpC;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/interface.d.ts b/node_modules/flowbite/lib/esm/components/drawer/interface.d.ts new file mode 100644 index 0000000..a69c8f1 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/interface.d.ts @@ -0,0 +1,17 @@ +import { DrawerOptions, PlacementClasses } from './types'; +export declare interface DrawerInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DrawerOptions; + _visible: boolean; + _init(): void; + isVisible(): boolean; + isHidden(): boolean; + hide(): void; + show(): void; + toggle(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _getPlacementClasses(placement: string): PlacementClasses; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/drawer/interface.d.ts.map new file mode 100644 index 0000000..367b357 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,CAAC,OAAO,WAAW,eAAe;IAEpC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAGlB,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;IACf,eAAe,IAAI,IAAI,CAAC;IACxB,kBAAkB,IAAI,IAAI,CAAC;IAC3B,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC7D"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/interface.js b/node_modules/flowbite/lib/esm/components/drawer/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/interface.js.map b/node_modules/flowbite/lib/esm/components/drawer/interface.js.map new file mode 100644 index 0000000..91cef96 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/drawer/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/types.d.ts b/node_modules/flowbite/lib/esm/components/drawer/types.d.ts new file mode 100644 index 0000000..abc766f --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/types.d.ts @@ -0,0 +1,22 @@ +import { DrawerInterface } from './interface'; +export declare type DrawerOptions = { + placement?: string; + bodyScrolling?: boolean; + backdrop?: boolean; + edge?: boolean; + edgeOffset?: string; + backdropClasses?: string; + onShow?: (drawer: DrawerInterface) => void; + onHide?: (drawer: DrawerInterface) => void; + onToggle?: (drawer: DrawerInterface) => void; +}; +export declare type PlacementClasses = { + base: string[]; + active: string[]; + inactive: string[]; +}; +export declare type DrawerInstance = { + id: string; + object: DrawerInterface; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/types.d.ts.map b/node_modules/flowbite/lib/esm/components/drawer/types.d.ts.map new file mode 100644 index 0000000..ee84e44 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG;IACnC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/types.js b/node_modules/flowbite/lib/esm/components/drawer/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/drawer/types.js.map b/node_modules/flowbite/lib/esm/components/drawer/types.js.map new file mode 100644 index 0000000..b9d5343 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/drawer/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/drawer/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/index.d.ts b/node_modules/flowbite/lib/esm/components/dropdown/index.d.ts new file mode 100644 index 0000000..d0efbf5 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/index.d.ts @@ -0,0 +1,29 @@ +import type { Instance as PopperInstance } from '@popperjs/core'; +import type { DropdownOptions } from './types'; +import { DropdownInterface } from './interface'; +declare class Dropdown implements DropdownInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DropdownOptions; + _visible: boolean; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + constructor(targetElement?: HTMLElement | null, triggerElement?: HTMLElement | null, options?: DropdownOptions); + _init(): void; + _setupEventListeners(): void; + _createPopperInstance(): PopperInstance; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(): { + showEvents: string[]; + hideEvents: string[]; + }; + toggle(): void; + isVisible(): boolean; + show(): void; + hide(): void; +} +export declare function initDropdowns(): void; +export default Dropdown; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/index.d.ts.map b/node_modules/flowbite/lib/esm/components/dropdown/index.d.ts.map new file mode 100644 index 0000000..51a311c --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,QAAQ,IAAI,cAAc,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAchD,cAAM,QAAS,YAAW,iBAAiB;IACvC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;gBAG3D,aAAa,GAAE,WAAW,GAAG,IAAW,EACxC,cAAc,GAAE,WAAW,GAAG,IAAW,EACzC,OAAO,GAAE,eAAyB;IAUtC,KAAK;IAML,oBAAoB;IA+CpB,qBAAqB;IAiBrB,0BAA0B;IAW1B,2BAA2B;IAQ3B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW;IA+BpD,iBAAiB;;;;IAyBjB,MAAM;IASN,SAAS;IAIT,IAAI;IAuBJ,IAAI;CAoBP;AAED,wBAAgB,aAAa,SAmD5B;AAOD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/index.js b/node_modules/flowbite/lib/esm/components/dropdown/index.js new file mode 100644 index 0000000..cbd50d2 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/index.js @@ -0,0 +1,250 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +/* eslint-disable @typescript-eslint/no-empty-function */ +import { createPopper } from '@popperjs/core'; +var Default = { + placement: 'bottom', + triggerType: 'click', + offsetSkidding: 0, + offsetDistance: 10, + delay: 300, + ignoreClickOutsideClass: false, + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Dropdown = /** @class */ (function () { + function Dropdown(targetElement, triggerElement, options) { + if (targetElement === void 0) { targetElement = null; } + if (triggerElement === void 0) { triggerElement = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetElement; + this._triggerEl = triggerElement; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Dropdown.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Dropdown.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + // click event handling for trigger element + if (this._options.triggerType === 'click') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.toggle(); + }); + }); + } + // hover event handling for trigger element + if (this._options.triggerType === 'hover') { + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + if (ev === 'click') { + _this.toggle(); + } + else { + setTimeout(function () { + _this.show(); + }, _this._options.delay); + } + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, _this._options.delay); + }); + }); + } + }; + Dropdown.prototype._createPopperInstance = function () { + return createPopper(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [ + this._options.offsetSkidding, + this._options.offsetDistance, + ], + }, + }, + ], + }); + }; + Dropdown.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Dropdown.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + // Ignore clicks on the trigger element (ie. a datepicker input) + var ignoreClickOutsideClass = this._options.ignoreClickOutsideClass; + var isIgnored = false; + if (ignoreClickOutsideClass) { + var ignoredClickOutsideEls = document.querySelectorAll(".".concat(ignoreClickOutsideClass)); + ignoredClickOutsideEls.forEach(function (el) { + if (el.contains(clickedEl)) { + isIgnored = true; + return; + } + }); + } + // Ignore clicks on the target element (ie. dropdown itself) + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + !isIgnored && + this.isVisible()) { + this.hide(); + } + }; + Dropdown.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'click'], + hideEvents: ['mouseleave'], + }; + case 'click': + return { + showEvents: ['click'], + hideEvents: [], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['click'], + hideEvents: [], + }; + } + }; + Dropdown.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Dropdown.prototype.isVisible = function () { + return this._visible; + }; + Dropdown.prototype.show = function () { + this._targetEl.classList.remove('hidden'); + this._targetEl.classList.add('block'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + this._setupClickOutsideListener(); + // Update its position + this._popperInstance.update(); + this._visible = true; + // callback function + this._options.onShow(this); + }; + Dropdown.prototype.hide = function () { + this._targetEl.classList.remove('block'); + this._targetEl.classList.add('hidden'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + this._visible = false; + this._removeClickOutsideListener(); + // callback function + this._options.onHide(this); + }; + return Dropdown; +}()); +export function initDropdowns() { + document + .querySelectorAll('[data-dropdown-toggle]') + .forEach(function ($triggerEl) { + var dropdownId = $triggerEl.getAttribute('data-dropdown-toggle'); + var $dropdownEl = document.getElementById(dropdownId); + if ($dropdownEl) { + var placement = $triggerEl.getAttribute('data-dropdown-placement'); + var offsetSkidding = $triggerEl.getAttribute('data-dropdown-offset-skidding'); + var offsetDistance = $triggerEl.getAttribute('data-dropdown-offset-distance'); + var triggerType = $triggerEl.getAttribute('data-dropdown-trigger'); + var delay = $triggerEl.getAttribute('data-dropdown-delay'); + var ignoreClickOutsideClass = $triggerEl.getAttribute('data-dropdown-ignore-click-outside-class'); + new Dropdown($dropdownEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + offsetSkidding: offsetSkidding + ? parseInt(offsetSkidding) + : Default.offsetSkidding, + offsetDistance: offsetDistance + ? parseInt(offsetDistance) + : Default.offsetDistance, + delay: delay ? parseInt(delay) : Default.delay, + ignoreClickOutsideClass: ignoreClickOutsideClass + ? ignoreClickOutsideClass + : Default.ignoreClickOutsideClass, + }); + } + else { + console.error("The dropdown element with id \"".concat(dropdownId, "\" does not exist. Please check the data-dropdown-toggle attribute.")); + } + }); +} +if (typeof window !== 'undefined') { + window.Dropdown = Dropdown; + window.initDropdowns = initDropdowns; +} +export default Dropdown; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/index.js.map b/node_modules/flowbite/lib/esm/components/dropdown/index.js.map new file mode 100644 index 0000000..cb46e51 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/dropdown/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,IAAM,OAAO,GAAoB;IAC7B,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,OAAO;IACpB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,GAAG;IACV,uBAAuB,EAAE,KAAK;IAC9B,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IAQI,kBACI,aAAwC,EACxC,cAAyC,EACzC,OAAkC;QAFlC,8BAAA,EAAA,oBAAwC;QACxC,+BAAA,EAAA,qBAAyC;QACzC,wBAAA,EAAA,iBAAkC;QAElC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG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A0C,CAC7C,CAAC;YAEF,IAAI,QAAQ,CACR,WAA0B,EAC1B,UAAyB,EACzB;gBACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS;gBACpD,WAAW,EAAE,WAAW;oBACpB,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,OAAO,CAAC,WAAW;gBACzB,cAAc,EAAE,cAAc;oBAC1B,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;oBAC1B,CAAC,CAAC,OAAO,CAAC,cAAc;gBAC5B,cAAc,EAAE,cAAc;oBAC1B,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;oBAC1B,CAAC,CAAC,OAAO,CAAC,cAAc;gBAC5B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK;gBAC9C,uBAAuB,EAAE,uBAAuB;oBAC5C,CAAC,CAAC,uBAAuB;oBACzB,CAAC,CAAC,OAAO,CAAC,uBAAuB;aACrB,CACvB,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,yCAAiC,UAAU,wEAAoE,CAClH,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACX,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;CACxC;AAED,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts b/node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts new file mode 100644 index 0000000..95a1241 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts @@ -0,0 +1,22 @@ +import { DropdownOptions, DropdownTriggerType, DropdownTriggerEventTypes } from './types'; +import type { Instance as PopperInstance } from '@popperjs/core'; +export declare interface DropdownInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: DropdownOptions; + _visible: boolean; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _init(): void; + _createPopperInstance(): PopperInstance; + _setupEventListeners(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(triggerType: DropdownTriggerType): DropdownTriggerEventTypes; + isVisible(): boolean; + toggle(): void; + show(): void; + hide(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts.map new file mode 100644 index 0000000..eef9c76 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAE/D,KAAK,IAAI,IAAI,CAAC;IACd,qBAAqB,IAAI,cAAc,CAAC;IACxC,oBAAoB,IAAI,IAAI,CAAC;IAC7B,0BAA0B,IAAI,IAAI,CAAC;IACnC,2BAA2B,IAAI,IAAI,CAAC;IACpC,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,iBAAiB,CACb,WAAW,EAAE,mBAAmB,GACjC,yBAAyB,CAAC;IAC7B,SAAS,IAAI,OAAO,CAAC;IACrB,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/interface.js b/node_modules/flowbite/lib/esm/components/dropdown/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/interface.js.map b/node_modules/flowbite/lib/esm/components/dropdown/interface.js.map new file mode 100644 index 0000000..d4c8eb1 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dropdown/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/types.d.ts b/node_modules/flowbite/lib/esm/components/dropdown/types.d.ts new file mode 100644 index 0000000..47c79fb --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/types.d.ts @@ -0,0 +1,19 @@ +import { DropdownInterface } from './interface'; +import type { Placement } from '@popperjs/core'; +export declare type DropdownTriggerType = 'click' | 'hover' | 'none'; +export declare type DropdownTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type DropdownOptions = { + placement?: Placement; + triggerType?: DropdownTriggerType; + offsetSkidding?: number; + offsetDistance?: number; + ignoreClickOutsideClass?: string | boolean; + delay?: number; + onShow?: (tooltip: DropdownInterface) => void; + onHide?: (tooltip: DropdownInterface) => void; + onToggle?: (tooltip: DropdownInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/types.d.ts.map b/node_modules/flowbite/lib/esm/components/dropdown/types.d.ts.map new file mode 100644 index 0000000..f74ca43 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAErE,MAAM,CAAC,OAAO,MAAM,yBAAyB,GAAG;IAC5C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACnD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/types.js b/node_modules/flowbite/lib/esm/components/dropdown/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/dropdown/types.js.map b/node_modules/flowbite/lib/esm/components/dropdown/types.js.map new file mode 100644 index 0000000..de3d7a3 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/dropdown/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dropdown/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/index.d.ts b/node_modules/flowbite/lib/esm/components/index.d.ts new file mode 100644 index 0000000..3d22df6 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/index.d.ts @@ -0,0 +1,2 @@ +export declare function initFlowbite(): void; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/index.d.ts.map b/node_modules/flowbite/lib/esm/components/index.d.ts.map new file mode 100644 index 0000000..69c6ef6 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAYA,wBAAgB,YAAY,SAY3B"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/index.js b/node_modules/flowbite/lib/esm/components/index.js new file mode 100644 index 0000000..ac570a9 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/index.js @@ -0,0 +1,28 @@ +import { initAccordions } from './accordion'; +import { initCarousels } from './carousel'; +import { initCollapses } from './collapse'; +import { initDials } from './dial'; +import { initDismisses } from './dismiss'; +import { initDrawers } from './drawer'; +import { initDropdowns } from './dropdown'; +import { initModals } from './modal'; +import { initPopovers } from './popover'; +import { initTabs } from './tabs'; +import { initTooltips } from './tooltip'; +export function initFlowbite() { + initAccordions(); + initCollapses(); + initCarousels(); + initDismisses(); + initDropdowns(); + initModals(); + initDrawers(); + initTabs(); + initTooltips(); + initPopovers(); + initDials(); +} +if (typeof window !== 'undefined') { + window.initFlowbite = initFlowbite; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/index.js.map b/node_modules/flowbite/lib/esm/components/index.js.map new file mode 100644 index 0000000..661c695 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,UAAU,YAAY;IACxB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,SAAS,EAAE,CAAC;AAChB,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;CACtC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/index.d.ts b/node_modules/flowbite/lib/esm/components/modal/index.d.ts new file mode 100644 index 0000000..be91df7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/index.d.ts @@ -0,0 +1,26 @@ +import type { ModalOptions } from './types'; +import { ModalInterface } from './interface'; +declare class Modal implements ModalInterface { + _targetEl: HTMLElement | null; + _options: ModalOptions; + _isHidden: boolean; + _backdropEl: HTMLElement | null; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + constructor(targetEl?: HTMLElement | null, options?: ModalOptions); + _init(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _setupModalCloseEventListeners(): void; + _removeModalCloseEventListeners(): void; + _handleOutsideClick(target: EventTarget): void; + _getPlacementClasses(): string[]; + toggle(): void; + show(): void; + hide(): void; + isVisible(): boolean; + isHidden(): boolean; +} +export declare function initModals(): void; +export default Modal; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/index.d.ts.map b/node_modules/flowbite/lib/esm/components/modal/index.d.ts.map new file mode 100644 index 0000000..8c64578 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAa7C,cAAM,KAAM,YAAW,cAAc;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;gBAGtD,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,YAAsB;IASnC,KAAK;IAQL,eAAe;IAYf,kBAAkB;IAMlB,8BAA8B;IAwB9B,+BAA+B;IAe/B,mBAAmB,CAAC,MAAM,EAAE,WAAW;IASvC,oBAAoB;IA+BpB,MAAM;IAWN,IAAI;IAuBJ,IAAI;IAsBJ,SAAS;IAIT,QAAQ;CAGX;AASD,wBAAgB,UAAU,SAgIzB;AAOD,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/index.js b/node_modules/flowbite/lib/esm/components/modal/index.js new file mode 100644 index 0000000..5894a1b --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/index.js @@ -0,0 +1,270 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + placement: 'center', + backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40', + backdrop: 'dynamic', + closable: true, + onHide: function () { }, + onShow: function () { }, + onToggle: function () { }, +}; +var Modal = /** @class */ (function () { + function Modal(targetEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._options = __assign(__assign({}, Default), options); + this._isHidden = true; + this._backdropEl = null; + this._init(); + } + Modal.prototype._init = function () { + var _this = this; + if (this._targetEl) { + this._getPlacementClasses().map(function (c) { + _this._targetEl.classList.add(c); + }); + } + }; + Modal.prototype._createBackdrop = function () { + var _a; + if (this._isHidden) { + var backdropEl = document.createElement('div'); + backdropEl.setAttribute('modal-backdrop', ''); + (_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(' ')); + document.querySelector('body').append(backdropEl); + this._backdropEl = backdropEl; + } + }; + Modal.prototype._destroyBackdropEl = function () { + if (!this._isHidden) { + document.querySelector('[modal-backdrop]').remove(); + } + }; + Modal.prototype._setupModalCloseEventListeners = function () { + var _this = this; + if (this._options.backdrop === 'dynamic') { + this._clickOutsideEventListener = function (ev) { + _this._handleOutsideClick(ev.target); + }; + this._targetEl.addEventListener('click', this._clickOutsideEventListener, true); + } + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._removeModalCloseEventListeners = function () { + if (this._options.backdrop === 'dynamic') { + this._targetEl.removeEventListener('click', this._clickOutsideEventListener, true); + } + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Modal.prototype._handleOutsideClick = function (target) { + if (target === this._targetEl || + (target === this._backdropEl && this.isVisible())) { + this.hide(); + } + }; + Modal.prototype._getPlacementClasses = function () { + switch (this._options.placement) { + // top + case 'top-left': + return ['justify-start', 'items-start']; + case 'top-center': + return ['justify-center', 'items-start']; + case 'top-right': + return ['justify-end', 'items-start']; + // center + case 'center-left': + return ['justify-start', 'items-center']; + case 'center': + return ['justify-center', 'items-center']; + case 'center-right': + return ['justify-end', 'items-center']; + // bottom + case 'bottom-left': + return ['justify-start', 'items-end']; + case 'bottom-center': + return ['justify-center', 'items-end']; + case 'bottom-right': + return ['justify-end', 'items-end']; + default: + return ['justify-center', 'items-center']; + } + }; + Modal.prototype.toggle = function () { + if (this._isHidden) { + this.show(); + } + else { + this.hide(); + } + // callback function + this._options.onToggle(this); + }; + Modal.prototype.show = function () { + if (this.isHidden) { + this._targetEl.classList.add('flex'); + this._targetEl.classList.remove('hidden'); + this._targetEl.setAttribute('aria-modal', 'true'); + this._targetEl.setAttribute('role', 'dialog'); + this._targetEl.removeAttribute('aria-hidden'); + this._createBackdrop(); + this._isHidden = false; + // prevent body scroll + document.body.classList.add('overflow-hidden'); + // Add keyboard event listener to the document + if (this._options.closable) { + this._setupModalCloseEventListeners(); + } + // callback function + this._options.onShow(this); + } + }; + Modal.prototype.hide = function () { + if (this.isVisible) { + this._targetEl.classList.add('hidden'); + this._targetEl.classList.remove('flex'); + this._targetEl.setAttribute('aria-hidden', 'true'); + this._targetEl.removeAttribute('aria-modal'); + this._targetEl.removeAttribute('role'); + this._destroyBackdropEl(); + this._isHidden = true; + // re-apply body scroll + document.body.classList.remove('overflow-hidden'); + if (this._options.closable) { + this._removeModalCloseEventListeners(); + } + // callback function + this._options.onHide(this); + } + }; + Modal.prototype.isVisible = function () { + return !this._isHidden; + }; + Modal.prototype.isHidden = function () { + return this._isHidden; + }; + return Modal; +}()); +var getModalInstance = function (id, instances) { + if (instances.some(function (modalInstance) { return modalInstance.id === id; })) { + return instances.find(function (modalInstance) { return modalInstance.id === id; }); + } + return null; +}; +export function initModals() { + var modalInstances = []; + // initiate modal based on data-modal-target + document.querySelectorAll('[data-modal-target]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-target'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + if (!getModalInstance(modalId, modalInstances)) { + modalInstances.push({ + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?.")); + } + }); + // support pre v1.6.0 data-modal-toggle initialization + document.querySelectorAll('[data-modal-toggle]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-toggle'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var placement = $modalEl.getAttribute('data-modal-placement'); + var backdrop = $modalEl.getAttribute('data-modal-backdrop'); + var modal_1 = getModalInstance(modalId, modalInstances); + if (!modal_1) { + modal_1 = { + id: modalId, + object: new Modal($modalEl, { + placement: placement + ? placement + : Default.placement, + backdrop: backdrop ? backdrop : Default.backdrop, + }), + }; + modalInstances.push(modal_1); + } + $triggerEl.addEventListener('click', function () { + modal_1.object.toggle(); + }); + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?")); + } + }); + // show modal on click if exists based on id + document.querySelectorAll('[data-modal-show]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-show'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_2 = getModalInstance(modalId, modalInstances); + if (modal_2) { + $triggerEl.addEventListener('click', function () { + if (modal_2.object.isHidden) { + modal_2.object.show(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?")); + } + }); + // hide modal on click if exists based on id + document.querySelectorAll('[data-modal-hide]').forEach(function ($triggerEl) { + var modalId = $triggerEl.getAttribute('data-modal-hide'); + var $modalEl = document.getElementById(modalId); + if ($modalEl) { + var modal_3 = getModalInstance(modalId, modalInstances); + if (modal_3) { + $triggerEl.addEventListener('click', function () { + if (modal_3.object.isVisible) { + modal_3.object.hide(); + } + }); + } + else { + console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute.")); + } + } + else { + console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?")); + } + }); +} +if (typeof window !== 'undefined') { + window.Modal = Modal; + window.initModals = initModals; +} +export default Modal; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/index.js.map b/node_modules/flowbite/lib/esm/components/modal/index.js.map new file mode 100644 index 0000000..6b645b9 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/modal/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAM,OAAO,GAAiB;IAC1B,SAAS,EAAE,QAAQ;IACnB,eAAe,EACX,iEAA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ACjC,IAAI,OAAK,CAAC,MAAM,CAAC,SAAS,EAAE;wBACxB,OAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;qBACvB;gBACL,CAAC,CAAC,CAAC;aACN;iBAAM;gBACH,OAAO,CAAC,KAAK,CACT,wBAAiB,OAAO,2FAAwF,CACnH,CAAC;aACL;SACJ;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wBAAiB,OAAO,qGAAkG,CAC7H,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;CAClC;AAED,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/interface.d.ts b/node_modules/flowbite/lib/esm/components/modal/interface.d.ts new file mode 100644 index 0000000..2df722b --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/interface.d.ts @@ -0,0 +1,21 @@ +import { ModalOptions } from './types'; +export declare interface ModalInterface { + _targetEl: HTMLElement | null; + _options: ModalOptions; + _isHidden: boolean; + _backdropEl: HTMLElement | null; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _init(): void; + _createBackdrop(): void; + _destroyBackdropEl(): void; + _setupModalCloseEventListeners(): void; + _handleOutsideClick(target: EventTarget): void; + _getPlacementClasses(): string[]; + toggle(): void; + show(): void; + hide(): void; + isHidden(): boolean; + isVisible(): boolean; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/modal/interface.d.ts.map new file mode 100644 index 0000000..6fa46f7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,OAAO,WAAW,cAAc;IAEnC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAG9B,QAAQ,EAAE,YAAY,CAAC;IAGvB,SAAS,EAAE,OAAO,CAAC;IAGnB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAEhC,0BAA0B,EAAE,kCAAkC,CAAC;IAE/D,qBAAqB,EAAE,kCAAkC,CAAC;IAG1D,KAAK,IAAI,IAAI,CAAC;IAGd,eAAe,IAAI,IAAI,CAAC;IAGxB,kBAAkB,IAAI,IAAI,CAAC;IAG3B,8BAA8B,IAAI,IAAI,CAAC;IAGvC,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAG/C,oBAAoB,IAAI,MAAM,EAAE,CAAC;IAGjC,MAAM,IAAI,IAAI,CAAC;IAGf,IAAI,IAAI,IAAI,CAAC;IAGb,IAAI,IAAI,IAAI,CAAC;IAGb,QAAQ,IAAI,OAAO,CAAC;IAGpB,SAAS,IAAI,OAAO,CAAC;CACxB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/interface.js b/node_modules/flowbite/lib/esm/components/modal/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/interface.js.map b/node_modules/flowbite/lib/esm/components/modal/interface.js.map new file mode 100644 index 0000000..5de1079 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/modal/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/types.d.ts b/node_modules/flowbite/lib/esm/components/modal/types.d.ts new file mode 100644 index 0000000..5dccfb1 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/types.d.ts @@ -0,0 +1,17 @@ +import { ModalInterface } from './interface'; +export declare type modalBackdrop = 'static' | 'dynamic'; +export declare type modalPlacement = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; +export declare type ModalOptions = { + placement?: modalPlacement; + backdropClasses?: string; + backdrop?: modalBackdrop; + closable?: boolean; + onShow?: (modal: ModalInterface) => void; + onHide?: (modal: ModalInterface) => void; + onToggle?: (modal: ModalInterface) => void; +}; +export declare type ModalInstance = { + id: string; + object: ModalInterface; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/types.d.ts.map b/node_modules/flowbite/lib/esm/components/modal/types.d.ts.map new file mode 100644 index 0000000..2754732 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AACzD,MAAM,CAAC,OAAO,MAAM,cAAc,GAC5B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,QAAQ,GACR,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAErB,MAAM,CAAC,OAAO,MAAM,YAAY,GAAG;IAC/B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,cAAc,CAAC;CAC1B,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/types.js b/node_modules/flowbite/lib/esm/components/modal/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/modal/types.js.map b/node_modules/flowbite/lib/esm/components/modal/types.js.map new file mode 100644 index 0000000..e049979 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/modal/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/modal/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/index.d.ts b/node_modules/flowbite/lib/esm/components/popover/index.d.ts new file mode 100644 index 0000000..33732b6 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/index.d.ts @@ -0,0 +1,32 @@ +import type { Instance as PopperInstance } from '@popperjs/core'; +import type { PopoverOptions } from './types'; +import { PopoverInterface } from './interface'; +declare class Popover implements PopoverInterface { + _targetEl: HTMLElement; + _triggerEl: HTMLElement; + _options: PopoverOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: PopoverOptions); + _init(): void; + _setupEventListeners(): void; + _createPopperInstance(): PopperInstance; + _getTriggerEvents(): { + showEvents: string[]; + hideEvents: string[]; + }; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + isVisible(): boolean; + toggle(): void; + show(): void; + hide(): void; +} +export declare function initPopovers(): void; +export default Popover; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/index.d.ts.map b/node_modules/flowbite/lib/esm/components/popover/index.d.ts.map new file mode 100644 index 0000000..67e916e --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/popover/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,QAAQ,IAAI,cAAc,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAW/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAC1D,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB;IAUrC,KAAK;IAML,oBAAoB;IA6BpB,qBAAqB;IAcrB,iBAAiB;;;;IAyBjB,qBAAqB;IAarB,sBAAsB;IAQtB,0BAA0B;IAW1B,2BAA2B;IAQ3B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW;IAYpD,SAAS;IAIT,MAAM;IASN,IAAI;IA6BJ,IAAI;CAyBP;AAED,wBAAgB,YAAY,SA2B3B;AAOD,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/index.js b/node_modules/flowbite/lib/esm/components/popover/index.js new file mode 100644 index 0000000..ea4eb6d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/index.js @@ -0,0 +1,218 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +/* eslint-disable @typescript-eslint/no-empty-function */ +import { createPopper } from '@popperjs/core'; +var Default = { + placement: 'top', + offset: 10, + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Popover = /** @class */ (function () { + function Popover(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Popover.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Popover.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + _this._targetEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._targetEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + _this._targetEl.addEventListener(ev, function () { + setTimeout(function () { + if (!_this._triggerEl.matches(':hover')) { + _this.hide(); + } + }, 100); + }); + }); + }; + Popover.prototype._createPopperInstance = function () { + return createPopper(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, this._options.offset], + }, + }, + ], + }); + }; + Popover.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Popover.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Popover.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Popover.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Popover.prototype.isVisible = function () { + return this._visible; + }; + Popover.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + this._options.onToggle(this); + }; + Popover.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility to true + this._visible = true; + // callback function + this._options.onShow(this); + }; + Popover.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility to false + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Popover; +}()); +export function initPopovers() { + document.querySelectorAll('[data-popover-target]').forEach(function ($triggerEl) { + var popoverID = $triggerEl.getAttribute('data-popover-target'); + var $popoverEl = document.getElementById(popoverID); + if ($popoverEl) { + var triggerType = $triggerEl.getAttribute('data-popover-trigger'); + var placement = $triggerEl.getAttribute('data-popover-placement'); + var offset = $triggerEl.getAttribute('data-popover-offset'); + new Popover($popoverEl, $triggerEl, { + placement: placement ? placement : Default.placement, + offset: offset ? parseInt(offset) : Default.offset, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The popover element with id \"".concat(popoverID, "\" does not exist. Please check the data-popover-target attribute.")); + } + }); +} +if (typeof window !== 'undefined') { + window.Popover = Popover; + window.initPopovers = initPopovers; +} +export default Popover; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/index.js.map b/node_modules/flowbite/lib/esm/components/popover/index.js.map new file mode 100644 index 0000000..f25289c --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sour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B,CAAC,CAAC;YAE9D,IAAI,OAAO,CACP,UAAyB,EACzB,UAAyB,EACzB;gBACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS;gBACpD,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM;gBAClD,WAAW,EAAE,WAAW;oBACpB,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,OAAO,CAAC,WAAW;aACV,CACtB,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wCAAgC,SAAS,uEAAmE,CAC/G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;CACtC;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/interface.d.ts b/node_modules/flowbite/lib/esm/components/popover/interface.d.ts new file mode 100644 index 0000000..851a5a9 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/interface.d.ts @@ -0,0 +1,22 @@ +import { PopoverOptions, PopoverTriggerType, PopoverTriggerEventTypes } from './types'; +import type { Instance as PopperInstance } from '@popperjs/core'; +export declare interface PopoverInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: PopoverOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _setupEventListeners(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(triggerType: PopoverTriggerType): PopoverTriggerEventTypes; + isVisible(): boolean; + show(): void; + hide(): void; + toggle(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/popover/interface.d.ts.map new file mode 100644 index 0000000..8527eea --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/popover/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAE1D,oBAAoB,IAAI,IAAI,CAAC;IAC7B,0BAA0B,IAAI,IAAI,CAAC;IACnC,2BAA2B,IAAI,IAAI,CAAC;IACpC,qBAAqB,IAAI,IAAI,CAAC;IAC9B,sBAAsB,IAAI,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,iBAAiB,CACb,WAAW,EAAE,kBAAkB,GAChC,wBAAwB,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/interface.js b/node_modules/flowbite/lib/esm/components/popover/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/interface.js.map b/node_modules/flowbite/lib/esm/components/popover/interface.js.map new file mode 100644 index 0000000..495553d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/popover/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/types.d.ts b/node_modules/flowbite/lib/esm/components/popover/types.d.ts new file mode 100644 index 0000000..1b8512f --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/types.d.ts @@ -0,0 +1,16 @@ +import { PopoverInterface } from './interface'; +import type { Placement } from '@popperjs/core'; +export declare type PopoverTriggerType = 'click' | 'hover' | 'none'; +export declare type PopoverTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type PopoverOptions = { + placement?: Placement; + offset?: number; + triggerType?: PopoverTriggerType; + onShow?: (tooltip: PopoverInterface) => void; + onHide?: (tooltip: PopoverInterface) => void; + onToggle?: (tooltip: PopoverInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/types.d.ts.map b/node_modules/flowbite/lib/esm/components/popover/types.d.ts.map new file mode 100644 index 0000000..83d1cf6 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/popover/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,CAAC,OAAO,MAAM,wBAAwB,GAAG;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAClD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/types.js b/node_modules/flowbite/lib/esm/components/popover/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/popover/types.js.map b/node_modules/flowbite/lib/esm/components/popover/types.js.map new file mode 100644 index 0000000..8f2e0e4 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/popover/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/popover/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/index.d.ts b/node_modules/flowbite/lib/esm/components/tabs/index.d.ts new file mode 100644 index 0000000..fd62e63 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/index.d.ts @@ -0,0 +1,16 @@ +import type { TabItem, TabsOptions } from './types'; +import { TabsInterface } from './interface'; +declare class Tabs implements TabsInterface { + _items: TabItem[]; + _activeTab: TabItem; + _options: TabsOptions; + constructor(items?: TabItem[], options?: TabsOptions); + _init(): void; + getActiveTab(): TabItem; + _setActiveTab(tab: TabItem): void; + getTab(id: string): TabItem; + show(id: string, forceShow?: boolean): void; +} +export declare function initTabs(): void; +export default Tabs; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/index.d.ts.map b/node_modules/flowbite/lib/esm/components/tabs/index.d.ts.map new file mode 100644 index 0000000..bafbd71 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAW5C,cAAM,IAAK,YAAW,aAAa;IAC/B,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;gBAEV,KAAK,GAAE,OAAO,EAAO,EAAE,OAAO,GAAE,WAAqB;IAOjE,KAAK;IAmBL,YAAY;IAIZ,aAAa,CAAC,GAAG,EAAE,OAAO;IAI1B,MAAM,CAAC,EAAE,EAAE,MAAM;IAIjB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,UAAQ;CAmCrC;AAED,wBAAgB,QAAQ,SA0BvB;AAOD,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/index.js b/node_modules/flowbite/lib/esm/components/tabs/index.js new file mode 100644 index 0000000..2e9a4cc --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/index.js @@ -0,0 +1,111 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Default = { + defaultTabId: null, + activeClasses: 'text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500', + inactiveClasses: 'dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300', + onShow: function () { }, +}; +var Tabs = /** @class */ (function () { + function Tabs(items, options) { + if (items === void 0) { items = []; } + if (options === void 0) { options = Default; } + this._items = items; + this._activeTab = options ? this.getTab(options.defaultTabId) : null; + this._options = __assign(__assign({}, Default), options); + this._init(); + } + Tabs.prototype._init = function () { + var _this = this; + if (this._items.length) { + // set the first tab as active if not set by explicitly + if (!this._activeTab) { + this._setActiveTab(this._items[0]); + } + // force show the first default tab + this.show(this._activeTab.id, true); + // show tab content based on click + this._items.map(function (tab) { + tab.triggerEl.addEventListener('click', function () { + _this.show(tab.id); + }); + }); + } + }; + Tabs.prototype.getActiveTab = function () { + return this._activeTab; + }; + Tabs.prototype._setActiveTab = function (tab) { + this._activeTab = tab; + }; + Tabs.prototype.getTab = function (id) { + return this._items.filter(function (t) { return t.id === id; })[0]; + }; + Tabs.prototype.show = function (id, forceShow) { + var _a, _b; + var _this = this; + if (forceShow === void 0) { forceShow = false; } + var tab = this.getTab(id); + // don't do anything if already active + if (tab === this._activeTab && !forceShow) { + return; + } + // hide other tabs + this._items.map(function (t) { + var _a, _b; + if (t !== tab) { + (_a = t.triggerEl.classList).remove.apply(_a, _this._options.activeClasses.split(' ')); + (_b = t.triggerEl.classList).add.apply(_b, _this._options.inactiveClasses.split(' ')); + t.targetEl.classList.add('hidden'); + t.triggerEl.setAttribute('aria-selected', 'false'); + } + }); + // show active tab + (_a = tab.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(' ')); + (_b = tab.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(' ')); + tab.triggerEl.setAttribute('aria-selected', 'true'); + tab.targetEl.classList.remove('hidden'); + this._setActiveTab(tab); + // callback function + this._options.onShow(this, tab); + }; + return Tabs; +}()); +export function initTabs() { + document.querySelectorAll('[data-tabs-toggle]').forEach(function ($triggerEl) { + var tabItems = []; + var defaultTabId = null; + $triggerEl + .querySelectorAll('[role="tab"]') + .forEach(function ($triggerEl) { + var isActive = $triggerEl.getAttribute('aria-selected') === 'true'; + var tab = { + id: $triggerEl.getAttribute('data-tabs-target'), + triggerEl: $triggerEl, + targetEl: document.querySelector($triggerEl.getAttribute('data-tabs-target')), + }; + tabItems.push(tab); + if (isActive) { + defaultTabId = tab.id; + } + }); + new Tabs(tabItems, { + defaultTabId: defaultTabId, + }); + }); +} +if (typeof window !== 'undefined') { + window.Tabs = Tabs; + window.initTabs = initTabs; +} +export default Tabs; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/index.js.map b/node_modules/flowbite/lib/esm/components/tabs/index.js.map new file mode 100644 index 0000000..cefce57 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/tabs/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,IAAM,OAAO,GAAgB;IACzB,YAAY,EAAE,IAAI;IAClB,aAAa,EACT,oHAAoH;IACxH,eAAe,EACX,kKAAkK;IACtK,MAAM,EAAE,cAAO,CAAC;CACnB,CAAC;AAEF;IAKI,cAAY,KAAqB,EAAE,OAA8B;QAArD,sBAAA,EAAA,UAAqB;QAAE,wBAAA,EAAA,iBAA8B;QAC7D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,IAAI,CAAC,QAAQ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,QAAQ;IACpB,QAAQ,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,UAAC,UAAU;QAC/D,IAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,UAAU;aACL,gBAAgB,CAAC,cAAc,CAAC;aAChC,OAAO,CAAC,UAAC,UAAuB;YAC7B,IAAM,QAAQ,GACV,UAAU,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM,CAAC;YACxD,IAAM,GAAG,GAAY;gBACjB,EAAE,EAAE,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC;gBAC/C,SAAS,EAAE,UAAU;gBACrB,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAC5B,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAC9C;aACJ,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEnB,IAAI,QAAQ,EAAE;gBACV,YAAY,GAAG,GAAG,CAAC,EAAE,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;QACP,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,YAAY,EAAE,YAAY;SACd,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;CAC9B;AAED,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/interface.d.ts b/node_modules/flowbite/lib/esm/components/tabs/interface.d.ts new file mode 100644 index 0000000..9e07566 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/interface.d.ts @@ -0,0 +1,12 @@ +import { TabItem, TabsOptions } from './types'; +export declare interface TabsInterface { + _items: TabItem[]; + _activeTab: TabItem; + _options: TabsOptions; + _init(): void; + _setActiveTab(tab: TabItem): void; + getActiveTab(): TabItem; + getTab(id: string): TabItem; + show(id: string, forceShow?: boolean): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/tabs/interface.d.ts.map new file mode 100644 index 0000000..3cd72bd --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;IAEtB,KAAK,IAAI,IAAI,CAAC;IACd,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,YAAY,IAAI,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/interface.js b/node_modules/flowbite/lib/esm/components/tabs/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/interface.js.map b/node_modules/flowbite/lib/esm/components/tabs/interface.js.map new file mode 100644 index 0000000..6fc7bb2 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/tabs/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/types.d.ts b/node_modules/flowbite/lib/esm/components/tabs/types.d.ts new file mode 100644 index 0000000..342be0d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/types.d.ts @@ -0,0 +1,13 @@ +import { TabsInterface } from './interface'; +export declare type TabsOptions = { + defaultTabId?: string; + activeClasses?: string; + inactiveClasses?: string; + onShow?: (tabs: TabsInterface, tab: TabItem) => void; +}; +export declare type TabItem = { + id: string; + triggerEl: HTMLElement; + targetEl: HTMLElement; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/types.d.ts.map b/node_modules/flowbite/lib/esm/components/tabs/types.d.ts.map new file mode 100644 index 0000000..da457a9 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,OAAO,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;CACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/types.js b/node_modules/flowbite/lib/esm/components/tabs/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tabs/types.js.map b/node_modules/flowbite/lib/esm/components/tabs/types.js.map new file mode 100644 index 0000000..a4a4aff --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tabs/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/tabs/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/index.d.ts b/node_modules/flowbite/lib/esm/components/tooltip/index.d.ts new file mode 100644 index 0000000..041a7da --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/index.d.ts @@ -0,0 +1,32 @@ +import type { Instance as PopperInstance } from '@popperjs/core'; +import type { TooltipOptions } from './types'; +import { TooltipInterface } from './interface'; +declare class Tooltip implements TooltipInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: TooltipOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _visible: boolean; + constructor(targetEl?: HTMLElement | null, triggerEl?: HTMLElement | null, options?: TooltipOptions); + _init(): void; + _setupEventListeners(): void; + _createPopperInstance(): PopperInstance; + _getTriggerEvents(): { + showEvents: string[]; + hideEvents: string[]; + }; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + isVisible(): boolean; + toggle(): void; + show(): void; + hide(): void; +} +export declare function initTooltips(): void; +export default Tooltip; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/index.d.ts.map b/node_modules/flowbite/lib/esm/components/tooltip/index.d.ts.map new file mode 100644 index 0000000..fc88084 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAER,QAAQ,IAAI,cAAc,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAU/C,cAAM,OAAQ,YAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAC1D,QAAQ,EAAE,OAAO,CAAC;gBAGd,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,OAAO,GAAE,cAAwB;IAUrC,KAAK;IAML,oBAAoB;IAcpB,qBAAqB;IAcrB,iBAAiB;;;;IAyBjB,qBAAqB;IAarB,sBAAsB;IAQtB,0BAA0B;IAW1B,2BAA2B;IAQ3B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW;IAYpD,SAAS;IAIT,MAAM;IAQN,IAAI;IA6BJ,IAAI;CAyBP;AAED,wBAAgB,YAAY,SAyB3B;AAOD,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/index.js b/node_modules/flowbite/lib/esm/components/tooltip/index.js new file mode 100644 index 0000000..2fa8da8 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/index.js @@ -0,0 +1,200 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +/* eslint-disable @typescript-eslint/no-empty-function */ +import { createPopper } from '@popperjs/core'; +var Default = { + placement: 'top', + triggerType: 'hover', + onShow: function () { }, + onHide: function () { }, + onToggle: function () { }, +}; +var Tooltip = /** @class */ (function () { + function Tooltip(targetEl, triggerEl, options) { + if (targetEl === void 0) { targetEl = null; } + if (triggerEl === void 0) { triggerEl = null; } + if (options === void 0) { options = Default; } + this._targetEl = targetEl; + this._triggerEl = triggerEl; + this._options = __assign(__assign({}, Default), options); + this._popperInstance = this._createPopperInstance(); + this._visible = false; + this._init(); + } + Tooltip.prototype._init = function () { + if (this._triggerEl) { + this._setupEventListeners(); + } + }; + Tooltip.prototype._setupEventListeners = function () { + var _this = this; + var triggerEvents = this._getTriggerEvents(); + triggerEvents.showEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.show(); + }); + }); + triggerEvents.hideEvents.forEach(function (ev) { + _this._triggerEl.addEventListener(ev, function () { + _this.hide(); + }); + }); + }; + Tooltip.prototype._createPopperInstance = function () { + return createPopper(this._triggerEl, this._targetEl, { + placement: this._options.placement, + modifiers: [ + { + name: 'offset', + options: { + offset: [0, 8], + }, + }, + ], + }); + }; + Tooltip.prototype._getTriggerEvents = function () { + switch (this._options.triggerType) { + case 'hover': + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + case 'click': + return { + showEvents: ['click', 'focus'], + hideEvents: ['focusout', 'blur'], + }; + case 'none': + return { + showEvents: [], + hideEvents: [], + }; + default: + return { + showEvents: ['mouseenter', 'focus'], + hideEvents: ['mouseleave', 'blur'], + }; + } + }; + Tooltip.prototype._setupKeydownListener = function () { + var _this = this; + this._keydownEventListener = function (ev) { + if (ev.key === 'Escape') { + _this.hide(); + } + }; + document.body.addEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._removeKeydownListener = function () { + document.body.removeEventListener('keydown', this._keydownEventListener, true); + }; + Tooltip.prototype._setupClickOutsideListener = function () { + var _this = this; + this._clickOutsideEventListener = function (ev) { + _this._handleClickOutside(ev, _this._targetEl); + }; + document.body.addEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._removeClickOutsideListener = function () { + document.body.removeEventListener('click', this._clickOutsideEventListener, true); + }; + Tooltip.prototype._handleClickOutside = function (ev, targetEl) { + var clickedEl = ev.target; + if (clickedEl !== targetEl && + !targetEl.contains(clickedEl) && + !this._triggerEl.contains(clickedEl) && + this.isVisible()) { + this.hide(); + } + }; + Tooltip.prototype.isVisible = function () { + return this._visible; + }; + Tooltip.prototype.toggle = function () { + if (this.isVisible()) { + this.hide(); + } + else { + this.show(); + } + }; + Tooltip.prototype.show = function () { + this._targetEl.classList.remove('opacity-0', 'invisible'); + this._targetEl.classList.add('opacity-100', 'visible'); + // Enable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: true }, + ], false) })); }); + // handle click outside + this._setupClickOutsideListener(); + // handle esc keydown + this._setupKeydownListener(); + // Update its position + this._popperInstance.update(); + // set visibility + this._visible = true; + // callback function + this._options.onShow(this); + }; + Tooltip.prototype.hide = function () { + this._targetEl.classList.remove('opacity-100', 'visible'); + this._targetEl.classList.add('opacity-0', 'invisible'); + // Disable the event listeners + this._popperInstance.setOptions(function (options) { return (__assign(__assign({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [ + { name: 'eventListeners', enabled: false }, + ], false) })); }); + // handle click outside + this._removeClickOutsideListener(); + // handle esc keydown + this._removeKeydownListener(); + // set visibility + this._visible = false; + // callback function + this._options.onHide(this); + }; + return Tooltip; +}()); +export function initTooltips() { + document.querySelectorAll('[data-tooltip-target]').forEach(function ($triggerEl) { + var tooltipId = $triggerEl.getAttribute('data-tooltip-target'); + var $tooltipEl = document.getElementById(tooltipId); + if ($tooltipEl) { + var triggerType = $triggerEl.getAttribute('data-tooltip-trigger'); + var placement = $triggerEl.getAttribute('data-tooltip-placement'); + new Tooltip($tooltipEl, $triggerEl, { + placement: placement ? placement : Default.placement, + triggerType: triggerType + ? triggerType + : Default.triggerType, + }); + } + else { + console.error("The tooltip element with id \"".concat(tooltipId, "\" does not exist. Please check the data-tooltip-target attribute.")); + } + }); +} +if (typeof window !== 'undefined') { + window.Tooltip = Tooltip; + window.initTooltips = initTooltips; +} +export default Tooltip; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/index.js.map b/node_modules/flowbite/lib/esm/components/tooltip/index.js.map new file mode 100644 index 0000000..75e62ba --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/tooltip/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,IAAM,OAAO,GAAmB;IAC5B,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,OAAO;IACpB,MAAM,EAAE,cAAO,CAAC;IAChB,MAAM,EAAE,cAAO,CAAC;IAChB,QAAQ,EAAE,cAAO,CAAC;CACrB,CAAC;AAEF;IASI,iBACI,QAAmC,EACnC,SAAoC,EACpC,OAAiC;QAFjC,yBAAA,EAAA,eAAmC;QACnC,0BAAA,EAAA,gBAAoC;QACpC,wBAAA,EAAA,iBAAiC;QAEjC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI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SAAS,GAAG,UAAU,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;YAEpE,IAAI,OAAO,CACP,UAAyB,EACzB,UAAyB,EACzB;gBACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS;gBACpD,WAAW,EAAE,WAAW;oBACpB,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,OAAO,CAAC,WAAW;aACV,CACtB,CAAC;SACL;aAAM;YACH,OAAO,CAAC,KAAK,CACT,wCAAgC,SAAS,uEAAmE,CAC/G,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;CACtC;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts b/node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts new file mode 100644 index 0000000..f081b33 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts @@ -0,0 +1,23 @@ +import { TooltipOptions, TooltipTriggerType, TooltipTriggerEventTypes } from './types'; +import type { Instance as PopperInstance } from '@popperjs/core'; +export declare interface TooltipInterface { + _targetEl: HTMLElement | null; + _triggerEl: HTMLElement | null; + _options: TooltipOptions; + _popperInstance: PopperInstance; + _clickOutsideEventListener: EventListenerOrEventListenerObject; + _keydownEventListener: EventListenerOrEventListenerObject; + _init(): void; + _setupEventListeners(): void; + _setupClickOutsideListener(): void; + _removeClickOutsideListener(): void; + _setupKeydownListener(): void; + _removeKeydownListener(): void; + _handleClickOutside(ev: Event, targetEl: HTMLElement): void; + _getTriggerEvents(triggerType: TooltipTriggerType): TooltipTriggerEventTypes; + isVisible(): boolean; + show(): void; + hide(): void; + toggle(): void; +} +//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts.map b/node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts.map new file mode 100644 index 0000000..b395e6b --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/interface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,cAAc,CAAC;IAChC,0BAA0B,EAAE,kCAAkC,CAAC;IAC/D,qBAAqB,EAAE,kCAAkC,CAAC;IAE1D,KAAK,IAAI,IAAI,CAAC;IACd,oBAAoB,IAAI,IAAI,CAAC;IAC7B,0BAA0B,IAAI,IAAI,CAAC;IACnC,2BAA2B,IAAI,IAAI,CAAC;IACpC,qBAAqB,IAAI,IAAI,CAAC;IAC9B,sBAAsB,IAAI,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,iBAAiB,CACb,WAAW,EAAE,kBAAkB,GAChC,wBAAwB,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/interface.js b/node_modules/flowbite/lib/esm/components/tooltip/interface.js new file mode 100644 index 0000000..95423ac --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/interface.js.map b/node_modules/flowbite/lib/esm/components/tooltip/interface.js.map new file mode 100644 index 0000000..8a5f072 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/tooltip/interface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/types.d.ts b/node_modules/flowbite/lib/esm/components/tooltip/types.d.ts new file mode 100644 index 0000000..1ba5bb3 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/types.d.ts @@ -0,0 +1,15 @@ +import { TooltipInterface } from './interface'; +import type { Placement } from '@popperjs/core'; +export declare type TooltipTriggerType = 'click' | 'hover' | 'none'; +export declare type TooltipTriggerEventTypes = { + showEvents: string[]; + hideEvents: string[]; +}; +export declare type TooltipOptions = { + placement?: Placement; + triggerType?: TooltipTriggerType; + onShow?: (tooltip: TooltipInterface) => void; + onHide?: (tooltip: TooltipInterface) => void; + onToggle?: (tooltip: TooltipInterface) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/types.d.ts.map b/node_modules/flowbite/lib/esm/components/tooltip/types.d.ts.map new file mode 100644 index 0000000..048bf1d --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,CAAC,OAAO,MAAM,wBAAwB,GAAG;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,cAAc,GAAG;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAClD,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/types.js b/node_modules/flowbite/lib/esm/components/tooltip/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/components/tooltip/types.js.map b/node_modules/flowbite/lib/esm/components/tooltip/types.js.map new file mode 100644 index 0000000..cd09cf9 --- /dev/null +++ b/node_modules/flowbite/lib/esm/components/tooltip/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/tooltip/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/config/global.d.ts b/node_modules/flowbite/lib/esm/config/global.d.ts new file mode 100644 index 0000000..8937b76 --- /dev/null +++ b/node_modules/flowbite/lib/esm/config/global.d.ts @@ -0,0 +1,39 @@ +import Accordion from '../components/accordion'; +import Carousel from '../components/carousel'; +import Collapse from '../components/collapse'; +import Dial from '../components/dial'; +import Dismiss from '../components/dismiss'; +import Drawer from '../components/drawer'; +import Dropdown from '../components/dropdown'; +import Modal from '../components/modal'; +import Popover from '../components/popover'; +import Tabs from '../components/tabs'; +import Tooltip from '../components/tooltip'; +declare global { + interface Window { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Dismiss: typeof Dismiss; + Drawer: typeof Drawer; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + initAccordions: () => void; + initCarousels: () => void; + initCollapses: () => void; + initDials: () => void; + initDismisses: () => void; + initDrawers: () => void; + initDropdowns: () => void; + initModals: () => void; + initPopovers: () => void; + initTabs: () => void; + initTooltips: () => void; + initFlowbite: () => void; + } +} +//# sourceMappingURL=global.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/config/global.d.ts.map b/node_modules/flowbite/lib/esm/config/global.d.ts.map new file mode 100644 index 0000000..b57ae87 --- /dev/null +++ b/node_modules/flowbite/lib/esm/config/global.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/config/global.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,OAAO,SAAS,CAAC;QAC5B,QAAQ,EAAE,OAAO,QAAQ,CAAC;QAC1B,QAAQ,EAAE,OAAO,QAAQ,CAAC;QAC1B,IAAI,EAAE,OAAO,IAAI,CAAC;QAClB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,QAAQ,EAAE,OAAO,QAAQ,CAAC;QAC1B,KAAK,EAAE,OAAO,KAAK,CAAC;QACpB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,IAAI,EAAE,OAAO,IAAI,CAAC;QAClB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,cAAc,EAAE,MAAM,IAAI,CAAC;QAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;QACtB,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;QACxB,aAAa,EAAE,MAAM,IAAI,CAAC;QAC1B,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;QACrB,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,YAAY,EAAE,MAAM,IAAI,CAAC;KAC5B;CACJ"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/config/global.js b/node_modules/flowbite/lib/esm/config/global.js new file mode 100644 index 0000000..a8d4563 --- /dev/null +++ b/node_modules/flowbite/lib/esm/config/global.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/config/global.js.map b/node_modules/flowbite/lib/esm/config/global.js.map new file mode 100644 index 0000000..52ccc1e --- /dev/null +++ b/node_modules/flowbite/lib/esm/config/global.js.map @@ -0,0 +1 @@ +{"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/config/global.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/dom/events.d.ts b/node_modules/flowbite/lib/esm/dom/events.d.ts new file mode 100644 index 0000000..3bbb83b --- /dev/null +++ b/node_modules/flowbite/lib/esm/dom/events.d.ts @@ -0,0 +1,8 @@ +declare class Events { + private _eventType; + private _eventFunctions; + constructor(eventType: string, eventFunctions?: EventListener[]); + init(): void; +} +export default Events; +//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/dom/events.d.ts.map b/node_modules/flowbite/lib/esm/dom/events.d.ts.map new file mode 100644 index 0000000..de90c16 --- /dev/null +++ b/node_modules/flowbite/lib/esm/dom/events.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/dom/events.ts"],"names":[],"mappings":"AAAA,cAAM,MAAM;IACR,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,SAAS,EAAE,MAAM,EAAE,cAAc,GAAE,aAAa,EAAO;IAKnE,IAAI;CAOP;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/dom/events.js b/node_modules/flowbite/lib/esm/dom/events.js new file mode 100644 index 0000000..3d335f6 --- /dev/null +++ b/node_modules/flowbite/lib/esm/dom/events.js @@ -0,0 +1,18 @@ +var Events = /** @class */ (function () { + function Events(eventType, eventFunctions) { + if (eventFunctions === void 0) { eventFunctions = []; } + this._eventType = eventType; + this._eventFunctions = eventFunctions; + } + Events.prototype.init = function () { + var _this = this; + this._eventFunctions.forEach(function (eventFunction) { + if (typeof window !== 'undefined') { + window.addEventListener(_this._eventType, eventFunction); + } + }); + }; + return Events; +}()); +export default Events; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/dom/events.js.map b/node_modules/flowbite/lib/esm/dom/events.js.map new file mode 100644 index 0000000..727d3ef --- /dev/null +++ b/node_modules/flowbite/lib/esm/dom/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/dom/events.ts"],"names":[],"mappings":"AAAA;IAII,gBAAY,SAAiB,EAAE,cAAoC;QAApC,+BAAA,EAAA,mBAAoC;QAC/D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IAC1C,CAAC;IAED,qBAAI,GAAJ;QAAA,iBAMC;QALG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAC,aAAa;YACvC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;gBAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;aAC3D;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IACL,aAAC;AAAD,CAAC,AAhBD,IAgBC;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.d.ts b/node_modules/flowbite/lib/esm/index.d.ts new file mode 100644 index 0000000..5660236 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.d.ts @@ -0,0 +1,47 @@ +import './components/index'; +export { default as Accordion } from './components/accordion'; +export { default as Carousel } from './components/carousel'; +export { default as Collapse } from './components/collapse'; +export { default as Dial } from './components/dial'; +export { default as Dismiss } from './components/dismiss'; +export { default as Drawer } from './components/drawer'; +export { default as Dropdown } from './components/dropdown'; +export { default as Modal } from './components/modal'; +export { default as Popover } from './components/popover'; +export { default as Tabs } from './components/tabs'; +export { default as Tooltip } from './components/tooltip'; +export * from './components/accordion/types'; +export * from './components/carousel/types'; +export * from './components/collapse/types'; +export * from './components/dial/types'; +export * from './components/dismiss/types'; +export * from './components/drawer/types'; +export * from './components/dropdown/types'; +export * from './components/modal/types'; +export * from './components/popover/types'; +export * from './components/tabs/types'; +export * from './components/tooltip/types'; +export * from './components/accordion/interface'; +export * from './components/carousel/interface'; +export * from './components/collapse/interface'; +export * from './components/dial/interface'; +export * from './components/dismiss/interface'; +export * from './components/drawer/interface'; +export * from './components/dropdown/interface'; +export * from './components/modal/interface'; +export * from './components/popover/interface'; +export * from './components/tabs/interface'; +export * from './components/tooltip/interface'; +export { initAccordions } from './components/accordion'; +export { initCarousels } from './components/carousel'; +export { initCollapses } from './components/collapse'; +export { initDials } from './components/dial'; +export { initDismisses } from './components/dismiss'; +export { initDrawers } from './components/drawer'; +export { initDropdowns } from './components/dropdown'; +export { initModals } from './components/modal'; +export { initPopovers } from './components/popover'; +export { initTabs } from './components/tabs'; +export { initTooltips } from './components/tooltip'; +export { initFlowbite } from './components/index'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.d.ts.map b/node_modules/flowbite/lib/esm/index.d.ts.map new file mode 100644 index 0000000..8997bca --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,oBAAoB,CAAC;AAmB5B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM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AAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.js b/node_modules/flowbite/lib/esm/index.js new file mode 100644 index 0000000..5511f9c --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.js @@ -0,0 +1,79 @@ +import Events from './dom/events'; +import { initAccordions } from './components/accordion'; +import { initCollapses } from './components/collapse'; +import { initCarousels } from './components/carousel'; +import { initDismisses } from './components/dismiss'; +import { initDropdowns } from './components/dropdown'; +import { initModals } from './components/modal'; +import { initDrawers } from './components/drawer'; +import { initTabs } from './components/tabs'; +import { initTooltips } from './components/tooltip'; +import { initPopovers } from './components/popover'; +import { initDials } from './components/dial'; +import './components/index'; +// setup events for data attributes +var events = new Events('load', [ + initAccordions, + initCollapses, + initCarousels, + initDismisses, + initDropdowns, + initModals, + initDrawers, + initTabs, + initTooltips, + initPopovers, + initDials, +]); +events.init(); +// export all components +export { default as Accordion } from './components/accordion'; +export { default as Carousel } from './components/carousel'; +export { default as Collapse } from './components/collapse'; +export { default as Dial } from './components/dial'; +export { default as Dismiss } from './components/dismiss'; +export { default as Drawer } from './components/drawer'; +export { default as Dropdown } from './components/dropdown'; +export { default as Modal } from './components/modal'; +export { default as Popover } from './components/popover'; +export { default as Tabs } from './components/tabs'; +export { default as Tooltip } from './components/tooltip'; +// export all types +export * from './components/accordion/types'; +export * from './components/carousel/types'; +export * from './components/collapse/types'; +export * from './components/dial/types'; +export * from './components/dismiss/types'; +export * from './components/drawer/types'; +export * from './components/dropdown/types'; +export * from './components/modal/types'; +export * from './components/popover/types'; +export * from './components/tabs/types'; +export * from './components/tooltip/types'; +// export all interfaces +export * from './components/accordion/interface'; +export * from './components/carousel/interface'; +export * from './components/collapse/interface'; +export * from './components/dial/interface'; +export * from './components/dismiss/interface'; +export * from './components/drawer/interface'; +export * from './components/dropdown/interface'; +export * from './components/modal/interface'; +export * from './components/popover/interface'; +export * from './components/tabs/interface'; +export * from './components/tooltip/interface'; +// export init functions +export { initAccordions } from './components/accordion'; +export { initCarousels } from './components/carousel'; +export { initCollapses } from './components/collapse'; +export { initDials } from './components/dial'; +export { initDismisses } from './components/dismiss'; +export { initDrawers } from './components/drawer'; +export { initDropdowns } from './components/dropdown'; +export { initModals } from './components/modal'; +export { initPopovers } from './components/popover'; +export { initTabs } from './components/tabs'; +export { initTooltips } from './components/tooltip'; +// export all init functions +export { initFlowbite } from './components/index'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.js.map b/node_modules/flowbite/lib/esm/index.js.map new file mode 100644 index 0000000..f6ee034 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,oBAAoB,CAAC;AAE5B,mCAAmC;AACnC,IAAM,MAAM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AA4B,CAAC;AAE3C,wBAAwB;AACxB,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAE/C,wBAAwB;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,4BAA4B;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.phoenix.d.ts b/node_modules/flowbite/lib/esm/index.phoenix.d.ts new file mode 100644 index 0000000..9bec6d4 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.phoenix.d.ts @@ -0,0 +1,29 @@ +import Accordion from './components/accordion'; +import Carousel from './components/carousel'; +import Collapse from './components/collapse'; +import Dial from './components/dial'; +import Dismiss from './components/dismiss'; +import Drawer from './components/drawer'; +import Dropdown from './components/dropdown'; +import Modal from './components/modal'; +import Popover from './components/popover'; +import Tabs from './components/tabs'; +import Tooltip from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +declare const _default: { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Drawer: typeof Drawer; + Dismiss: typeof Dismiss; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + Events: typeof Events; +}; +export default _default; +//# sourceMappingURL=index.phoenix.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.phoenix.d.ts.map b/node_modules/flowbite/lib/esm/index.phoenix.d.ts.map new file mode 100644 index 0000000..0e05cf0 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.phoenix.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.phoenix.d.ts","sourceRoot":"","sources":["../../src/index.phoenix.ts"],"names":[],"mappings":"AACA,OAAO,SAA6B,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAuB,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAkB,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;AAgClC,wBAaE"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.phoenix.js b/node_modules/flowbite/lib/esm/index.phoenix.js new file mode 100644 index 0000000..f0b94d7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.phoenix.js @@ -0,0 +1,57 @@ +// core components +import Accordion, { initAccordions } from './components/accordion'; +import Carousel, { initCarousels } from './components/carousel'; +import Collapse, { initCollapses } from './components/collapse'; +import Dial, { initDials } from './components/dial'; +import Dismiss, { initDismisses } from './components/dismiss'; +import Drawer, { initDrawers } from './components/drawer'; +import Dropdown, { initDropdowns } from './components/dropdown'; +import Modal, { initModals } from './components/modal'; +import Popover, { initPopovers } from './components/popover'; +import Tabs, { initTabs } from './components/tabs'; +import Tooltip, { initTooltips } from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +var liveViewLoadEvents = new Events('phx:page-loading-stop', [ + initAccordions, + initCollapses, + initCarousels, + initDismisses, + initDropdowns, + initModals, + initDrawers, + initTabs, + initTooltips, + initPopovers, + initDials, +]); +liveViewLoadEvents.init(); +var regularViewLoadEvents = new Events('load', [ + initAccordions, + initCollapses, + initCarousels, + initDismisses, + initDropdowns, + initModals, + initDrawers, + initTabs, + initTooltips, + initPopovers, + initDials, +]); +regularViewLoadEvents.init(); +export default { + Accordion: Accordion, + Carousel: Carousel, + Collapse: Collapse, + Dial: Dial, + Drawer: Drawer, + Dismiss: Dismiss, + Dropdown: Dropdown, + Modal: Modal, + Popover: Popover, + Tabs: Tabs, + Tooltip: Tooltip, + Events: Events, +}; +//# sourceMappingURL=index.phoenix.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.phoenix.js.map b/node_modules/flowbite/lib/esm/index.phoenix.js.map new file mode 100644 index 0000000..76890b7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.phoenix.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.phoenix.js","sourceRoot":"","sources":["../../src/index.phoenix.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,SAAS,EAAE,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,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AAA;IACR,IAAI,MAAA;IACJ,MAAM,QAAA;IACN,OAAO,SAAA;IACP,QAAQ,UAAA;IACR,KAAK,OAAA;IACL,OAAO,SAAA;IACP,IAAI,MAAA;IACJ,OAAO,SAAA;IACP,MAAM,QAAA;CACT,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.turbo.d.ts b/node_modules/flowbite/lib/esm/index.turbo.d.ts new file mode 100644 index 0000000..413a593 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.turbo.d.ts @@ -0,0 +1,29 @@ +import Accordion from './components/accordion'; +import Carousel from './components/carousel'; +import Collapse from './components/collapse'; +import Dial from './components/dial'; +import Dismiss from './components/dismiss'; +import Drawer from './components/drawer'; +import Dropdown from './components/dropdown'; +import Modal from './components/modal'; +import Popover from './components/popover'; +import Tabs from './components/tabs'; +import Tooltip from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +declare const _default: { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Drawer: typeof Drawer; + Dismiss: typeof Dismiss; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + Events: typeof Events; +}; +export default _default; +//# sourceMappingURL=index.turbo.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.turbo.d.ts.map b/node_modules/flowbite/lib/esm/index.turbo.d.ts.map new file mode 100644 index 0000000..4b913c1 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.turbo.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.turbo.d.ts","sourceRoot":"","sources":["../../src/index.turbo.ts"],"names":[],"mappings":"AACA,OAAO,SAA6B,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAuB,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAkB,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;AAgClC,wBAaE"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.turbo.js b/node_modules/flowbite/lib/esm/index.turbo.js new file mode 100644 index 0000000..39db2f2 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.turbo.js @@ -0,0 +1,57 @@ +// core components +import Accordion, { initAccordions } from './components/accordion'; +import Carousel, { initCarousels } from './components/carousel'; +import Collapse, { initCollapses } from './components/collapse'; +import Dial, { initDials } from './components/dial'; +import Dismiss, { initDismisses } from './components/dismiss'; +import Drawer, { initDrawers } from './components/drawer'; +import Dropdown, { initDropdowns } from './components/dropdown'; +import Modal, { initModals } from './components/modal'; +import Popover, { initPopovers } from './components/popover'; +import Tabs, { initTabs } from './components/tabs'; +import Tooltip, { initTooltips } from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +var turboLoadEvents = new Events('turbo:load', [ + initAccordions, + initCollapses, + initCarousels, + initDismisses, + initDropdowns, + initModals, + initDrawers, + initTabs, + initTooltips, + initPopovers, + initDials, +]); +turboLoadEvents.init(); +var turboFrameLoadEvents = new Events('turbo:frame-load', [ + initAccordions, + initCollapses, + initCarousels, + initDismisses, + initDropdowns, + initModals, + initDrawers, + initTabs, + initTooltips, + initPopovers, + initDials, +]); +turboFrameLoadEvents.init(); +export default { + Accordion: Accordion, + Carousel: Carousel, + Collapse: Collapse, + Dial: Dial, + Drawer: Drawer, + Dismiss: Dismiss, + Dropdown: Dropdown, + Modal: Modal, + Popover: Popover, + Tabs: Tabs, + Tooltip: Tooltip, + Events: Events, +}; +//# sourceMappingURL=index.turbo.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.turbo.js.map b/node_modules/flowbite/lib/esm/index.turbo.js.map new file mode 100644 index 0000000..d518165 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.turbo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.turbo.js","sourceRoot":"","sources":["../../src/index.turbo.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,SAAS,EAAE,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,IAAM,eAAe,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE;IAC7C,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,UAAU;IACV,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,SAAS;CACZ,CAAC,CAAC;AACH,eAAe,CAAC,IAAI,EAAE,CAAC;AAEvB,IAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,kBAAkB,EAAE;IACxD,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,UAAU;IACV,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,SAAS;CACZ,CAAC,CAAC;AACH,oBAAoB,CAAC,IAAI,EAAE,CAAC;AAE5B,eAAe;IACX,SAAS,WAAA;IACT,QAAQ,UAAA;IACR,QAAQ,UAAA;IACR,IAAI,MAAA;IACJ,MAAM,QAAA;IACN,OAAO,SAAA;IACP,QAAQ,UAAA;IACR,KAAK,OAAA;IACL,OAAO,SAAA;IACP,IAAI,MAAA;IACJ,OAAO,SAAA;IACP,MAAM,QAAA;CACT,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.umd.d.ts b/node_modules/flowbite/lib/esm/index.umd.d.ts new file mode 100644 index 0000000..98f6048 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.umd.d.ts @@ -0,0 +1,30 @@ +import './flowbite.css'; +import Accordion from './components/accordion'; +import Carousel from './components/carousel'; +import Collapse from './components/collapse'; +import Dial from './components/dial'; +import Dismiss from './components/dismiss'; +import Drawer from './components/drawer'; +import Dropdown from './components/dropdown'; +import Modal from './components/modal'; +import Popover from './components/popover'; +import Tabs from './components/tabs'; +import Tooltip from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +declare const _default: { + Accordion: typeof Accordion; + Carousel: typeof Carousel; + Collapse: typeof Collapse; + Dial: typeof Dial; + Drawer: typeof Drawer; + Dismiss: typeof Dismiss; + Dropdown: typeof Dropdown; + Modal: typeof Modal; + Popover: typeof Popover; + Tabs: typeof Tabs; + Tooltip: typeof Tooltip; + Events: typeof Events; +}; +export default _default; +//# sourceMappingURL=index.umd.d.ts.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.umd.d.ts.map b/node_modules/flowbite/lib/esm/index.umd.d.ts.map new file mode 100644 index 0000000..60b4ec2 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.umd.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../src/index.umd.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,SAA6B,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAA0B,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAuB,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAA2B,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAkB,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAyB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;AAiBlC,wBAaE"} \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.umd.js b/node_modules/flowbite/lib/esm/index.umd.js new file mode 100644 index 0000000..a9f35c7 --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.umd.js @@ -0,0 +1,44 @@ +import './flowbite.css'; +// core components +import Accordion, { initAccordions } from './components/accordion'; +import Carousel, { initCarousels } from './components/carousel'; +import Collapse, { initCollapses } from './components/collapse'; +import Dial, { initDials } from './components/dial'; +import Dismiss, { initDismisses } from './components/dismiss'; +import Drawer, { initDrawers } from './components/drawer'; +import Dropdown, { initDropdowns } from './components/dropdown'; +import Modal, { initModals } from './components/modal'; +import Popover, { initPopovers } from './components/popover'; +import Tabs, { initTabs } from './components/tabs'; +import Tooltip, { initTooltips } from './components/tooltip'; +import './components/index'; +import Events from './dom/events'; +var events = new Events('load', [ + initAccordions, + initCollapses, + initCarousels, + initDismisses, + initDropdowns, + initModals, + initDrawers, + initTabs, + initTooltips, + initPopovers, + initDials, +]); +events.init(); +export default { + Accordion: Accordion, + Carousel: Carousel, + Collapse: Collapse, + Dial: Dial, + Drawer: Drawer, + Dismiss: Dismiss, + Dropdown: Dropdown, + Modal: Modal, + Popover: Popover, + Tabs: Tabs, + Tooltip: Tooltip, + Events: Events, +}; +//# sourceMappingURL=index.umd.js.map \ No newline at end of file diff --git a/node_modules/flowbite/lib/esm/index.umd.js.map b/node_modules/flowbite/lib/esm/index.umd.js.map new file mode 100644 index 0000000..5eca6de --- /dev/null +++ b/node_modules/flowbite/lib/esm/index.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.js","sourceRoot":"","sources":["../../src/index.umd.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,kBAAkB;AAClB,OAAO,SAAS,EAAE,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE;IAC9B,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,UAAU;IACV,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,SAAS;CACZ,CAAC,CAAC;AACH,MAAM,CAAC,IAAI,EAAE,CAAC;AAEd,eAAe;IACX,SAAS,WAAA;IACT,QAAQ,UAAA;IACR,QAAQ,UAAA;IACR,IAAI,MAAA;IACJ,MAAM,QAAA;IACN,OAAO,SAAA;IACP,QAAQ,UAAA;IACR,KAAK,OAAA;IACL,OAAO,SAAA;IACP,IAAI,MAAA;IACJ,OAAO,SAAA;IACP,MAAM,QAAA;CACT,CAAC"} \ No newline at end of file diff --git a/node_modules/flowbite/package.json b/node_modules/flowbite/package.json new file mode 100644 index 0000000..1f0b774 --- /dev/null +++ b/node_modules/flowbite/package.json @@ -0,0 +1,121 @@ +{ + "name": "flowbite", + "version": "1.8.1", + "description": "The most popular library of interactive components built with Tailwind CSS", + "keywords": [ + "flowbite", + "typescript", + "javascript", + "webpack", + "html", + "css", + "component library", + "ui components", + "tailwind", + "tailwind css", + "tailwind components", + "tailwind elements", + "tailwind library", + "tailwind sections", + "tailwind css", + "tailwind ui", + "tailwind react", + "tailwind vue", + "tailwind angular", + "tailwind svelte", + "tailwind django", + "Tailwind ruby on rails", + "tailwind laravel", + "tailwind nuxt", + "tailwind next", + "tailwind astro", + "tailwind flask", + "eslint", + "prettier", + "cjs", + "esm", + "umd" + ], + "license": "MIT", + "main": "lib/cjs/index.js", + "module": "lib/esm/index.js", + "types": "lib/esm/index.d.ts", + "style": "dist/flowbite.min.css", + "repository": "https://github.com/themesberg/flowbite.git", + "bugs": "https://github.com/themesberg/flowbite/issues", + "homepage": "https://flowbite.com", + "contributors": [ + "Zoltán Szőgyényi (https://twitter.com/zoltanszogyenyi)", + "Robert Tanislav (https://twitter.com/roberttanislav)" + ], + "author": "Bergside Inc.", + "scripts": { + "start": "NODE_ENV=development run-p start:*", + "start:hugo": "hugo server -D", + "start:webpack": "webpack --mode=development --watch", + "build": "NODE_ENV=production && HUGO_ENV=production && run-s build:webpack build:hugo", + "build:hugo": "hugo", + "build:webpack": "webpack --mode=production", + "build:css:min": "NPM_ENV=production npx postcss src/flowbite.css > dist/flowbite.min.css", + "build:css": "NPM_ENV=development npx postcss src/flowbite.css > dist/flowbite.css", + "build:js": "run-s build:webpack", + "copy:js:dist": "copyfiles --flat static/flowbite.js dist && copyfiles --flat static/flowbite.js.map dist && copyfiles --flat static/flowbite.min.js.map dist && copyfiles --flat static/flowbite.min.js dist && copyfiles --flat static/flowbite.turbo.js dist && copyfiles --flat static/flowbite.turbo.min.js dist && copyfiles --flat static/flowbite.turbo.js.map dist && copyfiles --flat static/flowbite.turbo.min.js.map dist && copyfiles --flat static/flowbite.phoenix.js dist && copyfiles --flat static/flowbite.phoenix.min.js dist && copyfiles --flat static/flowbite.phoenix.js.map dist && copyfiles --flat static/flowbite.phoenix.min.js.map dist && copyfiles --flat static/datepicker.js dist && copyfiles --flat static/datepicker.min.js dist && copyfiles --flat static/datepicker.js.map dist && copyfiles --flat static/datepicker.turbo.js dist && copyfiles --flat static/datepicker.turbo.min.js dist && copyfiles --flat static/datepicker.turbo.js.map dist", + "build:dist": "mkdir -p dist && run-s build:css:min build:css build:js copy:js:dist", + "build:lib": "tsc --outDir lib/cjs && tsc -m es6 --outDir lib/esm", + "clean:lib": "shx rm -rf lib", + "clean:dist": "shx rm -rf dist", + "build:npm": "run-s clean:lib build:lib clean:dist build:dist", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx --ignore-path .gitignore" + }, + "devDependencies": { + "@babel/core": "^7.14.8", + "@babel/preset-env": "^7.14.8", + "@docsearch/js": "^3.0.0-alpha.42", + "@typescript-eslint/eslint-plugin": "^5.46.1", + "@typescript-eslint/parser": "^5.46.1", + "autoprefixer": "^10.3.3", + "babel-loader": "^8.2.2", + "copyfiles": "^2.4.1", + "core-js": "^3.8.1", + "css-loader": "^5.2.7", + "css-minimizer-webpack-plugin": "^3.0.2", + "cssnano": "^5.0.8", + "eslint": "^8.29.0", + "eslint-config-prettier": "^8.0.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-tailwindcss": "^3.7.1", + "file-loader": "^6.2.0", + "flowbite-datepicker": "^1.2.2", + "mini-css-extract-plugin": "^1.3.3", + "npm-run-all": "^4.1.5", + "postcss": "^8.3.6", + "postcss-cli": "^8.3.1", + "postcss-loader": "^4.3.0", + "postcss-preset-env": "^6.7.0", + "prettier": "^2.8.1", + "prettier-plugin-tailwindcss": "^0.2.1", + "shx": "^0.3.4", + "source-map-loader": "^2.0.0", + "style-loader": "^2.0.0", + "tailwindcss": "^3.3.0", + "terser-webpack-plugin": "^5.3.6", + "ts-loader": "^9.4.2", + "typescript": "^4.9.4", + "webpack": "^5.47.0", + "webpack-cli": "^4.7.2", + "webpack-dev-server": "^4.11.1", + "windicss": "^3.5.6", + "yarn": "^1.22.10" + }, + "dependencies": { + "@popperjs/core": "^2.9.3", + "mini-svg-data-uri": "^1.4.3" + }, + "files": [ + "lib", + "dist", + "plugin.d.ts", + "plugin.js", + "plugin-windicss.js" + ] +} diff --git a/node_modules/flowbite/plugin-windicss.js b/node_modules/flowbite/plugin-windicss.js new file mode 100644 index 0000000..c9bd26e --- /dev/null +++ b/node_modules/flowbite/plugin-windicss.js @@ -0,0 +1,588 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const svgToDataUri = require('mini-svg-data-uri'); +const plugin = require('windicss/plugin'); +const defaultTheme = require('windicss/defaultTheme'); +const colors = require('windicss/colors'); +const [baseFontSize, { lineHeight: baseLineHeight }] = + defaultTheme.fontSize.base; +const { spacing, borderWidth, borderRadius } = defaultTheme; + +module.exports = plugin( + function ({ addBase, theme }) { + addBase({ + [[ + "[type='text']", + "[type='email']", + "[type='url']", + "[type='password']", + "[type='number']", + "[type='date']", + "[type='datetime-local']", + "[type='month']", + "[type='search']", + "[type='tel']", + "[type='time']", + "[type='week']", + '[multiple]', + 'textarea', + 'select', + ]]: { + appearance: 'none', + 'background-color': '#fff', + 'border-color': theme('colors.gray.500', colors.gray[500]), + 'border-width': borderWidth['DEFAULT'], + 'border-radius': borderRadius.none, + 'padding-top': spacing[2], + 'padding-right': spacing[3], + 'padding-bottom': spacing[2], + 'padding-left': spacing[3], + 'font-size': baseFontSize, + 'line-height': baseLineHeight, + '--tw-shadow': '0 0 #0000', + '&:focus': { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': '0px', + '--tw-ring-offset-color': '#fff', + '--tw-ring-color': theme( + 'colors.blue.600', + colors.blue[600] + ), + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`, + 'border-color': theme('colors.blue.600', colors.blue[600]), + }, + }, + [['input::placeholder', 'textarea::placeholder']]: { + color: theme('colors.gray.500', colors.gray[500]), + opacity: '1', + }, + ['::-webkit-datetime-edit-fields-wrapper']: { + padding: '0', + }, + ['::-webkit-date-and-time-value']: { + 'min-height': '1.5em', + }, + ['select']: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-position': `right ${spacing[2]} center`, + 'background-repeat': `no-repeat`, + 'background-size': `1.5em 1.5em`, + 'padding-right': spacing[10], + 'print-color-adjust': `exact`, + }, + ['[multiple]']: { + 'background-image': 'initial', + 'background-position': 'initial', + 'background-repeat': 'unset', + 'background-size': 'initial', + 'padding-right': spacing[3], + 'print-color-adjust': 'unset', + }, + [[`[type='checkbox']`, `[type='radio']`]]: { + appearance: 'none', + padding: '0', + 'print-color-adjust': 'exact', + display: 'inline-block', + 'vertical-align': 'middle', + 'background-origin': 'border-box', + 'user-select': 'none', + 'flex-shrink': '0', + height: spacing[4], + width: spacing[4], + color: theme('colors.blue.600', colors.blue[600]), + 'background-color': '#fff', + 'border-color': theme('colors.gray.500', colors.gray[500]), + 'border-width': borderWidth['DEFAULT'], + '--tw-shadow': '0 0 #0000', + }, + [`[type='checkbox']`]: { + 'border-radius': borderRadius['none'], + }, + [`[type='radio']`]: { + 'border-radius': '100%', + }, + [[`[type='checkbox']:focus`, `[type='radio']:focus`]]: { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': '2px', + '--tw-ring-offset-color': '#fff', + '--tw-ring-color': theme('colors.blue.600', colors.blue[600]), + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`, + }, + [[ + `[type='checkbox']:checked`, + `[type='radio']:checked`, + `.dark [type='checkbox']:checked`, + `.dark [type='radio']:checked`, + ]]: { + 'border-color': `transparent`, + 'background-color': `currentColor`, + 'background-size': `100% 100%`, + 'background-position': `center`, + 'background-repeat': `no-repeat`, + }, + [`[type='checkbox']:checked`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + }, + [`[type='radio']:checked`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + }, + [`[type='checkbox']:indeterminate`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'border-color': `transparent`, + 'background-color': `currentColor`, + 'background-size': `100% 100%`, + 'background-position': `center`, + 'background-repeat': `no-repeat`, + }, + [[ + `[type='checkbox']:indeterminate:hover`, + `[type='checkbox']:indeterminate:focus`, + ]]: { + 'border-color': 'transparent', + 'background-color': 'currentColor', + }, + [`[type='file']`]: { + background: 'unset', + 'border-color': 'inherit', + 'border-width': '0', + 'border-radius': '0', + padding: '0', + 'font-size': 'unset', + 'line-height': 'inherit', + }, + [`[type='file']:focus`]: { + outline: `1px auto inherit`, + }, + [[`input[type=file]::file-selector-button`]]: { + color: 'white', + background: theme('colors.gray.800', colors.gray[800]), + border: 0, + 'font-weight': theme('fontWeight.medium'), + 'font-size': theme('fontSize.sm'), + cursor: 'pointer', + 'padding-top': spacing[2.5], + 'padding-bottom': spacing[2.5], + 'padding-left': spacing[8], + 'padding-right': spacing[4], + 'margin-inline-start': '-1rem', + 'margin-inline-end': '1rem', + '&:hover': { + background: theme('colors.gray.700', colors.gray[700]), + }, + }, + [[`.dark input[type=file]::file-selector-button`]]: { + color: 'white', + background: theme('colors.gray.600', colors.gray[600]), + '&:hover': { + background: theme('colors.gray.500', colors.gray[500]), + }, + }, + [[`input[type="range"]::-webkit-slider-thumb`]]: { + height: spacing[5], + width: spacing[5], + background: theme('colors.blue.600', colors.blue[600]), + 'border-radius': borderRadius.full, + border: 0, + appearance: 'none', + '-moz-appearance': 'none', + '-webkit-appearance': 'none', + cursor: 'pointer', + }, + [[`input[type="range"]:disabled::-webkit-slider-thumb`]]: { + background: theme('colors.gray.400', colors.gray[400]), + }, + [[`.dark input[type="range"]:disabled::-webkit-slider-thumb`]]: { + background: theme('colors.gray.500', colors.gray[500]), + }, + [[`input[type="range"]:focus::-webkit-slider-thumb`]]: { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-offset-shadow': + 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)', + '--tw-ring-shadow': + 'var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)', + 'box-shadow': + 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)', + '--tw-ring-opacity': 1, + '--tw-ring-color': 'rgb(164 202 254 / var(--tw-ring-opacity))', + }, + [[`input[type="range"]::-moz-range-thumb`]]: { + height: spacing[5], + width: spacing[5], + background: theme('colors.blue.600', colors.blue[600]), + 'border-radius': borderRadius.full, + border: 0, + appearance: 'none', + '-moz-appearance': 'none', + '-webkit-appearance': 'none', + cursor: 'pointer', + }, + [[`input[type="range"]:disabled::-moz-range-thumb`]]: { + background: theme('colors.gray.400', colors.gray[400]), + }, + [[`.dark input[type="range"]:disabled::-moz-range-thumb`]]: { + background: theme('colors.gray.500', colors.gray[500]), + }, + [[`input[type="range"]::-moz-range-progress`]]: { + background: theme('colors.blue.500', colors.blue[500]), + }, + [[`input[type="range"]::-ms-fill-lower`]]: { + background: theme('colors.blue.500', colors.blue[500]), + }, + [[`input[type="range"].range-sm::-webkit-slider-thumb`]]: { + height: spacing[4], + width: spacing[4], + }, + [[`input[type="range"].range-lg::-webkit-slider-thumb`]]: { + height: spacing[6], + width: spacing[6], + }, + [[`input[type="range"].range-sm::-moz-range-thumb`]]: { + height: spacing[4], + width: spacing[4], + }, + [[`input[type="range"].range-lg::-moz-range-thumb`]]: { + height: spacing[6], + width: spacing[6], + }, + // remove from v2.x+ + ['.toggle-bg:after']: { + content: '""', + position: 'absolute', + top: spacing[0.5], + left: spacing[0.5], + background: 'white', + 'border-color': theme('colors.gray.300', colors.gray[300]), + 'border-width': borderWidth['DEFAULT'], + 'border-radius': borderRadius.full, + height: theme('height.5'), + width: theme('width.5'), + 'transition-property': + 'background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter', + 'transition-duration': '.15s', + 'box-shadow': + 'var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color)', + }, + ['input:checked + .toggle-bg:after']: { + transform: 'translateX(100%);', + 'border-color': 'white', + }, + ['input:checked + .toggle-bg']: { + background: theme('colors.blue.600', colors.gray[600]), + 'border-color': theme('colors.blue.600', colors.gray[600]), + }, + // remove from v2.x+ END + [['.tooltip-arrow', '.tooltip-arrow:before']]: { + position: 'absolute', + width: '8px', + height: '8px', + background: 'inherit', + }, + ['.tooltip-arrow']: { + visibility: 'hidden', + }, + ['.tooltip-arrow:before']: { + content: '""', + visibility: 'visible', + transform: 'rotate(45deg)', + }, + [`[data-tooltip-style^='light'] + .tooltip > .tooltip-arrow:before`]: + { + 'border-style': 'solid', + 'border-color': colors.gray[200], + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='top'] > .tooltip-arrow:before`]: + { + 'border-bottom-width': '1px', + 'border-right-width': '1px', + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='right'] > .tooltip-arrow:before`]: + { + 'border-bottom-width': '1px', + 'border-left-width': '1px', + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='bottom'] > .tooltip-arrow:before`]: + { + 'border-top-width': '1px', + 'border-left-width': '1px', + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='left'] > .tooltip-arrow:before`]: + { + 'border-top-width': '1px', + 'border-right-width': '1px', + }, + [`.tooltip[data-popper-placement^='top'] > .tooltip-arrow`]: { + bottom: '-4px', + }, + [`.tooltip[data-popper-placement^='bottom'] > .tooltip-arrow`]: { + top: '-4px', + }, + [`.tooltip[data-popper-placement^='left'] > .tooltip-arrow`]: { + right: '-4px', + }, + [`.tooltip[data-popper-placement^='right'] > .tooltip-arrow`]: { + left: '-4px', + }, + ['.tooltip.invisible > .tooltip-arrow:before']: { + visibility: 'hidden', + }, + [['[data-popper-arrow]', '[data-popper-arrow]:before']]: { + position: 'absolute', + width: '8px', + height: '8px', + background: 'inherit', + }, + ['[data-popper-arrow]']: { + visibility: 'hidden', + }, + ['[data-popper-arrow]:before']: { + content: '""', + visibility: 'visible', + transform: 'rotate(45deg)', + }, + ['[data-popper-arrow]:after']: { + content: '""', + visibility: 'visible', + transform: 'rotate(45deg)', + position: 'absolute', + width: '9px', + height: '9px', + background: 'inherit', + }, + [`[role="tooltip"] > [data-popper-arrow]:before`]: { + 'border-style': 'solid', + 'border-color': colors.gray[200], + }, + [`.dark [role="tooltip"] > [data-popper-arrow]:before`]: { + 'border-style': 'solid', + 'border-color': colors.gray[600], + }, + [`[role="tooltip"] > [data-popper-arrow]:after`]: { + 'border-style': 'solid', + 'border-color': colors.gray[200], + }, + [`.dark [role="tooltip"] > [data-popper-arrow]:after`]: { + 'border-style': 'solid', + 'border-color': colors.gray[600], + }, + [`[role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]:before`]: + { + 'border-bottom-width': '1px', + 'border-right-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]:after`]: + { + 'border-bottom-width': '1px', + 'border-right-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]:before`]: + { + 'border-bottom-width': '1px', + 'border-left-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]:after`]: + { + 'border-bottom-width': '1px', + 'border-left-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]:before`]: + { + 'border-top-width': '1px', + 'border-left-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]:after`]: + { + 'border-top-width': '1px', + 'border-left-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]:before`]: + { + 'border-top-width': '1px', + 'border-right-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]:after`]: + { + 'border-top-width': '1px', + 'border-right-width': '1px', + }, + [`[role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]`]: + { + bottom: '-5px', + }, + [`[role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]`]: + { + top: '-5px', + }, + [`[role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]`]: + { + right: '-5px', + }, + [`[role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]`]: + { + left: '-5px', + }, + ['[role="tooltip"].invisible > [data-popper-arrow]:before']: { + visibility: 'hidden', + }, + ['[role="tooltip"].invisible > [data-popper-arrow]:after']: { + visibility: 'hidden', + }, + }); + }, + { + darkMode: 'class', // or 'media' or 'class', + theme: { + extend: { + height: { + modal: 'calc(100% - 2rem)', + }, + boxShadow: { + 'sm-light': '0 2px 5px 0px rgba(255, 255, 255, 0.08)', + }, + colors: { + transparent: 'transparent', + white: '#ffffff', + black: '#000000', + gray: { + 50: '#F9FAFB', + 100: '#F3F4F6', + 200: '#E5E7EB', + 300: '#D1D5DB', + 400: '#9CA3AF', + 500: '#6B7280', + 600: '#4B5563', + 700: '#374151', + 800: '#1F2937', + 900: '#111827', + }, + red: { + 50: '#FDF2F2', + 100: '#FDE8E8', + 200: '#FBD5D5', + 300: '#F8B4B4', + 400: '#F98080', + 500: '#F05252', + 600: '#E02424', + 700: '#C81E1E', + 800: '#9B1C1C', + 900: '#771D1D', + }, + orange: { + 50: '#FFF8F1', + 100: '#FEECDC', + 200: '#FCD9BD', + 300: '#FDBA8C', + 400: '#FF8A4C', + 500: '#FF5A1F', + 600: '#D03801', + 700: '#B43403', + 800: '#8A2C0D', + 900: '#771D1D', + }, + yellow: { + 50: '#FDFDEA', + 100: '#FDF6B2', + 200: '#FCE96A', + 300: '#FACA15', + 400: '#E3A008', + 500: '#C27803', + 600: '#9F580A', + 700: '#8E4B10', + 800: '#723B13', + 900: '#633112', + }, + green: { + 50: '#F3FAF7', + 100: '#DEF7EC', + 200: '#BCF0DA', + 300: '#84E1BC', + 400: '#31C48D', + 500: '#0E9F6E', + 600: '#057A55', + 700: '#046C4E', + 800: '#03543F', + 900: '#014737', + }, + teal: { + 50: '#EDFAFA', + 100: '#D5F5F6', + 200: '#AFECEF', + 300: '#7EDCE2', + 400: '#16BDCA', + 500: '#0694A2', + 600: '#047481', + 700: '#036672', + 800: '#05505C', + 900: '#014451', + }, + blue: { + 50: '#EBF5FF', + 100: '#E1EFFE', + 200: '#C3DDFD', + 300: '#A4CAFE', + 400: '#76A9FA', + 500: '#3F83F8', + 600: '#1C64F2', + 700: '#1A56DB', + 800: '#1E429F', + 900: '#233876', + }, + indigo: { + 50: '#F0F5FF', + 100: '#E5EDFF', + 200: '#CDDBFE', + 300: '#B4C6FC', + 400: '#8DA2FB', + 500: '#6875F5', + 600: '#5850EC', + 700: '#5145CD', + 800: '#42389D', + 900: '#362F78', + }, + purple: { + 50: '#F6F5FF', + 100: '#EDEBFE', + 200: '#DCD7FE', + 300: '#CABFFD', + 400: '#AC94FA', + 500: '#9061F9', + 600: '#7E3AF2', + 700: '#6C2BD9', + 800: '#5521B5', + 900: '#4A1D96', + }, + pink: { + 50: '#FDF2F8', + 100: '#FCE8F3', + 200: '#FAD1E8', + 300: '#F8B4D9', + 400: '#F17EB8', + 500: '#E74694', + 600: '#D61F69', + 700: '#BF125D', + 800: '#99154B', + 900: '#751A3D', + }, + }, + }, + }, + } +); diff --git a/node_modules/flowbite/plugin.d.ts b/node_modules/flowbite/plugin.d.ts new file mode 100644 index 0000000..a693e7f --- /dev/null +++ b/node_modules/flowbite/plugin.d.ts @@ -0,0 +1,2 @@ +declare const plugin: { handler: () => void }; +export = plugin; diff --git a/node_modules/flowbite/plugin.js b/node_modules/flowbite/plugin.js new file mode 100644 index 0000000..29bfc9a --- /dev/null +++ b/node_modules/flowbite/plugin.js @@ -0,0 +1,970 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const svgToDataUri = require('mini-svg-data-uri'); +const plugin = require('tailwindcss/plugin'); +const defaultTheme = require('tailwindcss/defaultTheme'); +const colors = require('tailwindcss/colors'); +const [baseFontSize, { lineHeight: baseLineHeight }] = + defaultTheme.fontSize.base; +const { spacing, borderWidth, borderRadius, boxShadow } = defaultTheme; + +module.exports = plugin.withOptions( + function (options = {}) { + // Enable forms and tooltip by default if not specified in options + const { charts = false, forms = true, tooltips = true } = options; + + return function ({ addBase, addComponents, theme }) { + // tooltip and popover styles + if (tooltips) { + addBase({ + // remove from v2.x+ END + [['.tooltip-arrow', '.tooltip-arrow:before']]: { + position: 'absolute', + width: '8px', + height: '8px', + background: 'inherit', + }, + [['.tooltip-arrow']]: { + visibility: 'hidden', + }, + [['.tooltip-arrow:before']]: { + content: '""', + visibility: 'visible', + transform: 'rotate(45deg)', + }, + [`[data-tooltip-style^='light'] + .tooltip > .tooltip-arrow:before`]: + { + 'border-style': 'solid', + 'border-color': colors.gray[200], + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='top'] > .tooltip-arrow:before`]: + { + 'border-bottom-width': '1px', + 'border-right-width': '1px', + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='right'] > .tooltip-arrow:before`]: + { + 'border-bottom-width': '1px', + 'border-left-width': '1px', + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='bottom'] > .tooltip-arrow:before`]: + { + 'border-top-width': '1px', + 'border-left-width': '1px', + }, + [`[data-tooltip-style^='light'] + .tooltip[data-popper-placement^='left'] > .tooltip-arrow:before`]: + { + 'border-top-width': '1px', + 'border-right-width': '1px', + }, + [`.tooltip[data-popper-placement^='top'] > .tooltip-arrow`]: + { + bottom: '-4px', + }, + [`.tooltip[data-popper-placement^='bottom'] > .tooltip-arrow`]: + { + top: '-4px', + }, + [`.tooltip[data-popper-placement^='left'] > .tooltip-arrow`]: + { + right: '-4px', + }, + [`.tooltip[data-popper-placement^='right'] > .tooltip-arrow`]: + { + left: '-4px', + }, + ['.tooltip.invisible > .tooltip-arrow:before']: { + visibility: 'hidden', + }, + [['[data-popper-arrow]', '[data-popper-arrow]:before']]: { + position: 'absolute', + width: '8px', + height: '8px', + background: 'inherit', + }, + ['[data-popper-arrow]']: { + visibility: 'hidden', + }, + ['[data-popper-arrow]:before']: { + content: '""', + visibility: 'visible', + transform: 'rotate(45deg)', + }, + ['[data-popper-arrow]:after']: { + content: '""', + visibility: 'visible', + transform: 'rotate(45deg)', + position: 'absolute', + width: '9px', + height: '9px', + background: 'inherit', + }, + [`[role="tooltip"] > [data-popper-arrow]:before`]: { + 'border-style': 'solid', + 'border-color': colors.gray[200], + }, + [`.dark [role="tooltip"] > [data-popper-arrow]:before`]: { + 'border-style': 'solid', + 'border-color': colors.gray[600], + }, + [`[role="tooltip"] > [data-popper-arrow]:after`]: { + 'border-style': 'solid', + 'border-color': colors.gray[200], + }, + [`.dark [role="tooltip"] > [data-popper-arrow]:after`]: { + 'border-style': 'solid', + 'border-color': colors.gray[600], + }, + [`[data-popover][role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]:before`]: + { + 'border-bottom-width': '1px', + 'border-right-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]:after`]: + { + 'border-bottom-width': '1px', + 'border-right-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]:before`]: + { + 'border-bottom-width': '1px', + 'border-left-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]:after`]: + { + 'border-bottom-width': '1px', + 'border-left-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]:before`]: + { + 'border-top-width': '1px', + 'border-left-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]:after`]: + { + 'border-top-width': '1px', + 'border-left-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]:before`]: + { + 'border-top-width': '1px', + 'border-right-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]:after`]: + { + 'border-top-width': '1px', + 'border-right-width': '1px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='top'] > [data-popper-arrow]`]: + { + bottom: '-5px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='bottom'] > [data-popper-arrow]`]: + { + top: '-5px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='left'] > [data-popper-arrow]`]: + { + right: '-5px', + }, + [`[data-popover][role="tooltip"][data-popper-placement^='right'] > [data-popper-arrow]`]: + { + left: '-5px', + }, + ['[role="tooltip"].invisible > [data-popper-arrow]:before']: + { + visibility: 'hidden', + }, + ['[role="tooltip"].invisible > [data-popper-arrow]:after']: + { + visibility: 'hidden', + }, + }); + } + + // form styles + if (forms) { + addBase({ + [[ + "[type='text']", + "[type='email']", + "[type='url']", + "[type='password']", + "[type='number']", + "[type='date']", + "[type='datetime-local']", + "[type='month']", + "[type='search']", + "[type='tel']", + "[type='time']", + "[type='week']", + '[multiple]', + 'textarea', + 'select', + ]]: { + appearance: 'none', + 'background-color': '#fff', + 'border-color': theme( + 'colors.gray.500', + colors.gray[500] + ), + 'border-width': borderWidth['DEFAULT'], + 'border-radius': borderRadius.none, + 'padding-top': spacing[2], + 'padding-right': spacing[3], + 'padding-bottom': spacing[2], + 'padding-left': spacing[3], + 'font-size': baseFontSize, + 'line-height': baseLineHeight, + '--tw-shadow': '0 0 #0000', + '&:focus': { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': '0px', + '--tw-ring-offset-color': '#fff', + '--tw-ring-color': theme( + 'colors.blue.600', + colors.blue[600] + ), + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`, + 'border-color': theme( + 'colors.blue.600', + colors.blue[600] + ), + }, + }, + [['input::placeholder', 'textarea::placeholder']]: { + color: theme('colors.gray.500', colors.gray[500]), + opacity: '1', + }, + ['::-webkit-datetime-edit-fields-wrapper']: { + padding: '0', + }, + ['::-webkit-date-and-time-value']: { + 'min-height': '1.5em', + }, + ['select:not([size])']: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-position': `right ${spacing[3]} center`, + 'background-repeat': `no-repeat`, + 'background-size': `0.75em 0.75em`, + 'padding-right': spacing[10], + 'print-color-adjust': `exact`, + }, + ['[multiple]']: { + 'background-image': 'initial', + 'background-position': 'initial', + 'background-repeat': 'unset', + 'background-size': 'initial', + 'padding-right': spacing[3], + 'print-color-adjust': 'unset', + }, + [[`[type='checkbox']`, `[type='radio']`]]: { + appearance: 'none', + padding: '0', + 'print-color-adjust': 'exact', + display: 'inline-block', + 'vertical-align': 'middle', + 'background-origin': 'border-box', + 'user-select': 'none', + 'flex-shrink': '0', + height: spacing[4], + width: spacing[4], + color: theme('colors.blue.600', colors.blue[600]), + 'background-color': '#fff', + 'border-color': theme( + 'colors.gray.500', + colors.gray[500] + ), + 'border-width': borderWidth['DEFAULT'], + '--tw-shadow': '0 0 #0000', + }, + [`[type='checkbox']`]: { + 'border-radius': borderRadius['none'], + }, + [`[type='radio']`]: { + 'border-radius': '100%', + }, + [[`[type='checkbox']:focus`, `[type='radio']:focus`]]: { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': '2px', + '--tw-ring-offset-color': '#fff', + '--tw-ring-color': theme( + 'colors.blue.600', + colors.blue[600] + ), + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)`, + }, + [[ + `[type='checkbox']:checked`, + `[type='radio']:checked`, + `.dark [type='checkbox']:checked`, + `.dark [type='radio']:checked`, + ]]: { + 'border-color': `transparent`, + 'background-color': `currentColor`, + 'background-size': `0.55em 0.55em`, + 'background-position': `center`, + 'background-repeat': `no-repeat`, + }, + [`[type='checkbox']:checked`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-repeat': `no-repeat`, + 'background-size': `0.55em 0.55em`, + 'print-color-adjust': `exact`, + }, + [`[type='radio']:checked`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-size': `1em 1em`, + }, + [`.dark [type='radio']:checked`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-size': `1em 1em`, + }, + [`[type='checkbox']:indeterminate`]: { + 'background-image': `url("${svgToDataUri( + `` + )}")`, + 'background-color': `currentColor`, + 'border-color': `transparent`, + 'background-position': `center`, + 'background-repeat': `no-repeat`, + 'background-size': `0.55em 0.55em`, + 'print-color-adjust': `exact`, + }, + [[ + `[type='checkbox']:indeterminate:hover`, + `[type='checkbox']:indeterminate:focus`, + ]]: { + 'border-color': 'transparent', + 'background-color': 'currentColor', + }, + [`[type='file']`]: { + background: 'unset', + 'border-color': 'inherit', + 'border-width': '0', + 'border-radius': '0', + padding: '0', + 'font-size': 'unset', + 'line-height': 'inherit', + }, + [`[type='file']:focus`]: { + outline: `1px auto inherit`, + }, + [[`input[type=file]::file-selector-button`]]: { + color: 'white', + background: theme('colors.gray.800', colors.gray[800]), + border: 0, + 'font-weight': theme('fontWeight.medium'), + 'font-size': theme('fontSize.sm'), + cursor: 'pointer', + 'padding-top': spacing[2.5], + 'padding-bottom': spacing[2.5], + 'padding-left': spacing[8], + 'padding-right': spacing[4], + 'margin-inline-start': '-1rem', + 'margin-inline-end': '1rem', + '&:hover': { + background: theme( + 'colors.gray.700', + colors.gray[700] + ), + }, + }, + [[`.dark input[type=file]::file-selector-button`]]: { + color: 'white', + background: theme('colors.gray.600', colors.gray[600]), + '&:hover': { + background: theme( + 'colors.gray.500', + colors.gray[500] + ), + }, + }, + [[`input[type="range"]::-webkit-slider-thumb`]]: { + height: spacing[5], + width: spacing[5], + background: theme('colors.blue.600', colors.blue[600]), + 'border-radius': borderRadius.full, + border: 0, + appearance: 'none', + '-moz-appearance': 'none', + '-webkit-appearance': 'none', + cursor: 'pointer', + }, + [[`input[type="range"]:disabled::-webkit-slider-thumb`]]: { + background: theme('colors.gray.400', colors.gray[400]), + }, + [[ + `.dark input[type="range"]:disabled::-webkit-slider-thumb`, + ]]: { + background: theme('colors.gray.500', colors.gray[500]), + }, + [[`input[type="range"]:focus::-webkit-slider-thumb`]]: { + outline: '2px solid transparent', + 'outline-offset': '2px', + '--tw-ring-offset-shadow': + 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)', + '--tw-ring-shadow': + 'var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)', + 'box-shadow': + 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)', + '--tw-ring-opacity': 1, + '--tw-ring-color': + 'rgb(164 202 254 / var(--tw-ring-opacity))', + }, + [[`input[type="range"]::-moz-range-thumb`]]: { + height: spacing[5], + width: spacing[5], + background: theme('colors.blue.600', colors.blue[600]), + 'border-radius': borderRadius.full, + border: 0, + appearance: 'none', + '-moz-appearance': 'none', + '-webkit-appearance': 'none', + cursor: 'pointer', + }, + [[`input[type="range"]:disabled::-moz-range-thumb`]]: { + background: theme('colors.gray.400', colors.gray[400]), + }, + [[`.dark input[type="range"]:disabled::-moz-range-thumb`]]: + { + background: theme( + 'colors.gray.500', + colors.gray[500] + ), + }, + [[`input[type="range"]::-moz-range-progress`]]: { + background: theme('colors.blue.500', colors.blue[500]), + }, + [[`input[type="range"]::-ms-fill-lower`]]: { + background: theme('colors.blue.500', colors.blue[500]), + }, + [[`input[type="range"].range-sm::-webkit-slider-thumb`]]: { + height: spacing[4], + width: spacing[4], + }, + [[`input[type="range"].range-lg::-webkit-slider-thumb`]]: { + height: spacing[6], + width: spacing[6], + }, + [[`input[type="range"].range-sm::-moz-range-thumb`]]: { + height: spacing[4], + width: spacing[4], + }, + [[`input[type="range"].range-lg::-moz-range-thumb`]]: { + height: spacing[6], + width: spacing[6], + }, + // remove from v2.x+ + [['.toggle-bg:after']]: { + content: '""', + position: 'absolute', + top: spacing[0.5], + left: spacing[0.5], + background: 'white', + 'border-color': theme( + 'colors.gray.300', + colors.gray[300] + ), + 'border-width': borderWidth['DEFAULT'], + 'border-radius': borderRadius.full, + height: theme('height.5'), + width: theme('width.5'), + 'transition-property': + 'background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter', + 'transition-duration': '.15s', + 'box-shadow': + 'var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color)', + }, + [['input:checked + .toggle-bg:after']]: { + transform: 'translateX(100%);', + 'border-color': 'white', + }, + [['input:checked + .toggle-bg']]: { + background: theme('colors.blue.600', colors.gray[600]), + 'border-color': theme( + 'colors.blue.600', + colors.gray[600] + ), + }, + }); + } + + // chart styles + if (charts) { + addComponents({ + '.apexcharts-canvas .apexcharts-tooltip': { + backgroundColor: 'white', + color: `${theme('colors.gray.500', colors.gray[500])}`, + border: '0 !important', + borderRadius: `${theme( + 'borderRadius.DEFAULT', + borderRadius.DEFAULT + )}`, + // padding: `${theme('spacing.3', spacing[3])}`, + boxShadow: `${theme('boxShadow.md', boxShadow.md)}`, + }, + '.dark .apexcharts-canvas .apexcharts-tooltip': { + backgroundColor: `${theme( + 'colors.gray.700', + colors.gray[700] + )}`, + color: `${theme('colors.gray.400', colors.gray[400])}`, + borderColor: 'transparent', + boxShadow: `${theme('boxShadow.md', boxShadow.md)}`, + }, + '.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title': + { + paddingTop: `${theme('spacing.2', spacing[2])}`, + paddingBottom: `${theme('spacing.2', spacing[2])}`, + paddingRight: `${theme('spacing.3', spacing[3])}`, + paddingLeft: `${theme('spacing.3', spacing[3])}`, + marginBottom: `${theme('spacing.3', spacing[3])}`, + backgroundColor: `${theme( + 'colors.gray.100', + colors.gray[100] + )}`, + borderBottomColor: `${theme( + 'colors.gray.200', + colors.gray[200] + )}`, + fontSize: `${theme( + 'fontSize.sm', + defaultTheme.fontSize.sm + )} !important`, + fontWeight: `${theme( + 'fontWeight.normal', + defaultTheme.fontWeight.normal + )}`, + color: `${theme( + 'colors.gray.500', + colors.gray[500] + )}`, + }, + '.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-title': + { + backgroundColor: `${theme( + 'colors.gray.600', + colors.gray[600] + )}`, + borderColor: `${theme( + 'colors.gray.500', + colors.gray[500] + )}`, + color: `${theme( + 'colors.gray.400', + colors.gray[400] + )}`, + }, + '.apexcharts-canvas .apexcharts-xaxistooltip': { + color: `${theme('colors.gray.500', colors.gray[500])}`, + paddingTop: `${theme('spacing.2', spacing[2])}`, + paddingBottom: `${theme('spacing.2', spacing[2])}`, + paddingRight: `${theme('spacing.3', spacing[3])}`, + paddingLeft: `${theme('spacing.3', spacing[3])}`, + borderColor: `transparent`, + backgroundColor: 'white', + borderRadius: `${theme( + 'borderRadius.DEFAULT', + borderRadius.DEFAULT + )}`, + boxShadow: `${theme('boxShadow.md', boxShadow.md)}`, + }, + '.dark .apexcharts-canvas .apexcharts-xaxistooltip': { + color: `${theme('colors.gray.400', colors.gray[400])}`, + backgroundColor: `${theme( + 'colors.gray.700', + colors.gray[700] + )}`, + }, + '.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label': + { + color: `${theme( + 'colors.gray.500', + colors.gray[500] + )}`, + fontSize: `${theme( + 'fontSize.sm', + defaultTheme.fontSize.sm + )}`, + }, + '.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-label': + { + color: `${theme( + 'colors.gray.400', + colors.gray[400] + )}`, + }, + '.apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value': + { + color: `${theme( + 'colors.gray.900', + colors.gray[900] + )}`, + fontSize: `${theme( + 'fontSize.sm', + defaultTheme.fontSize.sm + )}`, + }, + '.dark .apexcharts-canvas .apexcharts-tooltip .apexcharts-tooltip-text-y-value': + { + color: 'white', + }, + '.apexcharts-canvas .apexcharts-xaxistooltip-text': { + fontWeight: `${theme( + 'fontWeight.normal', + defaultTheme.fontWeight.normal + )}`, + fontSize: `${theme( + 'fontSize.sm', + defaultTheme.fontSize.sm + )} !important`, + }, + '.apexcharts-canvas .apexcharts-xaxistooltip:after, .apexcharts-canvas .apexcharts-xaxistooltip:before': + { + borderBottomColor: 'white', + }, + '.apexcharts-canvas .apexcharts-xaxistooltip:after': { + borderWidth: '8px', + marginLeft: '-8px', + }, + '.apexcharts-canvas .apexcharts-xaxistooltip:before': { + borderWidth: '10px', + marginLeft: '-10px', + }, + '.dark .apexcharts-canvas .apexcharts-xaxistooltip:after, .dark .apexcharts-canvas .apexcharts-xaxistooltip:before': + { + borderBottomColor: `${theme( + 'colors.gray.700', + colors.gray[700] + )}`, + }, + '.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-y-group': + { + padding: '0', + }, + '.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active': + { + paddingLeft: `${theme('spacing.3', spacing[3])}`, + paddingRight: `${theme('spacing.3', spacing[3])}`, + paddingBottom: `${theme('spacing.3', spacing[3])}`, + backgroundColor: 'white !important', + color: `${theme( + 'colors.gray.500', + colors.gray[500] + )} !important`, + }, + '.dark .apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active': + { + backgroundColor: `${theme( + 'colors.gray.700', + colors.gray[700] + )} !important`, + color: `${theme( + 'colors.gray.400', + colors.gray[400] + )} !important`, + }, + '.apexcharts-canvas .apexcharts-tooltip-series-group.apexcharts-active:first-of-type': + { + paddingTop: `${theme('spacing.3', spacing[3])}`, + }, + '.apexcharts-canvas .apexcharts-legend': { + padding: '0 !important', + }, + '.apexcharts-canvas .apexcharts-legend-text': { + fontSize: `${theme( + 'fontSize.xs', + defaultTheme.fontSize.xs + )}`, + fontWeight: `${theme( + 'fontWeight.medium', + defaultTheme.fontWeight.medium + )} !important`, + paddingLeft: `${theme('spacing.5', spacing[5])}`, + color: `${theme( + 'colors.gray.500', + colors.gray[500] + )} !important`, + }, + '.apexcharts-canvas .apexcharts-legend-text:not(.apexcharts-inactive-legend):hover': + { + color: `${theme( + 'colors.gray.900', + colors.gray[900] + )} !important`, + }, + '.dark .apexcharts-canvas .apexcharts-legend-text': { + color: `${theme( + 'colors.gray.400', + colors.gray[400] + )} !important`, + }, + '.dark .apexcharts-canvas .apexcharts-legend-text:not(.apexcharts-inactive-legend):hover': + { + color: `white !important`, + }, + '.apexcharts-canvas .apexcharts-legend-series': { + marginLeft: `${theme('spacing.2', spacing[2])}`, + marginRight: `${theme('spacing.2', spacing[2])}`, + marginBottom: `${theme( + 'spacing.1', + spacing[1] + )} !important`, + display: 'flex', + alignItems: 'center', + }, + '.apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-value': + { + fill: `${theme( + 'colors.gray.900', + colors.gray[900] + )} !important`, + fontSize: `${theme('fontSize.3xl')}`, + fontWeight: `${theme( + 'fontWeight.bold', + defaultTheme.fontWeight.bold + )}`, + }, + '.dark .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-value': + { + fill: `white !important`, + }, + '.apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-label': + { + fill: `${theme( + 'colors.gray.500', + colors.gray[500] + )} !important`, + fontSize: `${theme('fontSize.base')}`, + fontWeight: `${theme( + 'fontWeight.normal', + defaultTheme.fontWeight.normal + )}`, + }, + '.dark .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-text.apexcharts-datalabel-label': + { + fill: `${theme( + 'colors.gray.400', + colors.gray[400] + )} !important`, + }, + '.apexcharts-canvas .apexcharts-datalabels .apexcharts-text.apexcharts-pie-label': + { + fontSize: `${theme('fontSize.xs')} !important`, + fontWeight: `${theme( + 'fontWeight.semibold', + defaultTheme.fontWeight.semibold + )} !important`, + textShadow: `${theme( + 'boxShadow.none', + boxShadow.none + )} !important`, + filter: `none !important`, + }, + '.apexcharts-gridline, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs': + { + stroke: `${theme( + 'colors.gray.200', + colors.gray[200] + )} !important`, + }, + '.dark .apexcharts-gridline, .dark .apexcharts-xcrosshairs, .dark .apexcharts-ycrosshairs': + { + stroke: `${theme( + 'colors.gray.700', + colors.gray[700] + )} !important`, + }, + }); + } + }; + }, + function (options = {}) { + // Enable forms and tooltip by default if not specified in options + const { charts = false, forms = true, tooltips = true } = options; + + const safelist = [ + 'w-64', + 'w-1/2', + 'rounded-l-lg', + 'rounded-r-lg', + 'bg-gray-200', + 'grid-cols-4', + 'grid-cols-7', + 'h-6', + 'leading-6', + 'h-9', + 'leading-9', + 'shadow-lg', + ]; + + if (charts) { + safelist.push({ pattern: /^apexcharts-.*$/ }); + } + + return { + safelist: safelist, + darkMode: 'class', // or 'media' or 'class', + theme: { + extend: { + height: { + modal: 'calc(100% - 2rem)', + }, + boxShadow: { + 'sm-light': '0 2px 5px 0px rgba(255, 255, 255, 0.08)', + }, + colors: { + transparent: 'transparent', + white: '#ffffff', + black: '#000000', + gray: { + 50: '#F9FAFB', + 100: '#F3F4F6', + 200: '#E5E7EB', + 300: '#D1D5DB', + 400: '#9CA3AF', + 500: '#6B7280', + 600: '#4B5563', + 700: '#374151', + 800: '#1F2937', + 900: '#111827', + }, + red: { + 50: '#FDF2F2', + 100: '#FDE8E8', + 200: '#FBD5D5', + 300: '#F8B4B4', + 400: '#F98080', + 500: '#F05252', + 600: '#E02424', + 700: '#C81E1E', + 800: '#9B1C1C', + 900: '#771D1D', + }, + orange: { + 50: '#FFF8F1', + 100: '#FEECDC', + 200: '#FCD9BD', + 300: '#FDBA8C', + 400: '#FF8A4C', + 500: '#FF5A1F', + 600: '#D03801', + 700: '#B43403', + 800: '#8A2C0D', + 900: '#771D1D', + }, + yellow: { + 50: '#FDFDEA', + 100: '#FDF6B2', + 200: '#FCE96A', + 300: '#FACA15', + 400: '#E3A008', + 500: '#C27803', + 600: '#9F580A', + 700: '#8E4B10', + 800: '#723B13', + 900: '#633112', + }, + green: { + 50: '#F3FAF7', + 100: '#DEF7EC', + 200: '#BCF0DA', + 300: '#84E1BC', + 400: '#31C48D', + 500: '#0E9F6E', + 600: '#057A55', + 700: '#046C4E', + 800: '#03543F', + 900: '#014737', + }, + teal: { + 50: '#EDFAFA', + 100: '#D5F5F6', + 200: '#AFECEF', + 300: '#7EDCE2', + 400: '#16BDCA', + 500: '#0694A2', + 600: '#047481', + 700: '#036672', + 800: '#05505C', + 900: '#014451', + }, + blue: { + 50: '#EBF5FF', + 100: '#E1EFFE', + 200: '#C3DDFD', + 300: '#A4CAFE', + 400: '#76A9FA', + 500: '#3F83F8', + 600: '#1C64F2', + 700: '#1A56DB', + 800: '#1E429F', + 900: '#233876', + }, + indigo: { + 50: '#F0F5FF', + 100: '#E5EDFF', + 200: '#CDDBFE', + 300: '#B4C6FC', + 400: '#8DA2FB', + 500: '#6875F5', + 600: '#5850EC', + 700: '#5145CD', + 800: '#42389D', + 900: '#362F78', + }, + purple: { + 50: '#F6F5FF', + 100: '#EDEBFE', + 200: '#DCD7FE', + 300: '#CABFFD', + 400: '#AC94FA', + 500: '#9061F9', + 600: '#7E3AF2', + 700: '#6C2BD9', + 800: '#5521B5', + 900: '#4A1D96', + }, + pink: { + 50: '#FDF2F8', + 100: '#FCE8F3', + 200: '#FAD1E8', + 300: '#F8B4D9', + 400: '#F17EB8', + 500: '#E74694', + 600: '#D61F69', + 700: '#BF125D', + 800: '#99154B', + 900: '#751A3D', + }, + }, + }, + }, + }; + } +); diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE new file mode 100644 index 0000000..5bd884c --- /dev/null +++ b/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node 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/fs.realpath/README.md b/node_modules/fs.realpath/README.md new file mode 100644 index 0000000..a42ceac --- /dev/null +++ b/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js new file mode 100644 index 0000000..b09c7c7 --- /dev/null +++ b/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js new file mode 100644 index 0000000..b40305e --- /dev/null +++ b/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node 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. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json new file mode 100644 index 0000000..3edc57d --- /dev/null +++ b/node_modules/fs.realpath/package.json @@ -0,0 +1,26 @@ +{ + "name": "fs.realpath", + "version": "1.0.0", + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "old.js", + "index.js" + ] +} diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..d701b08 --- /dev/null +++ b/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker, 2021 Blaine Bublitz , Eric Schoffstall and other contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md new file mode 100644 index 0000000..6ae18a1 --- /dev/null +++ b/node_modules/glob-parent/README.md @@ -0,0 +1,134 @@ +

+ + + +

+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true; +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/'); // 'foo' +globParent('foo/\\[bar]/'); // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets + +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows + +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext'); // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext'); // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]'); // 'foo ' +globParent('foo \\[bar]*'); // 'foo ' + +// GOOD +globParent('./foo \\[bar]'); // 'foo [bar]' +globParent('./foo \\[bar]*'); // '.' +``` + +## License + +ISC + + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg?style=flat-square + +[ci-url]: https://github.com/gulpjs/glob-parent/actions?query=workflow:dev +[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/glob-parent/dev?style=flat-square + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg?style=flat-square + + + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100644 index 0000000..09dde64 --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,75 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var escaped = /\\([!*?|[\](){}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (isEnclosure(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlobby(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; + +function isEnclosure(str) { + var lastChar = str.slice(-1); + + var enclosureStart; + switch (lastChar) { + case '}': + enclosureStart = '{'; + break; + case ']': + enclosureStart = '['; + break; + default: + return false; + } + + var foundIndex = str.indexOf(enclosureStart); + if (foundIndex < 0) { + return false; + } + + return str.slice(foundIndex + 1, -1).includes(slash); +} + +function isGlobby(str) { + if (/\([^()]+$/.test(str)) { + return true; + } + if (str[0] === '{' || str[0] === '[') { + return true; + } + if (/[^\\][{[]/.test(str)) { + return true; + } + return isGlob(str); +} diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100644 index 0000000..baeab42 --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,54 @@ +{ + "name": "glob-parent", + "version": "6.0.2", + "description": "Extract the non-magic parent path from a glob string.", + "author": "Gulp Team (https://gulpjs.com/)", + "contributors": [ + "Elan Shanker (https://github.com/es128)", + "Blaine Bublitz " + ], + "repository": "gulpjs/glob-parent", + "license": "ISC", + "engines": { + "node": ">=10.13.0" + }, + "main": "index.js", + "files": [ + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only" + }, + "dependencies": { + "is-glob": "^4.0.3" + }, + "devDependencies": { + "eslint": "^7.0.0", + "eslint-config-gulp": "^5.0.0", + "expect": "^26.0.1", + "mocha": "^7.1.2", + "nyc": "^15.0.1" + }, + "nyc": { + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": { + "singleQuote": true + }, + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ] +} diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100644 index 0000000..0916a48 --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,375 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/glob/changelog.md b/node_modules/glob/changelog.md new file mode 100644 index 0000000..4163677 --- /dev/null +++ b/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100644 index 0000000..66651bb --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100644 index 0000000..58dec0f --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100644 index 0000000..6477c30 --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,46 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.1.6", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100644 index 0000000..c952134 --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/has/LICENSE-MIT b/node_modules/has/LICENSE-MIT new file mode 100644 index 0000000..ae7014d --- /dev/null +++ b/node_modules/has/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Thiago de Arruda + +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/has/README.md b/node_modules/has/README.md new file mode 100644 index 0000000..635e3a4 --- /dev/null +++ b/node_modules/has/README.md @@ -0,0 +1,18 @@ +# has + +> Object.prototype.hasOwnProperty.call shortcut + +## Installation + +```sh +npm install --save has +``` + +## Usage + +```js +var has = require('has'); + +has({}, 'hasOwnProperty'); // false +has(Object.prototype, 'hasOwnProperty'); // true +``` diff --git a/node_modules/has/package.json b/node_modules/has/package.json new file mode 100644 index 0000000..69cdd44 --- /dev/null +++ b/node_modules/has/package.json @@ -0,0 +1,45 @@ +{ + "name": "has", + "description": "Object.prototype.hasOwnProperty.call shortcut", + "version": "1.0.4", + "homepage": "https://github.com/tarruda/has", + "author": { + "name": "Thiago de Arruda", + "email": "tpadilha84@gmail.com" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/tarruda/has.git" + }, + "bugs": { + "url": "https://github.com/tarruda/has/issues" + }, + "license": "MIT", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" + } + ], + "main": "./src", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "eslint": "^4.19.1", + "tape": "^4.9.0" + }, + "engines": { + "node": ">= 0.4.0" + }, + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "tape test" + } +} diff --git a/node_modules/has/src/index.js b/node_modules/has/src/index.js new file mode 100644 index 0000000..688714c --- /dev/null +++ b/node_modules/has/src/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var hasOwnProperty = {}.hasOwnProperty; +var call = Function.prototype.call; + +module.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) { + return call.call(hasOwnProperty, O, P); +}; diff --git a/node_modules/has/test/index.js b/node_modules/has/test/index.js new file mode 100644 index 0000000..876aad9 --- /dev/null +++ b/node_modules/has/test/index.js @@ -0,0 +1,16 @@ +'use strict'; + +var test = require('tape'); +var has = require('../'); + +test('has', function (t) { + t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); + t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); + t['throws'](function () { + has(null, 'throws'); + }, TypeError, 'calling has on null throws TypeError'); + t['throws'](function () { + has(void 0, 'throws'); + }, TypeError, 'calling has on undefined throws TypeError'); + t.end(); +}); diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md new file mode 100644 index 0000000..6dc8929 --- /dev/null +++ b/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js new file mode 100644 index 0000000..48202b3 --- /dev/null +++ b/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json new file mode 100644 index 0000000..6084d35 --- /dev/null +++ b/node_modules/inflight/package.json @@ -0,0 +1,29 @@ +{ + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" + ], + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.1.2" + }, + "scripts": { + "test": "tap test.js --100" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/inflight.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" +} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js new file mode 100644 index 0000000..f71f2d9 --- /dev/null +++ b/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..86bbb3d --- /dev/null +++ b/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json new file mode 100644 index 0000000..37b4366 --- /dev/null +++ b/node_modules/inherits/package.json @@ -0,0 +1,29 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.4", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", + "scripts": { + "test": "tap" + }, + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] +} diff --git a/node_modules/is-binary-path/index.d.ts b/node_modules/is-binary-path/index.d.ts new file mode 100644 index 0000000..19dcd43 --- /dev/null +++ b/node_modules/is-binary-path/index.d.ts @@ -0,0 +1,17 @@ +/** +Check if a file path is a binary file. + +@example +``` +import isBinaryPath = require('is-binary-path'); + +isBinaryPath('source/unicorn.png'); +//=> true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` +*/ +declare function isBinaryPath(filePath: string): boolean; + +export = isBinaryPath; diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js new file mode 100644 index 0000000..ef7548c --- /dev/null +++ b/node_modules/is-binary-path/index.js @@ -0,0 +1,7 @@ +'use strict'; +const path = require('path'); +const binaryExtensions = require('binary-extensions'); + +const extensions = new Set(binaryExtensions); + +module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license new file mode 100644 index 0000000..401b1c7 --- /dev/null +++ b/node_modules/is-binary-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.com) + +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/is-binary-path/package.json b/node_modules/is-binary-path/package.json new file mode 100644 index 0000000..a8d005a --- /dev/null +++ b/node_modules/is-binary-path/package.json @@ -0,0 +1,40 @@ +{ + "name": "is-binary-path", + "version": "2.1.0", + "description": "Check if a file path is a binary file", + "license": "MIT", + "repository": "sindresorhus/is-binary-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "path", + "check", + "detect", + "is" + ], + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md new file mode 100644 index 0000000..b4ab025 --- /dev/null +++ b/node_modules/is-binary-path/readme.md @@ -0,0 +1,34 @@ +# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) + +> Check if a file path is a binary file + + +## Install + +``` +$ npm install is-binary-path +``` + + +## Usage + +```js +const isBinaryPath = require('is-binary-path'); + +isBinaryPath('source/unicorn.png'); +//=> true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` + + +## Related + +- [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions +- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.com) diff --git a/node_modules/is-core-module/.eslintrc b/node_modules/is-core-module/.eslintrc new file mode 100644 index 0000000..f2e0726 --- /dev/null +++ b/node_modules/is-core-module/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": "@ljharb", + "root": true, + "rules": { + "func-style": 1, + }, + "overrides": [ + { + "files": "test/**", + "rules": { + "global-require": 0, + "max-depth": 0, + "max-lines-per-function": 0, + "no-negated-condition": 0, + }, + }, + ], +} diff --git a/node_modules/is-core-module/.nycrc b/node_modules/is-core-module/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/is-core-module/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/is-core-module/CHANGELOG.md b/node_modules/is-core-module/CHANGELOG.md new file mode 100644 index 0000000..f44fd84 --- /dev/null +++ b/node_modules/is-core-module/CHANGELOG.md @@ -0,0 +1,173 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.13.0](https://github.com/inspect-js/is-core-module/compare/v2.12.1...v2.13.0) - 2023-08-05 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `semver`, `tape` [`c75b263`](https://github.com/inspect-js/is-core-module/commit/c75b263d047cb53430c3970107e5eb64d6cd6c0c) +- [New] `node:test/reporters` and `wasi`/`node:wasi` are in v18.17 [`d76cbf8`](https://github.com/inspect-js/is-core-module/commit/d76cbf8e9b208acfd98913fed5a5f45cb15fe5dc) + +## [v2.12.1](https://github.com/inspect-js/is-core-module/compare/v2.12.0...v2.12.1) - 2023-05-16 + +### Commits + +- [Fix] `test/reporters` now requires the `node:` prefix as of v20.2 [`12183d0`](https://github.com/inspect-js/is-core-module/commit/12183d0d8e4edf56b6ce18a1b3be54bfce10175b) + +## [v2.12.0](https://github.com/inspect-js/is-core-module/compare/v2.11.0...v2.12.0) - 2023-04-10 + +### Commits + +- [actions] update rebase action to use reusable workflow [`c0a7251`](https://github.com/inspect-js/is-core-module/commit/c0a7251f734f3c621932c5fcdfd1bf966b42ca32) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9ae8b7f`](https://github.com/inspect-js/is-core-module/commit/9ae8b7fac03c369861d0991b4a2ce8d4848e6a7d) +- [New] `test/reporters` added in v19.9, `wasi` added in v20 [`9d5341a`](https://github.com/inspect-js/is-core-module/commit/9d5341ab32053f25b7fa7db3c0e18461db24a79c) +- [Dev Deps] add missing `in-publish` dep [`5980245`](https://github.com/inspect-js/is-core-module/commit/59802456e9ac919fa748f53be9d8fbf304a197df) + +## [v2.11.0](https://github.com/inspect-js/is-core-module/compare/v2.10.0...v2.11.0) - 2022-10-18 + +### Commits + +- [meta] use `npmignore` to autogenerate an npmignore file [`3360011`](https://github.com/inspect-js/is-core-module/commit/33600118857b46177178072fba2affcdeb009d12) +- [Dev Deps] update `aud`, `tape` [`651c6b0`](https://github.com/inspect-js/is-core-module/commit/651c6b0cc2799d4130866cf43ad333dcade3d26c) +- [New] `inspector/promises` and `node:inspector/promises` is now available in node 19 [`22d332f`](https://github.com/inspect-js/is-core-module/commit/22d332fe22ac050305444e0781ff85af819abcb0) + +## [v2.10.0](https://github.com/inspect-js/is-core-module/compare/v2.9.0...v2.10.0) - 2022-08-03 + +### Commits + +- [New] `node:test` is now available in node ^16.17 [`e8fd36e`](https://github.com/inspect-js/is-core-module/commit/e8fd36e9b86c917775a07cc473b62a3294f459f2) +- [Tests] improve skip message [`c014a4c`](https://github.com/inspect-js/is-core-module/commit/c014a4c0cd6eb15fff573ae4709191775e70cab4) + +## [v2.9.0](https://github.com/inspect-js/is-core-module/compare/v2.8.1...v2.9.0) - 2022-04-19 + +### Commits + +- [New] add `node:test`, in node 18+ [`f853eca`](https://github.com/inspect-js/is-core-module/commit/f853eca801d0a7d4e1dbb670f1b6d9837d9533c5) +- [Tests] use `mock-property` [`03b3644`](https://github.com/inspect-js/is-core-module/commit/03b3644dff4417f4ba5a7d0aa0138f5f6b3e5c46) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7c0e2d0`](https://github.com/inspect-js/is-core-module/commit/7c0e2d06ed2a89acf53abe2ab34d703ed5b03455) +- [meta] simplify "exports" [`d6ed201`](https://github.com/inspect-js/is-core-module/commit/d6ed201eba7fbba0e59814a9050fc49a6e9878c8) + +## [v2.8.1](https://github.com/inspect-js/is-core-module/compare/v2.8.0...v2.8.1) - 2022-01-05 + +### Commits + +- [actions] reuse common workflows [`cd2cf9b`](https://github.com/inspect-js/is-core-module/commit/cd2cf9b3b66c8d328f65610efe41e9325db7716d) +- [Fix] update node 0.4 results [`062195d`](https://github.com/inspect-js/is-core-module/commit/062195d89f0876a88b95d378b43f7fcc1205bc5b) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0790b62`](https://github.com/inspect-js/is-core-module/commit/0790b6222848c6167132f9f73acc3520fa8d1298) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7d139a6`](https://github.com/inspect-js/is-core-module/commit/7d139a6d767709eabf0a0251e074ec1fb230c06e) +- [Tests] run `nyc` in `tests-only`, not `test` [`780e8a0`](https://github.com/inspect-js/is-core-module/commit/780e8a049951c71cf78b1707f0871c48a28bde14) + +## [v2.8.0](https://github.com/inspect-js/is-core-module/compare/v2.7.0...v2.8.0) - 2021-10-14 + +### Commits + +- [actions] update codecov uploader [`0cfe94e`](https://github.com/inspect-js/is-core-module/commit/0cfe94e106a7d005ea03e008c0a21dec13a77904) +- [New] add `readline/promises` to node v17+ [`4f78c30`](https://github.com/inspect-js/is-core-module/commit/4f78c3008b1b58b4db6dc91d99610b1bc859da7e) +- [Tests] node ^14.18 supports `node:` prefixes for CJS [`43e2f17`](https://github.com/inspect-js/is-core-module/commit/43e2f177452cea2f0eaf34f61b5407217bbdb6f4) + +## [v2.7.0](https://github.com/inspect-js/is-core-module/compare/v2.6.0...v2.7.0) - 2021-09-27 + +### Commits + +- [New] node `v14.18` added `node:`-prefixed core modules to `require` [`6d943ab`](https://github.com/inspect-js/is-core-module/commit/6d943abe81382b9bbe344384d80fbfebe1cc0526) +- [Tests] add coverage for Object.prototype pollution [`c6baf5f`](https://github.com/inspect-js/is-core-module/commit/c6baf5f942311a1945c1af41167bb80b84df2af7) +- [Dev Deps] update `@ljharb/eslint-config` [`6717f00`](https://github.com/inspect-js/is-core-module/commit/6717f000d063ea57beb772bded36c2f056ac404c) +- [eslint] fix linter warning [`594c10b`](https://github.com/inspect-js/is-core-module/commit/594c10bb7d39d7eb00925c90924199ff596184b2) +- [meta] add `sideEffects` flag [`c32cfa5`](https://github.com/inspect-js/is-core-module/commit/c32cfa5195632944c4dd4284a142b8476e75be13) + +## [v2.6.0](https://github.com/inspect-js/is-core-module/compare/v2.5.0...v2.6.0) - 2021-08-17 + +### Commits + +- [Dev Deps] update `eslint`, `tape` [`6cc928f`](https://github.com/inspect-js/is-core-module/commit/6cc928f8a4bba66aeeccc4f6beeac736d4bd3081) +- [New] add `stream/consumers` to node `>= 16.7` [`a1a423e`](https://github.com/inspect-js/is-core-module/commit/a1a423e467e4cc27df180234fad5bab45943e67d) +- [Refactor] Remove duplicated `&&` operand [`86faea7`](https://github.com/inspect-js/is-core-module/commit/86faea738213a2433c62d1098488dc9314dca832) +- [Tests] include prereleases [`a4da7a6`](https://github.com/inspect-js/is-core-module/commit/a4da7a6abf7568e2aa4fd98e69452179f1850963) + +## [v2.5.0](https://github.com/inspect-js/is-core-module/compare/v2.4.0...v2.5.0) - 2021-07-12 + +### Commits + +- [Dev Deps] update `auto-changelog`, `eslint` [`6334cc9`](https://github.com/inspect-js/is-core-module/commit/6334cc94f3af7469685bd8f236740991baaf2705) +- [New] add `stream/web` to node v16.5+ [`17ac59b`](https://github.com/inspect-js/is-core-module/commit/17ac59b662d63e220a2e5728625f005c24f177b2) + +## [v2.4.0](https://github.com/inspect-js/is-core-module/compare/v2.3.0...v2.4.0) - 2021-05-09 + +### Commits + +- [readme] add actions and codecov badges [`82b7faa`](https://github.com/inspect-js/is-core-module/commit/82b7faa12b56dbe47fbea67e1a5b9e447027ba40) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8096868`](https://github.com/inspect-js/is-core-module/commit/8096868c024a161ccd4d44110b136763e92eace8) +- [Dev Deps] update `eslint` [`6726824`](https://github.com/inspect-js/is-core-module/commit/67268249b88230018c510f6532a8046d7326346f) +- [New] add `diagnostics_channel` to node `^14.17` [`86c6563`](https://github.com/inspect-js/is-core-module/commit/86c65634201b8ff9b3e48a9a782594579c7f5c3c) +- [meta] fix prepublish script [`697a01e`](https://github.com/inspect-js/is-core-module/commit/697a01e3c9c0be074066520954f30fb28532ec57) + +## [v2.3.0](https://github.com/inspect-js/is-core-module/compare/v2.2.0...v2.3.0) - 2021-04-24 + +### Commits + +- [meta] do not publish github action workflow files [`060d4bb`](https://github.com/inspect-js/is-core-module/commit/060d4bb971a29451c19ff336eb56bee27f9fa95a) +- [New] add support for `node:` prefix, in node 16+ [`7341223`](https://github.com/inspect-js/is-core-module/commit/73412230a769f6e81c05eea50b6520cebf54ed2f) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`016269a`](https://github.com/inspect-js/is-core-module/commit/016269abae9f6657a5254adfbb813f09a05067f9) +- [patch] remove unneeded `.0` in version ranges [`cb466a6`](https://github.com/inspect-js/is-core-module/commit/cb466a6d89e52b8389e5c12715efcd550c41cea3) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`c9f9c39`](https://github.com/inspect-js/is-core-module/commit/c9f9c396ace60ef81906f98059c064e6452473ed) +- [actions] update workflows [`3ee4a89`](https://github.com/inspect-js/is-core-module/commit/3ee4a89fd5a02fccd43882d905448ea6a98e9a3c) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`dee4fed`](https://github.com/inspect-js/is-core-module/commit/dee4fed79690c1d43a22f7fa9426abebdc6d727f) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`7d046ba`](https://github.com/inspect-js/is-core-module/commit/7d046ba07ae8c9292e43652694ca808d7b309de8) +- [meta] use `prepublishOnly` script for npm 7+ [`149e677`](https://github.com/inspect-js/is-core-module/commit/149e6771a5ede6d097e71785b467a9c4b4977cc7) +- [readme] remove travis badge [`903b51d`](https://github.com/inspect-js/is-core-module/commit/903b51d6b69b98abeabfbc3695c345b02646f19c) + +## [v2.2.0](https://github.com/inspect-js/is-core-module/compare/v2.1.0...v2.2.0) - 2020-11-26 + +### Commits + +- [Tests] migrate tests to Github Actions [`c919f57`](https://github.com/inspect-js/is-core-module/commit/c919f573c0a92d10a0acad0b650b5aecb033d426) +- [patch] `core.json`: %s/ /\t/g [`db3f685`](https://github.com/inspect-js/is-core-module/commit/db3f68581f53e73cc09cd675955eb1bdd6a5a39b) +- [Tests] run `nyc` on all tests [`b2f925f`](https://github.com/inspect-js/is-core-module/commit/b2f925f8866f210ef441f39fcc8cc42692ab89b1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; add `safe-publish-latest` [`89f02a2`](https://github.com/inspect-js/is-core-module/commit/89f02a2b4162246dea303a6ee31bb9a550b05c72) +- [New] add `path/posix`, `path/win32`, `util/types` [`77f94f1`](https://github.com/inspect-js/is-core-module/commit/77f94f1e90ffd7c0be2a3f1aa8574ebf7fd981b3) + +## [v2.1.0](https://github.com/inspect-js/is-core-module/compare/v2.0.0...v2.1.0) - 2020-11-04 + +### Commits + +- [Dev Deps] update `eslint` [`5e0034e`](https://github.com/inspect-js/is-core-module/commit/5e0034eae57c09c8f1bd769f502486a00f56c6e4) +- [New] Add `diagnostics_channel` [`c2d83d0`](https://github.com/inspect-js/is-core-module/commit/c2d83d0a0225a1a658945d9bab7036ea347d29ec) + +## [v2.0.0](https://github.com/inspect-js/is-core-module/compare/v1.0.2...v2.0.0) - 2020-09-29 + +### Commits + +- v2 implementation [`865aeb5`](https://github.com/inspect-js/is-core-module/commit/865aeb5ca0e90248a3dfff5d7622e4751fdeb9cd) +- Only apps should have lockfiles [`5a5e660`](https://github.com/inspect-js/is-core-module/commit/5a5e660d568e37eb44e17fb1ebb12a105205fc2b) +- Initial commit for v2 [`5a51524`](https://github.com/inspect-js/is-core-module/commit/5a51524e06f92adece5fbb138c69b7b9748a2348) +- Tests [`116eae4`](https://github.com/inspect-js/is-core-module/commit/116eae4fccd01bc72c1fd3cc4b7561c387afc496) +- [meta] add `auto-changelog` [`c24388b`](https://github.com/inspect-js/is-core-module/commit/c24388bee828d223040519d1f5b226ca35beee63) +- [actions] add "Automatic Rebase" and "require allow edits" actions [`34292db`](https://github.com/inspect-js/is-core-module/commit/34292dbcbadae0868aff03c22dbd8b7b8a11558a) +- [Tests] add `npm run lint` [`4f9eeee`](https://github.com/inspect-js/is-core-module/commit/4f9eeee7ddff10698bbf528620f4dc8d4fa3e697) +- [readme] fix travis badges, https all URLs [`e516a73`](https://github.com/inspect-js/is-core-module/commit/e516a73b0dccce20938c432b1ba512eae8eff9e9) +- [meta] create FUNDING.yml [`1aabebc`](https://github.com/inspect-js/is-core-module/commit/1aabebca98d01f8a04e46bc2e2520fa93cf21ac6) +- [Fix] `domain`: domain landed sometime > v0.7.7 and <= v0.7.12 [`2df7d37`](https://github.com/inspect-js/is-core-module/commit/2df7d37595d41b15eeada732b706b926c2771655) +- [Fix] `sys`: worked in 0.6, not 0.7, and 0.8+ [`a75c134`](https://github.com/inspect-js/is-core-module/commit/a75c134229e1e9441801f6b73f6a52489346eb65) + +## [v1.0.2](https://github.com/inspect-js/is-core-module/compare/v1.0.1...v1.0.2) - 2014-09-28 + +### Commits + +- simpler [`66fe90f`](https://github.com/inspect-js/is-core-module/commit/66fe90f9771581b9adc0c3900baa52c21b5baea2) + +## [v1.0.1](https://github.com/inspect-js/is-core-module/compare/v1.0.0...v1.0.1) - 2014-09-28 + +### Commits + +- remove stupid [`f21f906`](https://github.com/inspect-js/is-core-module/commit/f21f906f882c2bd656a5fc5ed6fbe48ddaffb2ac) +- update readme [`1eff0ec`](https://github.com/inspect-js/is-core-module/commit/1eff0ec69798d1ec65771552d1562911e90a8027) + +## v1.0.0 - 2014-09-28 + +### Commits + +- init [`48e5e76`](https://github.com/inspect-js/is-core-module/commit/48e5e76cac378fddb8c1f7d4055b8dfc943d6b96) diff --git a/node_modules/is-core-module/LICENSE b/node_modules/is-core-module/LICENSE new file mode 100644 index 0000000..2e50287 --- /dev/null +++ b/node_modules/is-core-module/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Dave Justice + +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. \ No newline at end of file diff --git a/node_modules/is-core-module/README.md b/node_modules/is-core-module/README.md new file mode 100644 index 0000000..062d906 --- /dev/null +++ b/node_modules/is-core-module/README.md @@ -0,0 +1,40 @@ +# is-core-module [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version. + +## Example + +```js +var isCore = require('is-core-module'); +var assert = require('assert'); +assert(isCore('fs')); +assert(!isCore('butts')); +``` + +## Tests +Clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/is-core-module +[2]: https://versionbadg.es/inspect-js/is-core-module.svg +[5]: https://david-dm.org/inspect-js/is-core-module.svg +[6]: https://david-dm.org/inspect-js/is-core-module +[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg +[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies +[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/is-core-module.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg +[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module +[codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module +[actions-url]: https://github.com/inspect-js/is-core-module/actions diff --git a/node_modules/is-core-module/core.json b/node_modules/is-core-module/core.json new file mode 100644 index 0000000..3cda693 --- /dev/null +++ b/node_modules/is-core-module/core.json @@ -0,0 +1,158 @@ +{ + "assert": true, + "node:assert": [">= 14.18 && < 15", ">= 16"], + "assert/strict": ">= 15", + "node:assert/strict": ">= 16", + "async_hooks": ">= 8", + "node:async_hooks": [">= 14.18 && < 15", ">= 16"], + "buffer_ieee754": ">= 0.5 && < 0.9.7", + "buffer": true, + "node:buffer": [">= 14.18 && < 15", ">= 16"], + "child_process": true, + "node:child_process": [">= 14.18 && < 15", ">= 16"], + "cluster": ">= 0.5", + "node:cluster": [">= 14.18 && < 15", ">= 16"], + "console": true, + "node:console": [">= 14.18 && < 15", ">= 16"], + "constants": true, + "node:constants": [">= 14.18 && < 15", ">= 16"], + "crypto": true, + "node:crypto": [">= 14.18 && < 15", ">= 16"], + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "node:dgram": [">= 14.18 && < 15", ">= 16"], + "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"], + "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], + "dns": true, + "node:dns": [">= 14.18 && < 15", ">= 16"], + "dns/promises": ">= 15", + "node:dns/promises": ">= 16", + "domain": ">= 0.7.12", + "node:domain": [">= 14.18 && < 15", ">= 16"], + "events": true, + "node:events": [">= 14.18 && < 15", ">= 16"], + "freelist": "< 6", + "fs": true, + "node:fs": [">= 14.18 && < 15", ">= 16"], + "fs/promises": [">= 10 && < 10.1", ">= 14"], + "node:fs/promises": [">= 14.18 && < 15", ">= 16"], + "_http_agent": ">= 0.11.1", + "node:_http_agent": [">= 14.18 && < 15", ">= 16"], + "_http_client": ">= 0.11.1", + "node:_http_client": [">= 14.18 && < 15", ">= 16"], + "_http_common": ">= 0.11.1", + "node:_http_common": [">= 14.18 && < 15", ">= 16"], + "_http_incoming": ">= 0.11.1", + "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], + "_http_outgoing": ">= 0.11.1", + "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], + "_http_server": ">= 0.11.1", + "node:_http_server": [">= 14.18 && < 15", ">= 16"], + "http": true, + "node:http": [">= 14.18 && < 15", ">= 16"], + "http2": ">= 8.8", + "node:http2": [">= 14.18 && < 15", ">= 16"], + "https": true, + "node:https": [">= 14.18 && < 15", ">= 16"], + "inspector": ">= 8", + "node:inspector": [">= 14.18 && < 15", ">= 16"], + "inspector/promises": [">= 19"], + "node:inspector/promises": [">= 19"], + "_linklist": "< 8", + "module": true, + "node:module": [">= 14.18 && < 15", ">= 16"], + "net": true, + "node:net": [">= 14.18 && < 15", ">= 16"], + "node-inspect/lib/_inspect": ">= 7.6 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", + "os": true, + "node:os": [">= 14.18 && < 15", ">= 16"], + "path": true, + "node:path": [">= 14.18 && < 15", ">= 16"], + "path/posix": ">= 15.3", + "node:path/posix": ">= 16", + "path/win32": ">= 15.3", + "node:path/win32": ">= 16", + "perf_hooks": ">= 8.5", + "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], + "process": ">= 1", + "node:process": [">= 14.18 && < 15", ">= 16"], + "punycode": ">= 0.5", + "node:punycode": [">= 14.18 && < 15", ">= 16"], + "querystring": true, + "node:querystring": [">= 14.18 && < 15", ">= 16"], + "readline": true, + "node:readline": [">= 14.18 && < 15", ">= 16"], + "readline/promises": ">= 17", + "node:readline/promises": ">= 17", + "repl": true, + "node:repl": [">= 14.18 && < 15", ">= 16"], + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], + "_stream_transform": ">= 0.9.4", + "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], + "_stream_wrap": ">= 1.4.1", + "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], + "_stream_passthrough": ">= 0.9.4", + "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], + "_stream_readable": ">= 0.9.4", + "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], + "_stream_writable": ">= 0.9.4", + "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], + "stream": true, + "node:stream": [">= 14.18 && < 15", ">= 16"], + "stream/consumers": ">= 16.7", + "node:stream/consumers": ">= 16.7", + "stream/promises": ">= 15", + "node:stream/promises": ">= 16", + "stream/web": ">= 16.5", + "node:stream/web": ">= 16.5", + "string_decoder": true, + "node:string_decoder": [">= 14.18 && < 15", ">= 16"], + "sys": [">= 0.4 && < 0.7", ">= 0.8"], + "node:sys": [">= 14.18 && < 15", ">= 16"], + "test/reporters": ">= 19.9 && < 20.2", + "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], + "node:test": [">= 16.17 && < 17", ">= 18"], + "timers": true, + "node:timers": [">= 14.18 && < 15", ">= 16"], + "timers/promises": ">= 15", + "node:timers/promises": ">= 16", + "_tls_common": ">= 0.11.13", + "node:_tls_common": [">= 14.18 && < 15", ">= 16"], + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], + "tls": true, + "node:tls": [">= 14.18 && < 15", ">= 16"], + "trace_events": ">= 10", + "node:trace_events": [">= 14.18 && < 15", ">= 16"], + "tty": true, + "node:tty": [">= 14.18 && < 15", ">= 16"], + "url": true, + "node:url": [">= 14.18 && < 15", ">= 16"], + "util": true, + "node:util": [">= 14.18 && < 15", ">= 16"], + "util/types": ">= 15.3", + "node:util/types": ">= 16", + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8": ">= 1", + "node:v8": [">= 14.18 && < 15", ">= 16"], + "vm": true, + "node:vm": [">= 14.18 && < 15", ">= 16"], + "wasi": [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], + "node:wasi": [">= 18.17 && < 19", ">= 20"], + "worker_threads": ">= 11.7", + "node:worker_threads": [">= 14.18 && < 15", ">= 16"], + "zlib": ">= 0.5", + "node:zlib": [">= 14.18 && < 15", ">= 16"] +} diff --git a/node_modules/is-core-module/index.js b/node_modules/is-core-module/index.js new file mode 100644 index 0000000..f9637e0 --- /dev/null +++ b/node_modules/is-core-module/index.js @@ -0,0 +1,69 @@ +'use strict'; + +var has = require('has'); + +function specifierIncluded(current, specifier) { + var nodeParts = current.split('.'); + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = parseInt(nodeParts[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } + if (op === '>=') { + return cur >= ver; + } + return false; + } + return op === '>='; +} + +function matchesRange(current, range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { + return false; + } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(current, specifiers[i])) { + return false; + } + } + return true; +} + +function versionIncluded(nodeVersion, specifierValue) { + if (typeof specifierValue === 'boolean') { + return specifierValue; + } + + var current = typeof nodeVersion === 'undefined' + ? process.versions && process.versions.node + : nodeVersion; + + if (typeof current !== 'string') { + throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); + } + + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(current, specifierValue[i])) { + return true; + } + } + return false; + } + return matchesRange(current, specifierValue); +} + +var data = require('./core.json'); + +module.exports = function isCore(x, nodeVersion) { + return has(data, x) && versionIncluded(nodeVersion, data[x]); +}; diff --git a/node_modules/is-core-module/package.json b/node_modules/is-core-module/package.json new file mode 100644 index 0000000..1269c80 --- /dev/null +++ b/node_modules/is-core-module/package.json @@ -0,0 +1,73 @@ +{ + "name": "is-core-module", + "version": "2.13.0", + "description": "Is this specifier a node.js core module?", + "main": "index.js", + "sideEffects": false, + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/is-core-module.git" + }, + "keywords": [ + "core", + "modules", + "module", + "npm", + "node", + "dependencies" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/is-core-module/issues" + }, + "homepage": "https://github.com/inspect-js/is-core-module", + "dependencies": { + "has": "^1.0.3" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.3", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "mock-property": "^1.0.0", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "semver": "^6.3.1", + "tape": "^5.6.6" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github" + ] + } +} diff --git a/node_modules/is-core-module/test/index.js b/node_modules/is-core-module/test/index.js new file mode 100644 index 0000000..912808b --- /dev/null +++ b/node_modules/is-core-module/test/index.js @@ -0,0 +1,133 @@ +'use strict'; + +var test = require('tape'); +var keys = require('object-keys'); +var semver = require('semver'); +var mockProperty = require('mock-property'); + +var isCore = require('../'); +var data = require('../core.json'); + +var supportsNodePrefix = semver.satisfies(process.versions.node, '^14.18 || >= 16', { includePrerelease: true }); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(isCore('fs')); + st.ok(isCore('net')); + st.ok(isCore('http')); + + st.ok(!isCore('seq')); + st.ok(!isCore('../')); + + st.ok(!isCore('toString')); + + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(data); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func + if (isCore(mod)) { + st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw'); + } else { + st['throws'](requireFunc, mod + ' not supported; requiring throws'); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !data.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('repl._builtinLibs does not exist'); + } else { + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(data[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + if (mod.slice(0, 5) !== 'node:') { + if (supportsNodePrefix) { + st.doesNotThrow( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' does not throw' + ); + } else { + st['throws']( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' throws' + ); + } + } + } + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !data.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + } else { + var excludeList = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + // see https://github.com/nodejs/node/issues/42785 + if (semver.satisfies(process.version, '>= 18')) { + libs = libs.concat('node:test'); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (excludeList.indexOf(mod) === -1) { + st.ok(data[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + if (mod.slice(0, 5) !== 'node:') { + if (supportsNodePrefix) { + st.doesNotThrow( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' does not throw' + ); + } else { + st['throws']( + function () { require('node:' + mod); }, // eslint-disable-line no-loop-func + 'requiring node:' + mod + ' throws' + ); + } + } + } + } + } + st.end(); + }); + + t.test('Object.prototype pollution', function (st) { + var nonKey = 'not a core module'; + st.teardown(mockProperty(Object.prototype, 'fs', { value: false })); + st.teardown(mockProperty(Object.prototype, 'path', { value: '>= 999999999' })); + st.teardown(mockProperty(Object.prototype, 'http', { value: data.http })); + st.teardown(mockProperty(Object.prototype, nonKey, { value: true })); + + st.equal(isCore('fs'), true, 'fs is a core module even if Object.prototype lies'); + st.equal(isCore('path'), true, 'path is a core module even if Object.prototype lies'); + st.equal(isCore('http'), true, 'path is a core module even if Object.prototype matches data'); + st.equal(isCore(nonKey), false, '"' + nonKey + '" is not a core module even if Object.prototype lies'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +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/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 0000000..0416af5 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 0000000..c1d986f --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 0000000..7a90836 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,69 @@ +{ + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 0000000..740724b --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 0000000..620f563 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,150 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 0000000..858af03 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + } +} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +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/is-number/README.md b/node_modules/is-number/README.md new file mode 100644 index 0000000..eb8149e --- /dev/null +++ b/node_modules/is-number/README.md @@ -0,0 +1,187 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a finite number. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Why is this needed? + +In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use `+`, `-`, or `Number()` to cast a string value to a number (for example, when values are returned from user input, regex matches, parsers, etc). But there are many non-intuitive edge cases that yield unexpected results: + +```js +console.log(+[]); //=> 0 +console.log(+''); //=> 0 +console.log(+' '); //=> 0 +console.log(typeof NaN); //=> 'number' +``` + +This library offers a performant way to smooth out edge cases like these. + +## Usage + +```js +const isNumber = require('is-number'); +``` + +See the [tests](./test.js) for more examples. + +### true + +```js +isNumber(5e3); // true +isNumber(0xff); // true +isNumber(-1.1); // true +isNumber(0); // true +isNumber(1); // true +isNumber(1.1); // true +isNumber(10); // true +isNumber(10.10); // true +isNumber(100); // true +isNumber('-1.1'); // true +isNumber('0'); // true +isNumber('012'); // true +isNumber('0xff'); // true +isNumber('1'); // true +isNumber('1.1'); // true +isNumber('10'); // true +isNumber('10.10'); // true +isNumber('100'); // true +isNumber('5e3'); // true +isNumber(parseInt('012')); // true +isNumber(parseFloat('012')); // true +``` + +### False + +Everything else is false, as you would expect: + +```js +isNumber(Infinity); // false +isNumber(NaN); // false +isNumber(null); // false +isNumber(undefined); // false +isNumber(''); // false +isNumber(' '); // false +isNumber('foo'); // false +isNumber([1]); // false +isNumber([]); // false +isNumber(function () {}); // false +isNumber({}); // false +``` + +## Release history + +### 7.0.0 + +* Refactor. Now uses `.isFinite` if it exists. +* Performance is about the same as v6.0 when the value is a string or number. But it's now 3x-4x faster when the value is not a string or number. + +### 6.0.0 + +* Optimizations, thanks to @benaadams. + +### 5.0.0 + +**Breaking changes** + +* removed support for `instanceof Number` and `instanceof String` + +## Benchmarks + +As with all benchmarks, take these with a grain of salt. See the [benchmarks](./benchmark/index.js) for more detail. + +``` +# all +v7.0 x 413,222 ops/sec ±2.02% (86 runs sampled) +v6.0 x 111,061 ops/sec ±1.29% (85 runs sampled) +parseFloat x 317,596 ops/sec ±1.36% (86 runs sampled) +fastest is 'v7.0' + +# string +v7.0 x 3,054,496 ops/sec ±1.05% (89 runs sampled) +v6.0 x 2,957,781 ops/sec ±0.98% (88 runs sampled) +parseFloat x 3,071,060 ops/sec ±1.13% (88 runs sampled) +fastest is 'parseFloat,v7.0' + +# number +v7.0 x 3,146,895 ops/sec ±0.89% (89 runs sampled) +v6.0 x 3,214,038 ops/sec ±1.07% (89 runs sampled) +parseFloat x 3,077,588 ops/sec ±1.07% (87 runs sampled) +fastest is 'v6.0' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [charlike-old](https://github.com/charlike-old) | +| 1 | [benaadams](https://github.com/benaadams) | +| 1 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 15, 2018._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js new file mode 100644 index 0000000..27f19b7 --- /dev/null +++ b/node_modules/is-number/index.js @@ -0,0 +1,18 @@ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; +}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json new file mode 100644 index 0000000..3715072 --- /dev/null +++ b/node_modules/is-number/package.json @@ -0,0 +1,82 @@ +{ + "name": "is-number", + "description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.", + "version": "7.0.0", + "homepage": "https://github.com/jonschlinkert/is-number", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Olsten Larck (https://i.am.charlike.online)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "jonschlinkert/is-number", + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.12.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "cast", + "check", + "coerce", + "coercion", + "finite", + "integer", + "is", + "isnan", + "is-nan", + "is-num", + "is-number", + "isnumber", + "isfinite", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "parseFloat", + "parseInt", + "test", + "type", + "typeof", + "value" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "is-plain-object", + "is-primitive", + "isobject", + "kind-of" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/jiti/LICENSE b/node_modules/jiti/LICENSE new file mode 100644 index 0000000..e739abc --- /dev/null +++ b/node_modules/jiti/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Pooya Parsa + +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/jiti/README.md b/node_modules/jiti/README.md new file mode 100644 index 0000000..0c9cc6b --- /dev/null +++ b/node_modules/jiti/README.md @@ -0,0 +1,161 @@ +# jiti + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![bundle][bundle-src]][bundle-href] +[![License][license-src]][license-href] + +Runtime Typescript and ESM support for Node.js + +## Features + +- Seamless typescript and ESM syntax support +- Seamless interoperability between ESM and CommonJS +- Synchronous API to replace `require` +- Super slim and zero dependency +- Smart syntax detection to avoid extra transforms +- CommonJS cache integration +- Filesystem transpile hard cache +- V8 compile cache +- Custom resolve alias + +## Usage + +### Programmatic + +```js +const jiti = require("jiti")(__filename); + +jiti("./path/to/file.ts"); +``` + +You can also pass options as second argument: + +```js +const jiti = require("jiti")(__filename, { debug: true }); +``` + +### CLI + +```bash +jiti index.ts +# or npx jiti index.ts +``` + +### Register require hook + +```bash +node -r jiti/register index.ts +``` + +Alternatively, you can register `jiti` as a require hook programmatically: + +```js +const jiti = require("jiti")(); +const unregister = jiti.register(); +``` + +## Options + +### `debug` + +- Type: Boolean +- Default: `false` +- Environment Variable: `JITI_DEBUG` + +Enable debug to see which files are transpiled + +### `cache` + +- Type: Boolean | String +- Default: `true` +- Environment Variable: `JITI_CACHE` + +Use transpile cache + +If set to `true` will use `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/node-jiti` + +### `esmResolve` + +- Type: Boolean | String +- Default: `false` +- Environment Variable: `JITI_ESM_RESOLVE` + +Using esm resolution algorithm to support `import` condition. + +### `transform` + +- Type: Function +- Default: Babel (lazy loaded) + +Transform function. See [src/babel](./src/babel.ts) for more details + +### `sourceMaps` + +- Type: Boolean +- Default `false` +- Environment Variable: `JITI_SOURCE_MAPS` + +Add inline source map to transformed source for better debugging. + +### `interopDefault` + +- Type: Boolean +- Default: `false` + +Return the `.default` export of a module at the top-level. + +### `alias` + +- Type: Object +- Default: - +- Environment Variable: `JITI_ALIAS` + +Custom alias map used to resolve ids. + +### `nativeModules` + +- Type: Array +- Default: ['typescript`] +- Environment Variable: `JITI_NATIVE_MODULES` + +List of modules (within `node_modules`) to always use native require for them. + +### `transformModules` + +- Type: Array +- Default: [] +- Environment Variable: `JITI_TRANSFORM_MODULES` + +List of modules (within `node_modules`) to transform them regardless of syntax. + +### `experimentalBun` + +- Type: Boolean +- Default: Enabled if `process.versions.bun` exists (Bun runtime) +- Environment Variable: `JITI_EXPERIMENTAL_BUN` + +Enable experimental native Bun support for transformations. + +## Development + +- Clone this repository +- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` +- Install dependencies using `pnpm install` +- Run `pnpm dev` +- Run `pnpm jiti ./test/path/to/file.ts` + +## License + +MIT. Made with 💖 + + + +[npm-version-src]: https://img.shields.io/npm/v/jiti?style=flat&colorA=18181B&colorB=F0DB4F +[npm-version-href]: https://npmjs.com/package/jiti +[npm-downloads-src]: https://img.shields.io/npm/dm/jiti?style=flat&colorA=18181B&colorB=F0DB4F +[npm-downloads-href]: https://npmjs.com/package/jiti +[bundle-src]: https://img.shields.io/bundlephobia/minzip/jiti?style=flat&colorA=18181B&colorB=F0DB4F +[bundle-href]: https://bundlephobia.com/result?p=h3 +[license-src]: https://img.shields.io/github/license/unjs/jiti.svg?style=flat&colorA=18181B&colorB=F0DB4F +[license-href]: https://github.com/unjs/jiti/blob/main/LICENSE diff --git a/node_modules/jiti/bin/jiti.js b/node_modules/jiti/bin/jiti.js new file mode 100644 index 0000000..af44c47 --- /dev/null +++ b/node_modules/jiti/bin/jiti.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +const { resolve } = require("path"); + +const script = process.argv.splice(2, 1)[0]; + +if (!script) { + // eslint-disable-next-line no-console + console.error("Usage: jiti [...arguments]"); + process.exit(1); +} + +const pwd = process.cwd(); +const jiti = require("..")(pwd); +const resolved = (process.argv[1] = jiti.resolve(resolve(pwd, script))); +jiti(resolved); diff --git a/node_modules/jiti/dist/babel.d.ts b/node_modules/jiti/dist/babel.d.ts new file mode 100644 index 0000000..ea178d4 --- /dev/null +++ b/node_modules/jiti/dist/babel.d.ts @@ -0,0 +1,2 @@ +import { TransformOptions, TRANSFORM_RESULT } from "./types"; +export default function transform(opts: TransformOptions): TRANSFORM_RESULT; diff --git a/node_modules/jiti/dist/babel.js b/node_modules/jiti/dist/babel.js new file mode 100644 index 0000000..6085148 --- /dev/null +++ b/node_modules/jiti/dist/babel.js @@ -0,0 +1,1885 @@ +(()=>{var __webpack_modules__={"./node_modules/.pnpm/@ampproject+remapping@2.2.1/node_modules/@ampproject/remapping/dist/remapping.umd.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function(traceMapping,genMapping){"use strict";const SOURCELESS_MAPPING=SegmentObject("",-1,-1,"",null),EMPTY_SOURCES=[];function SegmentObject(source,line,column,name,content){return{source,line,column,name,content}}function Source(map,sources,source,content){return{map,sources,source,content}}function MapSource(map,sources){return Source(map,sources,"",null)}function OriginalSource(source,content){return Source(null,EMPTY_SOURCES,source,content)}function traceMappings(tree){const gen=new genMapping.GenMapping({file:tree.map.file}),{sources:rootSources,map}=tree,rootNames=map.names,rootMappings=traceMapping.decodedMappings(map);for(let i=0;inew traceMapping.TraceMap(m,""))),map=maps.pop();for(let i=0;i1)throw new Error(`Transformation map ${i} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let tree=build(map,loader,"",0);for(let i=maps.length-1;i>=0;i--)tree=MapSource(maps[i],[tree]);return tree}function build(map,loader,importer,importerDepth){const{resolvedSources,sourcesContent}=map,depth=importerDepth+1;return MapSource(map,resolvedSources.map(((sourceFile,i)=>{const ctx={importer,depth,source:sourceFile||"",content:void 0},sourceMap=loader(ctx.source,ctx),{source,content}=ctx;return sourceMap?build(new traceMapping.TraceMap(sourceMap,source),loader,source,depth):OriginalSource(source,void 0!==content?content:sourcesContent?sourcesContent[i]:null)})))}class SourceMap{constructor(map,options){const out=options.decodedMappings?genMapping.toDecodedMap(map):genMapping.toEncodedMap(map);this.version=out.version,this.file=out.file,this.mappings=out.mappings,this.names=out.names,this.sourceRoot=out.sourceRoot,this.sources=out.sources,options.excludeContent||(this.sourcesContent=out.sourcesContent)}toString(){return JSON.stringify(this)}}function remapping(input,loader,options){const opts="object"==typeof options?options:{excludeContent:!!options,decodedMappings:!1},tree=buildSourceMapTree(input,loader);return new SourceMap(traceMappings(tree),opts)}return remapping}(__webpack_require__("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.19/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"))},"./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/config/files lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/config/files lazy recursive",module.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/config/files sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/config/files sync recursive",module.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.22.15/node_modules/@babel/plugin-syntax-class-properties/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.22.5/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-class-properties",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("classProperties","classPrivateProperties","classPrivateMethods")}})));exports.default=_default},"./node_modules/.pnpm/@babel+plugin-syntax-export-namespace-from@7.8.3_@babel+core@7.22.15/node_modules/@babel/plugin-syntax-export-namespace-from/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.Z=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.22.5/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-export-namespace-from",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("exportNamespaceFrom")}})));exports.Z=_default},"./node_modules/.pnpm/@babel+plugin-syntax-nullish-coalescing-operator@7.8.3_@babel+core@7.22.15/node_modules/@babel/plugin-syntax-nullish-coalescing-operator/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.Z=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.22.5/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-nullish-coalescing-operator",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("nullishCoalescingOperator")}})));exports.Z=_default},"./node_modules/.pnpm/@babel+plugin-syntax-optional-chaining@7.8.3_@babel+core@7.22.15/node_modules/@babel/plugin-syntax-optional-chaining/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.Z=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.22.5/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-optional-chaining",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("optionalChaining")}})));exports.Z=_default},"./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js":function(__unused_webpack_module,exports,__webpack_require__){!function(exports,setArray,sourcemapCodec,traceMapping){"use strict";const COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,NO_NAME=-1;let addSegmentInternal;exports.addSegment=void 0,exports.addMapping=void 0,exports.maybeAddSegment=void 0,exports.maybeAddMapping=void 0,exports.setSourceContent=void 0,exports.toDecodedMap=void 0,exports.toEncodedMap=void 0,exports.fromMap=void 0,exports.allMappings=void 0;class GenMapping{constructor({file,sourceRoot}={}){this._names=new setArray.SetArray,this._sources=new setArray.SetArray,this._sourcesContent=[],this._mappings=[],this.file=file,this.sourceRoot=sourceRoot}}function getLine(mappings,index){for(let i=mappings.length;i<=index;i++)mappings[i]=[];return mappings[index]}function getColumnIndex(line,genColumn){let index=line.length;for(let i=index-1;i>=0&&!(genColumn>=line[i][COLUMN]);index=i--);return index}function insert(array,index,value){for(let i=array.length;i>index;i--)array[i]=array[i-1];array[index]=value}function removeEmptyFinalLines(mappings){const{length}=mappings;let len=length;for(let i=len-1;i>=0&&!(mappings[i].length>0);len=i,i--);lenaddSegmentInternal(!1,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content),exports.maybeAddSegment=(map,genLine,genColumn,source,sourceLine,sourceColumn,name,content)=>addSegmentInternal(!0,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content),exports.addMapping=(map,mapping)=>addMappingInternal(!1,map,mapping),exports.maybeAddMapping=(map,mapping)=>addMappingInternal(!0,map,mapping),exports.setSourceContent=(map,source,content)=>{const{_sources:sources,_sourcesContent:sourcesContent}=map;sourcesContent[setArray.put(sources,source)]=content},exports.toDecodedMap=map=>{const{file,sourceRoot,_mappings:mappings,_sources:sources,_sourcesContent:sourcesContent,_names:names}=map;return removeEmptyFinalLines(mappings),{version:3,file:file||void 0,names:names.array,sourceRoot:sourceRoot||void 0,sources:sources.array,sourcesContent,mappings}},exports.toEncodedMap=map=>{const decoded=exports.toDecodedMap(map);return Object.assign(Object.assign({},decoded),{mappings:sourcemapCodec.encode(decoded.mappings)})},exports.allMappings=map=>{const out=[],{_mappings:mappings,_sources:sources,_names:names}=map;for(let i=0;i{const map=new traceMapping.TraceMap(input),gen=new GenMapping({file:map.file,sourceRoot:map.sourceRoot});return putAll(gen._names,map.names),putAll(gen._sources,map.sources),gen._sourcesContent=map.sourcesContent||map.sources.map((()=>null)),gen._mappings=traceMapping.decodedMappings(map),gen},addSegmentInternal=(skipable,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content)=>{const{_mappings:mappings,_sources:sources,_sourcesContent:sourcesContent,_names:names}=map,line=getLine(mappings,genLine),index=getColumnIndex(line,genColumn);if(!source){if(skipable&&skipSourceless(line,index))return;return insert(line,index,[genColumn])}const sourcesIndex=setArray.put(sources,source),namesIndex=name?setArray.put(names,name):NO_NAME;if(sourcesIndex===sourcesContent.length&&(sourcesContent[sourcesIndex]=null!=content?content:null),!skipable||!skipSource(line,index,sourcesIndex,sourceLine,sourceColumn,namesIndex))return insert(line,index,name?[genColumn,sourcesIndex,sourceLine,sourceColumn,namesIndex]:[genColumn,sourcesIndex,sourceLine,sourceColumn])},exports.GenMapping=GenMapping,Object.defineProperty(exports,"__esModule",{value:!0})}(exports,__webpack_require__("./node_modules/.pnpm/@jridgewell+set-array@1.1.2/node_modules/@jridgewell/set-array/dist/set-array.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.15/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.19/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"))},"./node_modules/.pnpm/@jridgewell+resolve-uri@3.1.1/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js":function(module){module.exports=function(){"use strict";const schemeRegex=/^[\w+.-]+:\/\//,urlRegex=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,fileRegex=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;var UrlType;function isAbsoluteUrl(input){return schemeRegex.test(input)}function isSchemeRelativeUrl(input){return input.startsWith("//")}function isAbsolutePath(input){return input.startsWith("/")}function isFileUrl(input){return input.startsWith("file:")}function isRelative(input){return/^[.?#]/.test(input)}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||"",match[3],match[4]||"",match[5]||"/",match[6]||"",match[7]||"")}function parseFileUrl(input){const match=fileRegex.exec(input),path=match[2];return makeUrl("file:","",match[1]||"","",isAbsolutePath(path)?path:"/"+path,match[3]||"",match[4]||"")}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType.Absolute}}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl("http:"+input);return url.scheme="",url.type=UrlType.SchemeRelative,url}if(isAbsolutePath(input)){const url=parseAbsoluteUrl("http://foo.com"+input);return url.scheme="",url.host="",url.type=UrlType.AbsolutePath,url}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl("http://foo.com/"+input);return url.scheme="",url.host="",url.type=input?input.startsWith("?")?UrlType.Query:input.startsWith("#")?UrlType.Hash:UrlType.RelativePath:UrlType.Empty,url}function stripPathFilename(path){if(path.endsWith("/.."))return path;const index=path.lastIndexOf("/");return path.slice(0,index+1)}function mergePaths(url,base){normalizePath(base,base.type),"/"===url.path?url.path=base.path:url.path=stripPathFilename(base.path)+url.path}function normalizePath(url,type){const rel=type<=UrlType.RelativePath,pieces=url.path.split("/");let pointer=1,positive=0,addTrailingSlash=!1;for(let i=1;iinputType&&(inputType=baseType)}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){case UrlType.Hash:case UrlType.Query:return queryHash;case UrlType.RelativePath:{const path=url.path.slice(1);return path?isRelative(base||input)&&!isRelative(path)?"./"+path+queryHash:path+queryHash:queryHash||"."}case UrlType.AbsolutePath:return url.path+queryHash;default:return url.scheme+"//"+url.user+url.host+url.port+url.path+queryHash}}return function(UrlType){UrlType[UrlType.Empty=1]="Empty",UrlType[UrlType.Hash=2]="Hash",UrlType[UrlType.Query=3]="Query",UrlType[UrlType.RelativePath=4]="RelativePath",UrlType[UrlType.AbsolutePath=5]="AbsolutePath",UrlType[UrlType.SchemeRelative=6]="SchemeRelative",UrlType[UrlType.Absolute=7]="Absolute"}(UrlType||(UrlType={})),resolve}()},"./node_modules/.pnpm/@jridgewell+set-array@1.1.2/node_modules/@jridgewell/set-array/dist/set-array.umd.js":function(__unused_webpack_module,exports){!function(exports){"use strict";exports.get=void 0,exports.put=void 0,exports.pop=void 0;class SetArray{constructor(){this._indexes={__proto__:null},this.array=[]}}exports.get=(strarr,key)=>strarr._indexes[key],exports.put=(strarr,key)=>{const index=exports.get(strarr,key);if(void 0!==index)return index;const{array,_indexes:indexes}=strarr;return indexes[key]=array.push(key)-1},exports.pop=strarr=>{const{array,_indexes:indexes}=strarr;0!==array.length&&(indexes[array.pop()]=void 0)},exports.SetArray=SetArray,Object.defineProperty(exports,"__esModule",{value:!0})}(exports)},"./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.15/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js":function(__unused_webpack_module,exports){!function(exports){"use strict";const comma=",".charCodeAt(0),semicolon=";".charCodeAt(0),chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",intToChar=new Uint8Array(64),charToInt=new Uint8Array(128);for(let i=0;iBuffer.from(buf.buffer,buf.byteOffset,buf.byteLength).toString()}:{decode(buf){let out="";for(let i=0;i>>=1,shouldNegate&&(value=-2147483648|-value),state[j]+=value,pos}function hasMoreVlq(mappings,i,length){return!(i>=length)&&mappings.charCodeAt(i)!==comma}function sort(line){line.sort(sortComparator)}function sortComparator(a,b){return a[0]-b[0]}function encode(decoded){const state=new Int32Array(5),bufLength=16384,subLength=bufLength-36,buf=new Uint8Array(bufLength),sub=buf.subarray(0,subLength);let pos=0,out="";for(let i=0;i0&&(pos===bufLength&&(out+=td.decode(buf),pos=0),buf[pos++]=semicolon),0!==line.length){state[0]=0;for(let j=0;jsubLength&&(out+=td.decode(sub),buf.copyWithin(0,subLength,pos),pos-=subLength),j>0&&(buf[pos++]=comma),pos=encodeInteger(buf,pos,state,segment,0),1!==segment.length&&(pos=encodeInteger(buf,pos,state,segment,1),pos=encodeInteger(buf,pos,state,segment,2),pos=encodeInteger(buf,pos,state,segment,3),4!==segment.length&&(pos=encodeInteger(buf,pos,state,segment,4)))}}}return out+td.decode(buf.subarray(0,pos))}function encodeInteger(buf,pos,state,segment,j){const next=segment[j];let num=next-state[j];state[j]=next,num=num<0?-num<<1|1:num<<1;do{let clamped=31#num>>>=5,num>0&&(clamped|=32),buf[pos++]=intToChar[clamped]}while(num>0);return pos}exports.decode=decode,exports.encode=encode,Object.defineProperty(exports,"__esModule",{value:!0})}(exports)},"./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.19/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js":function(__unused_webpack_module,exports,__webpack_require__){!function(exports,sourcemapCodec,resolveUri){"use strict";function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var resolveUri__default=_interopDefaultLegacy(resolveUri);function resolve(input,base){return base&&!base.endsWith("/")&&(base+="/"),resolveUri__default.default(input,base)}function stripFilename(path){if(!path)return"";const index=path.lastIndexOf("/");return path.slice(0,index+1)}const COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,REV_GENERATED_LINE=1,REV_GENERATED_COLUMN=2;function maybeSort(mappings,owned){const unsortedIndex=nextUnsortedSegmentLine(mappings,0);if(unsortedIndex===mappings.length)return mappings;owned||(mappings=mappings.slice());for(let i=unsortedIndex;i>1),cmp=haystack[mid][COLUMN]-needle;if(0===cmp)return found=!0,mid;cmp<0?low=mid+1:high=mid-1}return found=!1,low-1}function upperBound(haystack,needle,index){for(let i=index+1;i=0&&haystack[i][COLUMN]===needle;index=i--);return index}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function memoizedBinarySearch(haystack,needle,state,key){const{lastKey,lastNeedle,lastIndex}=state;let low=0,high=haystack.length-1;if(key===lastKey){if(needle===lastNeedle)return found=-1!==lastIndex&&haystack[lastIndex][COLUMN]===needle,lastIndex;needle>=lastNeedle?low=-1===lastIndex?0:lastIndex:high=lastIndex}return state.lastKey=key,state.lastNeedle=needle,state.lastIndex=binarySearch(haystack,needle,low,high)}function buildBySources(decoded,memos){const sources=memos.map(buildNullArray);for(let i=0;iindex;i--)array[i]=array[i-1];array[index]=value}function buildNullArray(){return{__proto__:null}}const AnyMap=function(map,mapUrl){const parsed="string"==typeof map?JSON.parse(map):map;if(!("sections"in parsed))return new TraceMap(parsed,mapUrl);const mappings=[],sources=[],sourcesContent=[],names=[];recurse(parsed,mapUrl,mappings,sources,sourcesContent,names,0,0,1/0,1/0);const joined={version:3,file:parsed.file,names,sources,sourcesContent,mappings};return exports.presortedDecodedMap(joined)};function recurse(input,mapUrl,mappings,sources,sourcesContent,names,lineOffset,columnOffset,stopLine,stopColumn){const{sections}=input;for(let i=0;istopLine)return;const out=getLine(mappings,lineI),cOffset=0===i?columnOffset:0,line=decoded[i];for(let j=0;j=stopColumn)return;if(1===seg.length){out.push([column]);continue}const sourcesIndex=sourcesOffset+seg[SOURCES_INDEX],sourceLine=seg[SOURCE_LINE],sourceColumn=seg[SOURCE_COLUMN];out.push(4===seg.length?[column,sourcesIndex,sourceLine,sourceColumn]:[column,sourcesIndex,sourceLine,sourceColumn,namesOffset+seg[NAMES_INDEX]])}}}function append(arr,other){for(let i=0;iresolve(s||"",from)));const{mappings}=parsed;"string"==typeof mappings?(this._encoded=mappings,this._decoded=void 0):(this._encoded=void 0,this._decoded=maybeSort(mappings,isString)),this._decodedMemo=memoizedState(),this._bySources=void 0,this._bySourceMemos=void 0}}function clone(map,mappings){return{version:map.version,file:map.file,names:map.names,sourceRoot:map.sourceRoot,sources:map.sources,sourcesContent:map.sourcesContent,mappings}}function OMapping(source,line,column,name){return{source,line,column,name}}function GMapping(line,column){return{line,column}}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);return found?index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index):bias===LEAST_UPPER_BOUND&&index++,-1===index||index===segments.length?-1:index}function sliceGeneratedPositions(segments,memo,line,column,bias){let min=traceSegmentInternal(segments,memo,line,column,GREATEST_LOWER_BOUND);if(found||bias!==LEAST_UPPER_BOUND||min++,-1===min||min===segments.length)return[];const matchedColumn=found?column:segments[min][COLUMN];found||(min=lowerBound(segments,matchedColumn,min));const max=upperBound(segments,matchedColumn,min),result=[];for(;min<=max;min++){const segment=segments[min];result.push(GMapping(segment[REV_GENERATED_LINE]+1,segment[REV_GENERATED_COLUMN]))}return result}(()=>{function generatedPosition(map,source,line,column,bias,all){if(--line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const{sources,resolvedSources}=map;let sourceIndex=sources.indexOf(source);if(-1===sourceIndex&&(sourceIndex=resolvedSources.indexOf(source)),-1===sourceIndex)return all?[]:GMapping(null,null);const segments=(map._bySources||(map._bySources=buildBySources(exports.decodedMappings(map),map._bySourceMemos=sources.map(memoizedState))))[sourceIndex][line];if(null==segments)return all?[]:GMapping(null,null);const memo=map._bySourceMemos[sourceIndex];if(all)return sliceGeneratedPositions(segments,memo,line,column,bias);const index=traceSegmentInternal(segments,memo,line,column,bias);if(-1===index)return GMapping(null,null);const segment=segments[index];return GMapping(segment[REV_GENERATED_LINE]+1,segment[REV_GENERATED_COLUMN])}exports.encodedMappings=map=>{var _a;return null!==(_a=map._encoded)&&void 0!==_a?_a:map._encoded=sourcemapCodec.encode(map._decoded)},exports.decodedMappings=map=>map._decoded||(map._decoded=sourcemapCodec.decode(map._encoded)),exports.traceSegment=(map,line,column)=>{const decoded=exports.decodedMappings(map);if(line>=decoded.length)return null;const segments=decoded[line],index=traceSegmentInternal(segments,map._decodedMemo,line,column,GREATEST_LOWER_BOUND);return-1===index?null:segments[index]},exports.originalPositionFor=(map,{line,column,bias})=>{if(--line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=exports.decodedMappings(map);if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line],index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(-1===index)return OMapping(null,null,null,null);const segment=segments[index];if(1===segment.length)return OMapping(null,null,null,null);const{names,resolvedSources}=map;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],5===segment.length?names[segment[NAMES_INDEX]]:null)},exports.allGeneratedPositionsFor=(map,{source,line,column,bias})=>generatedPosition(map,source,line,column,bias||LEAST_UPPER_BOUND,!0),exports.generatedPositionFor=(map,{source,line,column,bias})=>generatedPosition(map,source,line,column,bias||GREATEST_LOWER_BOUND,!1),exports.eachMapping=(map,cb)=>{const decoded=exports.decodedMappings(map),{names,resolvedSources}=map;for(let i=0;i{const{sources,resolvedSources,sourcesContent}=map;if(null==sourcesContent)return null;let index=sources.indexOf(source);return-1===index&&(index=resolvedSources.indexOf(source)),-1===index?null:sourcesContent[index]},exports.presortedDecodedMap=(map,mapUrl)=>{const tracer=new TraceMap(clone(map,[]),mapUrl);return tracer._decoded=map.mappings,tracer},exports.decodedMap=map=>clone(map,exports.decodedMappings(map)),exports.encodedMap=map=>clone(map,exports.encodedMappings(map))})(),exports.AnyMap=AnyMap,exports.GREATEST_LOWER_BOUND=GREATEST_LOWER_BOUND,exports.LEAST_UPPER_BOUND=LEAST_UPPER_BOUND,exports.TraceMap=TraceMap,Object.defineProperty(exports,"__esModule",{value:!0})}(exports,__webpack_require__("./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.4.15/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+resolve-uri@3.1.1/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"))},"./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/index.js":(module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(api){var transformImport=(0,_utils.createDynamicImportTransform)(api);return{manipulateOptions:function(opts,parserOpts){parserOpts.plugins.push("dynamicImport")},visitor:{Import:function(path){transformImport(this,path)}}}};var _utils=__webpack_require__("./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/utils.js");module.exports=exports.default},"./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/utils.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function getImportSource(t,callNode){var importArguments=callNode.arguments,importPath=_slicedToArray(importArguments,1)[0];return t.isStringLiteral(importPath)||t.isTemplateLiteral(importPath)?(t.removeComments(importPath),importPath):t.templateLiteral([t.templateElement({raw:"",cooked:""}),t.templateElement({raw:"",cooked:""},!0)],importArguments)}exports.getImportSource=getImportSource,exports.createDynamicImportTransform=function(_ref){var template=_ref.template,t=_ref.types,builders={static:{interop:template("Promise.resolve().then(() => INTEROP(require(SOURCE)))"),noInterop:template("Promise.resolve().then(() => require(SOURCE))")},dynamic:{interop:template("Promise.resolve(SOURCE).then(s => INTEROP(require(s)))"),noInterop:template("Promise.resolve(SOURCE).then(s => require(s))")}},visited="function"==typeof WeakSet&&new WeakSet;return function(context,path){if(visited){if(visited.has(path))return;visited.add(path)}var node,SOURCE=getImportSource(t,path.parent),builder=(node=SOURCE,t.isStringLiteral(node)||t.isTemplateLiteral(node)&&0===node.expressions.length?builders.static:builders.dynamic),newImport=context.opts.noInterop?builder.noInterop({SOURCE}):builder.interop({SOURCE,INTEROP:context.addHelper("interopRequireWildcard")});path.parentPath.replaceWith(newImport)}}},"./node_modules/.pnpm/babel-plugin-parameter-decorator@1.0.16/node_modules/babel-plugin-parameter-decorator/lib/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";var _path=__webpack_require__("path");function isInType(path){switch(path.parent.type){case"TSTypeReference":case"TSQualifiedName":case"TSExpressionWithTypeArguments":case"TSTypeQuery":return!0;default:return!1}}module.exports=function(_ref){var types=_ref.types,decoratorExpressionForConstructor=function(decorator,param){return function(className){var resultantDecorator=types.callExpression(decorator.expression,[types.Identifier(className),types.Identifier("undefined"),types.NumericLiteral(param.key)]),resultantDecoratorWithFallback=types.logicalExpression("||",resultantDecorator,types.Identifier(className)),assignment=types.assignmentExpression("=",types.Identifier(className),resultantDecoratorWithFallback);return types.expressionStatement(assignment)}},decoratorExpressionForMethod=function(decorator,param){return function(className,functionName){var resultantDecorator=types.callExpression(decorator.expression,[types.Identifier("".concat(className,".prototype")),types.StringLiteral(functionName),types.NumericLiteral(param.key)]);return types.expressionStatement(resultantDecorator)}};return{visitor:{Program:function(path,state){var extension=(0,_path.extname)(state.file.opts.filename);".ts"!==extension&&".tsx"!==extension||function(){var decorators=Object.create(null);path.node.body.filter((function(it){var type=it.type,declaration=it.declaration;switch(type){case"ClassDeclaration":return!0;case"ExportNamedDeclaration":case"ExportDefaultDeclaration":return declaration&&"ClassDeclaration"===declaration.type;default:return!1}})).map((function(it){return"ClassDeclaration"===it.type?it:it.declaration})).forEach((function(clazz){clazz.body.body.forEach((function(body){(body.params||[]).forEach((function(param){(param.decorators||[]).forEach((function(decorator){decorator.expression.callee?decorators[decorator.expression.callee.name]=decorator:decorators[decorator.expression.name]=decorator}))}))}))}));var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=path.get("body")[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var stmt=_step.value;if("ImportDeclaration"===stmt.node.type){if(0===stmt.node.specifiers.length)continue;var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_loop=function(){var specifier=_step2.value,binding=stmt.scope.getBinding(specifier.local.name);binding.referencePaths.length?binding.referencePaths.reduce((function(prev,next){return prev||isInType(next)}),!1)&&Object.keys(decorators).forEach((function(k){var decorator=decorators[k];(decorator.expression.arguments||[]).forEach((function(arg){arg.name===specifier.local.name&&binding.referencePaths.push({parent:decorator.expression})}))})):decorators[specifier.local.name]&&binding.referencePaths.push({parent:decorators[specifier.local.name]})},_iterator2=stmt.node.specifiers[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)_loop()}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}}()},Function:function(path){var functionName="";path.node.id?functionName=path.node.id.name:path.node.key&&(functionName=path.node.key.name),(path.get("params")||[]).slice().forEach((function(param){var decorators=param.node.decorators||[],transformable=decorators.length;if(decorators.slice().forEach((function(decorator){if("ClassMethod"===path.type){var classIdentifier,parentNode=path.parentPath.parentPath,classDeclaration=path.findParent((function(p){return"ClassDeclaration"===p.type}));if(classDeclaration?classIdentifier=classDeclaration.node.id.name:(parentNode.insertAfter(null),classIdentifier=function(path){var assignment=path.findParent((function(p){return"AssignmentExpression"===p.node.type}));return"SequenceExpression"===assignment.node.right.type?assignment.node.right.expressions[1].name:"ClassExpression"===assignment.node.right.type?assignment.node.left.name:null}(path)),"constructor"===functionName){var expression=decoratorExpressionForConstructor(decorator,param)(classIdentifier);parentNode.insertAfter(expression)}else{var _expression=decoratorExpressionForMethod(decorator,param)(classIdentifier,functionName);parentNode.insertAfter(_expression)}}else{var className=path.findParent((function(p){return"VariableDeclarator"===p.node.type})).node.id.name;if(functionName===className){var _expression2=decoratorExpressionForConstructor(decorator,param)(className);if("body"===path.parentKey)path.insertAfter(_expression2);else path.findParent((function(p){return"body"===p.parentKey})).insertAfter(_expression2)}else{var classParent=path.findParent((function(p){return"CallExpression"===p.node.type})),_expression3=decoratorExpressionForMethod(decorator,param)(className,functionName);classParent.insertAfter(_expression3)}}})),transformable){var replacement=function(path){switch(path.node.type){case"ObjectPattern":return types.ObjectPattern(path.node.properties);case"AssignmentPattern":return types.AssignmentPattern(path.node.left,path.node.right);case"TSParameterProperty":return types.Identifier(path.node.parameter.name);default:return types.Identifier(path.node.name)}}(param);param.replaceWith(replacement)}}))}}}}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/metadataVisitor.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.metadataVisitor=function(classPath,path){const field=path.node,classNode=classPath.node;switch(field.type){case"ClassMethod":const decorators="constructor"===field.kind?classNode.decorators:field.decorators;if(!decorators||0===decorators.length)return;decorators.push(createMetadataDesignDecorator("design:type",_core.types.identifier("Function"))),decorators.push(createMetadataDesignDecorator("design:paramtypes",_core.types.arrayExpression(field.params.map((param=>(0,_serializeType.serializeType)(classPath,param))))));break;case"ClassProperty":if(!field.decorators||0===field.decorators.length)return;if(!field.typeAnnotation||"TSTypeAnnotation"!==field.typeAnnotation.type)return;field.decorators.push(createMetadataDesignDecorator("design:type",(0,_serializeType.serializeType)(classPath,field)))}};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/index.js"),_serializeType=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/serializeType.js");function createMetadataDesignDecorator(design,typeArg){return _core.types.decorator(_core.types.callExpression(_core.types.memberExpression(_core.types.identifier("Reflect"),_core.types.identifier("metadata")),[_core.types.stringLiteral(design),typeArg]))}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/serializeType.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serializeType=function(classPath,param){const node=getTypedNode(param);if(null==node)return createVoidZero();if(!node.typeAnnotation||"TSTypeAnnotation"!==node.typeAnnotation.type)return createVoidZero();const annotation=node.typeAnnotation.typeAnnotation;return serializeTypeNode(classPath.node.id?classPath.node.id.name:"",annotation)},exports.isClassType=isClassType;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/index.js");function createVoidZero(){return _core.types.unaryExpression("void",_core.types.numericLiteral(0))}function getTypedNode(param){return null==param?null:"ClassProperty"===param.type||"Identifier"===param.type||"ObjectPattern"===param.type?param:"AssignmentPattern"===param.type&&"Identifier"===param.left.type?param.left:"TSParameterProperty"===param.type?getTypedNode(param.parameter):null}function serializeTypeReferenceNode(className,node){const reference=serializeReference(node.typeName);return isClassType(className,reference)?_core.types.identifier("Object"):_core.types.conditionalExpression(_core.types.binaryExpression("===",_core.types.unaryExpression("typeof",reference),_core.types.stringLiteral("undefined")),_core.types.identifier("Object"),_core.types.cloneDeep(reference))}function isClassType(className,node){switch(node.type){case"Identifier":return node.name===className;case"MemberExpression":return isClassType(className,node.object);default:throw new Error(`The property expression at ${node.start} is not valid as a Type to be used in Reflect.metadata`)}}function serializeReference(typeName){return"Identifier"===typeName.type?_core.types.identifier(typeName.name):_core.types.memberExpression(serializeReference(typeName.left),typeName.right)}function serializeTypeNode(className,node){if(void 0===node)return _core.types.identifier("Object");switch(node.type){case"TSVoidKeyword":case"TSUndefinedKeyword":case"TSNullKeyword":case"TSNeverKeyword":return createVoidZero();case"TSParenthesizedType":return serializeTypeNode(className,node.typeAnnotation);case"TSFunctionType":case"TSConstructorType":return _core.types.identifier("Function");case"TSArrayType":case"TSTupleType":return _core.types.identifier("Array");case"TSTypePredicate":case"TSBooleanKeyword":return _core.types.identifier("Boolean");case"TSStringKeyword":return _core.types.identifier("String");case"TSObjectKeyword":return _core.types.identifier("Object");case"TSLiteralType":switch(node.literal.type){case"StringLiteral":return _core.types.identifier("String");case"NumericLiteral":return _core.types.identifier("Number");case"BooleanLiteral":return _core.types.identifier("Boolean");default:throw new Error("Bad type for decorator"+node.literal)}case"TSNumberKeyword":case"TSBigIntKeyword":return _core.types.identifier("Number");case"TSSymbolKeyword":return _core.types.identifier("Symbol");case"TSTypeReference":return serializeTypeReferenceNode(className,node);case"TSIntersectionType":case"TSUnionType":return serializeTypeList(className,node.types);case"TSConditionalType":return serializeTypeList(className,[node.trueType,node.falseType]);case"TSTypeQuery":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSTypeLiteral":case"TSAnyKeyword":case"TSUnknownKeyword":case"TSThisType":break;default:throw new Error("Bad type for decorator")}return _core.types.identifier("Object")}function serializeTypeList(className,types){let serializedUnion;for(let typeNode of types){for(;"TSParenthesizedType"===typeNode.type;)typeNode=typeNode.typeAnnotation;if("TSNeverKeyword"===typeNode.type)continue;if("TSNullKeyword"===typeNode.type||"TSUndefinedKeyword"===typeNode.type)continue;const serializedIndividual=serializeTypeNode(className,typeNode);if(_core.types.isIdentifier(serializedIndividual)&&"Object"===serializedIndividual.name)return serializedIndividual;if(serializedUnion){if(!_core.types.isIdentifier(serializedUnion)||!_core.types.isIdentifier(serializedIndividual)||serializedUnion.name!==serializedIndividual.name)return _core.types.identifier("Object")}else serializedUnion=serializedIndividual}return serializedUnion||createVoidZero()}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/parameter/parameterVisitor.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parameterVisitor=function(classPath,path){if("ClassMethod"!==path.type)return;if("ClassMethod"!==path.node.type)return;if("Identifier"!==path.node.key.type)return;const methodPath=path;(methodPath.get("params")||[]).slice().forEach((function(param){let resultantDecorator;null!=("Identifier"===param.node.type||"ObjectPattern"===param.node.type?param.node:"TSParameterProperty"===param.node.type&&"Identifier"===param.node.parameter.type?param.node.parameter:null)&&((param.node.decorators||[]).slice().forEach((function(decorator){"constructor"===methodPath.node.kind?(resultantDecorator=createParamDecorator(param.key,decorator.expression,!0),classPath.node.decorators||(classPath.node.decorators=[]),classPath.node.decorators.push(resultantDecorator)):(resultantDecorator=createParamDecorator(param.key,decorator.expression,!1),methodPath.node.decorators||(methodPath.node.decorators=[]),methodPath.node.decorators.push(resultantDecorator))})),resultantDecorator&&(param.node.decorators=null))}))};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.22.15/node_modules/@babel/core/lib/index.js");function createParamDecorator(paramIndex,decoratorExpression,isConstructor=!1){return _core.types.decorator(_core.types.functionExpression(null,[_core.types.identifier("target"),_core.types.identifier("key")],_core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(decoratorExpression,[_core.types.identifier("target"),_core.types.identifier(isConstructor?"undefined":"key"),_core.types.numericLiteral(paramIndex)]))])))}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/plugin.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.22.5/node_modules/@babel/helper-plugin-utils/lib/index.js"),_parameterVisitor=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/parameter/parameterVisitor.js"),_metadataVisitor=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.22.15/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/metadataVisitor.js"),_default=(0,_helperPluginUtils.declare)((api=>(api.assertVersion(7),{visitor:{Program(programPath){programPath.traverse({ClassDeclaration(path){for(const field of path.get("body").get("body"))"ClassMethod"!==field.type&&"ClassProperty"!==field.type||((0,_parameterVisitor.parameterVisitor)(path,field),(0,_metadataVisitor.metadataVisitor)(path,field));path.parentPath.scope.crawl()}})}}})));exports.default=_default},"./node_modules/.pnpm/convert-source-map@1.9.0/node_modules/convert-source-map/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";var decodeBase64,fs=__webpack_require__("fs"),path=__webpack_require__("path");function Converter(sm,opts){(opts=opts||{}).isFileComment&&(sm=function(sm,dir){var r=exports.mapFileCommentRegex.exec(sm),filename=r[1]||r[2],filepath=path.resolve(dir,filename);try{return fs.readFileSync(filepath,"utf8")}catch(e){throw new Error("An error occurred while trying to read the map file at "+filepath+"\n"+e)}}(sm,opts.commentFileDir)),opts.hasComment&&(sm=function(sm){return sm.split(",").pop()}(sm)),opts.isEncoded&&(sm=decodeBase64(sm)),(opts.isJSON||opts.isEncoded)&&(sm=JSON.parse(sm)),this.sourcemap=sm}Object.defineProperty(exports,"commentRegex",{get:function(){return/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/gm}}),Object.defineProperty(exports,"mapFileCommentRegex",{get:function(){return/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm}}),decodeBase64="undefined"!=typeof Buffer?"function"==typeof Buffer.from?function(base64){return Buffer.from(base64,"base64").toString()}:function(base64){if("number"==typeof value)throw new TypeError("The value to decode must not be of type number.");return new Buffer(base64,"base64").toString()}:function(base64){return decodeURIComponent(escape(atob(base64)))},Converter.prototype.toJSON=function(space){return JSON.stringify(this.sourcemap,null,space)},"undefined"!=typeof Buffer?"function"==typeof Buffer.from?Converter.prototype.toBase64=function(){var json=this.toJSON();return Buffer.from(json,"utf8").toString("base64")}:Converter.prototype.toBase64=function(){var json=this.toJSON();if("number"==typeof json)throw new TypeError("The json to encode must not be of type number.");return new Buffer(json,"utf8").toString("base64")}:Converter.prototype.toBase64=function(){var json=this.toJSON();return btoa(unescape(encodeURIComponent(json)))},Converter.prototype.toComment=function(options){var data="sourceMappingURL=data:application/json;charset=utf-8;base64,"+this.toBase64();return options&&options.multiline?"/*# "+data+" */":"//# "+data},Converter.prototype.toObject=function(){return JSON.parse(this.toJSON())},Converter.prototype.addProperty=function(key,value){if(this.sourcemap.hasOwnProperty(key))throw new Error('property "'+key+'" already exists on the sourcemap, use set property instead');return this.setProperty(key,value)},Converter.prototype.setProperty=function(key,value){return this.sourcemap[key]=value,this},Converter.prototype.getProperty=function(key){return this.sourcemap[key]},exports.fromObject=function(obj){return new Converter(obj)},exports.fromJSON=function(json){return new Converter(json,{isJSON:!0})},exports.fromBase64=function(base64){return new Converter(base64,{isEncoded:!0})},exports.fromComment=function(comment){return new Converter(comment=comment.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),{isEncoded:!0,hasComment:!0})},exports.fromMapFileComment=function(comment,dir){return new Converter(comment,{commentFileDir:dir,isFileComment:!0,isJSON:!0})},exports.fromSource=function(content){var m=content.match(exports.commentRegex);return m?exports.fromComment(m.pop()):null},exports.fromMapFileSource=function(content,dir){var m=content.match(exports.mapFileCommentRegex);return m?exports.fromMapFileComment(m.pop(),dir):null},exports.removeComments=function(src){return src.replace(exports.commentRegex,"")},exports.removeMapFileComments=function(src){return src.replace(exports.mapFileCommentRegex,"")},exports.generateMapFileComment=function(file,options){var data="sourceMappingURL="+file;return options&&options.multiline?"/*# "+data+" */":"//# "+data}},"./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js":(module,exports,__webpack_require__)=>{exports.formatArgs=function(args){if(args[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+args[0]+(this.useColors?"%c ":" ")+"+"+module.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;args.splice(1,0,c,"color: inherit");let index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,(match=>{"%%"!==match&&(index++,"%c"===match&&(lastC=index))})),args.splice(lastC,0,c)},exports.save=function(namespaces){try{namespaces?exports.storage.setItem("debug",namespaces):exports.storage.removeItem("debug")}catch(error){}},exports.load=function(){let r;try{r=exports.storage.getItem("debug")}catch(error){}!r&&"undefined"!=typeof process&&"env"in process&&(r=process.env.DEBUG);return r},exports.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},exports.storage=function(){try{return localStorage}catch(error){}}(),exports.destroy=(()=>{let warned=!1;return()=>{warned||(warned=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),exports.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],exports.log=console.debug||console.log||(()=>{}),module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js")(exports);const{formatters}=module.exports;formatters.j=function(v){try{return JSON.stringify(v)}catch(error){return"[UnexpectedJSONParseError]: "+error.message}}},"./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=function(env){function createDebug(namespace){let prevTime,namespacesCache,enabledCache,enableOverride=null;function debug(...args){if(!debug.enabled)return;const self=debug,curr=Number(new Date),ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr,args[0]=createDebug.coerce(args[0]),"string"!=typeof args[0]&&args.unshift("%O");let index=0;args[0]=args[0].replace(/%([a-zA-Z%])/g,((match,format)=>{if("%%"===match)return"%";index++;const formatter=createDebug.formatters[format];if("function"==typeof formatter){const val=args[index];match=formatter.call(self,val),args.splice(index,1),index--}return match})),createDebug.formatArgs.call(self,args);(self.log||createDebug.log).apply(self,args)}return debug.namespace=namespace,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(namespace),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==enableOverride?enableOverride:(namespacesCache!==createDebug.namespaces&&(namespacesCache=createDebug.namespaces,enabledCache=createDebug.enabled(namespace)),enabledCache),set:v=>{enableOverride=v}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(namespace,delimiter){const newDebug=createDebug(this.namespace+(void 0===delimiter?":":delimiter)+namespace);return newDebug.log=this.log,newDebug}function toNamespace(regexp){return regexp.toString().substring(2,regexp.toString().length-2).replace(/\.\*\?$/,"*")}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function(val){if(val instanceof Error)return val.stack||val.message;return val},createDebug.disable=function(){const namespaces=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((namespace=>"-"+namespace))].join(",");return createDebug.enable(""),namespaces},createDebug.enable=function(namespaces){let i;createDebug.save(namespaces),createDebug.namespaces=namespaces,createDebug.names=[],createDebug.skips=[];const split=("string"==typeof namespaces?namespaces:"").split(/[\s,]+/),len=split.length;for(i=0;i{createDebug[key]=env[key]})),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function(namespace){let hash=0;for(let i=0;i{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"):module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js")},"./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js":(module,exports,__webpack_require__)=>{const tty=__webpack_require__("tty"),util=__webpack_require__("util");exports.init=function(debug){debug.inspectOpts={};const keys=Object.keys(exports.inspectOpts);for(let i=0;i{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),exports.colors=[6,2,3,4,5,1];try{const supportsColor=__webpack_require__("./node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");supportsColor&&(supportsColor.stderr||supportsColor).level>=2&&(exports.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(error){}exports.inspectOpts=Object.keys(process.env).filter((key=>/^debug_/i.test(key))).reduce(((obj,key)=>{const prop=key.substring(6).toLowerCase().replace(/_([a-z])/g,((_,k)=>k.toUpperCase()));let val=process.env[key];return val=!!/^(yes|on|true|enabled)$/i.test(val)||!/^(no|off|false|disabled)$/i.test(val)&&("null"===val?null:Number(val)),obj[prop]=val,obj}),{}),module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js")(exports);const{formatters}=module.exports;formatters.o=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts).split("\n").map((str=>str.trim())).join(" ")},formatters.O=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts)}},"./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js":module=>{"use strict";const GENSYNC_START=Symbol.for("gensync:v1:start"),GENSYNC_SUSPEND=Symbol.for("gensync:v1:suspend"),GENSYNC_EXPECTED_START="GENSYNC_EXPECTED_START",GENSYNC_EXPECTED_SUSPEND="GENSYNC_EXPECTED_SUSPEND",GENSYNC_OPTIONS_ERROR="GENSYNC_OPTIONS_ERROR";function assertTypeof(type,name,value,allowUndefined){if(typeof value===type||allowUndefined&&void 0===value)return;let msg;throw msg=allowUndefined?`Expected opts.${name} to be either a ${type}, or undefined.`:`Expected opts.${name} to be a ${type}.`,makeError(msg,GENSYNC_OPTIONS_ERROR)}function makeError(msg,code){return Object.assign(new Error(msg),{code})}function buildOperation({name,arity,sync,async}){return setFunctionMetadata(name,arity,(function*(...args){const resume=yield GENSYNC_START;if(!resume){return sync.call(this,args)}let result;try{async.call(this,args,(value=>{result||(result={value},resume())}),(err=>{result||(result={err},resume())}))}catch(err){result={err},resume()}if(yield GENSYNC_SUSPEND,result.hasOwnProperty("err"))throw result.err;return result.value}))}function evaluateSync(gen){let value;for(;!({value}=gen.next()).done;)assertStart(value,gen);return value}function evaluateAsync(gen,resolve,reject){!function step(){try{let value;for(;!({value}=gen.next()).done;){assertStart(value,gen);let sync=!0,didSyncResume=!1;const out=gen.next((()=>{sync?didSyncResume=!0:step()}));if(sync=!1,assertSuspend(out,gen),!didSyncResume)return}return resolve(value)}catch(err){return reject(err)}}()}function assertStart(value,gen){value!==GENSYNC_START&&throwError(gen,makeError(`Got unexpected yielded value in gensync generator: ${JSON.stringify(value)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,GENSYNC_EXPECTED_START))}function assertSuspend({value,done},gen){(done||value!==GENSYNC_SUSPEND)&&throwError(gen,makeError(done?"Unexpected generator completion. If you get this, it is probably a gensync bug.":`Expected GENSYNC_SUSPEND, got ${JSON.stringify(value)}. If you get this, it is probably a gensync bug.`,GENSYNC_EXPECTED_SUSPEND))}function throwError(gen,err){throw gen.throw&&gen.throw(err),err}function setFunctionMetadata(name,arity,fn){if("string"==typeof name){const nameDesc=Object.getOwnPropertyDescriptor(fn,"name");nameDesc&&!nameDesc.configurable||Object.defineProperty(fn,"name",Object.assign(nameDesc||{},{configurable:!0,value:name}))}if("number"==typeof arity){const lengthDesc=Object.getOwnPropertyDescriptor(fn,"length");lengthDesc&&!lengthDesc.configurable||Object.defineProperty(fn,"length",Object.assign(lengthDesc||{},{configurable:!0,value:arity}))}return fn}module.exports=Object.assign((function(optsOrFn){let genFn=optsOrFn;return genFn="function"!=typeof optsOrFn?function({name,arity,sync,async,errback}){if(assertTypeof("string","name",name,!0),assertTypeof("number","arity",arity,!0),assertTypeof("function","sync",sync),assertTypeof("function","async",async,!0),assertTypeof("function","errback",errback,!0),async&&errback)throw makeError("Expected one of either opts.async or opts.errback, but got _both_.",GENSYNC_OPTIONS_ERROR);if("string"!=typeof name){let fnName;errback&&errback.name&&"errback"!==errback.name&&(fnName=errback.name),async&&async.name&&"async"!==async.name&&(fnName=async.name.replace(/Async$/,"")),sync&&sync.name&&"sync"!==sync.name&&(fnName=sync.name.replace(/Sync$/,"")),"string"==typeof fnName&&(name=fnName)}"number"!=typeof arity&&(arity=sync.length);return buildOperation({name,arity,sync:function(args){return sync.apply(this,args)},async:function(args,resolve,reject){async?async.apply(this,args).then(resolve,reject):errback?errback.call(this,...args,((err,value)=>{null==err?resolve(value):reject(err)})):resolve(sync.apply(this,args))}})}(optsOrFn):function(genFn){return setFunctionMetadata(genFn.name,genFn.length,(function(...args){return genFn.apply(this,args)}))}(optsOrFn),Object.assign(genFn,function(genFn){const fns={sync:function(...args){return evaluateSync(genFn.apply(this,args))},async:function(...args){return new Promise(((resolve,reject)=>{evaluateAsync(genFn.apply(this,args),resolve,reject)}))},errback:function(...args){const cb=args.pop();if("function"!=typeof cb)throw makeError("Asynchronous function called without callback","GENSYNC_ERRBACK_NO_CALLBACK");let gen;try{gen=genFn.apply(this,args)}catch(err){return void cb(err)}evaluateAsync(gen,(val=>cb(void 0,val)),(err=>cb(err)))}};return fns}(genFn))}),{all:buildOperation({name:"all",arity:1,sync:function(args){return Array.from(args[0]).map((item=>evaluateSync(item)))},async:function(args,resolve,reject){const items=Array.from(args[0]);if(0===items.length)return void Promise.resolve().then((()=>resolve([])));let count=0;const results=items.map((()=>{}));items.forEach(((item,i)=>{evaluateAsync(item,(val=>{results[i]=val,count+=1,count===results.length&&resolve(results)}),reject)}))}}),race:buildOperation({name:"race",arity:1,sync:function(args){const items=Array.from(args[0]);if(0===items.length)throw makeError("Must race at least 1 item","GENSYNC_RACE_NONEMPTY");return evaluateSync(items[0])},async:function(args,resolve,reject){const items=Array.from(args[0]);if(0===items.length)throw makeError("Must race at least 1 item","GENSYNC_RACE_NONEMPTY");for(const item of items)evaluateAsync(item,resolve,reject)}})})},"./node_modules/.pnpm/globals@11.12.0/node_modules/globals/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/.pnpm/globals@11.12.0/node_modules/globals/globals.json")},"./node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js":module=>{"use strict";module.exports=(flag,argv=process.argv)=>{const prefix=flag.startsWith("-")?"":1===flag.length?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return-1!==position&&(-1===terminatorPosition||position{"use strict";const object={},hasOwnProperty=object.hasOwnProperty,forOwn=(object,callback)=>{for(const key in object)hasOwnProperty.call(object,key)&&callback(key,object[key])},toString=object.toString,isArray=Array.isArray,isBuffer=Buffer.isBuffer,singleEscapes={'"':'\\"',"'":"\\'","\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},regexSingleEscape=/["'\\\b\f\n\r\t]/,regexDigit=/[0-9]/,regexWhitelist=/[ !#-&\(-\[\]-_a-~]/,jsesc=(argument,options)=>{const increaseIndentation=()=>{oldIndent=indent,++options.indentLevel,indent=options.indent.repeat(options.indentLevel)},defaults={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},json=options&&options.json;var destination,source;json&&(defaults.quotes="double",defaults.wrap=!0),destination=defaults,"single"!=(options=(source=options)?(forOwn(source,((key,value)=>{destination[key]=value})),destination):destination).quotes&&"double"!=options.quotes&&"backtick"!=options.quotes&&(options.quotes="single");const quote="double"==options.quotes?'"':"backtick"==options.quotes?"`":"'",compact=options.compact,lowercaseHex=options.lowercaseHex;let indent=options.indent.repeat(options.indentLevel),oldIndent="";const inline1=options.__inline1__,inline2=options.__inline2__,newLine=compact?"":"\n";let result,isEmpty=!0;const useBinNumbers="binary"==options.numbers,useOctNumbers="octal"==options.numbers,useDecNumbers="decimal"==options.numbers,useHexNumbers="hexadecimal"==options.numbers;if(json&&argument&&(value=>"function"==typeof value)(argument.toJSON)&&(argument=argument.toJSON()),!(value=>"string"==typeof value||"[object String]"==toString.call(value))(argument)){if((value=>"[object Map]"==toString.call(value))(argument))return 0==argument.size?"new Map()":(compact||(options.__inline1__=!0,options.__inline2__=!1),"new Map("+jsesc(Array.from(argument),options)+")");if((value=>"[object Set]"==toString.call(value))(argument))return 0==argument.size?"new Set()":"new Set("+jsesc(Array.from(argument),options)+")";if(isBuffer(argument))return 0==argument.length?"Buffer.from([])":"Buffer.from("+jsesc(Array.from(argument),options)+")";if(isArray(argument))return result=[],options.wrap=!0,inline1&&(options.__inline1__=!1,options.__inline2__=!0),inline2||increaseIndentation(),((array,callback)=>{const length=array.length;let index=-1;for(;++index{isEmpty=!1,inline2&&(options.__inline2__=!1),result.push((compact||inline2?"":indent)+jsesc(value,options))})),isEmpty?"[]":inline2?"["+result.join(", ")+"]":"["+newLine+result.join(","+newLine)+newLine+(compact?"":oldIndent)+"]";if(!(value=>"number"==typeof value||"[object Number]"==toString.call(value))(argument))return(value=>"[object Object]"==toString.call(value))(argument)?(result=[],options.wrap=!0,increaseIndentation(),forOwn(argument,((key,value)=>{isEmpty=!1,result.push((compact?"":indent)+jsesc(key,options)+":"+(compact?"":" ")+jsesc(value,options))})),isEmpty?"{}":"{"+newLine+result.join(","+newLine)+newLine+(compact?"":oldIndent)+"}"):json?JSON.stringify(argument)||"null":String(argument);if(json)return JSON.stringify(argument);if(useDecNumbers)return String(argument);if(useHexNumbers){let hexadecimal=argument.toString(16);return lowercaseHex||(hexadecimal=hexadecimal.toUpperCase()),"0x"+hexadecimal}if(useBinNumbers)return"0b"+argument.toString(2);if(useOctNumbers)return"0o"+argument.toString(8)}const string=argument;let index=-1;const length=string.length;for(result="";++index=55296&&first<=56319&&length>index+1){const second=string.charCodeAt(index+1);if(second>=56320&&second<=57343){let hexadecimal=(1024*(first-55296)+second-56320+65536).toString(16);lowercaseHex||(hexadecimal=hexadecimal.toUpperCase()),result+="\\u{"+hexadecimal+"}",++index;continue}}}if(!options.escapeEverything){if(regexWhitelist.test(character)){result+=character;continue}if('"'==character){result+=quote==character?'\\"':character;continue}if("`"==character){result+=quote==character?"\\`":character;continue}if("'"==character){result+=quote==character?"\\'":character;continue}}if("\0"==character&&!json&&!regexDigit.test(string.charAt(index+1))){result+="\\0";continue}if(regexSingleEscape.test(character)){result+=singleEscapes[character];continue}const charCode=character.charCodeAt(0);if(options.minimal&&8232!=charCode&&8233!=charCode){result+=character;continue}let hexadecimal=charCode.toString(16);lowercaseHex||(hexadecimal=hexadecimal.toUpperCase());const longhand=hexadecimal.length>2||json,escaped="\\"+(longhand?"u":"x")+("0000"+hexadecimal).slice(longhand?-4:-2);result+=escaped}return options.wrap&&(result=quote+result+quote),"`"==quote&&(result=result.replace(/\$\{/g,"\\${")),options.isScriptContext?result.replace(/<\/(script|style)/gi,"<\\/$1").replace(/ regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json new file mode 100644 index 0000000..566efdf --- /dev/null +++ b/node_modules/minimatch/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/node_modules/mz/HISTORY.md b/node_modules/mz/HISTORY.md new file mode 100644 index 0000000..6ebee21 --- /dev/null +++ b/node_modules/mz/HISTORY.md @@ -0,0 +1,66 @@ + +2.7.0 / 2017-09-13 +================== + + * feat: support fs.copyFile (#58) + +2.6.0 / 2016-11-22 +================== + + * Added fdatasync to fs api (#46) + +2.5.0 / 2016-11-04 +================== + + * feat: support fs.mkdtemp + +2.4.0 / 2016-03-23 +================== + + * add `fs.truncate()` [#34](https://github.com/normalize/mz/pull/34) + +2.3.1 / 2016-02-01 +================== + + * update `any-promise@v1` + +2.3.0 / 2016-01-30 +================== + + * feat(package): switch to `any-promise` to support more promise engines + +2.2.0 / 2016-01-24 +================== + + * feat(package): add index.js to files + +2.1.0 / 2015-10-15 +================== + + * support for readline library + +2.0.0 / 2015-05-24 +================== + + * support callbacks as well + +1.2.0 / 2014-12-16 +================== + + * refactor promisification to `thenify` and `thenify-all` + +1.1.0 / 2014-11-14 +================== + + * use `graceful-fs` if available + +1.0.1 / 2014-08-18 +================== + + * don't use `bluebird.promisify()` - unnecessarily wraps runtime errors, causing issues + +1.0.0 / 2014-06-18 +================== + + * use `bluebird` by default if found + * support node 0.8 diff --git a/node_modules/mz/LICENSE b/node_modules/mz/LICENSE new file mode 100644 index 0000000..1835f3d --- /dev/null +++ b/node_modules/mz/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and 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/mz/README.md b/node_modules/mz/README.md new file mode 100644 index 0000000..50d6557 --- /dev/null +++ b/node_modules/mz/README.md @@ -0,0 +1,106 @@ + +# MZ - Modernize node.js + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Dependency Status][david-image]][david-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +Modernize node.js to current ECMAScript specifications! +node.js will not update their API to ES6+ [for a while](https://github.com/joyent/node/issues/7549). +This library is a wrapper for various aspects of node.js' API. + +## Installation and Usage + +Set `mz` as a dependency and install it. + +```bash +npm i mz +``` + +Then prefix the relevant `require()`s with `mz/`: + +```js +var fs = require('mz/fs') + +fs.exists(__filename).then(function (exists) { + if (exists) // do something +}) +``` + +With ES2017, this will allow you to use async functions cleanly with node's core API: + +```js +const fs = require('mz/fs') + + +async function doSomething () { + if (await fs.exists(__filename)) // do something +} +``` + +## Promisification + +Many node methods are converted into promises. +Any properties that are deprecated or aren't asynchronous will simply be proxied. +The modules wrapped are: + +- `child_process` +- `crypto` +- `dns` +- `fs` (uses `graceful-fs` if available) +- `readline` +- `zlib` + +```js +var exec = require('mz/child_process').exec + +exec('node --version').then(function (stdout) { + console.log(stdout) +}) +``` + +## Promise Engine + +`mz` uses [`any-promise`](https://github.com/kevinbeaty/any-promise). + +## FAQ + +### Can I use this in production? + +Yes, Node 4.x ships with stable promises support. For older engines, +you should probably install your own promise implementation and register it with +`require('any-promise/register')('bluebird')`. + +### Will this make my app faster? + +Nope, probably slower actually. + +### Can I add more features? + +Sure. +Open an issue. + +Currently, the plans are to eventually support: + +- New APIs in node.js that are not available in older versions of node +- ECMAScript7 Streams + +[bluebird]: https://github.com/petkaantonov/bluebird + +[npm-image]: https://img.shields.io/npm/v/mz.svg?style=flat-square +[npm-url]: https://npmjs.org/package/mz +[github-tag]: http://img.shields.io/github/tag/normalize/mz.svg?style=flat-square +[github-url]: https://github.com/normalize/mz/tags +[travis-image]: https://img.shields.io/travis/normalize/mz.svg?style=flat-square +[travis-url]: https://travis-ci.org/normalize/mz +[coveralls-image]: https://img.shields.io/coveralls/normalize/mz.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/normalize/mz?branch=master +[david-image]: http://img.shields.io/david/normalize/mz.svg?style=flat-square +[david-url]: https://david-dm.org/normalize/mz +[license-image]: http://img.shields.io/npm/l/mz.svg?style=flat-square +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/mz.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/mz diff --git a/node_modules/mz/child_process.js b/node_modules/mz/child_process.js new file mode 100644 index 0000000..06d5d9e --- /dev/null +++ b/node_modules/mz/child_process.js @@ -0,0 +1,8 @@ + +require('thenify-all').withCallback( + require('child_process'), + exports, [ + 'exec', + 'execFile', + ] +) diff --git a/node_modules/mz/crypto.js b/node_modules/mz/crypto.js new file mode 100644 index 0000000..d8cff57 --- /dev/null +++ b/node_modules/mz/crypto.js @@ -0,0 +1,9 @@ + +require('thenify-all').withCallback( + require('crypto'), + exports, [ + 'pbkdf2', + 'pseudoRandomBytes', + 'randomBytes' + ] +) diff --git a/node_modules/mz/dns.js b/node_modules/mz/dns.js new file mode 100644 index 0000000..c103582 --- /dev/null +++ b/node_modules/mz/dns.js @@ -0,0 +1,16 @@ + +require('thenify-all').withCallback( + require('dns'), + exports, [ + 'lookup', + 'resolve', + 'resolve4', + 'resolve6', + 'resolveCname', + 'resolveMx', + 'resolveNs', + 'resolveSrv', + 'resolveTxt', + 'reverse' + ] +) diff --git a/node_modules/mz/fs.js b/node_modules/mz/fs.js new file mode 100644 index 0000000..1cfd2d7 --- /dev/null +++ b/node_modules/mz/fs.js @@ -0,0 +1,62 @@ + +var Promise = require('any-promise') +var fs +try { + fs = require('graceful-fs') +} catch(err) { + fs = require('fs') +} + +var api = [ + 'appendFile', + 'chmod', + 'chown', + 'close', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'open', + 'read', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'write', + 'writeFile' +] + +typeof fs.access === 'function' && api.push('access') +typeof fs.copyFile === 'function' && api.push('copyFile') +typeof fs.mkdtemp === 'function' && api.push('mkdtemp') + +require('thenify-all').withCallback(fs, exports, api) + +exports.exists = function (filename, callback) { + // callback + if (typeof callback === 'function') { + return fs.stat(filename, function (err) { + callback(null, !err); + }) + } + // or promise + return new Promise(function (resolve) { + fs.stat(filename, function (err) { + resolve(!err) + }) + }) +} diff --git a/node_modules/mz/index.js b/node_modules/mz/index.js new file mode 100644 index 0000000..cef508d --- /dev/null +++ b/node_modules/mz/index.js @@ -0,0 +1,8 @@ +module.exports = { + fs: require('./fs'), + dns: require('./dns'), + zlib: require('./zlib'), + crypto: require('./crypto'), + readline: require('./readline'), + child_process: require('./child_process') +} diff --git a/node_modules/mz/package.json b/node_modules/mz/package.json new file mode 100644 index 0000000..de8d542 --- /dev/null +++ b/node_modules/mz/package.json @@ -0,0 +1,44 @@ +{ + "name": "mz", + "description": "modernize node.js to current ECMAScript standards", + "version": "2.7.0", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "license": "MIT", + "repository": "normalize/mz", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + }, + "devDependencies": { + "istanbul": "^0.4.0", + "bluebird": "^3.0.0", + "mocha": "^3.0.0" + }, + "scripts": { + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "keywords": [ + "promisify", + "promise", + "thenify", + "then", + "es6" + ], + "files": [ + "index.js", + "child_process.js", + "crypto.js", + "dns.js", + "fs.js", + "readline.js", + "zlib.js" + ] +} diff --git a/node_modules/mz/readline.js b/node_modules/mz/readline.js new file mode 100644 index 0000000..eb70c46 --- /dev/null +++ b/node_modules/mz/readline.js @@ -0,0 +1,64 @@ +var readline = require('readline') +var Promise = require('any-promise') +var objectAssign = require('object-assign') +var Interface = readline.Interface + +function wrapCompleter (completer) { + if (completer.length === 2) return completer + + return function (line, cb) { + var result = completer(line) + + if (typeof result.then !== 'function') { + return cb(null, result) + } + + result.catch(cb).then(function (result) { + process.nextTick(function () { cb(null, result) }) + }) + } +} + +function InterfaceAsPromised (input, output, completer, terminal) { + if (arguments.length === 1) { + var options = input + + if (typeof options.completer === 'function') { + options = objectAssign({}, options, { + completer: wrapCompleter(options.completer) + }) + } + + Interface.call(this, options) + } else { + if (typeof completer === 'function') { + completer = wrapCompleter(completer) + } + + Interface.call(this, input, output, completer, terminal) + } +} + +InterfaceAsPromised.prototype = Object.create(Interface.prototype) + +InterfaceAsPromised.prototype.question = function (question, callback) { + if (typeof callback === 'function') { + return Interface.prototype.question.call(this, question, callback) + } + + var self = this + return new Promise(function (resolve) { + Interface.prototype.question.call(self, question, resolve) + }) +} + +objectAssign(exports, readline, { + Interface: InterfaceAsPromised, + createInterface: function (input, output, completer, terminal) { + if (arguments.length === 1) { + return new InterfaceAsPromised(input) + } + + return new InterfaceAsPromised(input, output, completer, terminal) + } +}) diff --git a/node_modules/mz/zlib.js b/node_modules/mz/zlib.js new file mode 100644 index 0000000..a05c26a --- /dev/null +++ b/node_modules/mz/zlib.js @@ -0,0 +1,13 @@ + +require('thenify-all').withCallback( + require('zlib'), + exports, [ + 'deflate', + 'deflateRaw', + 'gzip', + 'gunzip', + 'inflate', + 'inflateRaw', + 'unzip', + ] +) diff --git a/node_modules/nanoid/LICENSE b/node_modules/nanoid/LICENSE new file mode 100644 index 0000000..37f56aa --- /dev/null +++ b/node_modules/nanoid/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2017 Andrey Sitnik + +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/nanoid/README.md b/node_modules/nanoid/README.md new file mode 100644 index 0000000..a4abd92 --- /dev/null +++ b/node_modules/nanoid/README.md @@ -0,0 +1,39 @@ +# Nano ID + +Nano ID logo by Anton Lovchikov + +**English** | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) + +A tiny, secure, URL-friendly, unique string ID generator for JavaScript. + +> “An amazing level of senseless perfectionism, +> which is simply impossible not to respect.” + +* **Small.** 130 bytes (minified and gzipped). No dependencies. + [Size Limit] controls the size. +* **Fast.** It is 2 times faster than UUID. +* **Safe.** It uses hardware random generator. Can be used in clusters. +* **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). + So ID size was reduced from 36 to 21 symbols. +* **Portable.** Nano ID was ported + to [20 programming languages](#other-programming-languages). + +```js +import { nanoid } from 'nanoid' +model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" +``` + +Supports modern browsers, IE [with Babel], Node.js and React Native. + +[online tool]: https://gitpod.io/#https://github.com/ai/nanoid/ +[with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ +[Size Limit]: https://github.com/ai/size-limit + + + Sponsored by Evil Martians + + +## Docs +Read **[full docs](https://github.com/ai/nanoid#readme)** on GitHub. diff --git a/node_modules/nanoid/async/index.browser.cjs b/node_modules/nanoid/async/index.browser.cjs new file mode 100644 index 0000000..7e5bba8 --- /dev/null +++ b/node_modules/nanoid/async/index.browser.cjs @@ -0,0 +1,34 @@ +let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes)) +let customAlphabet = (alphabet, defaultSize = 21) => { + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + return async (size = defaultSize) => { + let id = '' + while (true) { + let bytes = crypto.getRandomValues(new Uint8Array(step)) + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} +let nanoid = async (size = 21) => { + let id = '' + let bytes = crypto.getRandomValues(new Uint8Array(size)) + while (size--) { + let byte = bytes[size] & 63 + if (byte < 36) { + id += byte.toString(36) + } else if (byte < 62) { + id += (byte - 26).toString(36).toUpperCase() + } else if (byte < 63) { + id += '_' + } else { + id += '-' + } + } + return id +} +module.exports = { nanoid, customAlphabet, random } diff --git a/node_modules/nanoid/async/index.browser.js b/node_modules/nanoid/async/index.browser.js new file mode 100644 index 0000000..5ece04d --- /dev/null +++ b/node_modules/nanoid/async/index.browser.js @@ -0,0 +1,34 @@ +let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes)) +let customAlphabet = (alphabet, defaultSize = 21) => { + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + return async (size = defaultSize) => { + let id = '' + while (true) { + let bytes = crypto.getRandomValues(new Uint8Array(step)) + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} +let nanoid = async (size = 21) => { + let id = '' + let bytes = crypto.getRandomValues(new Uint8Array(size)) + while (size--) { + let byte = bytes[size] & 63 + if (byte < 36) { + id += byte.toString(36) + } else if (byte < 62) { + id += (byte - 26).toString(36).toUpperCase() + } else if (byte < 63) { + id += '_' + } else { + id += '-' + } + } + return id +} +export { nanoid, customAlphabet, random } diff --git a/node_modules/nanoid/async/index.cjs b/node_modules/nanoid/async/index.cjs new file mode 100644 index 0000000..50db105 --- /dev/null +++ b/node_modules/nanoid/async/index.cjs @@ -0,0 +1,35 @@ +let crypto = require('crypto') +let { urlAlphabet } = require('../url-alphabet/index.cjs') +let random = bytes => + new Promise((resolve, reject) => { + crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => { + if (err) { + reject(err) + } else { + resolve(buf) + } + }) + }) +let customAlphabet = (alphabet, defaultSize = 21) => { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + let tick = (id, size = defaultSize) => + random(step).then(bytes => { + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + return tick(id, size) + }) + return size => tick('', size) +} +let nanoid = (size = 21) => + random(size).then(bytes => { + let id = '' + while (size--) { + id += urlAlphabet[bytes[size] & 63] + } + return id + }) +module.exports = { nanoid, customAlphabet, random } diff --git a/node_modules/nanoid/async/index.d.ts b/node_modules/nanoid/async/index.d.ts new file mode 100644 index 0000000..9e91965 --- /dev/null +++ b/node_modules/nanoid/async/index.d.ts @@ -0,0 +1,56 @@ +/** + * Generate secure URL-friendly unique ID. The non-blocking version. + * + * By default, the ID will have 21 symbols to have a collision probability + * similar to UUID v4. + * + * ```js + * import { nanoid } from 'nanoid/async' + * nanoid().then(id => { + * model.id = id + * }) + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A promise with a random string. + */ +export function nanoid(size?: number): Promise + +/** + * A low-level function. + * Generate secure unique ID with custom alphabet. The non-blocking version. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A function that returns a promise with a random string. + * + * ```js + * import { customAlphabet } from 'nanoid/async' + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * nanoid().then(id => { + * model.id = id //=> "8ё56а" + * }) + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => Promise + +/** + * Generate an array of random bytes collected from hardware noise. + * + * ```js + * import { random } from 'nanoid/async' + * random(5).then(bytes => { + * bytes //=> [10, 67, 212, 67, 89] + * }) + * ``` + * + * @param bytes Size of the array. + * @returns A promise with a random bytes array. + */ +export function random(bytes: number): Promise diff --git a/node_modules/nanoid/async/index.js b/node_modules/nanoid/async/index.js new file mode 100644 index 0000000..803fad6 --- /dev/null +++ b/node_modules/nanoid/async/index.js @@ -0,0 +1,35 @@ +import crypto from 'crypto' +import { urlAlphabet } from '../url-alphabet/index.js' +let random = bytes => + new Promise((resolve, reject) => { + crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => { + if (err) { + reject(err) + } else { + resolve(buf) + } + }) + }) +let customAlphabet = (alphabet, defaultSize = 21) => { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + let tick = (id, size = defaultSize) => + random(step).then(bytes => { + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + return tick(id, size) + }) + return size => tick('', size) +} +let nanoid = (size = 21) => + random(size).then(bytes => { + let id = '' + while (size--) { + id += urlAlphabet[bytes[size] & 63] + } + return id + }) +export { nanoid, customAlphabet, random } diff --git a/node_modules/nanoid/async/index.native.js b/node_modules/nanoid/async/index.native.js new file mode 100644 index 0000000..5cb3d57 --- /dev/null +++ b/node_modules/nanoid/async/index.native.js @@ -0,0 +1,26 @@ +import { getRandomBytesAsync } from 'expo-random' +import { urlAlphabet } from '../url-alphabet/index.js' +let random = getRandomBytesAsync +let customAlphabet = (alphabet, defaultSize = 21) => { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + let tick = (id, size = defaultSize) => + random(step).then(bytes => { + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + return tick(id, size) + }) + return size => tick('', size) +} +let nanoid = (size = 21) => + random(size).then(bytes => { + let id = '' + while (size--) { + id += urlAlphabet[bytes[size] & 63] + } + return id + }) +export { nanoid, customAlphabet, random } diff --git a/node_modules/nanoid/async/package.json b/node_modules/nanoid/async/package.json new file mode 100644 index 0000000..578cdb4 --- /dev/null +++ b/node_modules/nanoid/async/package.json @@ -0,0 +1,12 @@ +{ + "type": "module", + "main": "index.cjs", + "module": "index.js", + "react-native": { + "./index.js": "./index.native.js" + }, + "browser": { + "./index.js": "./index.browser.js", + "./index.cjs": "./index.browser.cjs" + } +} \ No newline at end of file diff --git a/node_modules/nanoid/bin/nanoid.cjs b/node_modules/nanoid/bin/nanoid.cjs new file mode 100644 index 0000000..c76db0f --- /dev/null +++ b/node_modules/nanoid/bin/nanoid.cjs @@ -0,0 +1,55 @@ +#!/usr/bin/env node + +let { nanoid, customAlphabet } = require('..') + +function print(msg) { + process.stdout.write(msg + '\n') +} + +function error(msg) { + process.stderr.write(msg + '\n') + process.exit(1) +} + +if (process.argv.includes('--help') || process.argv.includes('-h')) { + print(` + Usage + $ nanoid [options] + + Options + -s, --size Generated ID size + -a, --alphabet Alphabet to use + -h, --help Show this help + + Examples + $ nanoid --s 15 + S9sBF77U6sDB8Yg + + $ nanoid --size 10 --alphabet abc + bcabababca`) + process.exit() +} + +let alphabet, size +for (let i = 2; i < process.argv.length; i++) { + let arg = process.argv[i] + if (arg === '--size' || arg === '-s') { + size = Number(process.argv[i + 1]) + i += 1 + if (Number.isNaN(size) || size <= 0) { + error('Size must be positive integer') + } + } else if (arg === '--alphabet' || arg === '-a') { + alphabet = process.argv[i + 1] + i += 1 + } else { + error('Unknown argument ' + arg) + } +} + +if (alphabet) { + let customNanoid = customAlphabet(alphabet, size) + print(customNanoid()) +} else { + print(nanoid(size)) +} diff --git a/node_modules/nanoid/index.browser.cjs b/node_modules/nanoid/index.browser.cjs new file mode 100644 index 0000000..f800d6f --- /dev/null +++ b/node_modules/nanoid/index.browser.cjs @@ -0,0 +1,34 @@ +let { urlAlphabet } = require('./url-alphabet/index.cjs') +let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) +let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let j = step + while (j--) { + id += alphabet[bytes[j] & mask] || '' + if (id.length === size) return id + } + } + } +} +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) +let nanoid = (size = 21) => + crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => { + byte &= 63 + if (byte < 36) { + id += byte.toString(36) + } else if (byte < 62) { + id += (byte - 26).toString(36).toUpperCase() + } else if (byte > 62) { + id += '-' + } else { + id += '_' + } + return id + }, '') +module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/node_modules/nanoid/index.browser.js b/node_modules/nanoid/index.browser.js new file mode 100644 index 0000000..8b3139b --- /dev/null +++ b/node_modules/nanoid/index.browser.js @@ -0,0 +1,34 @@ +import { urlAlphabet } from './url-alphabet/index.js' +let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) +let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let j = step + while (j--) { + id += alphabet[bytes[j] & mask] || '' + if (id.length === size) return id + } + } + } +} +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) +let nanoid = (size = 21) => + crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => { + byte &= 63 + if (byte < 36) { + id += byte.toString(36) + } else if (byte < 62) { + id += (byte - 26).toString(36).toUpperCase() + } else if (byte > 62) { + id += '-' + } else { + id += '_' + } + return id + }, '') +export { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/node_modules/nanoid/index.cjs b/node_modules/nanoid/index.cjs new file mode 100644 index 0000000..0fa85e9 --- /dev/null +++ b/node_modules/nanoid/index.cjs @@ -0,0 +1,45 @@ +let crypto = require('crypto') +let { urlAlphabet } = require('./url-alphabet/index.cjs') +const POOL_SIZE_MULTIPLIER = 128 +let pool, poolOffset +let fillPool = bytes => { + if (!pool || pool.length < bytes) { + pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) + crypto.randomFillSync(pool) + poolOffset = 0 + } else if (poolOffset + bytes > pool.length) { + crypto.randomFillSync(pool) + poolOffset = 0 + } + poolOffset += bytes +} +let random = bytes => { + fillPool((bytes -= 0)) + return pool.subarray(poolOffset - bytes, poolOffset) +} +let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) +let nanoid = (size = 21) => { + fillPool((size -= 0)) + let id = '' + for (let i = poolOffset - size; i < poolOffset; i++) { + id += urlAlphabet[pool[i] & 63] + } + return id +} +module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/node_modules/nanoid/index.d.ts b/node_modules/nanoid/index.d.ts new file mode 100644 index 0000000..3e111a3 --- /dev/null +++ b/node_modules/nanoid/index.d.ts @@ -0,0 +1,91 @@ +/** + * Generate secure URL-friendly unique ID. + * + * By default, the ID will have 21 symbols to have a collision probability + * similar to UUID v4. + * + * ```js + * import { nanoid } from 'nanoid' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A random string. + */ +export function nanoid(size?: number): string + +/** + * Generate secure unique ID with custom alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A random string generator. + * + * ```js + * const { customAlphabet } = require('nanoid') + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * nanoid() //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => string + +/** + * Generate unique ID with custom random generator and alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * ```js + * import { customRandom } from 'nanoid/format' + * + * const nanoid = customRandom('abcdef', 5, size => { + * const random = [] + * for (let i = 0; i < size; i++) { + * random.push(randomByte()) + * } + * return random + * }) + * + * nanoid() //=> "fbaef" + * ``` + * + * @param alphabet Alphabet used to generate a random string. + * @param size Size of the random string. + * @param random A random bytes generator. + * @returns A random string generator. + */ +export function customRandom( + alphabet: string, + size: number, + random: (bytes: number) => Uint8Array +): () => string + +/** + * URL safe symbols. + * + * ```js + * import { urlAlphabet } from 'nanoid' + * const nanoid = customAlphabet(urlAlphabet, 10) + * nanoid() //=> "Uakgb_J5m9" + * ``` + */ +export const urlAlphabet: string + +/** + * Generate an array of random bytes collected from hardware noise. + * + * ```js + * import { customRandom, random } from 'nanoid' + * const nanoid = customRandom("abcdef", 5, random) + * ``` + * + * @param bytes Size of the array. + * @returns An array of random bytes. + */ +export function random(bytes: number): Uint8Array diff --git a/node_modules/nanoid/index.js b/node_modules/nanoid/index.js new file mode 100644 index 0000000..21e155f --- /dev/null +++ b/node_modules/nanoid/index.js @@ -0,0 +1,45 @@ +import crypto from 'crypto' +import { urlAlphabet } from './url-alphabet/index.js' +const POOL_SIZE_MULTIPLIER = 128 +let pool, poolOffset +let fillPool = bytes => { + if (!pool || pool.length < bytes) { + pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) + crypto.randomFillSync(pool) + poolOffset = 0 + } else if (poolOffset + bytes > pool.length) { + crypto.randomFillSync(pool) + poolOffset = 0 + } + poolOffset += bytes +} +let random = bytes => { + fillPool((bytes -= 0)) + return pool.subarray(poolOffset - bytes, poolOffset) +} +let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) +let nanoid = (size = 21) => { + fillPool((size -= 0)) + let id = '' + for (let i = poolOffset - size; i < poolOffset; i++) { + id += urlAlphabet[pool[i] & 63] + } + return id +} +export { nanoid, customAlphabet, customRandom, urlAlphabet, random } diff --git a/node_modules/nanoid/nanoid.js b/node_modules/nanoid/nanoid.js new file mode 100644 index 0000000..ec242ea --- /dev/null +++ b/node_modules/nanoid/nanoid.js @@ -0,0 +1 @@ +export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),""); \ No newline at end of file diff --git a/node_modules/nanoid/non-secure/index.cjs b/node_modules/nanoid/non-secure/index.cjs new file mode 100644 index 0000000..09d57cd --- /dev/null +++ b/node_modules/nanoid/non-secure/index.cjs @@ -0,0 +1,21 @@ +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' +let customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = '' + let i = size + while (i--) { + id += alphabet[(Math.random() * alphabet.length) | 0] + } + return id + } +} +let nanoid = (size = 21) => { + let id = '' + let i = size + while (i--) { + id += urlAlphabet[(Math.random() * 64) | 0] + } + return id +} +module.exports = { nanoid, customAlphabet } diff --git a/node_modules/nanoid/non-secure/index.d.ts b/node_modules/nanoid/non-secure/index.d.ts new file mode 100644 index 0000000..4965322 --- /dev/null +++ b/node_modules/nanoid/non-secure/index.d.ts @@ -0,0 +1,33 @@ +/** + * Generate URL-friendly unique ID. This method uses the non-secure + * predictable random generator with bigger collision probability. + * + * ```js + * import { nanoid } from 'nanoid/non-secure' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @returns A random string. + */ +export function nanoid(size?: number): string + +/** + * Generate a unique ID based on a custom alphabet. + * This method uses the non-secure predictable random generator + * with bigger collision probability. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @returns A random string generator. + * + * ```js + * import { customAlphabet } from 'nanoid/non-secure' + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * model.id = //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => string diff --git a/node_modules/nanoid/non-secure/index.js b/node_modules/nanoid/non-secure/index.js new file mode 100644 index 0000000..e7e19ad --- /dev/null +++ b/node_modules/nanoid/non-secure/index.js @@ -0,0 +1,21 @@ +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' +let customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = '' + let i = size + while (i--) { + id += alphabet[(Math.random() * alphabet.length) | 0] + } + return id + } +} +let nanoid = (size = 21) => { + let id = '' + let i = size + while (i--) { + id += urlAlphabet[(Math.random() * 64) | 0] + } + return id +} +export { nanoid, customAlphabet } diff --git a/node_modules/nanoid/non-secure/package.json b/node_modules/nanoid/non-secure/package.json new file mode 100644 index 0000000..9930d6a --- /dev/null +++ b/node_modules/nanoid/non-secure/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "main": "index.cjs", + "module": "index.js", + "react-native": "index.js" +} \ No newline at end of file diff --git a/node_modules/nanoid/package.json b/node_modules/nanoid/package.json new file mode 100644 index 0000000..19d7d7a --- /dev/null +++ b/node_modules/nanoid/package.json @@ -0,0 +1,66 @@ +{ + "name": "nanoid", + "version": "3.3.6", + "description": "A tiny (116 bytes), secure URL-friendly unique string ID generator", + "keywords": [ + "uuid", + "random", + "id", + "url" + ], + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "ai/nanoid", + "browser": { + "./index.js": "./index.browser.js", + "./async/index.js": "./async/index.browser.js", + "./async/index.cjs": "./async/index.browser.cjs", + "./index.cjs": "./index.browser.cjs" + }, + "react-native": "index.js", + "bin": "./bin/nanoid.cjs", + "sideEffects": false, + "types": "./index.d.ts", + "type": "module", + "main": "index.cjs", + "module": "index.js", + "exports": { + ".": { + "types": "./index.d.ts", + "browser": "./index.browser.js", + "require": "./index.cjs", + "import": "./index.js", + "default": "./index.js" + }, + "./index.d.ts": "./index.d.ts", + "./package.json": "./package.json", + "./async/package.json": "./async/package.json", + "./async": { + "browser": "./async/index.browser.js", + "require": "./async/index.cjs", + "import": "./async/index.js", + "default": "./async/index.js" + }, + "./non-secure/package.json": "./non-secure/package.json", + "./non-secure": { + "require": "./non-secure/index.cjs", + "import": "./non-secure/index.js", + "default": "./non-secure/index.js" + }, + "./url-alphabet/package.json": "./url-alphabet/package.json", + "./url-alphabet": { + "require": "./url-alphabet/index.cjs", + "import": "./url-alphabet/index.js", + "default": "./url-alphabet/index.js" + } + } +} \ No newline at end of file diff --git a/node_modules/nanoid/url-alphabet/index.cjs b/node_modules/nanoid/url-alphabet/index.cjs new file mode 100644 index 0000000..757b709 --- /dev/null +++ b/node_modules/nanoid/url-alphabet/index.cjs @@ -0,0 +1,3 @@ +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' +module.exports = { urlAlphabet } diff --git a/node_modules/nanoid/url-alphabet/index.js b/node_modules/nanoid/url-alphabet/index.js new file mode 100644 index 0000000..c2782e5 --- /dev/null +++ b/node_modules/nanoid/url-alphabet/index.js @@ -0,0 +1,3 @@ +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' +export { urlAlphabet } diff --git a/node_modules/nanoid/url-alphabet/package.json b/node_modules/nanoid/url-alphabet/package.json new file mode 100644 index 0000000..9930d6a --- /dev/null +++ b/node_modules/nanoid/url-alphabet/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "main": "index.cjs", + "module": "index.js", + "react-native": "index.js" +} \ No newline at end of file diff --git a/node_modules/normalize-path/LICENSE b/node_modules/normalize-path/LICENSE new file mode 100644 index 0000000..d32ab44 --- /dev/null +++ b/node_modules/normalize-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +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/normalize-path/README.md b/node_modules/normalize-path/README.md new file mode 100644 index 0000000..726d4d6 --- /dev/null +++ b/node_modules/normalize-path/README.md @@ -0,0 +1,127 @@ +# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) + +> Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save normalize-path +``` + +## Usage + +```js +const normalize = require('normalize-path'); + +console.log(normalize('\\foo\\bar\\baz\\')); +//=> '/foo/bar/baz' +``` + +**win32 namespaces** + +```js +console.log(normalize('\\\\?\\UNC\\Server01\\user\\docs\\Letter.txt')); +//=> '//?/UNC/Server01/user/docs/Letter.txt' + +console.log(normalize('\\\\.\\CdRomX')); +//=> '//./CdRomX' +``` + +**Consecutive slashes** + +Condenses multiple consecutive forward slashes (except for leading slashes in win32 namespaces) to a single slash. + +```js +console.log(normalize('.//foo//bar///////baz/')); +//=> './foo/bar/baz' +``` + +### Trailing slashes + +By default trailing slashes are removed. Pass `false` as the last argument to disable this behavior and _**keep** trailing slashes_: + +```js +console.log(normalize('foo\\bar\\baz\\', false)); //=> 'foo/bar/baz/' +console.log(normalize('./foo/bar/baz/', false)); //=> './foo/bar/baz/' +``` + +## Release history + +### v3.0 + +No breaking changes in this release. + +* a check was added to ensure that [win32 namespaces](https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces) are handled properly by win32 `path.parse()` after a path has been normalized by this library. +* a minor optimization was made to simplify how the trailing separator was handled + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +Other useful path-related libraries: + +* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") +* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") +* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") +* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 35 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [phated](https://github.com/phated) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 19, 2018._ \ No newline at end of file diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js new file mode 100644 index 0000000..6fac553 --- /dev/null +++ b/node_modules/normalize-path/index.js @@ -0,0 +1,35 @@ +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json new file mode 100644 index 0000000..ad61098 --- /dev/null +++ b/node_modules/normalize-path/package.json @@ -0,0 +1,77 @@ +{ + "name": "normalize-path", + "description": "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.", + "version": "3.0.0", + "homepage": "https://github.com/jonschlinkert/normalize-path", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Blaine Bublitz (https://twitter.com/BlaineBublitz)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "jonschlinkert/normalize-path", + "bugs": { + "url": "https://github.com/jonschlinkert/normalize-path/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^1.0.0", + "minimist": "^1.2.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "absolute", + "backslash", + "delimiter", + "file", + "file-path", + "filepath", + "fix", + "forward", + "fp", + "fs", + "normalize", + "path", + "relative", + "separator", + "slash", + "slashes", + "trailing", + "unix", + "urix" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "description": "Other useful path-related libraries:", + "list": [ + "contains-path", + "is-absolute", + "is-relative", + "parse-filepath", + "path-ends-with", + "path-ends-with", + "unixify" + ] + }, + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 0000000..0930cf8 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 0000000..503eb1e --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 0000000..1be09d3 --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object-hash/LICENSE b/node_modules/object-hash/LICENSE new file mode 100644 index 0000000..6ea185f --- /dev/null +++ b/node_modules/object-hash/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 object-hash 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/object-hash/dist/object_hash.js b/node_modules/object-hash/dist/object_hash.js new file mode 100644 index 0000000..2e584c5 --- /dev/null +++ b/node_modules/object-hash/dist/object_hash.js @@ -0,0 +1 @@ +!function(e){var t;"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):("undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.objectHash=e())}(function(){return function r(o,i,u){function s(n,e){if(!i[n]){if(!o[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(a)return a(n,!0);throw new Error("Cannot find module '"+n+"'")}e=i[n]={exports:{}};o[n][0].call(e.exports,function(e){var t=o[n][1][e];return s(t||e)},e,e.exports,r,o,i,u)}return i[n].exports}for(var a="function"==typeof require&&require,e=0;e>16),s((65280&n)>>8),s(255&n);return 2==r?s(255&(n=f(e.charAt(t))<<2|f(e.charAt(t+1))>>4)):1==r&&(s((n=f(e.charAt(t))<<10|f(e.charAt(t+1))<<4|f(e.charAt(t+2))>>2)>>8&255),s(255&n)),o},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,u="";function s(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t>18&63)+s(o>>12&63)+s(o>>6&63)+s(63&o);switch(i){case 1:u=(u+=s((n=e[e.length-1])>>2))+s(n<<4&63)+"==";break;case 2:u=(u=(u+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+s(n>>4&63))+s(n<<2&63)+"="}return u}}(void 0===f?this.base64js={}:f)}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(O,e,H){!function(e,n,f,r,h,p,g,y,w){var a=O("base64-js"),i=O("ieee754");function f(e,t,n){if(!(this instanceof f))return new f(e,t,n);var r,o,i,u,s=typeof e;if("base64"===t&&"string"==s)for(e=(u=e).trim?u.trim():u.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==s)r=j(e);else if("string"==s)r=f.byteLength(e,t);else{if("object"!=s)throw new Error("First argument needs to be a number, array or string.");r=j(e.length)}if(f._useTypedArrays?o=f._augment(new Uint8Array(r)):((o=this).length=r,o._isBuffer=!0),f._useTypedArrays&&"number"==typeof e.byteLength)o._set(e);else if(C(u=e)||f.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(i=0;i>8,n=n%256,r.push(n),r.push(t);return r}(t),e,n,r)}function v(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o>>0)):(t+1>>0),o}function _(e,t,n,r){if(r||(d("boolean"==typeof n,"missing or invalid endian"),d(null!=t,"missing offset"),d(t+1>>8*(r?i:1-i)}function l(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+3>>8*(r?i:3-i)&255}function B(e,t,n,r,o){o||(d(null!=t,"missing value"),d("boolean"==typeof r,"missing or invalid endian"),d(null!=n,"missing offset"),d(n+1this.length&&(r=this.length);var o=(r=e.length-t=this.length))return this[e]},f.prototype.readUInt16LE=function(e,t){return o(this,e,!0,t)},f.prototype.readUInt16BE=function(e,t){return o(this,e,!1,t)},f.prototype.readUInt32LE=function(e,t){return u(this,e,!0,t)},f.prototype.readUInt32BE=function(e,t){return u(this,e,!1,t)},f.prototype.readInt8=function(e,t){if(t||(d(null!=e,"missing offset"),d(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){return _(this,e,!0,t)},f.prototype.readInt16BE=function(e,t){return _(this,e,!1,t)},f.prototype.readInt32LE=function(e,t){return E(this,e,!0,t)},f.prototype.readInt32BE=function(e,t){return E(this,e,!1,t)},f.prototype.readFloatLE=function(e,t){return I(this,e,!0,t)},f.prototype.readFloatBE=function(e,t){return I(this,e,!1,t)},f.prototype.readDoubleLE=function(e,t){return A(this,e,!0,t)},f.prototype.readDoubleBE=function(e,t){return A(this,e,!1,t)},f.prototype.writeUInt8=function(e,t,n){n||(d(null!=e,"missing value"),d(null!=t,"missing offset"),d(t=this.length||(this[t]=e)},f.prototype.writeUInt16LE=function(e,t,n){s(this,e,t,!0,n)},f.prototype.writeUInt16BE=function(e,t,n){s(this,e,t,!1,n)},f.prototype.writeUInt32LE=function(e,t,n){l(this,e,t,!0,n)},f.prototype.writeUInt32BE=function(e,t,n){l(this,e,t,!1,n)},f.prototype.writeInt8=function(e,t,n){n||(d(null!=e,"missing value"),d(null!=t,"missing offset"),d(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},f.prototype.writeInt16LE=function(e,t,n){B(this,e,t,!0,n)},f.prototype.writeInt16BE=function(e,t,n){B(this,e,t,!1,n)},f.prototype.writeInt32LE=function(e,t,n){L(this,e,t,!0,n)},f.prototype.writeInt32BE=function(e,t,n){L(this,e,t,!1,n)},f.prototype.writeFloatLE=function(e,t,n){U(this,e,t,!0,n)},f.prototype.writeFloatBE=function(e,t,n){U(this,e,t,!1,n)},f.prototype.writeDoubleLE=function(e,t,n){x(this,e,t,!0,n)},f.prototype.writeDoubleBE=function(e,t,n){x(this,e,t,!1,n)},f.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,d("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),d(t<=n,"end < start"),n!==t&&0!==this.length){d(0<=t&&t"},f.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(f._useTypedArrays)return new f(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function N(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function Y(e,t){d("number"==typeof e,"cannot write a non-number as a number"),d(0<=e,"specified a negative value for writing an unsigned value"),d(e<=t,"value is larger than maximum value for type"),d(Math.floor(e)===e,"value has a fractional component")}function F(e,t,n){d("number"==typeof e,"cannot write a non-number as a number"),d(e<=t,"value larger than maximum allowed value"),d(n<=e,"value smaller than minimum allowed value"),d(Math.floor(e)===e,"value has a fractional component")}function D(e,t,n){d("number"==typeof e,"cannot write a non-number as a number"),d(e<=t,"value larger than maximum allowed value"),d(n<=e,"value smaller than minimum allowed value")}function d(e,t){if(!e)throw new Error(t||"Failed assertion")}f._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=t.get,e.set=t.set,e.write=t.write,e.toString=t.toString,e.toLocaleString=t.toString,e.toJSON=t.toJSON,e.copy=t.copy,e.slice=t.slice,e.readUInt8=t.readUInt8,e.readUInt16LE=t.readUInt16LE,e.readUInt16BE=t.readUInt16BE,e.readUInt32LE=t.readUInt32LE,e.readUInt32BE=t.readUInt32BE,e.readInt8=t.readInt8,e.readInt16LE=t.readInt16LE,e.readInt16BE=t.readInt16BE,e.readInt32LE=t.readInt32LE,e.readInt32BE=t.readInt32BE,e.readFloatLE=t.readFloatLE,e.readFloatBE=t.readFloatBE,e.readDoubleLE=t.readDoubleLE,e.readDoubleBE=t.readDoubleBE,e.writeUInt8=t.writeUInt8,e.writeUInt16LE=t.writeUInt16LE,e.writeUInt16BE=t.writeUInt16BE,e.writeUInt32LE=t.writeUInt32LE,e.writeUInt32BE=t.writeUInt32BE,e.writeInt8=t.writeInt8,e.writeInt16LE=t.writeInt16LE,e.writeInt16BE=t.writeInt16BE,e.writeInt32LE=t.writeInt32LE,e.writeInt32BE=t.writeInt32BE,e.writeFloatLE=t.writeFloatLE,e.writeFloatBE=t.writeFloatBE,e.writeDoubleLE=t.writeDoubleLE,e.writeDoubleBE=t.writeDoubleBE,e.fill=t.fill,e.inspect=t.inspect,e.toArrayBuffer=t.toArrayBuffer,e}}.call(this,O("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},O("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(c,d,e){!function(e,t,a,n,r,o,i,u,s){var a=c("buffer").Buffer,f=4,l=new a(f);l.fill(0);d.exports={hash:function(e,t,n,r){for(var o=t(function(e,t){e.length%f!=0&&(n=e.length+(f-e.length%f),e=a.concat([e,l],n));for(var n,r=[],o=t?e.readInt32BE:e.readInt32LE,i=0;is?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u>>32-o,n)}function c(e,t,n,r,o,i,u){return s(t&n|~t&r,e,t,o,i,u)}function d(e,t,n,r,o,i,u){return s(t&r|n&~r,e,t,o,i,u)}function h(e,t,n,r,o,i,u){return s(t^n^r,e,t,o,i,u)}function p(e,t,n,r,o,i,u){return s(n^(t|~r),e,t,o,i,u)}function g(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}b.exports=function(e){return t.hash(e,n,16)}}.call(this,w("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,l,t){!function(e,t,n,r,o,i,u,s,f){var a;l.exports=a||function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n}}.call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(c,d,e){!function(e,t,n,r,o,s,a,f,l){var i=c("./helpers");function u(l,c){l[c>>5]|=128<<24-c%32,l[15+(c+64>>9<<4)]=c;for(var e,t,n,r=Array(80),o=1732584193,i=-271733879,u=-1732584194,s=271733878,d=-1009589776,h=0;h>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t){return e<>>32-t}d.exports=function(e){return i.hash(e,u,20,!0)}}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(c,d,e){!function(e,t,n,r,u,s,a,f,l){function b(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,l){var c,d=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),t=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),n=new Array(64);e[l>>5]|=128<<24-l%32,e[15+(l+64>>9<<4)]=l;for(var r,o,h=0;h>>t|e<<32-t},v=function(e,t){return e>>>t};d.exports=function(e){return i.hash(e,o,32,!0)}}.call(this,c("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,f){!function(e,t,n,r,o,i,u,s,a){f.read=function(e,t,n,r,o){var i,u,l=8*o-r-1,c=(1<>1,s=-7,a=n?o-1:0,f=n?-1:1,o=e[t+a];for(a+=f,i=o&(1<<-s)-1,o>>=-s,s+=l;0>=-s,s+=r;0>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:c-1,h=n?1:-1,c=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,o=s):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+a?d/n:d*Math.pow(2,1-a))*n&&(o++,n/=2),s<=o+a?(i=0,o=s):1<=o+a?(i=(t*n-1)*Math.pow(2,r),o+=a):(i=t*Math.pow(2,a-1)*Math.pow(2,r),o=0));8<=r;e[l+f]=255&i,f+=h,i/=256,r-=8);for(o=o<", type, " -> ", "_" + type); + + return this['_' + type](value); + }, + _object: function(object) { + var pattern = (/\[object (.*)\]/i); + var objString = Object.prototype.toString.call(object); + var objType = pattern.exec(objString); + if (!objType) { // object type did not match [object ...] + objType = 'unknown:[' + objString + ']'; + } else { + objType = objType[1]; // take only the class name + } + + objType = objType.toLowerCase(); + + var objectNumber = null; + + if ((objectNumber = context.indexOf(object)) >= 0) { + return this.dispatch('[CIRCULAR:' + objectNumber + ']'); + } else { + context.push(object); + } + + if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) { + write('buffer:'); + return write(object); + } + + if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') { + if(this['_' + objType]) { + this['_' + objType](object); + } else if (options.ignoreUnknown) { + return write('[' + objType + ']'); + } else { + throw new Error('Unknown object type "' + objType + '"'); + } + }else{ + var keys = Object.keys(object); + if (options.unorderedObjects) { + keys = keys.sort(); + } + // Make sure to incorporate special properties, so + // Types with different prototypes will produce + // a different hash and objects derived from + // different functions (`new Foo`, `new Bar`) will + // produce different hashes. + // We never do this for native functions since some + // seem to break because of that. + if (options.respectType !== false && !isNativeFunction(object)) { + keys.splice(0, 0, 'prototype', '__proto__', 'constructor'); + } + + if (options.excludeKeys) { + keys = keys.filter(function(key) { return !options.excludeKeys(key); }); + } + + write('object:' + keys.length + ':'); + var self = this; + return keys.forEach(function(key){ + self.dispatch(key); + write(':'); + if(!options.excludeValues) { + self.dispatch(object[key]); + } + write(','); + }); + } + }, + _array: function(arr, unordered){ + unordered = typeof unordered !== 'undefined' ? unordered : + options.unorderedArrays !== false; // default to options.unorderedArrays + + var self = this; + write('array:' + arr.length + ':'); + if (!unordered || arr.length <= 1) { + return arr.forEach(function(entry) { + return self.dispatch(entry); + }); + } + + // the unordered case is a little more complicated: + // since there is no canonical ordering on objects, + // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false, + // we first serialize each entry using a PassThrough stream + // before sorting. + // also: we can’t use the same context array for all entries + // since the order of hashing should *not* matter. instead, + // we keep track of the additions to a copy of the context array + // and add all of them to the global context array when we’re done + var contextAdditions = []; + var entries = arr.map(function(entry) { + var strm = new PassThrough(); + var localContext = context.slice(); // make copy + var hasher = typeHasher(options, strm, localContext); + hasher.dispatch(entry); + // take only what was added to localContext and append it to contextAdditions + contextAdditions = contextAdditions.concat(localContext.slice(context.length)); + return strm.read().toString(); + }); + context = context.concat(contextAdditions); + entries.sort(); + return this._array(entries, false); + }, + _date: function(date){ + return write('date:' + date.toJSON()); + }, + _symbol: function(sym){ + return write('symbol:' + sym.toString()); + }, + _error: function(err){ + return write('error:' + err.toString()); + }, + _boolean: function(bool){ + return write('bool:' + bool.toString()); + }, + _string: function(string){ + write('string:' + string.length + ':'); + write(string.toString()); + }, + _function: function(fn){ + write('fn:'); + if (isNativeFunction(fn)) { + this.dispatch('[native]'); + } else { + this.dispatch(fn.toString()); + } + + if (options.respectFunctionNames !== false) { + // Make sure we can still distinguish native functions + // by their name, otherwise String and Function will + // have the same hash + this.dispatch("function-name:" + String(fn.name)); + } + + if (options.respectFunctionProperties) { + this._object(fn); + } + }, + _number: function(number){ + return write('number:' + number.toString()); + }, + _xml: function(xml){ + return write('xml:' + xml.toString()); + }, + _null: function() { + return write('Null'); + }, + _undefined: function() { + return write('Undefined'); + }, + _regexp: function(regex){ + return write('regex:' + regex.toString()); + }, + _uint8array: function(arr){ + write('uint8array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _uint8clampedarray: function(arr){ + write('uint8clampedarray:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _int8array: function(arr){ + write('int8array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _uint16array: function(arr){ + write('uint16array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _int16array: function(arr){ + write('int16array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _uint32array: function(arr){ + write('uint32array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _int32array: function(arr){ + write('int32array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _float32array: function(arr){ + write('float32array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _float64array: function(arr){ + write('float64array:'); + return this.dispatch(Array.prototype.slice.call(arr)); + }, + _arraybuffer: function(arr){ + write('arraybuffer:'); + return this.dispatch(new Uint8Array(arr)); + }, + _url: function(url) { + return write('url:' + url.toString(), 'utf8'); + }, + _map: function(map) { + write('map:'); + var arr = Array.from(map); + return this._array(arr, options.unorderedSets !== false); + }, + _set: function(set) { + write('set:'); + var arr = Array.from(set); + return this._array(arr, options.unorderedSets !== false); + }, + _file: function(file) { + write('file:'); + return this.dispatch([file.name, file.size, file.type, file.lastModfied]); + }, + _blob: function() { + if (options.ignoreUnknown) { + return write('[blob]'); + } + + throw Error('Hashing Blob objects is currently not supported\n' + + '(see https://github.com/puleos/object-hash/issues/26)\n' + + 'Use "options.replacer" or "options.ignoreUnknown"\n'); + }, + _domwindow: function() { return write('domwindow'); }, + _bigint: function(number){ + return write('bigint:' + number.toString()); + }, + /* Node.js standard native objects */ + _process: function() { return write('process'); }, + _timer: function() { return write('timer'); }, + _pipe: function() { return write('pipe'); }, + _tcp: function() { return write('tcp'); }, + _udp: function() { return write('udp'); }, + _tty: function() { return write('tty'); }, + _statwatcher: function() { return write('statwatcher'); }, + _securecontext: function() { return write('securecontext'); }, + _connection: function() { return write('connection'); }, + _zlib: function() { return write('zlib'); }, + _context: function() { return write('context'); }, + _nodescript: function() { return write('nodescript'); }, + _httpparser: function() { return write('httpparser'); }, + _dataview: function() { return write('dataview'); }, + _signal: function() { return write('signal'); }, + _fsevent: function() { return write('fsevent'); }, + _tlswrap: function() { return write('tlswrap'); }, + }; +} + +// Mini-implementation of stream.PassThrough +// We are far from having need for the full implementation, and we can +// make assumptions like "many writes, then only one final read" +// and we can ignore encoding specifics +function PassThrough() { + return { + buf: '', + + write: function(b) { + this.buf += b; + }, + + end: function(b) { + this.buf += b; + }, + + read: function() { + return this.buf; + } + }; +} diff --git a/node_modules/object-hash/package.json b/node_modules/object-hash/package.json new file mode 100644 index 0000000..a72557f --- /dev/null +++ b/node_modules/object-hash/package.json @@ -0,0 +1,53 @@ +{ + "name": "object-hash", + "version": "3.0.0", + "description": "Generate hashes from javascript objects in node and the browser.", + "homepage": "https://github.com/puleos/object-hash", + "repository": { + "type": "git", + "url": "https://github.com/puleos/object-hash" + }, + "keywords": [ + "object", + "hash", + "sha1", + "md5" + ], + "bugs": { + "url": "https://github.com/puleos/object-hash/issues" + }, + "scripts": { + "test": "node ./node_modules/.bin/mocha test", + "prepublish": "gulp dist" + }, + "author": "Scott Puleo ", + "files": [ + "index.js", + "dist/object_hash.js" + ], + "license": "MIT", + "devDependencies": { + "browserify": "^16.2.3", + "gulp": "^4.0.0", + "gulp-browserify": "^0.5.1", + "gulp-coveralls": "^0.1.4", + "gulp-exec": "^3.0.1", + "gulp-istanbul": "^1.1.3", + "gulp-jshint": "^2.0.0", + "gulp-mocha": "^5.0.0", + "gulp-rename": "^1.2.0", + "gulp-replace": "^1.0.0", + "gulp-uglify": "^3.0.0", + "jshint": "^2.8.0", + "jshint-stylish": "^2.1.0", + "karma": "^4.2.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^6.2.0" + }, + "engines": { + "node": ">= 6" + }, + "main": "./index.js", + "browser": "./dist/object_hash.js" +} diff --git a/node_modules/object-hash/readme.markdown b/node_modules/object-hash/readme.markdown new file mode 100644 index 0000000..c507cf8 --- /dev/null +++ b/node_modules/object-hash/readme.markdown @@ -0,0 +1,198 @@ +# object-hash + +Generate hashes from objects and values in node and the browser. Uses node.js +crypto module for hashing. Supports SHA1 and many others (depending on the platform) +as well as custom streams (e.g. CRC32). + +[![NPM](https://nodei.co/npm/object-hash.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/object-hash) + +[![Travis CI](https://secure.travis-ci.org/puleos/object-hash.png?branch=master)](https://secure.travis-ci.org/puleos/object-hash?branch=master) +[![Coverage Status](https://coveralls.io/repos/puleos/object-hash/badge.svg?branch=master&service=github)](https://coveralls.io/github/puleos/object-hash?branch=master) + +* Hash values of any type. +* Supports a keys only option for grouping similar objects with different values. + +```js +var hash = require('object-hash'); + +hash({foo: 'bar'}) // => '67b69634f9880a282c14a0f0cb7ba20cf5d677e9' +hash([1, 2, 2.718, 3.14159]) // => '136b9b88375971dff9f1af09d7356e3e04281951' +``` + +## Versioning Disclaimer + +Starting with version `1.1.8` (released April 2017), new versions will consider +the exact returned hash part of the API contract, i.e. changes that will affect +hash values will be considered `semver-major`. Previous versions may violate +that expectation. + +For more information, see [this discussion](https://github.com/puleos/object-hash/issues/30). + +## hash(value, options) + +Generate a hash from any object or type. Defaults to sha1 with hex encoding. + +* `algorithm` hash algo to be used: 'sha1', 'md5', 'passthrough'. default: sha1 + * This supports the algorithms returned by `crypto.getHashes()`. Note that the default of SHA-1 is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. + * This also supports the `passthrough` algorith, which will return the information that would otherwise have been hashed. +* `excludeValues` {true|false} hash object keys, values ignored. default: false +* `encoding` hash encoding, supports 'buffer', 'hex', 'binary', 'base64'. default: hex +* `ignoreUnknown` {true|*false} ignore unknown object types. default: false +* `replacer` optional function that replaces values before hashing. default: accept all values +* `respectFunctionProperties` {true|false} Whether properties on functions are considered when hashing. default: true +* `respectFunctionNames` {true|false} consider `name` property of functions for hashing. default: true +* `respectType` {true|false} Whether special type attributes (`.prototype`, `.__proto__`, `.constructor`) + are hashed. default: true +* `unorderedArrays` {true|false} Sort all arrays before hashing. Note that this affects *all* collections, + i.e. including typed arrays, Sets, Maps, etc. default: false +* `unorderedSets` {true|false} Sort `Set` and `Map` instances before hashing, i.e. make + `hash(new Set([1, 2])) == hash(new Set([2, 1]))` return `true`. default: true +* `unorderedObjects` {true|false} Sort objects before hashing, i.e. make `hash({ x: 1, y: 2 }) === hash({ y: 2, x: 1 })`. default: true +* `excludeKeys` optional function for excluding specific key(s) from hashing, if true is returned then exclude from hash. default: include all keys + +## hash.sha1(value) + +Hash using the sha1 algorithm. + +Note that SHA-1 is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. + +*Sugar method, equivalent to* `hash(value, {algorithm: 'sha1'})` + +## hash.keys(value) + +Hash object keys using the sha1 algorithm, values ignored. + +*Sugar method, equivalent to* `hash(value, {excludeValues: true})` + +## hash.MD5(value) + +Hash using the md5 algorithm. + +Note that the MD5 algorithm is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. + +*Sugar method, equivalent to* `hash(value, {algorithm: 'md5'})` + +## hash.keysMD5(value) + +Hash object keys using the md5 algorithm, values ignored. + +Note that the MD5 algorithm is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired. + +*Sugar method, equivalent to* `hash(value, {algorithm: 'md5', excludeValues: true})` + +## hash.writeToStream(value, [options,] stream) + +Write the information that would otherwise have been hashed to a stream, e.g.: + +```js +hash.writeToStream({foo: 'bar', a: 42}, {respectType: false}, process.stdout) +// => e.g. 'object:a:number:42foo:string:bar' +``` + +## Installation + +node: + +```js +npm install object-hash +``` + +browser: */dist/object_hash.js* + +```html + + + +``` + +## Example usage + +```js +var hash = require('object-hash'); + +var peter = { name: 'Peter', stapler: false, friends: ['Joanna', 'Michael', 'Samir'] }; +var michael = { name: 'Michael', stapler: false, friends: ['Peter', 'Samir'] }; +var bob = { name: 'Bob', stapler: true, friends: [] }; + +/*** + * sha1 hex encoding (default) + */ +hash(peter); +// 14fa461bf4b98155e82adc86532938553b4d33a9 +hash(michael); +// 4b2b30e27699979ce46714253bc2213010db039c +hash(bob); +// 38d96106bc8ef3d8bd369b99bb6972702c9826d5 + +/*** + * hash object keys, values ignored + */ +hash(peter, { excludeValues: true }); +// 48f370a772c7496f6c9d2e6d92e920c87dd00a5c +hash(michael, { excludeValues: true }); +// 48f370a772c7496f6c9d2e6d92e920c87dd00a5c +hash.keys(bob); +// 48f370a772c7496f6c9d2e6d92e920c87dd00a5c + +/*** + * hash object, ignore specific key(s) + */ +hash(peter, { excludeKeys: function(key) { + if ( key === 'friends') { + return true; + } + return false; + } +}); +// 66b7d7e64871aa9fda1bdc8e88a28df797648d80 + +/*** + * md5 base64 encoding + */ +hash(peter, { algorithm: 'md5', encoding: 'base64' }); +// 6rkWaaDiG3NynWw4svGH7g== +hash(michael, { algorithm: 'md5', encoding: 'base64' }); +// djXaWpuWVJeOF8Sb6SFFNg== +hash(bob, { algorithm: 'md5', encoding: 'base64' }); +// lFzkw/IJ8/12jZI0rQeS3w== +``` + +## Legacy Browser Support + +IE <= 8 and Opera <= 11 support dropped in version 0.3.0. If you require +legacy browser support you must either use an ES5 shim or use version 0.2.5 +of this module. + +## Development + +```sh-session +git clone https://github.com/puleos/object-hash +``` + +## Node Docker Wrapper + +If you want to stand this up in a docker container, you should take at look +at the [![node-object-hash](https://github.com/bean5/node-object-hash)](https://github.com/bean5/node-object-hash) project. + +### gulp tasks + +* `gulp watch` (default) watch files, test and lint on change/add +* `gulp test` unit tests +* `gulp karma` browser unit tests +* `gulp lint` jshint +* `gulp dist` create browser version in /dist + +## License + +MIT + +## Changelog + +### v2.0.0 + +Only Node.js versions `>= 6.0.0` are being tested in CI now. +No other breaking changes were introduced. diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md new file mode 100644 index 0000000..1f1ffca --- /dev/null +++ b/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js new file mode 100644 index 0000000..2354067 --- /dev/null +++ b/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json new file mode 100644 index 0000000..16815b2 --- /dev/null +++ b/node_modules/once/package.json @@ -0,0 +1,33 @@ +{ + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" + }, + "dependencies": { + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.0.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "files": [ + "once.js" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, + "keywords": [ + "once", + "function", + "one", + "single" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js new file mode 100644 index 0000000..22aa6c3 --- /dev/null +++ b/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json new file mode 100644 index 0000000..91196d5 --- /dev/null +++ b/node_modules/path-is-absolute/package.json @@ -0,0 +1,43 @@ +{ + "name": "path-is-absolute", + "version": "1.0.1", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": "sindresorhus/path-is-absolute", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "devDependencies": { + "xo": "^0.16.0" + } +} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md new file mode 100644 index 0000000..8dbdf5f --- /dev/null +++ b/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-parse/LICENSE b/node_modules/path-parse/LICENSE new file mode 100644 index 0000000..810f3db --- /dev/null +++ b/node_modules/path-parse/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Javier Blanco + +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/path-parse/README.md b/node_modules/path-parse/README.md new file mode 100644 index 0000000..05097f8 --- /dev/null +++ b/node_modules/path-parse/README.md @@ -0,0 +1,42 @@ +# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) + +> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). + +## Install + +``` +$ npm install --save path-parse +``` + +## Usage + +```js +var pathParse = require('path-parse'); + +pathParse('/home/user/dir/file.txt'); +//=> { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +## API + +See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. + +### pathParse(path) + +### pathParse.posix(path) + +The Posix specific version. + +### pathParse.win32(path) + +The Windows specific version. + +## License + +MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js new file mode 100644 index 0000000..f062d0a --- /dev/null +++ b/node_modules/path-parse/index.js @@ -0,0 +1,75 @@ +'use strict'; + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into into [dir, root, basename, name, ext] +var splitWindowsRe = + /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; + +var win32 = {}; + +function win32SplitPath(filename) { + return splitWindowsRe.exec(filename).slice(1); +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 5) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[1], + dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), + base: allParts[2], + ext: allParts[4], + name: allParts[3] + }; +}; + + + +// Split a filename into [dir, root, basename, name, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 5) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + + return { + root: allParts[1], + dir: allParts[0].slice(0, -1), + base: allParts[2], + ext: allParts[4], + name: allParts[3], + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json new file mode 100644 index 0000000..36c23f8 --- /dev/null +++ b/node_modules/path-parse/package.json @@ -0,0 +1,33 @@ +{ + "name": "path-parse", + "version": "1.0.7", + "description": "Node.js path.parse() ponyfill", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/jbgutierrez/path-parse.git" + }, + "keywords": [ + "path", + "paths", + "file", + "dir", + "parse", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim" + ], + "author": "Javier Blanco ", + "license": "MIT", + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" + }, + "homepage": "https://github.com/jbgutierrez/path-parse#readme" +} diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE new file mode 100644 index 0000000..496098c --- /dev/null +++ b/node_modules/picocolors/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md new file mode 100644 index 0000000..8e47aa8 --- /dev/null +++ b/node_modules/picocolors/README.md @@ -0,0 +1,21 @@ +# picocolors + +The tiniest and the fastest library for terminal output formatting with ANSI colors. + +```javascript +import pc from "picocolors" + +console.log( + pc.green(`How are ${pc.italic(`you`)} doing?`) +) +``` + +- **No dependencies.** +- **14 times** smaller and **2 times** faster than chalk. +- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist. +- Node.js v6+ & browsers support. Support for both CJS and ESM projects. +- TypeScript type declarations included. +- [`NO_COLOR`](https://no-color.org/) friendly. + +## Docs +Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub. diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json new file mode 100644 index 0000000..85a12d5 --- /dev/null +++ b/node_modules/picocolors/package.json @@ -0,0 +1,25 @@ +{ + "name": "picocolors", + "version": "1.0.0", + "main": "./picocolors.js", + "types": "./picocolors.d.ts", + "browser": { + "./picocolors.js": "./picocolors.browser.js" + }, + "sideEffects": false, + "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors", + "files": [ + "picocolors.*", + "types.ts" + ], + "keywords": [ + "terminal", + "colors", + "formatting", + "cli", + "console" + ], + "author": "Alexey Raspopov", + "repository": "alexeyraspopov/picocolors", + "license": "ISC" +} diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js new file mode 100644 index 0000000..5eb9fbe --- /dev/null +++ b/node_modules/picocolors/picocolors.browser.js @@ -0,0 +1,4 @@ +var x=String; +var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}}; +module.exports=create(); +module.exports.createColors = create; diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts new file mode 100644 index 0000000..94e146a --- /dev/null +++ b/node_modules/picocolors/picocolors.d.ts @@ -0,0 +1,5 @@ +import { Colors } from "./types" + +declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors } + +export = picocolors diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js new file mode 100644 index 0000000..fdb6304 --- /dev/null +++ b/node_modules/picocolors/picocolors.js @@ -0,0 +1,58 @@ +let tty = require("tty") + +let isColorSupported = + !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && + ("FORCE_COLOR" in process.env || + process.argv.includes("--color") || + process.platform === "win32" || + (tty.isatty(1) && process.env.TERM !== "dumb") || + "CI" in process.env) + +let formatter = + (open, close, replace = open) => + input => { + let string = "" + input + let index = string.indexOf(close, open.length) + return ~index + ? open + replaceClose(string, close, replace, index) + close + : open + string + close + } + +let replaceClose = (string, close, replace, index) => { + let start = string.substring(0, index) + replace + let end = string.substring(index + close.length) + let nextIndex = end.indexOf(close) + return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end +} + +let createColors = (enabled = isColorSupported) => ({ + isColorSupported: enabled, + reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String, + bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, + dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, + italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, + underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, + inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, + hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, + strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, + black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, + red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, + green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, + yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, + blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, + magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, + cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, + white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, + gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, + bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, + bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, + bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, + bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, + bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, + bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, + bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, + bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, +}) + +module.exports = createColors() +module.exports.createColors = createColors diff --git a/node_modules/picocolors/types.ts b/node_modules/picocolors/types.ts new file mode 100644 index 0000000..b4bacee --- /dev/null +++ b/node_modules/picocolors/types.ts @@ -0,0 +1,30 @@ +export type Formatter = (input: string | number | null | undefined) => string + +export interface Colors { + isColorSupported: boolean + reset: Formatter + bold: Formatter + dim: Formatter + italic: Formatter + underline: Formatter + inverse: Formatter + hidden: Formatter + strikethrough: Formatter + black: Formatter + red: Formatter + green: Formatter + yellow: Formatter + blue: Formatter + magenta: Formatter + cyan: Formatter + white: Formatter + gray: Formatter + bgBlack: Formatter + bgRed: Formatter + bgGreen: Formatter + bgYellow: Formatter + bgBlue: Formatter + bgMagenta: Formatter + bgCyan: Formatter + bgWhite: Formatter +} diff --git a/node_modules/picomatch/CHANGELOG.md b/node_modules/picomatch/CHANGELOG.md new file mode 100644 index 0000000..8ccc6c1 --- /dev/null +++ b/node_modules/picomatch/CHANGELOG.md @@ -0,0 +1,136 @@ +# Release history + +**All notable changes to this project will be documented in this file.** + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## 2.3.1 (2022-01-02) + +### Fixed + +* Fixes bug when a pattern containing an expression after the closing parenthesis (`/!(*.d).{ts,tsx}`) was incorrectly converted to regexp ([9f241ef](https://github.com/micromatch/picomatch/commit/9f241ef)). + +### Changed + +* Some documentation improvements ([f81d236](https://github.com/micromatch/picomatch/commit/f81d236), [421e0e7](https://github.com/micromatch/picomatch/commit/421e0e7)). + +## 2.3.0 (2021-05-21) + +### Fixed + +* Fixes bug where file names with two dots were not being matched consistently with negation extglobs containing a star ([56083ef](https://github.com/micromatch/picomatch/commit/56083ef)) + +## 2.2.3 (2021-04-10) + +### Fixed + +* Do not skip pattern seperator for square brackets ([fb08a30](https://github.com/micromatch/picomatch/commit/fb08a30)). +* Set negatedExtGlob also if it does not span the whole pattern ([032e3f5](https://github.com/micromatch/picomatch/commit/032e3f5)). + +## 2.2.2 (2020-03-21) + +### Fixed + +* Correctly handle parts of the pattern after parentheses in the `scan` method ([e15b920](https://github.com/micromatch/picomatch/commit/e15b920)). + +## 2.2.1 (2020-01-04) + +* Fixes [#49](https://github.com/micromatch/picomatch/issues/49), so that braces with no sets or ranges are now propertly treated as literals. + +## 2.2.0 (2020-01-04) + +* Disable fastpaths mode for the parse method ([5b8d33f](https://github.com/micromatch/picomatch/commit/5b8d33f)) +* Add `tokens`, `slashes`, and `parts` to the object returned by `picomatch.scan()`. + +## 2.1.0 (2019-10-31) + +* add benchmarks for scan ([4793b92](https://github.com/micromatch/picomatch/commit/4793b92)) +* Add eslint object-curly-spacing rule ([707c650](https://github.com/micromatch/picomatch/commit/707c650)) +* Add prefer-const eslint rule ([5c7501c](https://github.com/micromatch/picomatch/commit/5c7501c)) +* Add support for nonegate in scan API ([275c9b9](https://github.com/micromatch/picomatch/commit/275c9b9)) +* Change lets to consts. Move root import up. ([4840625](https://github.com/micromatch/picomatch/commit/4840625)) +* closes https://github.com/micromatch/picomatch/issues/21 ([766bcb0](https://github.com/micromatch/picomatch/commit/766bcb0)) +* Fix "Extglobs" table in readme ([eb19da8](https://github.com/micromatch/picomatch/commit/eb19da8)) +* fixes https://github.com/micromatch/picomatch/issues/20 ([9caca07](https://github.com/micromatch/picomatch/commit/9caca07)) +* fixes https://github.com/micromatch/picomatch/issues/26 ([fa58f45](https://github.com/micromatch/picomatch/commit/fa58f45)) +* Lint test ([d433a34](https://github.com/micromatch/picomatch/commit/d433a34)) +* lint unit tests ([0159b55](https://github.com/micromatch/picomatch/commit/0159b55)) +* Make scan work with noext ([6c02e03](https://github.com/micromatch/picomatch/commit/6c02e03)) +* minor linting ([c2a2b87](https://github.com/micromatch/picomatch/commit/c2a2b87)) +* minor parser improvements ([197671d](https://github.com/micromatch/picomatch/commit/197671d)) +* remove eslint since it... ([07876fa](https://github.com/micromatch/picomatch/commit/07876fa)) +* remove funding file ([8ebe96d](https://github.com/micromatch/picomatch/commit/8ebe96d)) +* Remove unused funks ([cbc6d54](https://github.com/micromatch/picomatch/commit/cbc6d54)) +* Run eslint during pretest, fix existing eslint findings ([0682367](https://github.com/micromatch/picomatch/commit/0682367)) +* support `noparen` in scan ([3d37569](https://github.com/micromatch/picomatch/commit/3d37569)) +* update changelog ([7b34e77](https://github.com/micromatch/picomatch/commit/7b34e77)) +* update travis ([777f038](https://github.com/micromatch/picomatch/commit/777f038)) +* Use eslint-disable-next-line instead of eslint-disable ([4e7c1fd](https://github.com/micromatch/picomatch/commit/4e7c1fd)) + +## 2.0.7 (2019-05-14) + +* 2.0.7 ([9eb9a71](https://github.com/micromatch/picomatch/commit/9eb9a71)) +* supports lookbehinds ([1f63f7e](https://github.com/micromatch/picomatch/commit/1f63f7e)) +* update .verb.md file with typo change ([2741279](https://github.com/micromatch/picomatch/commit/2741279)) +* fix: typo in README ([0753e44](https://github.com/micromatch/picomatch/commit/0753e44)) + +## 2.0.4 (2019-04-10) + +### Fixed + +- Readme link [fixed](https://github.com/micromatch/picomatch/pull/13/commits/a96ab3aa2b11b6861c23289964613d85563b05df) by @danez. +- `options.capture` now works as expected when fastpaths are enabled. See https://github.com/micromatch/picomatch/pull/12/commits/26aefd71f1cfaf95c37f1c1fcab68a693b037304. Thanks to @DrPizza. + +## 2.0.0 (2019-04-10) + +### Added + +- Adds support for `options.onIgnore`. See the readme for details +- Adds support for `options.onResult`. See the readme for details + +### Breaking changes + +- The unixify option was renamed to `windows` +- caching and all related options and methods have been removed + +## 1.0.0 (2018-11-05) + +- adds `.onMatch` option +- improvements to `.scan` method +- numerous improvements and optimizations for matching and parsing +- better windows path handling + +## 0.1.0 - 2017-04-13 + +First release. + + +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog diff --git a/node_modules/picomatch/LICENSE b/node_modules/picomatch/LICENSE new file mode 100644 index 0000000..3608dca --- /dev/null +++ b/node_modules/picomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-present, Jon Schlinkert. + +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/picomatch/README.md b/node_modules/picomatch/README.md new file mode 100644 index 0000000..b0526e2 --- /dev/null +++ b/node_modules/picomatch/README.md @@ -0,0 +1,708 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L32) + +Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.test](lib/picomatch.js#L117) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.test(input, regex[, options]); + +console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); +// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } +``` + +### [.matchBase](lib/picomatch.js#L161) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L183) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.isMatch(string, patterns[, options]); + +console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(picomatch.isMatch('a.a', 'b.*')); //=> false +``` + +### [.parse](lib/picomatch.js#L199) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L231) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.scan(input[, options]); + +const result = picomatch.scan('!./foo/*.js'); +console.log(result); +{ prefix: '!./', + input: '!./foo/*.js', + start: 3, + base: 'foo', + glob: '*.js', + isBrace: false, + isBracket: false, + isGlob: true, + isExtglob: false, + isGlobstar: false, + negated: true } +``` + +### [.compileRe](lib/picomatch.js#L245) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L286) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L321) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | + +picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error. + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +console.log(result); +// { +// prefix: '!./', +// input: '!./foo/*.js', +// start: 3, +// base: 'foo', +// glob: '*.js', +// isBrace: false, +// isBracket: false, +// isGlob: true, +// isExtglob: false, +// isGlobstar: false, +// negated: true, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +``` +# .makeRe star + picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled) + minimatch x 627,206 ops/sec ±1.96% (87 runs sampled)) + +# .makeRe star; dot=true + picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled) + minimatch x 525,876 ops/sec ±0.60% (88 runs sampled) + +# .makeRe globstar + picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled) + minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d) + +# .makeRe globstars + picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled) + minimatch x 477,179 ops/sec ±1.33% (91 runs sampled) + +# .makeRe with leading star + picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled) + minimatch x 453,564 ops/sec ±1.43% (94 runs sampled) + +# .makeRe - basic braces + picomatch x 392,067 ops/sec ±0.70% (90 runs sampled) + minimatch x 99,532 ops/sec ±2.03% (87 runs sampled)) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js new file mode 100644 index 0000000..d2f2bc5 --- /dev/null +++ b/node_modules/picomatch/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/picomatch'); diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js new file mode 100644 index 0000000..a62ef38 --- /dev/null +++ b/node_modules/picomatch/lib/constants.js @@ -0,0 +1,179 @@ +'use strict'; + +const path = require('path'); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js new file mode 100644 index 0000000..58269d0 --- /dev/null +++ b/node_modules/picomatch/lib/parse.js @@ -0,0 +1,1091 @@ +'use strict'; + +const constants = require('./constants'); +const utils = require('./utils'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js new file mode 100644 index 0000000..782d809 --- /dev/null +++ b/node_modules/picomatch/lib/picomatch.js @@ -0,0 +1,342 @@ +'use strict'; + +const path = require('path'); +const scan = require('./scan'); +const parse = require('./parse'); +const utils = require('./utils'); +const constants = require('./constants'); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; diff --git a/node_modules/picomatch/lib/scan.js b/node_modules/picomatch/lib/scan.js new file mode 100644 index 0000000..e59cd7a --- /dev/null +++ b/node_modules/picomatch/lib/scan.js @@ -0,0 +1,391 @@ +'use strict'; + +const utils = require('./utils'); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = require('./constants'); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js new file mode 100644 index 0000000..c3ca766 --- /dev/null +++ b/node_modules/picomatch/lib/utils.js @@ -0,0 +1,64 @@ +'use strict'; + +const path = require('path'); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json new file mode 100644 index 0000000..3db22d4 --- /dev/null +++ b/node_modules/picomatch/package.json @@ -0,0 +1,81 @@ +{ + "name": "picomatch", + "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", + "version": "2.3.1", + "homepage": "https://github.com/micromatch/picomatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "funding": "https://github.com/sponsors/jonschlinkert", + "repository": "micromatch/picomatch", + "bugs": { + "url": "https://github.com/micromatch/picomatch/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "devDependencies": { + "eslint": "^6.8.0", + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.2.2", + "nyc": "^15.0.0", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "glob", + "match", + "picomatch" + ], + "nyc": { + "reporter": [ + "html", + "lcov", + "text-summary" + ] + }, + "verb": { + "toc": { + "render": true, + "method": "preWrite", + "maxdepth": 3 + }, + "layout": "empty", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "micromatch" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "minimatch", + "nanomatch", + "picomatch" + ] + } +} diff --git a/node_modules/pify/index.js b/node_modules/pify/index.js new file mode 100644 index 0000000..7c720eb --- /dev/null +++ b/node_modules/pify/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; diff --git a/node_modules/pify/license b/node_modules/pify/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/pify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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/pify/package.json b/node_modules/pify/package.json new file mode 100644 index 0000000..311d198 --- /dev/null +++ b/node_modules/pify/package.json @@ -0,0 +1,48 @@ +{ + "name": "pify", + "version": "2.3.0", + "description": "Promisify a callback-style function", + "license": "MIT", + "repository": "sindresorhus/pify", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava && npm run optimization-test", + "optimization-test": "node --allow-natives-syntax optimization-test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "promises", + "promisify", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "es2015" + ], + "devDependencies": { + "ava": "*", + "pinkie-promise": "^1.0.0", + "v8-natives": "0.0.2", + "xo": "*" + } +} diff --git a/node_modules/pify/readme.md b/node_modules/pify/readme.md new file mode 100644 index 0000000..c79ca8b --- /dev/null +++ b/node_modules/pify/readme.md @@ -0,0 +1,119 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// promisify a single function + +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// or promisify all methods in a module + +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [promiseModule], [options]) + +Returns a promise wrapped version of the supplied function or module. + +#### input + +Type: `function`, `object` + +Callback-style function or module whose methods you want to promisify. + +#### promiseModule + +Type: `function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + +#### options + +##### multiArgs + +Type: `boolean` +Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `array` of (`string`|`regex`) + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `array` of (`string`|`regex`) +Default: `[/.+Sync$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean` +Default: `false` + +By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(data, null); + }); +}; + +// promisify methods but not fn() +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/pirates/LICENSE b/node_modules/pirates/LICENSE new file mode 100644 index 0000000..acc7a0e --- /dev/null +++ b/node_modules/pirates/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016-2018 Ari Porad + +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/pirates/README.md b/node_modules/pirates/README.md new file mode 100644 index 0000000..f61065e --- /dev/null +++ b/node_modules/pirates/README.md @@ -0,0 +1,69 @@ +# Pirates [![Coverage][codecov-badge]][codecov-link] + +### Properly hijack require + +[codecov-badge]: https://img.shields.io/codecov/c/github/danez/pirates/master.svg?style=flat "codecov" +[codecov-link]: https://codecov.io/gh/danez/pirates "codecov" + +## Why? + +Two reasons: +1. Babel and istanbul were breaking each other. +2. Everyone seemed to re-invent the wheel on this, and everyone wanted a solution that was DRY, simple, easy to use, +and made everything Just Work™, while allowing multiple require hooks, in a fashion similar to calling `super`. + +For some context, see [the Babel issue thread][] which started this all, then [the nyc issue thread][], where +discussion was moved (as we began to discuss just using the code nyc had developed), and finally to [#1][issue-1] +where discussion was finally moved. + +[the Babel issue thread]: https://github.com/babel/babel/pull/3062 "Babel Issue Thread" +[the nyc issue thread]: https://github.com/bcoe/nyc/issues/70 "NYC Issue Thread" +[issue-1]: https://github.com/danez/pirates/issues/1 "Issue #1" + +## Installation + + npm install --save pirates + +## Usage + +Using pirates is really easy: +```javascript +// my-module/register.js +const addHook = require('pirates').addHook; +// Or if you use ES modules +// import { addHook } from 'pirates'; + +function matcher(filename) { + // Here, you can inspect the filename to determine if it should be hooked or + // not. Just return a truthy/falsey. Files in node_modules are automatically ignored, + // unless otherwise specified in options (see below). + + // TODO: Implement your logic here + return true; +} + +const revert = addHook( + (code, filename) => code.replace('@@foo', 'console.log(\'foo\');'), + { exts: ['.js'], matcher } +); + +// And later, if you want to un-hook require, you can just do: +revert(); +``` + +## API + +### pirates.addHook(hook, [opts={ [matcher: true], [exts: ['.js']], [ignoreNodeModules: true] }]); +Add a require hook. `hook` must be a function that takes `(code, filename)`, and returns the modified code. `opts` is +an optional options object. Available options are: `matcher`, which is a function that accepts a filename, and +returns a truthy value if the file should be hooked (defaults to a function that always returns true), falsey if +otherwise; `exts`, which is an array of extensions to hook, they should begin with `.` (defaults to `['.js']`); +`ignoreNodeModules`, if true, any file in a `node_modules` folder wont be hooked (the matcher also wont be called), +if false, then the matcher will be called for any files in `node_modules` (defaults to true). + + +## Projects that use Pirates + +See the [wiki page](https://github.com/danez/pirates/wiki/Projects-using-Pirates). If you add Pirates to your project, +(And you should! It works best if everyone uses it. Then we can have a happy world full of happy require hooks!), please +add yourself to the wiki. diff --git a/node_modules/pirates/index.d.ts b/node_modules/pirates/index.d.ts new file mode 100644 index 0000000..b2d8ce6 --- /dev/null +++ b/node_modules/pirates/index.d.ts @@ -0,0 +1,82 @@ +/* (c) 2015 Ari Porad (@ariporad) . License: ariporad.mit-license.org */ + +/** + * The hook. Accepts the code of the module and the filename. + */ +declare type Hook = (code: string, filename: string) => string; + +/** + * A matcher function, will be called with path to a file. + * + * Should return truthy if the file should be hooked, falsy otherwise. + */ +declare type Matcher = (path: string) => boolean; + +/** + * Reverts the hook when called. + */ +declare type RevertFunction = () => void; +interface Options { + /** + * The extensions to hook. Should start with '.' (ex. ['.js']). + * + * Takes precedence over `exts`, `extension` and `ext`. + * + * @alias exts + * @alias extension + * @alias ext + * @default ['.js'] + */ + extensions?: ReadonlyArray | string; + + /** + * The extensions to hook. Should start with '.' (ex. ['.js']). + * + * Takes precedence over `extension` and `ext`. + * + * @alias extension + * @alias ext + * @default ['.js'] + */ + exts?: ReadonlyArray | string; + + /** + * The extensions to hook. Should start with '.' (ex. ['.js']). + * + * Takes precedence over `ext`. + * + * @alias ext + * @default ['.js'] + */ + extension?: ReadonlyArray | string; + + /** + * The extensions to hook. Should start with '.' (ex. ['.js']). + * + * @default ['.js'] + */ + ext?: ReadonlyArray | string; + + /** + * A matcher function, will be called with path to a file. + * + * Should return truthy if the file should be hooked, falsy otherwise. + */ + matcher?: Matcher | null; + + /** + * Auto-ignore node_modules. Independent of any matcher. + * + * @default true + */ + ignoreNodeModules?: boolean; +} + +/** + * Add a require hook. + * + * @param hook The hook. Accepts the code of the module and the filename. Required. + * @returns The `revert` function. Reverts the hook when called. + */ +export declare function addHook(hook: Hook, opts?: Options): RevertFunction; +export {}; diff --git a/node_modules/pirates/lib/index.js b/node_modules/pirates/lib/index.js new file mode 100644 index 0000000..aa5f5d7 --- /dev/null +++ b/node_modules/pirates/lib/index.js @@ -0,0 +1,139 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addHook = addHook; +var _module = _interopRequireDefault(require("module")); +var _path = _interopRequireDefault(require("path")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/* (c) 2015 Ari Porad (@ariporad) . License: ariporad.mit-license.org */ + +const nodeModulesRegex = /^(?:.*[\\/])?node_modules(?:[\\/].*)?$/; +// Guard against poorly mocked module constructors. +const Module = module.constructor.length > 1 ? module.constructor : _module.default; +const HOOK_RETURNED_NOTHING_ERROR_MESSAGE = '[Pirates] A hook returned a non-string, or nothing at all! This is a' + ' violation of intergalactic law!\n' + '--------------------\n' + 'If you have no idea what this means or what Pirates is, let me explain: ' + 'Pirates is a module that makes is easy to implement require hooks. One of' + " the require hooks you're using uses it. One of these require hooks" + " didn't return anything from it's handler, so we don't know what to" + ' do. You might want to debug this.'; + +/** + * @param {string} filename The filename to check. + * @param {string[]} exts The extensions to hook. Should start with '.' (ex. ['.js']). + * @param {Matcher|null} matcher A matcher function, will be called with path to a file. Should return truthy if the file should be hooked, falsy otherwise. + * @param {boolean} ignoreNodeModules Auto-ignore node_modules. Independent of any matcher. + */ +function shouldCompile(filename, exts, matcher, ignoreNodeModules) { + if (typeof filename !== 'string') { + return false; + } + if (exts.indexOf(_path.default.extname(filename)) === -1) { + return false; + } + const resolvedFilename = _path.default.resolve(filename); + if (ignoreNodeModules && nodeModulesRegex.test(resolvedFilename)) { + return false; + } + if (matcher && typeof matcher === 'function') { + return !!matcher(resolvedFilename); + } + return true; +} + +/** + * @callback Hook The hook. Accepts the code of the module and the filename. + * @param {string} code + * @param {string} filename + * @returns {string} + */ +/** + * @callback Matcher A matcher function, will be called with path to a file. + * + * Should return truthy if the file should be hooked, falsy otherwise. + * @param {string} path + * @returns {boolean} + */ +/** + * @callback RevertFunction Reverts the hook when called. + * @returns {void} + */ +/** + * @typedef {object} Options + * @property {Matcher|null} [matcher=null] A matcher function, will be called with path to a file. + * + * Should return truthy if the file should be hooked, falsy otherwise. + * + * @property {string[]} [extensions=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * @property {string[]} [exts=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * + * @property {string[]} [extension=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * @property {string[]} [ext=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']). + * + * @property {boolean} [ignoreNodeModules=true] Auto-ignore node_modules. Independent of any matcher. + */ + +/** + * Add a require hook. + * + * @param {Hook} hook The hook. Accepts the code of the module and the filename. Required. + * @param {Options} [opts] Options + * @returns {RevertFunction} The `revert` function. Reverts the hook when called. + */ +function addHook(hook, opts = {}) { + let reverted = false; + const loaders = []; + const oldLoaders = []; + let exts; + + // We need to do this to fix #15. Basically, if you use a non-standard extension (ie. .jsx), then + // We modify the .js loader, then use the modified .js loader for as the base for .jsx. + // This prevents that. + const originalJSLoader = Module._extensions['.js']; + const matcher = opts.matcher || null; + const ignoreNodeModules = opts.ignoreNodeModules !== false; + exts = opts.extensions || opts.exts || opts.extension || opts.ext || ['.js']; + if (!Array.isArray(exts)) { + exts = [exts]; + } + exts.forEach(ext => { + if (typeof ext !== 'string') { + throw new TypeError(`Invalid Extension: ${ext}`); + } + const oldLoader = Module._extensions[ext] || originalJSLoader; + oldLoaders[ext] = Module._extensions[ext]; + loaders[ext] = Module._extensions[ext] = function newLoader(mod, filename) { + let compile; + if (!reverted) { + if (shouldCompile(filename, exts, matcher, ignoreNodeModules)) { + compile = mod._compile; + mod._compile = function _compile(code) { + // reset the compile immediately as otherwise we end up having the + // compile function being changed even though this loader might be reverted + // Not reverting it here leads to long useless compile chains when doing + // addHook -> revert -> addHook -> revert -> ... + // The compile function is also anyway created new when the loader is called a second time. + mod._compile = compile; + const newCode = hook(code, filename); + if (typeof newCode !== 'string') { + throw new Error(HOOK_RETURNED_NOTHING_ERROR_MESSAGE); + } + return mod._compile(newCode, filename); + }; + } + } + oldLoader(mod, filename); + }; + }); + return function revert() { + if (reverted) return; + reverted = true; + exts.forEach(ext => { + // if the current loader for the extension is our loader then unregister it and set the oldLoader again + // if not we can not do anything as we cannot remove a loader from within the loader-chain + if (Module._extensions[ext] === loaders[ext]) { + if (!oldLoaders[ext]) { + delete Module._extensions[ext]; + } else { + Module._extensions[ext] = oldLoaders[ext]; + } + } + }); + }; +} \ No newline at end of file diff --git a/node_modules/pirates/package.json b/node_modules/pirates/package.json new file mode 100644 index 0000000..331ed0e --- /dev/null +++ b/node_modules/pirates/package.json @@ -0,0 +1,74 @@ +{ + "name": "pirates", + "description": "Properly hijack require, i.e., properly define require hooks and customizations", + "main": "lib/index.js", + "types": "index.d.ts", + "scripts": { + "clean": "rimraf lib", + "build": "babel src -d lib", + "test": "cross-env BABEL_ENV=test yarn run build && nyc ava", + "lint": "eslint --report-unused-disable-directives .", + "prepublishOnly": "yarn run build" + }, + "files": [ + "lib", + "index.d.ts" + ], + "repository": { + "type": "git", + "url": "https://github.com/danez/pirates.git" + }, + "engines": { + "node": ">= 6" + }, + "author": { + "name": "Ari Porad", + "email": "ari@ariporad.com", + "url": "http://ariporad.com" + }, + "devDependencies": { + "@babel/cli": "7.21.0", + "@babel/core": "7.21.4", + "@babel/preset-env": "7.21.4", + "ava": "1.4.1", + "babel-core": "7.0.0-bridge.0", + "babel-eslint": "10.1.0", + "babel-plugin-istanbul": "5.2.0", + "cross-env": "5.2.1", + "decache": "4.6.1", + "eslint": "5.16.0", + "eslint-config-prettier": "4.3.0", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-prettier": "3.4.1", + "mock-require": "3.0.3", + "nyc": "13.3.0", + "prettier": "1.19.1", + "rewire": "4.0.1", + "rimraf": "3.0.2" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/danez/pirates/issues" + }, + "homepage": "https://github.com/danez/pirates#readme", + "ava": { + "files": [ + "test/*.js" + ], + "sources": [ + "lib/**/*.js" + ] + }, + "nyc": { + "include": [ + "src/*.js" + ], + "reporter": [ + "json", + "text" + ], + "sourceMap": false, + "instrument": false + }, + "version": "4.0.6" +} diff --git a/node_modules/postcss-import/LICENSE b/node_modules/postcss-import/LICENSE new file mode 100644 index 0000000..13983fb --- /dev/null +++ b/node_modules/postcss-import/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Maxime Thirouin, Jason Campbell & Kevin Mårtensson + +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/postcss-import/README.md b/node_modules/postcss-import/README.md new file mode 100644 index 0000000..ac0148e --- /dev/null +++ b/node_modules/postcss-import/README.md @@ -0,0 +1,244 @@ +# postcss-import + +[![Build](https://img.shields.io/travis/postcss/postcss-import/master)](https://travis-ci.org/postcss/postcss-import) +[![Version](https://img.shields.io/npm/v/postcss-import)](https://github.com/postcss/postcss-import/blob/master/CHANGELOG.md) +[![postcss compatibility](https://img.shields.io/npm/dependency-version/postcss-import/peer/postcss)](https://postcss.org/) + +> [PostCSS](https://github.com/postcss/postcss) plugin to transform `@import` +rules by inlining content. + +This plugin can consume local files, node modules or web_modules. +To resolve path of an `@import` rule, it can look into root directory +(by default `process.cwd()`), `web_modules`, `node_modules` +or local modules. +_When importing a module, it will look for `index.css` or file referenced in +`package.json` in the `style` or `main` fields._ +You can also provide manually multiples paths where to look at. + +**Notes:** + +- **This plugin should probably be used as the first plugin of your list. +This way, other plugins will work on the AST as if there were only a single file +to process, and will probably work as you can expect**. +- This plugin works great with +[postcss-url](https://github.com/postcss/postcss-url) plugin, +which will allow you to adjust assets `url()` (or even inline them) after +inlining imported files. +- In order to optimize output, **this plugin will only import a file once** on +a given scope (root, media query...). +Tests are made from the path & the content of imported files (using a hash +table). +If this behavior is not what you want, look at `skipDuplicates` option +- If you are looking for **Glob Imports**, you can use [postcss-import-ext-glob](https://github.com/dimitrinicolas/postcss-import-ext-glob) to extend postcss-import. +- Imports which are not modified (by `options.filter` or because they are remote + imports) are moved to the top of the output. +- **This plugin attempts to follow the CSS `@import` spec**; `@import` + statements must precede all other statements (besides `@charset`). + +## Installation + +```console +$ npm install -D postcss-import +``` + +## Usage + +Unless your stylesheet is in the same place where you run postcss +(`process.cwd()`), you will need to use `from` option to make relative imports +work. + +```js +// dependencies +const fs = require("fs") +const postcss = require("postcss") +const atImport = require("postcss-import") + +// css to be processed +const css = fs.readFileSync("css/input.css", "utf8") + +// process css +postcss() + .use(atImport()) + .process(css, { + // `from` option is needed here + from: "css/input.css" + }) + .then((result) => { + const output = result.css + + console.log(output) + }) +``` + +`css/input.css`: + +```css +/* can consume `node_modules`, `web_modules` or local modules */ +@import "cssrecipes-defaults"; /* == @import "../node_modules/cssrecipes-defaults/index.css"; */ +@import "normalize.css"; /* == @import "../node_modules/normalize.css/normalize.css"; */ + +@import "foo.css"; /* relative to css/ according to `from` option above */ + +@import "bar.css" (min-width: 25em); + +@import 'baz.css' layer(baz-layer); + +body { + background: black; +} +``` + +will give you: + +```css +/* ... content of ../node_modules/cssrecipes-defaults/index.css */ +/* ... content of ../node_modules/normalize.css/normalize.css */ + +/* ... content of css/foo.css */ + +@media (min-width: 25em) { +/* ... content of css/bar.css */ +} + +@layer baz-layer { +/* ... content of css/baz.css */ +} + +body { + background: black; +} +``` + +Checkout the [tests](test) for more examples. + +### Options + +### `filter` +Type: `Function` +Default: `() => true` + +Only transform imports for which the test function returns `true`. Imports for +which the test function returns `false` will be left as is. The function gets +the path to import as an argument and should return a boolean. + +#### `root` + +Type: `String` +Default: `process.cwd()` or _dirname of +[the postcss `from`](https://github.com/postcss/postcss#node-source)_ + +Define the root where to resolve path (eg: place where `node_modules` are). +Should not be used that much. +_Note: nested `@import` will additionally benefit of the relative dirname of +imported files._ + +#### `path` + +Type: `String|Array` +Default: `[]` + +A string or an array of paths in where to look for files. + +#### `plugins` + +Type: `Array` +Default: `undefined` + +An array of plugins to be applied on each imported files. + +#### `resolve` + +Type: `Function` +Default: `null` + +You can provide a custom path resolver with this option. This function gets +`(id, basedir, importOptions)` arguments and should return a path, an array of +paths or a promise resolving to the path(s). If you do not return an absolute +path, your path will be resolved to an absolute path using the default +resolver. +You can use [resolve](https://github.com/substack/node-resolve) for this. + +#### `load` + +Type: `Function` +Default: null + +You can overwrite the default loading way by setting this option. +This function gets `(filename, importOptions)` arguments and returns content or +promised content. + +#### `skipDuplicates` + +Type: `Boolean` +Default: `true` + +By default, similar files (based on the same content) are being skipped. +It's to optimize output and skip similar files like `normalize.css` for example. +If this behavior is not what you want, just set this option to `false` to +disable it. + +#### `addModulesDirectories` + +Type: `Array` +Default: `[]` + +An array of folder names to add to [Node's resolver](https://github.com/substack/node-resolve). +Values will be appended to the default resolve directories: +`["node_modules", "web_modules"]`. + +This option is only for adding additional directories to default resolver. If +you provide your own resolver via the `resolve` configuration option above, then +this value will be ignored. + +#### `nameLayer` + +Type: `Function` +Default: `null` + +You can provide a custom naming function for anonymous layers (`@import 'baz.css' layer;`). +This function gets `(index, rootFilename)` arguments and should return a unique string. + +This option only influences imports without a layer name. +Without this option the plugin will warn on anonymous layers. + +#### Example with some options + +```js +const postcss = require("postcss") +const atImport = require("postcss-import") + +postcss() + .use(atImport({ + path: ["src/css"], + })) + .process(cssString) + .then((result) => { + const { css } = result + }) +``` + +## `dependency` Message Support + +`postcss-import` adds a message to `result.messages` for each `@import`. Messages are in the following format: + +``` +{ + type: 'dependency', + file: absoluteFilePath, + parent: fileContainingTheImport +} +``` + +This is mainly for use by postcss runners that implement file watching. + +--- + +## CONTRIBUTING + +* ⇄ Pull requests and ★ Stars are always welcome. +* For bugs and feature requests, please create an issue. +* Pull requests must be accompanied by passing automated tests (`$ npm test`). + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/postcss-import/index.js b/node_modules/postcss-import/index.js new file mode 100644 index 0000000..d324a7e --- /dev/null +++ b/node_modules/postcss-import/index.js @@ -0,0 +1,420 @@ +"use strict" +// builtin tooling +const path = require("path") + +// internal tooling +const joinMedia = require("./lib/join-media") +const joinLayer = require("./lib/join-layer") +const resolveId = require("./lib/resolve-id") +const loadContent = require("./lib/load-content") +const processContent = require("./lib/process-content") +const parseStatements = require("./lib/parse-statements") +const assignLayerNames = require("./lib/assign-layer-names") +const dataURL = require("./lib/data-url") + +function AtImport(options) { + options = { + root: process.cwd(), + path: [], + skipDuplicates: true, + resolve: resolveId, + load: loadContent, + plugins: [], + addModulesDirectories: [], + nameLayer: null, + ...options, + } + + options.root = path.resolve(options.root) + + // convert string to an array of a single element + if (typeof options.path === "string") options.path = [options.path] + + if (!Array.isArray(options.path)) options.path = [] + + options.path = options.path.map(p => path.resolve(options.root, p)) + + return { + postcssPlugin: "postcss-import", + Once(styles, { result, atRule, postcss }) { + const state = { + importedFiles: {}, + hashFiles: {}, + rootFilename: null, + anonymousLayerCounter: 0, + } + + if (styles.source?.input?.file) { + state.rootFilename = styles.source.input.file + state.importedFiles[styles.source.input.file] = {} + } + + if (options.plugins && !Array.isArray(options.plugins)) { + throw new Error("plugins option must be an array") + } + + if (options.nameLayer && typeof options.nameLayer !== "function") { + throw new Error("nameLayer option must be a function") + } + + return parseStyles(result, styles, options, state, [], []).then( + bundle => { + applyRaws(bundle) + applyMedia(bundle) + applyStyles(bundle, styles) + } + ) + + function applyRaws(bundle) { + bundle.forEach((stmt, index) => { + if (index === 0) return + + if (stmt.parent) { + const { before } = stmt.parent.node.raws + if (stmt.type === "nodes") stmt.nodes[0].raws.before = before + else stmt.node.raws.before = before + } else if (stmt.type === "nodes") { + stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n" + } + }) + } + + function applyMedia(bundle) { + bundle.forEach(stmt => { + if ( + (!stmt.media.length && !stmt.layer.length) || + stmt.type === "charset" + ) { + return + } + + if (stmt.layer.length > 1) { + assignLayerNames(stmt.layer, stmt.node, state, options) + } + + if (stmt.type === "import") { + const parts = [stmt.fullUri] + + const media = stmt.media.join(", ") + + if (stmt.layer.length) { + const layerName = stmt.layer.join(".") + + let layerParams = "layer" + if (layerName) { + layerParams = `layer(${layerName})` + } + + parts.push(layerParams) + } + + if (media) { + parts.push(media) + } + + stmt.node.params = parts.join(" ") + } else if (stmt.type === "media") { + if (stmt.layer.length) { + const layerNode = atRule({ + name: "layer", + params: stmt.layer.join("."), + source: stmt.node.source, + }) + + if (stmt.parentMedia?.length) { + const mediaNode = atRule({ + name: "media", + params: stmt.parentMedia.join(", "), + source: stmt.node.source, + }) + + mediaNode.append(layerNode) + layerNode.append(stmt.node) + stmt.node = mediaNode + } else { + layerNode.append(stmt.node) + stmt.node = layerNode + } + } else { + stmt.node.params = stmt.media.join(", ") + } + } else { + const { nodes } = stmt + const { parent } = nodes[0] + + let outerAtRule + let innerAtRule + if (stmt.media.length && stmt.layer.length) { + const mediaNode = atRule({ + name: "media", + params: stmt.media.join(", "), + source: parent.source, + }) + + const layerNode = atRule({ + name: "layer", + params: stmt.layer.join("."), + source: parent.source, + }) + + mediaNode.append(layerNode) + innerAtRule = layerNode + outerAtRule = mediaNode + } else if (stmt.media.length) { + const mediaNode = atRule({ + name: "media", + params: stmt.media.join(", "), + source: parent.source, + }) + + innerAtRule = mediaNode + outerAtRule = mediaNode + } else if (stmt.layer.length) { + const layerNode = atRule({ + name: "layer", + params: stmt.layer.join("."), + source: parent.source, + }) + + innerAtRule = layerNode + outerAtRule = layerNode + } + + parent.insertBefore(nodes[0], outerAtRule) + + // remove nodes + nodes.forEach(node => { + node.parent = undefined + }) + + // better output + nodes[0].raws.before = nodes[0].raws.before || "\n" + + // wrap new rules with media query and/or layer at rule + innerAtRule.append(nodes) + + stmt.type = "media" + stmt.node = outerAtRule + delete stmt.nodes + } + }) + } + + function applyStyles(bundle, styles) { + styles.nodes = [] + + // Strip additional statements. + bundle.forEach(stmt => { + if (["charset", "import", "media"].includes(stmt.type)) { + stmt.node.parent = undefined + styles.append(stmt.node) + } else if (stmt.type === "nodes") { + stmt.nodes.forEach(node => { + node.parent = undefined + styles.append(node) + }) + } + }) + } + + function parseStyles(result, styles, options, state, media, layer) { + const statements = parseStatements(result, styles) + + return Promise.resolve(statements) + .then(stmts => { + // process each statement in series + return stmts.reduce((promise, stmt) => { + return promise.then(() => { + stmt.media = joinMedia(media, stmt.media || []) + stmt.parentMedia = media + stmt.layer = joinLayer(layer, stmt.layer || []) + + // skip protocol base uri (protocol://url) or protocol-relative + if ( + stmt.type !== "import" || + /^(?:[a-z]+:)?\/\//i.test(stmt.uri) + ) { + return + } + + if (options.filter && !options.filter(stmt.uri)) { + // rejected by filter + return + } + + return resolveImportId(result, stmt, options, state) + }) + }, Promise.resolve()) + }) + .then(() => { + let charset + const imports = [] + const bundle = [] + + function handleCharset(stmt) { + if (!charset) charset = stmt + // charsets aren't case-sensitive, so convert to lower case to compare + else if ( + stmt.node.params.toLowerCase() !== + charset.node.params.toLowerCase() + ) { + throw new Error( + `Incompatable @charset statements: + ${stmt.node.params} specified in ${stmt.node.source.input.file} + ${charset.node.params} specified in ${charset.node.source.input.file}` + ) + } + } + + // squash statements and their children + statements.forEach(stmt => { + if (stmt.type === "charset") handleCharset(stmt) + else if (stmt.type === "import") { + if (stmt.children) { + stmt.children.forEach((child, index) => { + if (child.type === "import") imports.push(child) + else if (child.type === "charset") handleCharset(child) + else bundle.push(child) + // For better output + if (index === 0) child.parent = stmt + }) + } else imports.push(stmt) + } else if (stmt.type === "media" || stmt.type === "nodes") { + bundle.push(stmt) + } + }) + + return charset + ? [charset, ...imports.concat(bundle)] + : imports.concat(bundle) + }) + } + + function resolveImportId(result, stmt, options, state) { + if (dataURL.isValid(stmt.uri)) { + return loadImportContent(result, stmt, stmt.uri, options, state).then( + result => { + stmt.children = result + } + ) + } + + const atRule = stmt.node + let sourceFile + if (atRule.source?.input?.file) { + sourceFile = atRule.source.input.file + } + const base = sourceFile + ? path.dirname(atRule.source.input.file) + : options.root + + return Promise.resolve(options.resolve(stmt.uri, base, options)) + .then(paths => { + if (!Array.isArray(paths)) paths = [paths] + // Ensure that each path is absolute: + return Promise.all( + paths.map(file => { + return !path.isAbsolute(file) + ? resolveId(file, base, options) + : file + }) + ) + }) + .then(resolved => { + // Add dependency messages: + resolved.forEach(file => { + result.messages.push({ + type: "dependency", + plugin: "postcss-import", + file, + parent: sourceFile, + }) + }) + + return Promise.all( + resolved.map(file => { + return loadImportContent(result, stmt, file, options, state) + }) + ) + }) + .then(result => { + // Merge loaded statements + stmt.children = result.reduce((result, statements) => { + return statements ? result.concat(statements) : result + }, []) + }) + } + + function loadImportContent(result, stmt, filename, options, state) { + const atRule = stmt.node + const { media, layer } = stmt + + assignLayerNames(layer, atRule, state, options) + + if (options.skipDuplicates) { + // skip files already imported at the same scope + if (state.importedFiles[filename]?.[media]?.[layer]) { + return + } + + // save imported files to skip them next time + if (!state.importedFiles[filename]) { + state.importedFiles[filename] = {} + } + if (!state.importedFiles[filename][media]) { + state.importedFiles[filename][media] = {} + } + state.importedFiles[filename][media][layer] = true + } + + return Promise.resolve(options.load(filename, options)).then( + content => { + if (content.trim() === "") { + result.warn(`${filename} is empty`, { node: atRule }) + return + } + + // skip previous imported files not containing @import rules + if (state.hashFiles[content]?.[media]?.[layer]) { + return + } + + return processContent( + result, + content, + filename, + options, + postcss + ).then(importedResult => { + const styles = importedResult.root + result.messages = result.messages.concat(importedResult.messages) + + if (options.skipDuplicates) { + const hasImport = styles.some(child => { + return child.type === "atrule" && child.name === "import" + }) + if (!hasImport) { + // save hash files to skip them next time + if (!state.hashFiles[content]) { + state.hashFiles[content] = {} + } + if (!state.hashFiles[content][media]) { + state.hashFiles[content][media] = {} + } + state.hashFiles[content][media][layer] = true + } + } + + // recursion: import @import from imported file + return parseStyles(result, styles, options, state, media, layer) + }) + } + ) + } + }, + } +} + +AtImport.postcss = true + +module.exports = AtImport diff --git a/node_modules/postcss-import/lib/assign-layer-names.js b/node_modules/postcss-import/lib/assign-layer-names.js new file mode 100644 index 0000000..18cfcc7 --- /dev/null +++ b/node_modules/postcss-import/lib/assign-layer-names.js @@ -0,0 +1,17 @@ +"use strict" + +module.exports = function (layer, node, state, options) { + layer.forEach((layerPart, i) => { + if (layerPart.trim() === "") { + if (options.nameLayer) { + layer[i] = options + .nameLayer(state.anonymousLayerCounter++, state.rootFilename) + .toString() + } else { + throw node.error( + `When using anonymous layers in @import you must also set the "nameLayer" plugin option` + ) + } + } + }) +} diff --git a/node_modules/postcss-import/lib/data-url.js b/node_modules/postcss-import/lib/data-url.js new file mode 100644 index 0000000..a59c5fb --- /dev/null +++ b/node_modules/postcss-import/lib/data-url.js @@ -0,0 +1,17 @@ +"use strict" + +const dataURLRegexp = /^data:text\/css;base64,/i + +function isValid(url) { + return dataURLRegexp.test(url) +} + +function contents(url) { + // "data:text/css;base64,".length === 21 + return Buffer.from(url.slice(21), "base64").toString() +} + +module.exports = { + isValid, + contents, +} diff --git a/node_modules/postcss-import/lib/join-layer.js b/node_modules/postcss-import/lib/join-layer.js new file mode 100644 index 0000000..9d91519 --- /dev/null +++ b/node_modules/postcss-import/lib/join-layer.js @@ -0,0 +1,9 @@ +"use strict" + +module.exports = function (parentLayer, childLayer) { + if (!parentLayer.length && childLayer.length) return childLayer + if (parentLayer.length && !childLayer.length) return parentLayer + if (!parentLayer.length && !childLayer.length) return [] + + return parentLayer.concat(childLayer) +} diff --git a/node_modules/postcss-import/lib/join-media.js b/node_modules/postcss-import/lib/join-media.js new file mode 100644 index 0000000..fcaaecd --- /dev/null +++ b/node_modules/postcss-import/lib/join-media.js @@ -0,0 +1,28 @@ +"use strict" + +const startsWithKeywordRegexp = /^(all|not|only|print|screen)/i + +module.exports = function (parentMedia, childMedia) { + if (!parentMedia.length && childMedia.length) return childMedia + if (parentMedia.length && !childMedia.length) return parentMedia + if (!parentMedia.length && !childMedia.length) return [] + + const media = [] + + parentMedia.forEach(parentItem => { + const parentItemStartsWithKeyword = startsWithKeywordRegexp.test(parentItem) + + childMedia.forEach(childItem => { + const childItemStartsWithKeyword = startsWithKeywordRegexp.test(childItem) + if (parentItem !== childItem) { + if (childItemStartsWithKeyword && !parentItemStartsWithKeyword) { + media.push(`${childItem} and ${parentItem}`) + } else { + media.push(`${parentItem} and ${childItem}`) + } + } + }) + }) + + return media +} diff --git a/node_modules/postcss-import/lib/load-content.js b/node_modules/postcss-import/lib/load-content.js new file mode 100644 index 0000000..c10b57e --- /dev/null +++ b/node_modules/postcss-import/lib/load-content.js @@ -0,0 +1,12 @@ +"use strict" + +const readCache = require("read-cache") +const dataURL = require("./data-url") + +module.exports = filename => { + if (dataURL.isValid(filename)) { + return dataURL.contents(filename) + } + + return readCache(filename, "utf-8") +} diff --git a/node_modules/postcss-import/lib/parse-statements.js b/node_modules/postcss-import/lib/parse-statements.js new file mode 100644 index 0000000..0c94e5a --- /dev/null +++ b/node_modules/postcss-import/lib/parse-statements.js @@ -0,0 +1,172 @@ +"use strict" + +// external tooling +const valueParser = require("postcss-value-parser") + +// extended tooling +const { stringify } = valueParser + +function split(params, start) { + const list = [] + const last = params.reduce((item, node, index) => { + if (index < start) return "" + if (node.type === "div" && node.value === ",") { + list.push(item) + return "" + } + return item + stringify(node) + }, "") + list.push(last) + return list +} + +module.exports = function (result, styles) { + const statements = [] + let nodes = [] + + styles.each(node => { + let stmt + if (node.type === "atrule") { + if (node.name === "import") stmt = parseImport(result, node) + else if (node.name === "media") stmt = parseMedia(result, node) + else if (node.name === "charset") stmt = parseCharset(result, node) + } + + if (stmt) { + if (nodes.length) { + statements.push({ + type: "nodes", + nodes, + media: [], + layer: [], + }) + nodes = [] + } + statements.push(stmt) + } else nodes.push(node) + }) + + if (nodes.length) { + statements.push({ + type: "nodes", + nodes, + media: [], + layer: [], + }) + } + + return statements +} + +function parseMedia(result, atRule) { + const params = valueParser(atRule.params).nodes + return { + type: "media", + node: atRule, + media: split(params, 0), + layer: [], + } +} + +function parseCharset(result, atRule) { + if (atRule.prev()) { + return result.warn("@charset must precede all other statements", { + node: atRule, + }) + } + return { + type: "charset", + node: atRule, + media: [], + layer: [], + } +} + +function parseImport(result, atRule) { + let prev = atRule.prev() + if (prev) { + do { + if ( + prev.type !== "comment" && + (prev.type !== "atrule" || + (prev.name !== "import" && + prev.name !== "charset" && + !(prev.name === "layer" && !prev.nodes))) + ) { + return result.warn( + "@import must precede all other statements (besides @charset or empty @layer)", + { node: atRule } + ) + } + prev = prev.prev() + } while (prev) + } + + if (atRule.nodes) { + return result.warn( + "It looks like you didn't end your @import statement correctly. " + + "Child nodes are attached to it.", + { node: atRule } + ) + } + + const params = valueParser(atRule.params).nodes + const stmt = { + type: "import", + node: atRule, + media: [], + layer: [], + } + + // prettier-ignore + if ( + !params.length || + ( + params[0].type !== "string" || + !params[0].value + ) && + ( + params[0].type !== "function" || + params[0].value !== "url" || + !params[0].nodes.length || + !params[0].nodes[0].value + ) + ) { + return result.warn(`Unable to find uri in '${ atRule.toString() }'`, { + node: atRule, + }) + } + + if (params[0].type === "string") stmt.uri = params[0].value + else stmt.uri = params[0].nodes[0].value + stmt.fullUri = stringify(params[0]) + + let remainder = params + if (remainder.length > 2) { + if ( + (remainder[2].type === "word" || remainder[2].type === "function") && + remainder[2].value === "layer" + ) { + if (remainder[1].type !== "space") { + return result.warn("Invalid import layer statement", { node: atRule }) + } + + if (remainder[2].nodes) { + stmt.layer = [stringify(remainder[2].nodes)] + } else { + stmt.layer = [""] + } + remainder = remainder.slice(2) + } + } + + if (remainder.length > 2) { + if (remainder[1].type !== "space") { + return result.warn("Invalid import media statement", { node: atRule }) + } + + stmt.media = split(remainder, 2) + } + + return stmt +} diff --git a/node_modules/postcss-import/lib/process-content.js b/node_modules/postcss-import/lib/process-content.js new file mode 100644 index 0000000..ec413e0 --- /dev/null +++ b/node_modules/postcss-import/lib/process-content.js @@ -0,0 +1,59 @@ +"use strict" + +// builtin tooling +const path = require("path") + +// placeholder tooling +let sugarss + +module.exports = function processContent( + result, + content, + filename, + options, + postcss +) { + const { plugins } = options + const ext = path.extname(filename) + + const parserList = [] + + // SugarSS support: + if (ext === ".sss") { + if (!sugarss) { + try { + sugarss = require("sugarss") + } catch {} // Ignore + } + if (sugarss) + return runPostcss(postcss, content, filename, plugins, [sugarss]) + } + + // Syntax support: + if (result.opts.syntax?.parse) { + parserList.push(result.opts.syntax.parse) + } + + // Parser support: + if (result.opts.parser) parserList.push(result.opts.parser) + // Try the default as a last resort: + parserList.push(null) + + return runPostcss(postcss, content, filename, plugins, parserList) +} + +function runPostcss(postcss, content, filename, plugins, parsers, index) { + if (!index) index = 0 + return postcss(plugins) + .process(content, { + from: filename, + parser: parsers[index], + }) + .catch(err => { + // If there's an error, try the next parser + index++ + // If there are no parsers left, throw it + if (index === parsers.length) throw err + return runPostcss(postcss, content, filename, plugins, parsers, index) + }) +} diff --git a/node_modules/postcss-import/lib/resolve-id.js b/node_modules/postcss-import/lib/resolve-id.js new file mode 100644 index 0000000..ffef034 --- /dev/null +++ b/node_modules/postcss-import/lib/resolve-id.js @@ -0,0 +1,42 @@ +"use strict" + +// external tooling +const resolve = require("resolve") + +const moduleDirectories = ["web_modules", "node_modules"] + +function resolveModule(id, opts) { + return new Promise((res, rej) => { + resolve(id, opts, (err, path) => (err ? rej(err) : res(path))) + }) +} + +module.exports = function (id, base, options) { + const paths = options.path + + const resolveOpts = { + basedir: base, + moduleDirectory: moduleDirectories.concat(options.addModulesDirectories), + paths, + extensions: [".css"], + packageFilter: function processPackage(pkg) { + if (pkg.style) pkg.main = pkg.style + else if (!pkg.main || !/\.css$/.test(pkg.main)) pkg.main = "index.css" + return pkg + }, + preserveSymlinks: false, + } + + return resolveModule(`./${id}`, resolveOpts) + .catch(() => resolveModule(id, resolveOpts)) + .catch(() => { + if (paths.indexOf(base) === -1) paths.unshift(base) + + throw new Error( + `Failed to find '${id}' + in [ + ${paths.join(",\n ")} + ]` + ) + }) +} diff --git a/node_modules/postcss-import/package.json b/node_modules/postcss-import/package.json new file mode 100644 index 0000000..a81ea5f --- /dev/null +++ b/node_modules/postcss-import/package.json @@ -0,0 +1,65 @@ +{ + "name": "postcss-import", + "version": "15.1.0", + "description": "PostCSS plugin to import CSS files", + "keywords": [ + "css", + "postcss", + "postcss-plugin", + "import", + "node modules", + "npm" + ], + "author": "Maxime Thirouin", + "license": "MIT", + "repository": "https://github.com/postcss/postcss-import.git", + "files": [ + "index.js", + "lib" + ], + "engines": { + "node": ">=14.0.0" + }, + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "devDependencies": { + "ava": "^5.0.0", + "eslint": "^8.2.0", + "eslint-config-problems": "^7.0.0", + "eslint-plugin-prettier": "^4.0.0", + "postcss": "^8.0.0", + "postcss-scss": "^4.0.0", + "prettier": "~2.8.0", + "sugarss": "^4.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + }, + "scripts": { + "ci": "eslint . && ava", + "lint": "eslint . --fix", + "pretest": "npm run lint", + "test": "ava" + }, + "eslintConfig": { + "extends": "eslint-config-problems", + "env": { + "node": true + }, + "plugins": [ + "prettier" + ], + "rules": { + "prettier/prettier": [ + "error", + { + "semi": false, + "arrowParens": "avoid" + } + ] + } + } +} diff --git a/node_modules/postcss-js/LICENSE b/node_modules/postcss-js/LICENSE new file mode 100644 index 0000000..d3bd672 --- /dev/null +++ b/node_modules/postcss-js/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2015 Andrey Sitnik + +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/postcss-js/README.md b/node_modules/postcss-js/README.md new file mode 100644 index 0000000..a29e3b0 --- /dev/null +++ b/node_modules/postcss-js/README.md @@ -0,0 +1,22 @@ +# PostCSS JS + + + +[PostCSS] for CSS-in-JS and styles in JS objects. + +For example, to use [Stylelint] or [RTLCSS] plugins in your workflow. + + + Sponsored by Evil Martians + + +[Stylelint]: https://github.com/stylelint/stylelint +[PostCSS]: https://github.com/postcss/postcss +[RTLCSS]: https://github.com/MohammadYounes/rtlcss + + +## Docs +Read full docs **[here](https://github.com/postcss/postcss-js#readme)**. diff --git a/node_modules/postcss-js/async.js b/node_modules/postcss-js/async.js new file mode 100644 index 0000000..4c2f3c6 --- /dev/null +++ b/node_modules/postcss-js/async.js @@ -0,0 +1,15 @@ +let postcss = require('postcss') + +let processResult = require('./process-result') +let parse = require('./parser') + +module.exports = function async(plugins) { + let processor = postcss(plugins) + return async input => { + let result = await processor.process(input, { + parser: parse, + from: undefined + }) + return processResult(result) + } +} diff --git a/node_modules/postcss-js/index.js b/node_modules/postcss-js/index.js new file mode 100644 index 0000000..8a4274e --- /dev/null +++ b/node_modules/postcss-js/index.js @@ -0,0 +1,11 @@ +let objectify = require('./objectifier') +let parse = require('./parser') +let async = require('./async') +let sync = require('./sync') + +module.exports = { + objectify, + parse, + async, + sync +} diff --git a/node_modules/postcss-js/index.mjs b/node_modules/postcss-js/index.mjs new file mode 100644 index 0000000..d14b61c --- /dev/null +++ b/node_modules/postcss-js/index.mjs @@ -0,0 +1,8 @@ +import index from './index.js' + +export default index + +export const objectify = index.objectify +export const parse = index.parse +export const async = index.async +export const sync = index.sync diff --git a/node_modules/postcss-js/objectifier.js b/node_modules/postcss-js/objectifier.js new file mode 100644 index 0000000..a4708b8 --- /dev/null +++ b/node_modules/postcss-js/objectifier.js @@ -0,0 +1,85 @@ +let camelcase = require('camelcase-css') + +let UNITLESS = { + boxFlex: true, + boxFlexGroup: true, + columnCount: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + fillOpacity: true, + strokeDashoffset: true, + strokeOpacity: true, + strokeWidth: true +} + +function atRule(node) { + if (typeof node.nodes === 'undefined') { + return true + } else { + return process(node) + } +} + +function process(node) { + let name + let result = {} + + node.each(child => { + if (child.type === 'atrule') { + name = '@' + child.name + if (child.params) name += ' ' + child.params + if (typeof result[name] === 'undefined') { + result[name] = atRule(child) + } else if (Array.isArray(result[name])) { + result[name].push(atRule(child)) + } else { + result[name] = [result[name], atRule(child)] + } + } else if (child.type === 'rule') { + let body = process(child) + if (result[child.selector]) { + for (let i in body) { + result[child.selector][i] = body[i] + } + } else { + result[child.selector] = body + } + } else if (child.type === 'decl') { + if (child.prop[0] === '-' && child.prop[1] === '-') { + name = child.prop + } else if (child.parent && child.parent.selector === ':export') { + name = child.prop + } else { + name = camelcase(child.prop) + } + let value = child.value + if (!isNaN(child.value) && UNITLESS[name]) { + value = parseFloat(child.value) + } + if (child.important) value += ' !important' + if (typeof result[name] === 'undefined') { + result[name] = value + } else if (Array.isArray(result[name])) { + result[name].push(value) + } else { + result[name] = [result[name], value] + } + } + }) + return result +} + +module.exports = process diff --git a/node_modules/postcss-js/package.json b/node_modules/postcss-js/package.json new file mode 100644 index 0000000..ce0ff35 --- /dev/null +++ b/node_modules/postcss-js/package.json @@ -0,0 +1,42 @@ +{ + "name": "postcss-js", + "version": "4.0.1", + "description": "PostCSS for CSS-in-JS and styles in JS objects", + "keywords": [ + "postcss", + "postcss-runner", + "js", + "inline", + "react", + "css", + "cssinjs" + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "postcss/postcss-js", + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "exports": { + ".": { + "require": "./index.js", + "import": "./index.mjs" + }, + "./package.json": "./package.json", + "./async": "./async.js", + "./objectifier": "./objectifier.js", + "./parser": "./parser.js", + "./process-result": "./process-result.js", + "./sync": "./sync.js" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + }, + "dependencies": { + "camelcase-css": "^2.0.1" + } +} diff --git a/node_modules/postcss-js/parser.js b/node_modules/postcss-js/parser.js new file mode 100644 index 0000000..17ae264 --- /dev/null +++ b/node_modules/postcss-js/parser.js @@ -0,0 +1,104 @@ +let postcss = require('postcss') + +let IMPORTANT = /\s*!important\s*$/i + +let UNITLESS = { + 'box-flex': true, + 'box-flex-group': true, + 'column-count': true, + 'flex': true, + 'flex-grow': true, + 'flex-positive': true, + 'flex-shrink': true, + 'flex-negative': true, + 'font-weight': true, + 'line-clamp': true, + 'line-height': true, + 'opacity': true, + 'order': true, + 'orphans': true, + 'tab-size': true, + 'widows': true, + 'z-index': true, + 'zoom': true, + 'fill-opacity': true, + 'stroke-dashoffset': true, + 'stroke-opacity': true, + 'stroke-width': true +} + +function dashify(str) { + return str + .replace(/([A-Z])/g, '-$1') + .replace(/^ms-/, '-ms-') + .toLowerCase() +} + +function decl(parent, name, value) { + if (value === false || value === null) return + + if (!name.startsWith('--')) { + name = dashify(name) + } + + if (typeof value === 'number') { + if (value === 0 || UNITLESS[name]) { + value = value.toString() + } else { + value += 'px' + } + } + + if (name === 'css-float') name = 'float' + + if (IMPORTANT.test(value)) { + value = value.replace(IMPORTANT, '') + parent.push(postcss.decl({ prop: name, value, important: true })) + } else { + parent.push(postcss.decl({ prop: name, value })) + } +} + +function atRule(parent, parts, value) { + let node = postcss.atRule({ name: parts[1], params: parts[3] || '' }) + if (typeof value === 'object') { + node.nodes = [] + parse(value, node) + } + parent.push(node) +} + +function parse(obj, parent) { + let name, value, node + for (name in obj) { + value = obj[name] + if (value === null || typeof value === 'undefined') { + continue + } else if (name[0] === '@') { + let parts = name.match(/@(\S+)(\s+([\W\w]*)\s*)?/) + if (Array.isArray(value)) { + for (let i of value) { + atRule(parent, parts, i) + } + } else { + atRule(parent, parts, value) + } + } else if (Array.isArray(value)) { + for (let i of value) { + decl(parent, name, i) + } + } else if (typeof value === 'object') { + node = postcss.rule({ selector: name }) + parse(value, node) + parent.push(node) + } else { + decl(parent, name, value) + } + } +} + +module.exports = function (obj) { + let root = postcss.root() + parse(obj, root) + return root +} diff --git a/node_modules/postcss-js/process-result.js b/node_modules/postcss-js/process-result.js new file mode 100644 index 0000000..215a95c --- /dev/null +++ b/node_modules/postcss-js/process-result.js @@ -0,0 +1,11 @@ +let objectify = require('./objectifier') + +module.exports = function processResult(result) { + if (console && console.warn) { + result.warnings().forEach(warn => { + let source = warn.plugin || 'PostCSS' + console.warn(source + ': ' + warn.text) + }) + } + return objectify(result.root) +} diff --git a/node_modules/postcss-js/sync.js b/node_modules/postcss-js/sync.js new file mode 100644 index 0000000..745bd27 --- /dev/null +++ b/node_modules/postcss-js/sync.js @@ -0,0 +1,12 @@ +let postcss = require('postcss') + +let processResult = require('./process-result') +let parse = require('./parser') + +module.exports = function (plugins) { + let processor = postcss(plugins) + return input => { + let result = processor.process(input, { parser: parse, from: undefined }) + return processResult(result) + } +} diff --git a/node_modules/postcss-load-config/LICENSE b/node_modules/postcss-load-config/LICENSE new file mode 100644 index 0000000..458e8a3 --- /dev/null +++ b/node_modules/postcss-load-config/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright Michael Ciniawsky + +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/postcss-load-config/README.md b/node_modules/postcss-load-config/README.md new file mode 100644 index 0000000..c1700f4 --- /dev/null +++ b/node_modules/postcss-load-config/README.md @@ -0,0 +1,491 @@ +[![npm][npm]][npm-url] +[![node][node]][node-url] +[![deps][deps]][deps-url] +[![test][test]][test-url] +[![coverage][cover]][cover-url] +[![code style][style]][style-url] +[![chat][chat]][chat-url] + +
+ + + + + +

Load Config

+
+ +

Install

+ +```bash +npm i -D postcss-load-config +``` + +

Usage

+ +```bash +npm i -S|-D postcss-plugin +``` + +Install all required PostCSS plugins and save them to your **package.json** `dependencies`/`devDependencies` + +Then create a PostCSS config file by choosing one of the following formats + +### `package.json` + +Create a **`postcss`** section in your project's **`package.json`** + +``` +Project (Root) + |– client + |– public + | + |- package.json +``` + +```json +{ + "postcss": { + "parser": "sugarss", + "map": false, + "plugins": { + "postcss-plugin": {} + } + } +} +``` + +### `.postcssrc` + +Create a **`.postcssrc`** file in JSON or YAML format + +> ℹ️ It's recommended to use an extension (e.g **`.postcssrc.json`** or **`.postcssrc.yml`**) instead of `.postcssrc` + +``` +Project (Root) + |– client + |– public + | + |- (.postcssrc|.postcssrc.json|.postcssrc.yml) + |- package.json +``` + +**`.postcssrc.json`** +```json +{ + "parser": "sugarss", + "map": false, + "plugins": { + "postcss-plugin": {} + } +} +``` + +**`.postcssrc.yml`** +```yaml +parser: sugarss +map: false +plugins: + postcss-plugin: {} +``` + +### `.postcssrc.js` or `postcss.config.js` + +You may need some logic within your config. +In this case create JS file named: +- `.postcssrc.js` +- `.postcssrc.mjs` +- `.postcssrc.cjs` +- `.postcssrc.ts` +- `postcss.config.js` +- `postcss.config.mjs` +- `postcss.config.cjs` +- `postcss.config.ts` + +``` +Project (Root) + |– client + |– public + |- (.postcssrc|postcss.config).(js|mjs|cjs|ts) + |- package.json +``` + +You can export the config as an `{Object}` + +**.postcssrc.js** +```js +module.exports = { + parser: 'sugarss', + map: false, + plugins: { + 'postcss-plugin': {} + } +} +``` + +Or export a `{Function}` that returns the config (more about the `ctx` param below) + +**.postcssrc.js** +```js +module.exports = (ctx) => ({ + parser: ctx.parser ? 'sugarss' : false, + map: ctx.env === 'development' ? ctx.map : false, + plugins: { + 'postcss-plugin': ctx.options.plugin + } +}) +``` + +Plugins can be loaded either using an `{Object}` or an `{Array}` + +#### `{Object}` + +**.postcssrc.js** +```js +module.exports = ({ env }) => ({ + ...options, + plugins: { + 'postcss-plugin': env === 'production' ? {} : false + } +}) +``` + +> ℹ️ When using an `{Object}`, the key can be a Node.js module name, a path to a JavaScript file that is relative to the directory of the PostCSS config file, or an absolute path to a JavaScript file. + +#### `{Array}` + +**.postcssrc.js** +```js +module.exports = ({ env }) => ({ + ...options, + plugins: [ + env === 'production' ? require('postcss-plugin')() : false + ] +}) +``` +> :warning: When using an `{Array}`, make sure to `require()` each plugin + +

Options

+ +|Name|Type|Default|Description| +|:--:|:--:|:-----:|:----------| +|[**`to`**](#to)|`{String}`|`undefined`|Destination File Path| +|[**`map`**](#map)|`{String\|Object}`|`false`|Enable/Disable Source Maps| +|[**`from`**](#from)|`{String}`|`undefined`|Source File Path| +|[**`parser`**](#parser)|`{String\|Function}`|`false`|Custom PostCSS Parser| +|[**`syntax`**](#syntax)|`{String\|Function}`|`false`|Custom PostCSS Syntax| +|[**`stringifier`**](#stringifier)|`{String\|Function}`|`false`|Custom PostCSS Stringifier| + +### `parser` + +**.postcssrc.js** +```js +module.exports = { + parser: 'sugarss' +} +``` + +### `syntax` + +**.postcssrc.js** +```js +module.exports = { + syntax: 'postcss-scss' +} +``` + +### `stringifier` + +**.postcssrc.js** +```js +module.exports = { + stringifier: 'midas' +} +``` + +### [**`map`**](https://github.com/postcss/postcss/blob/master/docs/source-maps.md) + +**.postcssrc.js** +```js +module.exports = { + map: 'inline' +} +``` + +> :warning: In most cases `options.from` && `options.to` are set by the third-party which integrates this package (CLI, gulp, webpack). It's unlikely one needs to set/use `options.from` && `options.to` within a config file. Unless you're a third-party plugin author using this module and its Node API directly **dont't set `options.from` && `options.to` yourself** + +### `to` + +```js +module.exports = { + to: 'path/to/dest.css' +} +``` + +### `from` + +```js +module.exports = { + from: 'path/to/src.css' +} +``` + +

Plugins

+ +### `{} || null` + +The plugin will be loaded with defaults + +```js +'postcss-plugin': {} || null +``` + +**.postcssrc.js** +```js +module.exports = { + plugins: { + 'postcss-plugin': {} || null + } +} +``` + +> :warning: `{}` must be an **empty** `{Object}` literal + +### `{Object}` + +The plugin will be loaded with given options + +```js +'postcss-plugin': { option: '', option: '' } +``` + +**.postcssrc.js** +```js +module.exports = { + plugins: { + 'postcss-plugin': { option: '', option: '' } + } +} +``` + +### `false` + +The plugin will not be loaded + +```js +'postcss-plugin': false +``` + +**.postcssrc.js** +```js +module.exports = { + plugins: { + 'postcss-plugin': false + } +} +``` + +### `Ordering` + +Plugin **execution order** is determined by declaration in the plugins section (**top-down**) + +```js +{ + plugins: { + 'postcss-plugin': {}, // [0] + 'postcss-plugin': {}, // [1] + 'postcss-plugin': {} // [2] + } +} +``` + +

Context

+ +When using a `{Function}` (`postcss.config.js` or `.postcssrc.js`), it's possible to pass context to `postcss-load-config`, which will be evaluated while loading your config. By default `ctx.env (process.env.NODE_ENV)` and `ctx.cwd (process.cwd())` are available on the `ctx` `{Object}` + +> ℹ️ Most third-party integrations add additional properties to the `ctx` (e.g `postcss-loader`). Check the specific module's README for more information about what is available on the respective `ctx` + +

Examples

+ +**postcss.config.js** + +```js +module.exports = (ctx) => ({ + parser: ctx.parser ? 'sugarss' : false, + map: ctx.env === 'development' ? ctx.map : false, + plugins: { + 'postcss-import': {}, + 'postcss-nested': {}, + cssnano: ctx.env === 'production' ? {} : false + } +}) +``` + +
+ +
+ +```json +"scripts": { + "build": "NODE_ENV=production node postcss", + "start": "NODE_ENV=development node postcss" +} +``` + +```js +const { readFileSync } = require('fs') + +const postcss = require('postcss') +const postcssrc = require('postcss-load-config') + +const css = readFileSync('index.sss', 'utf8') + +const ctx = { parser: true, map: 'inline' } + +postcssrc(ctx).then(({ plugins, options }) => { + postcss(plugins) + .process(css, options) + .then((result) => console.log(result.css)) +}) +``` + +
+ +
+ +```json +"scripts": { + "build": "NODE_ENV=production gulp", + "start": "NODE_ENV=development gulp" +} +``` + +```js +const { task, src, dest, series, watch } = require('gulp') + +const postcss = require('gulp-postcssrc') + +const css = () => { + src('src/*.css') + .pipe(postcss()) + .pipe(dest('dest')) +}) + +task('watch', () => { + watch(['src/*.css', 'postcss.config.js'], css) +}) + +task('default', series(css, 'watch')) +``` + +
+ +
+ +```json +"scripts": { + "build": "NODE_ENV=production webpack", + "start": "NODE_ENV=development webpack-dev-server" +} +``` + +**webpack.config.js** +```js +module.exports = (env) => ({ + module: { + rules: [ + { + test: /\.css$/, + use: [ + 'style-loader', + 'css-loader', + 'postcss-loader' + ] + } + ] + } +}) +``` + +

Maintainers

+ + + + + + + + +
+ +
+ Michael Ciniawsky +
+ +
+ Mateusz Derks +
+ +

Contributors

+ + + + + + + + + + +
+ +
+ Ryan Dunckel +
+ +
+ Patrick Gilday +
+ +
+ Dalton Santos +
+ +
+ François Wouts +
+ + +[npm]: https://img.shields.io/npm/v/postcss-load-config.svg +[npm-url]: https://npmjs.com/package/postcss-load-config + +[node]: https://img.shields.io/node/v/postcss-load-plugins.svg +[node-url]: https://nodejs.org/ + +[deps]: https://david-dm.org/michael-ciniawsky/postcss-load-config.svg +[deps-url]: https://david-dm.org/michael-ciniawsky/postcss-load-config + +[test]: http://img.shields.io/travis/michael-ciniawsky/postcss-load-config.svg +[test-url]: https://travis-ci.org/michael-ciniawsky/postcss-load-config + +[cover]: https://coveralls.io/repos/github/michael-ciniawsky/postcss-load-config/badge.svg +[cover-url]: https://coveralls.io/github/michael-ciniawsky/postcss-load-config + +[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg +[style-url]: http://standardjs.com/ + +[chat]: https://img.shields.io/gitter/room/postcss/postcss.svg +[chat-url]: https://gitter.im/postcss/postcss + +## Security Contact + +To report a security vulnerability, please use the [Tidelift security contact]. +Tidelift will coordinate the fix and disclosure. + +[Tidelift security contact]: https://tidelift.com/security diff --git a/node_modules/postcss-load-config/package.json b/node_modules/postcss-load-config/package.json new file mode 100644 index 0000000..7e40f91 --- /dev/null +++ b/node_modules/postcss-load-config/package.json @@ -0,0 +1,48 @@ +{ + "name": "postcss-load-config", + "version": "4.0.1", + "description": "Autoload Config for PostCSS", + "main": "src/index.js", + "types": "src/index.d.ts", + "files": [ + "src" + ], + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^2.1.1" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "postcss": { + "optional": true + } + }, + "keywords": [ + "postcss", + "postcssrc", + "postcss.config.js" + ], + "author": "Michael Ciniawky ", + "contributors": [ + "Ryan Dunckel", + "Mateusz Derks", + "Dalton Santos", + "Patrick Gilday", + "François Wouts" + ], + "repository": "postcss/postcss-load-config", + "license": "MIT" +} diff --git a/node_modules/postcss-load-config/src/index.d.ts b/node_modules/postcss-load-config/src/index.d.ts new file mode 100644 index 0000000..4979220 --- /dev/null +++ b/node_modules/postcss-load-config/src/index.d.ts @@ -0,0 +1,65 @@ +// based on @types/postcss-load-config@2.0.1 +// Type definitions for postcss-load-config 2.1 +import Processor from 'postcss/lib/processor'; +import { Plugin, ProcessOptions, Transformer } from 'postcss'; +import { Options as ConfigOptions } from "lilconfig"; + +declare function postcssrc( + ctx?: postcssrc.ConfigContext, + path?: string, + options?: ConfigOptions +): Promise; + +declare namespace postcssrc { + // In the ConfigContext, these three options can be instances of the + // appropriate class, or strings. If they are strings, postcss-load-config will + // require() them and pass the instances along. + export interface ProcessOptionsPreload { + parser?: string | ProcessOptions['parser']; + stringifier?: string | ProcessOptions['stringifier']; + syntax?: string | ProcessOptions['syntax']; + } + + // The remaining ProcessOptions, sans the three above. + export type RemainingProcessOptions = Pick< + ProcessOptions, + Exclude + >; + + // Additional context options that postcss-load-config understands. + export interface Context { + cwd?: string; + env?: string; + } + + // The full shape of the ConfigContext. + export type ConfigContext = Context & + ProcessOptionsPreload & + RemainingProcessOptions; + + // Result of postcssrc is a Promise containing the filename plus the options + // and plugins that are ready to pass on to postcss. + export type ResultPlugin = Plugin | Transformer | Processor; + + export interface Result { + file: string; + options: ProcessOptions; + plugins: ResultPlugin[]; + } + + export type ConfigPlugin = Transformer | Plugin | Processor; + + export interface Config { + parser?: string | ProcessOptions['parser'] | false; + stringifier?: string | ProcessOptions['stringifier'] | false; + syntax?: string | ProcessOptions['syntax'] | false; + map?: string | false; + from?: string; + to?: string; + plugins?: Array | Record; + } + + export type ConfigFn = (ctx: ConfigContext) => Config | Promise; +} + +export = postcssrc; diff --git a/node_modules/postcss-load-config/src/index.js b/node_modules/postcss-load-config/src/index.js new file mode 100644 index 0000000..a7d1670 --- /dev/null +++ b/node_modules/postcss-load-config/src/index.js @@ -0,0 +1,179 @@ +'use strict' + +const resolve = require('path').resolve +const url = require('url') + +const config = require('lilconfig') +const yaml = require('yaml') + +const loadOptions = require('./options.js') +const loadPlugins = require('./plugins.js') + +/* istanbul ignore next */ +const interopRequireDefault = (obj) => obj && obj.__esModule ? obj : { default: obj } + +/** + * Process the result from cosmiconfig + * + * @param {Object} ctx Config Context + * @param {Object} result Cosmiconfig result + * + * @return {Object} PostCSS Config + */ +const processResult = (ctx, result) => { + const file = result.filepath || '' + let config = interopRequireDefault(result.config).default || {} + + if (typeof config === 'function') { + config = config(ctx) + } else { + config = Object.assign({}, config, ctx) + } + + if (!config.plugins) { + config.plugins = [] + } + + return { + plugins: loadPlugins(config, file), + options: loadOptions(config, file), + file + } +} + +/** + * Builds the Config Context + * + * @param {Object} ctx Config Context + * + * @return {Object} Config Context + */ +const createContext = (ctx) => { + /** + * @type {Object} + * + * @prop {String} cwd=process.cwd() Config search start location + * @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined` + */ + ctx = Object.assign({ + cwd: process.cwd(), + env: process.env.NODE_ENV + }, ctx) + + if (!ctx.env) { + process.env.NODE_ENV = 'development' + } + + return ctx +} + +const importDefault = async filepath => { + const module = await import(url.pathToFileURL(filepath).href) + return module.default +} + +const addTypeScriptLoader = (options = {}, loader) => { + const moduleName = 'postcss' + + return { + ...options, + searchPlaces: [ + ...(options.searchPlaces || []), + 'package.json', + `.${moduleName}rc`, + `.${moduleName}rc.json`, + `.${moduleName}rc.yaml`, + `.${moduleName}rc.yml`, + `.${moduleName}rc.ts`, + `.${moduleName}rc.js`, + `.${moduleName}rc.cjs`, + `.${moduleName}rc.mjs`, + `${moduleName}.config.ts`, + `${moduleName}.config.js`, + `${moduleName}.config.cjs`, + `${moduleName}.config.mjs` + ], + loaders: { + ...options.loaders, + '.yaml': (filepath, content) => yaml.parse(content), + '.yml': (filepath, content) => yaml.parse(content), + '.js': importDefault, + '.cjs': importDefault, + '.mjs': importDefault, + '.ts': loader + } + } +} + +const withTypeScriptLoader = (rcFunc) => { + return (ctx, path, options) => { + return rcFunc(ctx, path, addTypeScriptLoader(options, (configFile) => { + let registerer = { enabled () {} } + + try { + // Register TypeScript compiler instance + registerer = require('ts-node').register() + + return require(configFile) + } catch (err) { + if (err.code === 'MODULE_NOT_FOUND') { + throw new Error( + `'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${err.message}` + ) + } + + throw err + } finally { + registerer.enabled(false) + } + })) + } +} + +/** + * Load Config + * + * @method rc + * + * @param {Object} ctx Config Context + * @param {String} path Config Path + * @param {Object} options Config Options + * + * @return {Promise} config PostCSS Config + */ +const rc = withTypeScriptLoader((ctx, path, options) => { + /** + * @type {Object} The full Config Context + */ + ctx = createContext(ctx) + + /** + * @type {String} `process.cwd()` + */ + path = path ? resolve(path) : process.cwd() + + return config.lilconfig('postcss', options) + .search(path) + .then((result) => { + if (!result) { + throw new Error(`No PostCSS Config found in: ${path}`) + } + + return processResult(ctx, result) + }) +}) + +/** + * Autoload Config for PostCSS + * + * @author Michael Ciniawsky @michael-ciniawsky + * @license MIT + * + * @module postcss-load-config + * @version 2.1.0 + * + * @requires comsiconfig + * @requires ./options + * @requires ./plugins + */ +module.exports = rc diff --git a/node_modules/postcss-load-config/src/options.js b/node_modules/postcss-load-config/src/options.js new file mode 100644 index 0000000..d3ef2d6 --- /dev/null +++ b/node_modules/postcss-load-config/src/options.js @@ -0,0 +1,47 @@ +'use strict' + +const req = require('./req.js') + +/** + * Load Options + * + * @private + * @method options + * + * @param {Object} config PostCSS Config + * + * @return {Object} options PostCSS Options + */ +const options = (config, file) => { + if (config.parser && typeof config.parser === 'string') { + try { + config.parser = req(config.parser, file) + } catch (err) { + throw new Error(`Loading PostCSS Parser failed: ${err.message}\n\n(@${file})`) + } + } + + if (config.syntax && typeof config.syntax === 'string') { + try { + config.syntax = req(config.syntax, file) + } catch (err) { + throw new Error(`Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})`) + } + } + + if (config.stringifier && typeof config.stringifier === 'string') { + try { + config.stringifier = req(config.stringifier, file) + } catch (err) { + throw new Error(`Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})`) + } + } + + if (config.plugins) { + delete config.plugins + } + + return config +} + +module.exports = options diff --git a/node_modules/postcss-load-config/src/plugins.js b/node_modules/postcss-load-config/src/plugins.js new file mode 100644 index 0000000..6cb994b --- /dev/null +++ b/node_modules/postcss-load-config/src/plugins.js @@ -0,0 +1,85 @@ +'use strict' + +const req = require('./req.js') + +/** + * Plugin Loader + * + * @private + * @method load + * + * @param {String} plugin PostCSS Plugin Name + * @param {Object} options PostCSS Plugin Options + * + * @return {Function} PostCSS Plugin + */ +const load = (plugin, options, file) => { + try { + if ( + options === null || + options === undefined || + Object.keys(options).length === 0 + ) { + return req(plugin, file) + } else { + return req(plugin, file)(options) + } + } catch (err) { + throw new Error(`Loading PostCSS Plugin failed: ${err.message}\n\n(@${file})`) + } +} + +/** + * Load Plugins + * + * @private + * @method plugins + * + * @param {Object} config PostCSS Config Plugins + * + * @return {Array} plugins PostCSS Plugins + */ +const plugins = (config, file) => { + let plugins = [] + + if (Array.isArray(config.plugins)) { + plugins = config.plugins.filter(Boolean) + } else { + plugins = Object.keys(config.plugins) + .filter((plugin) => { + return config.plugins[plugin] !== false ? plugin : '' + }) + .map((plugin) => { + return load(plugin, config.plugins[plugin], file) + }) + } + + if (plugins.length && plugins.length > 0) { + plugins.forEach((plugin, i) => { + if (plugin.default) { + plugin = plugin.default + } + + if (plugin.postcss === true) { + plugin = plugin() + } else if (plugin.postcss) { + plugin = plugin.postcss + } + + if ( + // eslint-disable-next-line + !( + (typeof plugin === 'object' && Array.isArray(plugin.plugins)) || + (typeof plugin === 'object' && plugin.postcssPlugin) || + (typeof plugin === 'function') + ) + ) { + throw new TypeError(`Invalid PostCSS Plugin found at: plugins[${i}]\n\n(@${file})`) + } + }) + } + + return plugins +} + +module.exports = plugins diff --git a/node_modules/postcss-load-config/src/req.js b/node_modules/postcss-load-config/src/req.js new file mode 100644 index 0000000..42020c9 --- /dev/null +++ b/node_modules/postcss-load-config/src/req.js @@ -0,0 +1,10 @@ +// eslint-disable-next-line n/no-deprecated-api +const { createRequire, createRequireFromPath } = require('module') + +function req (name, rootFile) { + const create = createRequire || createRequireFromPath + const require = create(rootFile) + return require(name) +} + +module.exports = req diff --git a/node_modules/postcss-nested/LICENSE b/node_modules/postcss-nested/LICENSE new file mode 100644 index 0000000..1ae47a2 --- /dev/null +++ b/node_modules/postcss-nested/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2014 Andrey Sitnik + +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/postcss-nested/README.md b/node_modules/postcss-nested/README.md new file mode 100644 index 0000000..7e78ec8 --- /dev/null +++ b/node_modules/postcss-nested/README.md @@ -0,0 +1,86 @@ +# PostCSS Nested + + + +[PostCSS] plugin to unwrap nested rules closer to Sass syntax. + +```css +.phone { + &_title { + width: 500px; + @media (max-width: 500px) { + width: auto; + } + body.is_dark & { + color: white; + } + } + img { + display: block; + } +} + +.title { + font-size: var(--font); + + @at-root html { + --font: 16px + } +} +``` + +will be processed to: + +```css +.phone_title { + width: 500px; +} +@media (max-width: 500px) { + .phone_title { + width: auto; + } +} +body.is_dark .phone_title { + color: white; +} +.phone img { + display: block; +} + +.title { + font-size: var(--font); +} +html { + --font: 16px +} +``` + +Related plugins: + +* Use [`postcss-current-selector`] **after** this plugin if you want + to use current selector in properties or variables values. +* Use [`postcss-nested-ancestors`] **before** this plugin if you want + to reference any ancestor element directly in your selectors with `^&`. + +Alternatives: + +* See also [`postcss-nesting`], which implements [CSSWG draft]. +* [`postcss-nested-props`] for nested properties like `font-size`. + + + Sponsored by Evil Martians + + +[`postcss-current-selector`]: https://github.com/komlev/postcss-current-selector +[`postcss-nested-ancestors`]: https://github.com/toomuchdesign/postcss-nested-ancestors +[`postcss-nested-props`]: https://github.com/jedmao/postcss-nested-props +[`postcss-nesting`]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting +[CSSWG draft]: https://drafts.csswg.org/css-nesting-1/ +[PostCSS]: https://github.com/postcss/postcss + + +## Docs +Read full docs **[here](https://github.com/postcss/postcss-nested#readme)**. diff --git a/node_modules/postcss-nested/index.d.ts b/node_modules/postcss-nested/index.d.ts new file mode 100644 index 0000000..5367682 --- /dev/null +++ b/node_modules/postcss-nested/index.d.ts @@ -0,0 +1,41 @@ +// Original definitions (@types/postcss-nested) +// by Maxim Vorontsov + +import { PluginCreator } from 'postcss' + +declare namespace nested { + interface Options { + /** + * By default, plugin will bubble only `@media`, `@supports` and `@layer` + * at-rules. Use this option to add your custom at-rules to this list. + */ + bubble?: string[] + + /** + * By default, plugin will unwrap only `@font-face`, `@keyframes`, + * and `@document` at-rules. You can add your custom at-rules + * to this list by this option. + */ + unwrap?: string[] + + /** + * By default, plugin will strip out any empty selector generated + * by intermediate nesting levels. You can set this option to `true` + * to preserve them. + */ + preserveEmpty?: boolean + + /** + * The plugin supports the SCSS custom at-rule `@at-root` which breaks + * rule blocks out of their nested position. If you want, you can choose + * a new custom name for this rule in your code. + */ + rootRuleName?: string + } + + type Nested = PluginCreator +} + +declare const nested: nested.Nested + +export = nested diff --git a/node_modules/postcss-nested/index.js b/node_modules/postcss-nested/index.js new file mode 100644 index 0000000..fe8618e --- /dev/null +++ b/node_modules/postcss-nested/index.js @@ -0,0 +1,361 @@ +const { Rule, AtRule } = require('postcss') +let parser = require('postcss-selector-parser') + +/** + * Run a selector string through postcss-selector-parser + */ +function parse(rawSelector, rule) { + let nodes + try { + parser(parsed => { + nodes = parsed + }).processSync(rawSelector) + } catch (e) { + if (rawSelector.includes(':')) { + throw rule ? rule.error('Missed semicolon') : e + } else { + throw rule ? rule.error(e.message) : e + } + } + return nodes.at(0) +} + +/** + * Replaces the "&" token in a node's selector with the parent selector + * similar to what SCSS does. + * + * Mutates the nodes list + */ +function interpolateAmpInSelector(nodes, parent) { + let replaced = false + nodes.each(node => { + if (node.type === 'nesting') { + let clonedParent = parent.clone({}) + if (node.value !== '&') { + node.replaceWith( + parse(node.value.replace('&', clonedParent.toString())) + ) + } else { + node.replaceWith(clonedParent) + } + replaced = true + } else if ('nodes' in node && node.nodes) { + if (interpolateAmpInSelector(node, parent)) { + replaced = true + } + } + }) + return replaced +} + +/** + * Combines parent and child selectors, in a SCSS-like way + */ +function mergeSelectors(parent, child) { + let merged = [] + parent.selectors.forEach(sel => { + let parentNode = parse(sel, parent) + + child.selectors.forEach(selector => { + if (!selector) { + return + } + let node = parse(selector, child) + let replaced = interpolateAmpInSelector(node, parentNode) + if (!replaced) { + node.prepend(parser.combinator({ value: ' ' })) + node.prepend(parentNode.clone({})) + } + merged.push(node.toString()) + }) + }) + return merged +} + +/** + * Move a child and its preceeding comment(s) to after "after" + */ +function breakOut(child, after) { + let prev = child.prev() + after.after(child) + while (prev && prev.type === 'comment') { + let nextPrev = prev.prev() + after.after(prev) + prev = nextPrev + } + return child +} + +function createFnAtruleChilds(bubble) { + return function atruleChilds(rule, atrule, bubbling, mergeSels = bubbling) { + let children = [] + atrule.each(child => { + if (child.type === 'rule' && bubbling) { + if (mergeSels) { + child.selectors = mergeSelectors(rule, child) + } + } else if (child.type === 'atrule' && child.nodes) { + if (bubble[child.name]) { + atruleChilds(rule, child, mergeSels) + } else if (atrule[rootRuleMergeSel] !== false) { + children.push(child) + } + } else { + children.push(child) + } + }) + if (bubbling) { + if (children.length) { + let clone = rule.clone({ nodes: [] }) + for (let child of children) { + clone.append(child) + } + atrule.prepend(clone) + } + } + } +} + +function pickDeclarations(selector, declarations, after) { + let parent = new Rule({ + selector, + nodes: [] + }) + parent.append(declarations) + after.after(parent) + return parent +} + +function atruleNames(defaults, custom) { + let list = {} + for (let name of defaults) { + list[name] = true + } + if (custom) { + for (let name of custom) { + list[name.replace(/^@/, '')] = true + } + } + return list +} + +function parseRootRuleParams(params) { + params = params.trim() + let braceBlock = params.match(/^\((.*)\)$/) + if (!braceBlock) { + return { type: 'basic', selector: params } + } + let bits = braceBlock[1].match(/^(with(?:out)?):(.+)$/) + if (bits) { + let allowlist = bits[1] === 'with' + let rules = Object.fromEntries( + bits[2] + .trim() + .split(/\s+/) + .map(name => [name, true]) + ) + if (allowlist && rules.all) { + return { type: 'noop' } + } + let escapes = rule => !!rules[rule] + if (rules.all) { + escapes = () => true + } else if (allowlist) { + escapes = rule => (rule === 'all' ? false : !rules[rule]) + } + + return { + type: 'withrules', + escapes + } + } + // Unrecognized brace block + return { type: 'unknown' } +} + +function getAncestorRules(leaf) { + let lineage = [] + let parent = leaf.parent + + while (parent && parent instanceof AtRule) { + lineage.push(parent) + parent = parent.parent + } + return lineage +} + +function unwrapRootRule(rule) { + let escapes = rule[rootRuleEscapes] + + if (!escapes) { + rule.after(rule.nodes) + } else { + let nodes = rule.nodes + + let topEscaped + let topEscapedIdx = -1 + let breakoutLeaf + let breakoutRoot + let clone + + let lineage = getAncestorRules(rule) + lineage.forEach((parent, i) => { + if (escapes(parent.name)) { + topEscaped = parent + topEscapedIdx = i + breakoutRoot = clone + } else { + let oldClone = clone + clone = parent.clone({ nodes: [] }) + oldClone && clone.append(oldClone) + breakoutLeaf = breakoutLeaf || clone + } + }) + + if (!topEscaped) { + rule.after(nodes) + } else if (!breakoutRoot) { + topEscaped.after(nodes) + } else { + let leaf = breakoutLeaf + leaf.append(nodes) + topEscaped.after(breakoutRoot) + } + + if (rule.next() && topEscaped) { + let restRoot + lineage.slice(0, topEscapedIdx + 1).forEach((parent, i, arr) => { + let oldRoot = restRoot + restRoot = parent.clone({ nodes: [] }) + oldRoot && restRoot.append(oldRoot) + + let nextSibs = [] + let _child = arr[i - 1] || rule + let next = _child.next() + while (next) { + nextSibs.push(next) + next = next.next() + } + restRoot.append(nextSibs) + }) + restRoot && (breakoutRoot || nodes[nodes.length - 1]).after(restRoot) + } + } + + rule.remove() +} + +const rootRuleMergeSel = Symbol('rootRuleMergeSel') +const rootRuleEscapes = Symbol('rootRuleEscapes') + +function normalizeRootRule(rule) { + let { params } = rule + let { type, selector, escapes } = parseRootRuleParams(params) + if (type === 'unknown') { + throw rule.error( + `Unknown @${rule.name} parameter ${JSON.stringify(params)}` + ) + } + if (type === 'basic' && selector) { + let selectorBlock = new Rule({ selector, nodes: rule.nodes }) + rule.removeAll() + rule.append(selectorBlock) + } + rule[rootRuleEscapes] = escapes + rule[rootRuleMergeSel] = escapes ? !escapes('all') : type === 'noop' +} + +const hasRootRule = Symbol('hasRootRule') + +module.exports = (opts = {}) => { + let bubble = atruleNames( + ['media', 'supports', 'layer', 'container'], + opts.bubble + ) + let atruleChilds = createFnAtruleChilds(bubble) + let unwrap = atruleNames( + [ + 'document', + 'font-face', + 'keyframes', + '-webkit-keyframes', + '-moz-keyframes' + ], + opts.unwrap + ) + let rootRuleName = (opts.rootRuleName || 'at-root').replace(/^@/, '') + let preserveEmpty = opts.preserveEmpty + + return { + postcssPlugin: 'postcss-nested', + + Once(root) { + root.walkAtRules(rootRuleName, node => { + normalizeRootRule(node) + root[hasRootRule] = true + }) + }, + + Rule(rule) { + let unwrapped = false + let after = rule + let copyDeclarations = false + let declarations = [] + + rule.each(child => { + if (child.type === 'rule') { + if (declarations.length) { + after = pickDeclarations(rule.selector, declarations, after) + declarations = [] + } + + copyDeclarations = true + unwrapped = true + child.selectors = mergeSelectors(rule, child) + after = breakOut(child, after) + } else if (child.type === 'atrule') { + if (declarations.length) { + after = pickDeclarations(rule.selector, declarations, after) + declarations = [] + } + if (child.name === rootRuleName) { + unwrapped = true + atruleChilds(rule, child, true, child[rootRuleMergeSel]) + after = breakOut(child, after) + } else if (bubble[child.name]) { + copyDeclarations = true + unwrapped = true + atruleChilds(rule, child, true) + after = breakOut(child, after) + } else if (unwrap[child.name]) { + copyDeclarations = true + unwrapped = true + atruleChilds(rule, child, false) + after = breakOut(child, after) + } else if (copyDeclarations) { + declarations.push(child) + } + } else if (child.type === 'decl' && copyDeclarations) { + declarations.push(child) + } + }) + + if (declarations.length) { + after = pickDeclarations(rule.selector, declarations, after) + } + + if (unwrapped && preserveEmpty !== true) { + rule.raws.semicolon = true + if (rule.nodes.length === 0) rule.remove() + } + }, + + RootExit(root) { + if (root[hasRootRule]) { + root.walkAtRules(rootRuleName, unwrapRootRule) + root[hasRootRule] = false + } + } + } +} +module.exports.postcss = true diff --git a/node_modules/postcss-nested/package.json b/node_modules/postcss-nested/package.json new file mode 100644 index 0000000..3c9d9ac --- /dev/null +++ b/node_modules/postcss-nested/package.json @@ -0,0 +1,28 @@ +{ + "name": "postcss-nested", + "version": "6.0.1", + "description": "PostCSS plugin to unwrap nested rules like how Sass does it", + "keywords": [ + "postcss", + "css", + "postcss-plugin", + "sass", + "nested" + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "postcss/postcss-nested", + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" + }, + "dependencies": { + "postcss-selector-parser": "^6.0.11" + } +} diff --git a/node_modules/postcss-selector-parser/API.md b/node_modules/postcss-selector-parser/API.md new file mode 100644 index 0000000..64459e3 --- /dev/null +++ b/node_modules/postcss-selector-parser/API.md @@ -0,0 +1,872 @@ +# API Documentation + +*Please use only this documented API when working with the parser. Methods +not documented here are subject to change at any point.* + +## `parser` function + +This is the module's main entry point. + +```js +const parser = require('postcss-selector-parser'); +``` + +### `parser([transform], [options])` + +Creates a new `processor` instance + +```js +const processor = parser(); +``` + +Or, with optional transform function + +```js +const transform = selectors => { + selectors.walkUniversals(selector => { + selector.remove(); + }); +}; + +const processor = parser(transform) + +// Example +const result = processor.processSync('*.class'); +// => .class +``` + +[See processor documentation](#processor) + +Arguments: + +* `transform (function)`: Provide a function to work with the parsed AST. +* `options (object)`: Provide default options for all calls on the returned `Processor`. + +### `parser.attribute([props])` + +Creates a new attribute selector. + +```js +parser.attribute({attribute: 'href'}); +// => [href] +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.className([props])` + +Creates a new class selector. + +```js +parser.className({value: 'button'}); +// => .button +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.combinator([props])` + +Creates a new selector combinator. + +```js +parser.combinator({value: '+'}); +// => + +``` + +Arguments: + +* `props (object)`: The new node's properties. + +Notes: +* **Descendant Combinators** The value of descendant combinators created by the + parser always just a single space (`" "`). For descendant selectors with no + comments, additional space is now stored in `node.spaces.before`. Depending + on the location of comments, additional spaces may be stored in + `node.raws.spaces.before`, `node.raws.spaces.after`, or `node.raws.value`. +* **Named Combinators** Although, nonstandard and unlikely to ever become a standard, + named combinators like `/deep/` and `/for/` are parsed as combinators. The + `node.value` is name after being unescaped and normalized as lowercase. The + original value for the combinator name is stored in `node.raws.value`. + + +### `parser.comment([props])` + +Creates a new comment. + +```js +parser.comment({value: '/* Affirmative, Dave. I read you. */'}); +// => /* Affirmative, Dave. I read you. */ +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.id([props])` + +Creates a new id selector. + +```js +parser.id({value: 'search'}); +// => #search +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.nesting([props])` + +Creates a new nesting selector. + +```js +parser.nesting(); +// => & +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.pseudo([props])` + +Creates a new pseudo selector. + +```js +parser.pseudo({value: '::before'}); +// => ::before +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.root([props])` + +Creates a new root node. + +```js +parser.root(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.selector([props])` + +Creates a new selector node. + +```js +parser.selector(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.string([props])` + +Creates a new string node. + +```js +parser.string(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.tag([props])` + +Creates a new tag selector. + +```js +parser.tag({value: 'button'}); +// => button +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.universal([props])` + +Creates a new universal selector. + +```js +parser.universal(); +// => * +``` + +Arguments: + +* `props (object)`: The new node's properties. + +## Node types + +### `node.type` + +A string representation of the selector type. It can be one of the following; +`attribute`, `class`, `combinator`, `comment`, `id`, `nesting`, `pseudo`, +`root`, `selector`, `string`, `tag`, or `universal`. Note that for convenience, +these constants are exposed on the main `parser` as uppercased keys. So for +example you can get `id` by querying `parser.ID`. + +```js +parser.attribute({attribute: 'href'}).type; +// => 'attribute' +``` + +### `node.parent` + +Returns the parent node. + +```js +root.nodes[0].parent === root; +``` + +### `node.toString()`, `String(node)`, or `'' + node` + +Returns a string representation of the node. + +```js +const id = parser.id({value: 'search'}); +console.log(String(id)); +// => #search +``` + +### `node.next()` & `node.prev()` + +Returns the next/previous child of the parent node. + +```js +const next = id.next(); +if (next && next.type !== 'combinator') { + throw new Error('Qualified IDs are not allowed!'); +} +``` + +### `node.replaceWith(node)` + +Replace a node with another. + +```js +const attr = selectors.first.first; +const className = parser.className({value: 'test'}); +attr.replaceWith(className); +``` + +Arguments: + +* `node`: The node to substitute the original with. + +### `node.remove()` + +Removes the node from its parent node. + +```js +if (node.type === 'id') { + node.remove(); +} +``` + +### `node.clone([opts])` + +Returns a copy of a node, detached from any parent containers that the +original might have had. + +```js +const cloned = node.clone(); +``` + +### `node.isAtPosition(line, column)` + +Return a `boolean` indicating whether this node includes the character at the +position of the given line and column. Returns `undefined` if the nodes lack +sufficient source metadata to determine the position. + +Arguments: + +* `line`: 1-index based line number relative to the start of the selector. +* `column`: 1-index based column number relative to the start of the selector. + +### `node.spaces` + +Extra whitespaces around the node will be moved into `node.spaces.before` and +`node.spaces.after`. So for example, these spaces will be moved as they have +no semantic meaning: + +```css + h1 , h2 {} +``` + +For descendent selectors, the value is always a single space. + +```css +h1 h2 {} +``` + +Additional whitespace is found in either the `node.spaces.before` and `node.spaces.after` depending on the presence of comments or other whitespace characters. If the actual whitespace does not start or end with a single space, the node's raw value is set to the actual space(s) found in the source. + +### `node.source` + +An object describing the node's start/end, line/column source position. + +Within the following CSS, the `.bar` class node ... + +```css +.foo, + .bar {} +``` + +... will contain the following `source` object. + +```js +source: { + start: { + line: 2, + column: 3 + }, + end: { + line: 2, + column: 6 + } +} +``` + +### `node.sourceIndex` + +The zero-based index of the node within the original source string. + +Within the following CSS, the `.baz` class node will have a `sourceIndex` of `12`. + +```css +.foo, .bar, .baz {} +``` + +## Container types + +The `root`, `selector`, and `pseudo` nodes have some helper methods for working +with their children. + +### `container.nodes` + +An array of the container's children. + +```js +// Input: h1 h2 +selectors.at(0).nodes.length // => 3 +selectors.at(0).nodes[0].value // => 'h1' +selectors.at(0).nodes[1].value // => ' ' +``` + +### `container.first` & `container.last` + +The first/last child of the container. + +```js +selector.first === selector.nodes[0]; +selector.last === selector.nodes[selector.nodes.length - 1]; +``` + +### `container.at(index)` + +Returns the node at position `index`. + +```js +selector.at(0) === selector.first; +selector.at(0) === selector.nodes[0]; +``` + +Arguments: + +* `index`: The index of the node to return. + +### `container.atPosition(line, column)` + +Returns the node at the source position `line` and `column`. + +```js +// Input: :not(.foo),\n#foo > :matches(ol, ul) +selector.atPosition(1, 1); // => :not(.foo) +selector.atPosition(2, 1); // => \n#foo +``` + +Arguments: + +* `line`: The line number of the node to return. +* `column`: The column number of the node to return. + +### `container.index(node)` + +Return the index of the node within its container. + +```js +selector.index(selector.nodes[2]) // => 2 +``` + +Arguments: + +* `node`: A node within the current container. + +### `container.length` + +Proxy to the length of the container's nodes. + +```js +container.length === container.nodes.length +``` + +### `container` Array iterators + +The container class provides proxies to certain Array methods; these are: + +* `container.map === container.nodes.map` +* `container.reduce === container.nodes.reduce` +* `container.every === container.nodes.every` +* `container.some === container.nodes.some` +* `container.filter === container.nodes.filter` +* `container.sort === container.nodes.sort` + +Note that these methods only work on a container's immediate children; recursive +iteration is provided by `container.walk`. + +### `container.each(callback)` + +Iterate the container's immediate children, calling `callback` for each child. +You may return `false` within the callback to break the iteration. + +```js +let className; +selectors.each((selector, index) => { + if (selector.type === 'class') { + className = selector.value; + return false; + } +}); +``` + +Note that unlike `Array#forEach()`, this iterator is safe to use whilst adding +or removing nodes from the container. + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + and `index` arguments. + +### `container.walk(callback)` + +Like `container#each`, but will also iterate child nodes as long as they are +`container` types. + +```js +selectors.walk((selector, index) => { + // all nodes +}); +``` + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + and `index` arguments. + +This iterator is safe to use whilst mutating `container.nodes`, +like `container#each`. + +### `container.walk` proxies + +The container class provides proxy methods for iterating over types of nodes, +so that it is easier to write modules that target specific selectors. Those +methods are: + +* `container.walkAttributes` +* `container.walkClasses` +* `container.walkCombinators` +* `container.walkComments` +* `container.walkIds` +* `container.walkNesting` +* `container.walkPseudos` +* `container.walkTags` +* `container.walkUniversals` + +### `container.split(callback)` + +This method allows you to split a group of nodes by returning `true` from +a callback. It returns an array of arrays, where each inner array corresponds +to the groups that you created via the callback. + +```js +// (input) => h1 h2>>h3 +const list = selectors.first.split(selector => { + return selector.type === 'combinator'; +}); + +// (node values) => [['h1', ' '], ['h2', '>>'], ['h3']] +``` + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + as an argument. + +### `container.prepend(node)` & `container.append(node)` + +Add a node to the start/end of the container. Note that doing so will set +the parent property of the node to this container. + +```js +const id = parser.id({value: 'search'}); +selector.append(id); +``` + +Arguments: + +* `node`: The node to add. + +### `container.insertBefore(old, new)` & `container.insertAfter(old, new)` + +Add a node before or after an existing node in a container: + +```js +selectors.walk(selector => { + if (selector.type !== 'class') { + const className = parser.className({value: 'theme-name'}); + selector.parent.insertAfter(selector, className); + } +}); +``` + +Arguments: + +* `old`: The existing node in the container. +* `new`: The new node to add before/after the existing node. + +### `container.removeChild(node)` + +Remove the node from the container. Note that you can also use +`node.remove()` if you would like to remove just a single node. + +```js +selector.length // => 2 +selector.remove(id) +selector.length // => 1; +id.parent // undefined +``` + +Arguments: + +* `node`: The node to remove. + +### `container.removeAll()` or `container.empty()` + +Remove all children from the container. + +```js +selector.removeAll(); +selector.length // => 0 +``` + +## Root nodes + +A root node represents a comma separated list of selectors. Indeed, all +a root's `toString()` method does is join its selector children with a ','. +Other than this, it has no special functionality and acts like a container. + +### `root.trailingComma` + +This will be set to `true` if the input has a trailing comma, in order to +support parsing of legacy CSS hacks. + +## Selector nodes + +A selector node represents a single complex selector. For example, this +selector string `h1 h2 h3, [href] > p`, is represented as two selector nodes. +It has no special functionality of its own. + +## Pseudo nodes + +A pseudo selector extends a container node; if it has any parameters of its +own (such as `h1:not(h2, h3)`), they will be its children. Note that the pseudo +`value` will always contain the colons preceding the pseudo identifier. This +is so that both `:before` and `::before` are properly represented in the AST. + +## Attribute nodes + +### `attribute.quoted` + +Returns `true` if the attribute's value is wrapped in quotation marks, false if it is not. +Remains `undefined` if there is no attribute value. + +```css +[href=foo] /* false */ +[href='foo'] /* true */ +[href="foo"] /* true */ +[href] /* undefined */ +``` + +### `attribute.qualifiedAttribute` + +Returns the attribute name qualified with the namespace if one is given. + +### `attribute.offsetOf(part)` + + Returns the offset of the attribute part specified relative to the + start of the node of the output string. This is useful in raising + error messages about a specific part of the attribute, especially + in combination with `attribute.sourceIndex`. + + Returns `-1` if the name is invalid or the value doesn't exist in this + attribute. + + The legal values for `part` are: + + * `"ns"` - alias for "namespace" + * `"namespace"` - the namespace if it exists. + * `"attribute"` - the attribute name + * `"attributeNS"` - the start of the attribute or its namespace + * `"operator"` - the match operator of the attribute + * `"value"` - The value (string or identifier) + * `"insensitive"` - the case insensitivity flag + +### `attribute.raws.unquoted` + +Returns the unquoted content of the attribute's value. +Remains `undefined` if there is no attribute value. + +```css +[href=foo] /* foo */ +[href='foo'] /* foo */ +[href="foo"] /* foo */ +[href] /* undefined */ +``` + +### `attribute.spaces` + +Like `node.spaces` with the `before` and `after` values containing the spaces +around the element, the parts of the attribute can also have spaces before +and after them. The for each of `attribute`, `operator`, `value` and +`insensitive` there is corresponding property of the same nam in +`node.spaces` that has an optional `before` or `after` string containing only +whitespace. + +Note that corresponding values in `attributes.raws.spaces` contain values +including any comments. If set, these values will override the +`attribute.spaces` value. Take care to remove them if changing +`attribute.spaces`. + +### `attribute.raws` + +The raws object stores comments and other information necessary to re-render +the node exactly as it was in the source. + +If a comment is embedded within the identifiers for the `namespace`, `attribute` +or `value` then a property is placed in the raws for that value containing the full source of the propery including comments. + +If a comment is embedded within the space between parts of the attribute +then the raw for that space is set accordingly. + +Setting an attribute's property `raws` value to be deleted. + +For now, changing the spaces required also updating or removing any of the +raws values that override them. + +Example: `[ /*before*/ href /* after-attr */ = /* after-operator */ te/*inside-value*/st/* wow */ /*omg*/i/*bbq*/ /*whodoesthis*/]` would parse as: + +```js +{ + attribute: "href", + operator: "=", + value: "test", + spaces: { + before: '', + after: '', + attribute: { before: ' ', after: ' ' }, + operator: { after: ' ' }, + value: { after: ' ' }, + insensitive: { after: ' ' } + }, + raws: { + spaces: { + attribute: { before: ' /*before*/ ', after: ' /* after-attr */ ' }, + operator: { after: ' /* after-operator */ ' }, + value: { after: '/* wow */ /*omg*/' }, + insensitive: { after: '/*bbq*/ /*whodoesthis*/' } + }, + unquoted: 'test', + value: 'te/*inside-value*/st' + } +} +``` + +## `Processor` + +### `ProcessorOptions` + +* `lossless` - When `true`, whitespace is preserved. Defaults to `true`. +* `updateSelector` - When `true`, if any processor methods are passed a postcss + `Rule` node instead of a string, then that Rule's selector is updated + with the results of the processing. Defaults to `true`. + +### `process|processSync(selectors, [options])` + +Processes the `selectors`, returning a string from the result of processing. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +**Example:** + +```js +const parser = require("postcss-selector-parser"); +const processor = parser(); + +let result = processor.processSync(' .class'); +console.log(result); +// => .class + +// Asynchronous operation +let promise = processor.process(' .class').then(result => { + console.log(result) + // => .class +}); + +// To have the parser normalize whitespace values, utilize the options +result = processor.processSync(' .class ', {lossless: false}); +console.log(result); +// => .class + +// For better syntax errors, pass a PostCSS Rule node. +const postcss = require('postcss'); +rule = postcss.rule({selector: ' #foo > a, .class '}); +processor.process(rule, {lossless: false, updateSelector: true}).then(result => { + console.log(result); + // => #foo>a,.class + console.log("rule:", rule.selector); + // => rule: #foo>a,.class +}) +``` + +Arguments: + +* `selectors (string|postcss.Rule)`: Either a selector string or a PostCSS Rule + node. +* `[options] (object)`: Process options + + +### `ast|astSync(selectors, [options])` + +Like `process()` and `processSync()` but after +processing the `selectors` these methods return the `Root` node of the result +instead of a string. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +### `transform|transformSync(selectors, [options])` + +Like `process()` and `processSync()` but after +processing the `selectors` these methods return the value returned by the +processor callback. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +### Error Handling Within Selector Processors + +The root node passed to the selector processor callback +has a method `error(message, options)` that returns an +error object. This method should always be used to raise +errors relating to the syntax of selectors. The options +to this method are passed to postcss's error constructor +([documentation](http://api.postcss.org/Container.html#error)). + +#### Async Error Example + +```js +let processor = (root) => { + return new Promise((resolve, reject) => { + root.walkClasses((classNode) => { + if (/^(.*)[-_]/.test(classNode.value)) { + let msg = "classes may not have underscores or dashes in them"; + reject(root.error(msg, { + index: classNode.sourceIndex + RegExp.$1.length + 1, + word: classNode.value + })); + } + }); + resolve(); + }); +}; + +const postcss = require("postcss"); +const parser = require("postcss-selector-parser"); +const selectorProcessor = parser(processor); +const plugin = postcss.plugin('classValidator', (options) => { + return (root) => { + let promises = []; + root.walkRules(rule => { + promises.push(selectorProcessor.process(rule)); + }); + return Promise.all(promises); + }; +}); +postcss(plugin()).process(` +.foo-bar { + color: red; +} +`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); + +// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them +// +// > 1 | .foo-bar { +// | ^ +// 2 | color: red; +// 3 | } +``` + +#### Synchronous Error Example + +```js +let processor = (root) => { + root.walkClasses((classNode) => { + if (/.*[-_]/.test(classNode.value)) { + let msg = "classes may not have underscores or dashes in them"; + throw root.error(msg, { + index: classNode.sourceIndex, + word: classNode.value + }); + } + }); +}; + +const postcss = require("postcss"); +const parser = require("postcss-selector-parser"); +const selectorProcessor = parser(processor); +const plugin = postcss.plugin('classValidator', (options) => { + return (root) => { + root.walkRules(rule => { + selectorProcessor.processSync(rule); + }); + }; +}); +postcss(plugin()).process(` +.foo-bar { + color: red; +} +`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); + +// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them +// +// > 1 | .foo-bar { +// | ^ +// 2 | color: red; +// 3 | } +``` diff --git a/node_modules/postcss-selector-parser/CHANGELOG.md b/node_modules/postcss-selector-parser/CHANGELOG.md new file mode 100644 index 0000000..cb718db --- /dev/null +++ b/node_modules/postcss-selector-parser/CHANGELOG.md @@ -0,0 +1,525 @@ +# 6.0.13 + +- Fixed: throw on unexpected pipe symbols + +# 6.0.12 + +- Fixed: `clone` arguments should be optional + +# 6.0.11 + +- Fixed: parse attribute case insensitivity flag + +# 6.0.10 + +- Fixed: `isPseudoElement()` supports `:first-letter` and `:first-line` + +# 6.0.9 + +- Fixed: `Combinator.raws` property type + +# 6.0.8 + +- Fixed: reduced size + +# 6.0.7 + +- Fixed: parse animation percents + +# 6.0.6 + +- Fixed: parse quoted attributes containing a newline correctly + +# 6.0.5 + +- Perf: rework unesc for a 63+% performance boost + +# 6.0.4 + +- Fixed: ts errors + +# 6.0.3 + +- Fixed: replace node built-in "util" module with "util-deprecate" +- Fixed: handle uppercase pseudo elements +- Fixed: do not create invalid combinator before comment + +# 6.0.2 + +- Fixed an issue with parsing and stringifying an empty attribute value + +# 6.0.1 + +- Fixed an issue with unicode surrogate pair parsing + +# 6.0.0 + +- Updated: `cssesc` to 3.0.0 (major) +- Fixed: Issues with escaped `id` and `class` selectors + +# 5.0.0 + +- Allow escaped dot within class name. +- Update PostCSS to 7.0.7 (patch) + +# 5.0.0-rc.4 + +- Fixed an issue where comments immediately after an insensitive (in attribute) + were not parsed correctly. +- Updated `cssesc` to 2.0.0 (major). +- Removed outdated integration tests. +- Added tests for custom selectors, tags with attributes, the universal + selector with pseudos, and tokens after combinators. + +# 5.0.0-rc.1 + +To ease adoption of the v5.0 release, we have relaxed the node version +check performed by npm at installation time to allow for node 4, which +remains officially unsupported, but likely to continue working for the +time being. + +# 5.0.0-rc.0 + +This release has **BREAKING CHANGES** that were required to fix regressions +in 4.0.0 and to make the Combinator Node API consistent for all combinator +types. Please read carefully. + +## Summary of Changes + +* The way a descendent combinator that isn't a single space character (E.g. `.a .b`) is stored in the AST has changed. +* Named Combinators (E.g. `.a /for/ .b`) are now properly parsed as a combinator. +* It is now possible to look up a node based on the source location of a character in that node and to query nodes if they contain some character. +* Several bug fixes that caused the parser to hang and run out of memory when a `/` was encountered have been fixed. +* The minimum supported version of Node is now `v6.0.0`. + +### Changes to the Descendent Combinator + +In prior releases, the value of a descendant combinator with multiple spaces included all the spaces. + +* `.a .b`: Extra spaces are now stored as space before. + - Old & Busted: + - `combinator.value === " "` + - New hotness: + - `combinator.value === " " && combinator.spaces.before === " "` +* `.a /*comment*/.b`: A comment at the end of the combinator causes extra space to become after space. + - Old & Busted: + - `combinator.value === " "` + - `combinator.raws.value === " /*comment/"` + - New hotness: + - `combinator.value === " "` + - `combinator.spaces.after === " "` + - `combinator.raws.spaces.after === " /*comment*/"` +* `.a.b`: whitespace that doesn't start or end with a single space character is stored as a raw value. + - Old & Busted: + - `combinator.value === "\n"` + - `combinator.raws.value === undefined` + - New hotness: + - `combinator.value === " "` + - `combinator.raws.value === "\n"` + +### Support for "Named Combinators" + +Although, nonstandard and unlikely to ever become a standard, combinators like `/deep/` and `/for/` are now properly supported. + +Because they've been taken off the standardization track, there is no spec-official name for combinators of the form `//`. However, I talked to [Tab Atkins](https://twitter.com/tabatkins) and we agreed to call them "named combinators" so now they are called that. + +Before this release such named combinators were parsed without intention and generated three nodes of type `"tag"` where the first and last nodes had a value of `"/"`. + +* `.a /for/ .b` is parsed as a combinator. + - Old & Busted: + - `root.nodes[0].nodes[1].type === "tag"` + - `root.nodes[0].nodes[1].value === "/"` + - New hotness: + - `root.nodes[0].nodes[1].type === "combinator"` + - `root.nodes[0].nodes[1].value === "/for/"` +* `.a /F\6fR/ .b` escapes are handled and uppercase is normalized. + - Old & Busted: + - `root.nodes[0].nodes[2].type === "tag"` + - `root.nodes[0].nodes[2].value === "F\\6fR"` + - New hotness: + - `root.nodes[0].nodes[1].type === "combinator"` + - `root.nodes[0].nodes[1].value === "/for/"` + - `root.nodes[0].nodes[1].raws.value === "/F\\6fR/"` + +### Source position checks and lookups + +A new API was added to look up a node based on the source location. + +```js +const selectorParser = require("postcss-selector-parser"); +// You can find the most specific node for any given character +let combinator = selectorParser.astSync(".a > .b").atPosition(1,4); +combinator.toString() === " > "; +// You can check if a node includes a specific character +// Whitespace surrounding the node that is owned by that node +// is included in the check. +[2,3,4,5,6].map(column => combinator.isAtPosition(1, column)); +// => [false, true, true, true, false] +``` + +# 4.0.0 + +This release has **BREAKING CHANGES** that were required to fix bugs regarding values with escape sequences. Please read carefully. + +* **Identifiers with escapes** - CSS escape sequences are now hidden from the public API by default. + The normal value of a node like a class name or ID, or an aspect of a node such as attribute + selector's value, is unescaped. Escapes representing Non-ascii characters are unescaped into + unicode characters. For example: `bu\tton, .\31 00, #i\2764\FE0Fu, [attr="value is \"quoted\""]` + will parse respectively to the values `button`, `100`, `i❤️u`, `value is "quoted"`. + The original escape sequences for these values can be found in the corresponding property name + in `node.raws`. Where possible, deprecation warnings were added, but the nature + of escape handling makes it impossible to detect what is escaped or not. Our expectation is + that most users are neither expecting nor handling escape sequences in their use of this library, + and so for them, this is a bug fix. Users who are taking care to handle escapes correctly can + now update their code to remove the escape handling and let us do it for them. + +* **Mutating values with escapes** - When you make an update to a node property that has escape handling + The value is assumed to be unescaped, and any special characters are escaped automatically and + the corresponding `raws` value is immediately updated. This can result in changes to the original + escape format. Where the exact value of the escape sequence is important there are methods that + allow both values to be set in conjunction. There are a number of new convenience methods for + manipulating values that involve escapes, especially for attributes values where the quote mark + is involved. See https://github.com/postcss/postcss-selector-parser/pull/133 for an extensive + write-up on these changes. + + +**Upgrade/API Example** + +In `3.x` there was no unescape handling and internal consistency of several properties was the caller's job to maintain. It was very easy for the developer +to create a CSS file that did not parse correctly when some types of values +were in use. + +```js +const selectorParser = require("postcss-selector-parser"); +let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value"}); +attr.value; // => "a-value" +attr.toString(); // => [id=a-value] +// Add quotes to an attribute's value. +// All these values have to be set by the caller to be consistent: +// no internal consistency is maintained. +attr.raws.unquoted = attr.value +attr.value = "'" + attr.value + "'"; +attr.value; // => "'a-value'" +attr.quoted = true; +attr.toString(); // => "[id='a-value']" +``` + +In `4.0` there is a convenient API for setting and mutating values +that may need escaping. Especially for attributes. + +```js +const selectorParser = require("postcss-selector-parser"); + +// The constructor requires you specify the exact escape sequence +let className = selectorParser.className({value: "illegal class name", raws: {value: "illegal\\ class\\ name"}}); +className.toString(); // => '.illegal\\ class\\ name' + +// So it's better to set the value as a property +className = selectorParser.className(); +// Most properties that deal with identifiers work like this +className.value = "escape for me"; +className.value; // => 'escape for me' +className.toString(); // => '.escape\\ for\\ me' + +// emoji and all non-ascii are escaped to ensure it works in every css file. +className.value = "😱🦄😍"; +className.value; // => '😱🦄😍' +className.toString(); // => '.\\1F631\\1F984\\1F60D' + +// you can control the escape sequence if you want, or do bad bad things +className.setPropertyAndEscape('value', 'xxxx', 'yyyy'); +className.value; // => "xxxx" +className.toString(); // => ".yyyy" + +// Pass a value directly through to the css output without escaping it. +className.setPropertyWithoutEscape('value', '$REPLACE_ME$'); +className.value; // => "$REPLACE_ME$" +className.toString(); // => ".$REPLACE_ME$" + +// The biggest changes are to the Attribute class +// passing quoteMark explicitly is required to avoid a deprecation warning. +let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value", quoteMark: null}); +attr.toString(); // => "[id=a-value]" +// Get the value with quotes on it and any necessary escapes. +// This is the same as reading attr.value in 3.x. +attr.getQuotedValue(); // => "a-value"; +attr.quoteMark; // => null + +// Add quotes to an attribute's value. +attr.quoteMark = "'"; // This is all that's required. +attr.toString(); // => "[id='a-value']" +attr.quoted; // => true +// The value is still the same, only the quotes have changed. +attr.value; // => a-value +attr.getQuotedValue(); // => "'a-value'"; + +// deprecated assignment, no warning because there's no escapes +attr.value = "new-value"; +// no quote mark is needed so it is removed +attr.getQuotedValue(); // => "new-value"; + +// deprecated assignment, +attr.value = "\"a 'single quoted' value\""; +// > (node:27859) DeprecationWarning: Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead. +attr.getQuotedValue(); // => '"a \'single quoted\' value"'; +// quote mark inferred from first and last characters. +attr.quoteMark; // => '"' + +// setValue takes options to make manipulating the value simple. +attr.setValue('foo', {smart: true}); +// foo doesn't require any escapes or quotes. +attr.toString(); // => '[id=foo]' +attr.quoteMark; // => null + +// An explicit quote mark can be specified +attr.setValue('foo', {quoteMark: '"'}); +attr.toString(); // => '[id="foo"]' + +// preserves quote mark by default +attr.setValue('bar'); +attr.toString(); // => '[id="bar"]' +attr.quoteMark = null; +attr.toString(); // => '[id=bar]' + +// with no arguments, it preserves quote mark even when it's not a great idea +attr.setValue('a value \n that should be quoted'); +attr.toString(); // => '[id=a\\ value\\ \\A\\ that\\ should\\ be\\ quoted]' + +// smart preservation with a specified default +attr.setValue('a value \n that should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"}); +// => "[id='a value \\A that should be quoted']" +attr.quoteMark = '"'; +// => '[id="a value \\A that should be quoted"]' + +// this keeps double quotes because it wants to quote the value and the existing value has double quotes. +attr.setValue('this should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"}); +// => '[id="this should be quoted"]' + +// picks single quotes because the value has double quotes +attr.setValue('a "double quoted" value', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"}); +// => "[id='a "double quoted" value']" + +// setPropertyAndEscape lets you do anything you want. Even things that are a bad idea and illegal. +attr.setPropertyAndEscape('value', 'xxxx', 'the password is 42'); +attr.value; // => "xxxx" +attr.toString(); // => "[id=the password is 42]" + +// Pass a value directly through to the css output without escaping it. +attr.setPropertyWithoutEscape('value', '$REPLACEMENT$'); +attr.value; // => "$REPLACEMENT$" +attr.toString(); // => "[id=$REPLACEMENT$]" +``` + +# 3.1.2 + +* Fix: Removed dot-prop dependency since it's no longer written in es5. + +# 3.1.1 + +* Fix: typescript definitions weren't in the published package. + +# 3.1.0 + +* Fixed numerous bugs in attribute nodes relating to the handling of comments + and whitespace. There's significant changes to `attrNode.spaces` and `attrNode.raws` since the `3.0.0` release. +* Added `Attribute#offsetOf(part)` to get the offset location of + attribute parts like `"operator"` and `"value"`. This is most + often added to `Attribute#sourceIndex` for error reporting. + +# 3.0.0 + +## Breaking changes + +* Some tweaks to the tokenizer/attribute selector parsing mean that whitespace + locations might be slightly different to the 2.x code. +* Better attribute selector parsing with more validation; postcss-selector-parser + no longer uses regular expressions to parse attribute selectors. +* Added an async API (thanks to @jacobp100); the default `process` API is now + async, and the sync API is now accessed through `processSync` instead. +* `process()` and `processSync()` now return a string instead of the Processor + instance. +* Tweaks handling of Less interpolation (thanks to @jwilsson). +* Removes support for Node 0.12. + +## Other changes + +* `ast()` and `astSync()` methods have been added to the `Processor`. These + return the `Root` node of the selectors after processing them. +* `transform()` and `transformSync()` methods have been added to the + `Processor`. These return the value returned by the processor callback + after processing the selectors. +* Set the parent when inserting a node (thanks to @chriseppstein). +* Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac). +* Fixes handling of namespaces with qualified tag selectors. +* `process`, `ast` and `transform` (and their sync variants) now accept a + `postcss` rule node. When provided, better errors are generated and selector + processing is automatically set back to the rule selector (unless the `updateSelector` option is set to `false`.) +* Now more memory efficient when tokenizing selectors. + +### Upgrade hints + +The pattern of: + +`rule.selector = processor.process(rule.selector).result.toString();` + +is now: + +`processor.processSync(rule)` + +# 2.2.3 + +* Resolves an issue where the parser would not reduce multiple spaces between an + ampersand and another simple selector in lossy mode (thanks to @adam-26). + +# 2.2.2 + +* No longer hangs on an unescaped semicolon; instead the parser will throw + an exception for these cases. + +# 2.2.1 + +* Allows a consumer to specify whitespace tokens when creating a new Node + (thanks to @Semigradsky). + +# 2.2.0 + +* Added a new option to normalize whitespace when parsing the selector string + (thanks to @adam-26). + +# 2.1.1 + +* Better unquoted value handling within attribute selectors + (thanks to @evilebottnawi). + +# 2.1.0 + +* Added: Use string constants for all node types & expose them on the main + parser instance (thanks to @Aweary). + +# 2.0.0 + +This release contains the following breaking changes: + +* Renamed all `eachInside` iterators to `walk`. For example, `eachTag` is now + `walkTags`, and `eachInside` is now `walk`. +* Renamed `Node#removeSelf()` to `Node#remove()`. +* Renamed `Container#remove()` to `Container#removeChild()`. +* Renamed `Node#raw` to `Node#raws` (thanks to @davidtheclark). +* Now parses `&` as the *nesting* selector, rather than a *tag* selector. +* Fixes misinterpretation of Sass interpolation (e.g. `#{foo}`) as an + id selector (thanks to @davidtheclark). + +and; + +* Fixes parsing of attribute selectors with equals signs in them + (e.g. `[data-attr="foo=bar"]`) (thanks to @montmanu). +* Adds `quoted` and `raw.unquoted` properties to attribute nodes + (thanks to @davidtheclark). + +# 1.3.3 + +* Fixes an infinite loop on `)` and `]` tokens when they had no opening pairs. + Now postcss-selector-parser will throw when it encounters these lone tokens. + +# 1.3.2 + +* Now uses plain integers rather than `str.charCodeAt(0)` for compiled builds. + +# 1.3.1 + +* Update flatten to v1.x (thanks to @shinnn). + +# 1.3.0 + +* Adds a new node type, `String`, to fix a crash on selectors such as + `foo:bar("test")`. + +# 1.2.1 + +* Fixes a crash when the parser encountered a trailing combinator. + +# 1.2.0 + +* A more descriptive error is thrown when the parser expects to find a + pseudo-class/pseudo-element (thanks to @ashelley). +* Adds support for line/column locations for selector nodes, as well as a + `Node#sourceIndex` method (thanks to @davidtheclark). + +# 1.1.4 + +* Fixes a crash when a selector started with a `>` combinator. The module will + now no longer throw if a selector has a leading/trailing combinator node. + +# 1.1.3 + +* Fixes a crash on `@` tokens. + +# 1.1.2 + +* Fixes an infinite loop caused by using parentheses in a non-pseudo element + context. + +# 1.1.1 + +* Fixes a crash when a backslash ended a selector string. + +# 1.1.0 + +* Adds support for replacing multiple nodes at once with `replaceWith` + (thanks to @jonathantneal). +* Parser no longer throws on sequential IDs and trailing commas, to support + parsing of selector hacks. + +# 1.0.1 + +* Fixes using `insertAfter` and `insertBefore` during iteration. + +# 1.0.0 + +* Adds `clone` and `replaceWith` methods to nodes. +* Adds `insertBefore` and `insertAfter` to containers. +* Stabilises API. + +# 0.0.5 + +* Fixes crash on extra whitespace inside a pseudo selector's parentheses. +* Adds sort function to the container class. +* Enables the parser to pass its input through without transforming. +* Iteration-safe `each` and `eachInside`. + +# 0.0.4 + +* Tidy up redundant duplication. +* Fixes a bug where the parser would loop infinitely on universal selectors + inside pseudo selectors. +* Adds `length` getter and `eachInside`, `map`, `reduce` to the container class. +* When a selector has been removed from the tree, the root node will no longer + cast it to a string. +* Adds node type iterators to the container class (e.g. `eachComment`). +* Adds filter function to the container class. +* Adds split function to the container class. +* Create new node types by doing `parser.id(opts)` etc. +* Adds support for pseudo classes anywhere in the selector. + +# 0.0.3 + +* Adds `next` and `prev` to the node class. +* Adds `first` and `last` getters to the container class. +* Adds `every` and `some` iterators to the container class. +* Add `empty` alias for `removeAll`. +* Combinators are now types of node. +* Fixes the at method so that it is not an alias for `index`. +* Tidy up creation of new nodes in the parser. +* Refactors how namespaces are handled for consistency & less redundant code. +* Refactors AST to use `nodes` exclusively, and eliminates excessive nesting. +* Fixes nested pseudo parsing. +* Fixes whitespace parsing. + +# 0.0.2 + +* Adds support for namespace selectors. +* Adds support for selectors joined by escaped spaces - such as `.\31\ 0`. + +# 0.0.1 + +* Initial release. diff --git a/node_modules/postcss-selector-parser/LICENSE-MIT b/node_modules/postcss-selector-parser/LICENSE-MIT new file mode 100644 index 0000000..fd0e863 --- /dev/null +++ b/node_modules/postcss-selector-parser/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) Ben Briggs (http://beneb.info) + +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/postcss-selector-parser/README.md b/node_modules/postcss-selector-parser/README.md new file mode 100644 index 0000000..18a01c5 --- /dev/null +++ b/node_modules/postcss-selector-parser/README.md @@ -0,0 +1,49 @@ +# postcss-selector-parser [![Build Status](https://travis-ci.org/postcss/postcss-selector-parser.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-parser) + +> Selector parser with built in methods for working with selector strings. + +## Install + +With [npm](https://npmjs.com/package/postcss-selector-parser) do: + +``` +npm install postcss-selector-parser +``` + +## Quick Start + +```js +const parser = require('postcss-selector-parser'); +const transform = selectors => { + selectors.walk(selector => { + // do something with the selector + console.log(String(selector)) + }); +}; + +const transformed = parser(transform).processSync('h1, h2, h3'); +``` + +To normalize selector whitespace: + +```js +const parser = require('postcss-selector-parser'); +const normalized = parser().processSync('h1, h2, h3', {lossless: false}); +// -> h1,h2,h3 +``` + +Async support is provided through `parser.process` and will resolve a Promise +with the resulting selector string. + +## API + +Please see [API.md](API.md). + +## Credits + +* Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped + accelerate this module's development. + +## License + +MIT diff --git a/node_modules/postcss-selector-parser/dist/index.js b/node_modules/postcss-selector-parser/dist/index.js new file mode 100644 index 0000000..995741a --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/index.js @@ -0,0 +1,17 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _processor = _interopRequireDefault(require("./processor")); +var selectors = _interopRequireWildcard(require("./selectors")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +var parser = function parser(processor) { + return new _processor["default"](processor); +}; +Object.assign(parser, selectors); +delete parser.__esModule; +var _default = parser; +exports["default"] = _default; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/parser.js b/node_modules/postcss-selector-parser/dist/parser.js new file mode 100644 index 0000000..b4c75e3 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/parser.js @@ -0,0 +1,1012 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _root = _interopRequireDefault(require("./selectors/root")); +var _selector = _interopRequireDefault(require("./selectors/selector")); +var _className = _interopRequireDefault(require("./selectors/className")); +var _comment = _interopRequireDefault(require("./selectors/comment")); +var _id = _interopRequireDefault(require("./selectors/id")); +var _tag = _interopRequireDefault(require("./selectors/tag")); +var _string = _interopRequireDefault(require("./selectors/string")); +var _pseudo = _interopRequireDefault(require("./selectors/pseudo")); +var _attribute = _interopRequireWildcard(require("./selectors/attribute")); +var _universal = _interopRequireDefault(require("./selectors/universal")); +var _combinator = _interopRequireDefault(require("./selectors/combinator")); +var _nesting = _interopRequireDefault(require("./selectors/nesting")); +var _sortAscending = _interopRequireDefault(require("./sortAscending")); +var _tokenize = _interopRequireWildcard(require("./tokenize")); +var tokens = _interopRequireWildcard(require("./tokenTypes")); +var types = _interopRequireWildcard(require("./selectors/types")); +var _util = require("./util"); +var _WHITESPACE_TOKENS, _Object$assign; +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); +var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); +function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; +} +function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; +} +function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; +} +function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); +} +function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return undefined; + } + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); +} +function unescapeProp(node, prop) { + var value = node[prop]; + if (typeof value !== "string") { + return; + } + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, 'raws'); + node[prop] = (0, _util.unesc)(value); + if (node.raws[prop] === undefined) { + node.raws[prop] = value; + } + } + return node; +} +function indexesOf(array, item) { + var i = -1; + var indexes = []; + while ((i = array.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + return indexes; +} +function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function (item, i) { + return i === list.indexOf(item); + }); +} +var Parser = /*#__PURE__*/function () { + function Parser(rule, options) { + if (options === void 0) { + options = {}; + } + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root["default"]({ + source: rootSource + }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new _selector["default"]({ + source: { + start: { + line: 1, + column: 1 + } + } + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + var _proto = Parser.prototype; + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + return function (message, errorOptions) { + if (typeof _this.rule === 'string') { + return new Error(message); + } + return _this.rule.error(message, errorOptions); + }; + }; + _proto.attribute = function attribute() { + var attr = []; + var startingToken = this.currToken; + this.position++; + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + } + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { + return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); + } + var pos = 0; + var spaceBefore = ''; + var commentBefore = ''; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + // if ( + // len === 1 || + // pos === 0 && this.content(next) === '|' + // ) { + // return this.expected('attribute', token[TOKEN.START_POS], content); + // } + spaceAfterMeaningfulToken = true; + if (this.options.lossy) { + break; + } + if (lastAdded) { + (0, _util.ensureObject)(node, 'spaces', lastAdded); + var prevContent = node.spaces[lastAdded].after || ''; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; + if (existingComment) { + node.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + break; + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ''; + } + node.namespace = (node.namespace || "") + content; + var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; + if (rawValue) { + node.raws.namespace += content; + } + lastAdded = 'namespace'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); + node.value += "$"; + if (oldRawValue) { + node.raws.value = oldRawValue + "$"; + } + break; + } + // Falls through + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.combinator: + if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + if (content !== '|') { + spaceAfterMeaningfulToken = false; + break; + } + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if (!node.namespace && !node.attribute) { + node.namespace = true; + } + spaceAfterMeaningfulToken = false; + break; + case tokens.word: + if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && + // this look-ahead probably fails with comment nodes involved. + !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = 'namespace'; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ''; + } + node.attribute = (node.attribute || "") + content; + var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; + if (_rawValue) { + node.raws.attribute += content; + } + lastAdded = 'attribute'; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { + var _unescaped = (0, _util.unesc)(content); + var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; + var oldValue = node.value || ''; + node.value = oldValue + _unescaped; + node.quoteMark = null; + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = (_oldRawValue || oldValue) + content; + } + lastAdded = 'value'; + } else { + var insensitive = content === 'i' || content === "I"; + if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, 'raws'); + node.raws.insensitiveFlag = content; + } + lastAdded = 'insensitive'; + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'insensitive'); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ''; + } + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ''; + } + } else if (node.value || node.value === '') { + lastAdded = 'value'; + node.value += content; + if (node.raws.value) { + node.raws.value += content; + } + } + } + spaceAfterMeaningfulToken = false; + break; + case tokens.str: + if (!node.attribute || !node.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + var _unescapeValue = (0, _attribute.unescapeValue)(content), + unescaped = _unescapeValue.unescaped, + quoteMark = _unescapeValue.quoteMark; + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = 'value'; + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + case tokens.equals: + if (!node.attribute) { + return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); + } + if (node.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token[_tokenize.FIELDS.START_POS] + }); + } + node.operator = node.operator ? node.operator + content : content; + lastAdded = 'operator'; + spaceAfterMeaningfulToken = false; + break; + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { + var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; + var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; + (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ''; + var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; + (0, _util.ensureObject)(node, 'raws'); + node.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + break; + default: + return this.error("Unexpected \"" + content + "\" found.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + pos++; + } + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute["default"](node)); + this.position++; + } + + /** + * return a node containing meaningless garbage up to (but not including) the specified token position. + * if the token position is negative, all remaining tokens are consumed. + * + * This returns an array containing a single string node if all whitespace, + * otherwise an array of comment nodes with space before and after. + * + * These tokens are not added to the current selector, the caller can add them or use them to amend + * a previous node's space metadata. + * + * In lossy mode, this returns only comments. + */; + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = undefined; + do { + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + if (space) { + spaces.before = space; + space = ""; + } + lastComment = new _comment["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces: spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string["default"]({ + value: '', + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space, + after: '' + } + })); + } + } + return nodes; + } + + /** + * + * @param {*} nodes + */; + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + if (requiredSpace === void 0) { + requiredSpace = false; + } + var space = ""; + var rawSpace = ""; + nodes.forEach(function (n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + if (rawSpace === space) { + rawSpace = undefined; + } + var result = { + space: space, + rawSpace: rawSpace + }; + return result; + }; + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) { + position = this.position; + } + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + if (name !== nameRaw) { + raws.value = "/" + nameRaw + "/"; + } + var node = new _combinator["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws: raws + }); + this.position = this.position + 3; + return node; + } else { + this.unexpected(); + } + }; + _proto.combinator = function combinator() { + var _this3 = this; + if (this.content() === '|') { + return this.namespace(); + } + // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + if (nodes.length > 0) { + var last = this.current.last; + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), + space = _this$convertWhitespa.space, + rawSpace = _this$convertWhitespa.rawSpace; + if (rawSpace !== undefined) { + last.rawSpaceAfter += rawSpace; + } + last.spaces.after += space; + } else { + nodes.forEach(function (n) { + return _this3.newNode(n); + }); + } + } + return; + } + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = undefined; + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + var node; + if (this.isNamedCombinator()) { + node = this.namedCombinator(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + // pass + } else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), + _space = _this$convertWhitespa2.space, + _rawSpace = _this$convertWhitespa2.rawSpace; + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + // descendant combinator + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), + _space2 = _this$convertWhitespa3.space, + _rawSpace2 = _this$convertWhitespa3.rawSpace; + if (!_rawSpace2) { + _rawSpace2 = _space2; + } + var spaces = {}; + var raws = { + spaces: {} + }; + if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else { + raws.value = _rawSpace2; + } + node = new _combinator["default"]({ + value: ' ', + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: spaces, + raws: raws + }); + } + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + return this.newNode(node); + }; + _proto.comma = function comma() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + this.current._inferEndPosition(); + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + } + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + _proto.comment = function comment() { + var current = this.currToken; + this.newNode(new _comment["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + _proto.missingBackslash = function missingBackslash() { + return this.error('Expected a backslash preceding the semicolon.', { + index: this.currToken[_tokenize.FIELDS.START_POS] + }); + }; + _proto.missingParenthesis = function missingParenthesis() { + return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.unexpectedPipe = function unexpectedPipe() { + return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + this.unexpectedPipe(); + }; + _proto.nesting = function nesting() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + if (nextContent === "|") { + this.position++; + return; + } + } + var current = this.currToken; + this.newNode(new _nesting["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + if (last && last.type === types.PSEUDO) { + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position - 1]) + } + }); + var cache = this.current; + last.append(selector); + this.current = selector; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + if (unbalanced) { + this.parse(); + } else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + this.current = cache; + } else { + // I think this case should be an error. It's used to implement a basic parse of media queries + // but I don't think it's a good idea. + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new _string["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + } + if (unbalanced) { + return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.pseudo = function pseudo() { + var _this4 = this; + var pseudoStr = ''; + var startingToken = this.currToken; + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + if (!this.currToken) { + return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); + } + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function (first, length) { + pseudoStr += first; + _this4.newNode(new _pseudo["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + _this4.error('Misplaced parenthesis.', { + index: _this4.nextToken[_tokenize.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + _proto.space = function space() { + var content = this.content(); + // Handle space before and after the selector + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { + return node.type === 'comment'; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + _proto.string = function string() { + var current = this.currToken; + this.newNode(new _string["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + _proto.universal = function universal(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + var current = this.currToken; + this.newNode(new _universal["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + var nextToken = this.nextToken; + var word = this.content(); + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + if (current.lastIndexOf('\\') === current.length - 1) { + var next = this.nextToken; + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + nextToken = this.nextToken; + } + var hasClass = indexesOf(word, '.').filter(function (i) { + // Allow escaped dot within class name + var escapedDot = word[i - 1] === '\\'; + // Allow decimal numbers percent in @keyframes + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, '#').filter(function (i) { + return word[i - 1] !== '\\'; + }); + // Eliminate Sass interpolations from the list of id indexes + var interpolations = indexesOf(word, '#{'); + if (interpolations.length) { + hasId = hasId.filter(function (hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + } + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function (ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + if (i === 0 && firstCallback) { + return firstCallback.call(_this5, value, indices.length); + } + var node; + var current = _this5.currToken; + var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; + var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _className["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _id["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value: value, + source: source, + sourceIndex: sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag["default"](tagOpts); + } + _this5.newNode(node, namespace); + // Ensure that the namespace is used only once + namespace = null; + }); + this.position++; + }; + _proto.word = function word(namespace) { + var nextToken = this.nextToken; + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + return this.splitWord(namespace); + }; + _proto.loop = function loop() { + while (this.position < this.tokens.length) { + this.parse(true); + } + this.current._inferEndPosition(); + return this.root; + }; + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + case tokens.comment: + this.comment(); + break; + case tokens.openParenthesis: + this.parentheses(); + break; + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + break; + case tokens.openSquare: + this.attribute(); + break; + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + case tokens.colon: + this.pseudo(); + break; + case tokens.comma: + this.comma(); + break; + case tokens.asterisk: + this.universal(); + break; + case tokens.ampersand: + this.nesting(); + break; + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + case tokens.closeSquare: + this.missingSquareBracket(); + case tokens.semicolon: + this.missingBackslash(); + default: + this.unexpected(); + } + } + + /** + * Helpers + */; + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(', ') + " or " + last; + } + var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; + if (!found) { + return this.error("Expected " + an + " " + description + ".", { + index: index + }); + } + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { + index: index + }); + }; + _proto.requiredSpace = function requiredSpace(space) { + return this.options.lossy ? ' ' : space; + }; + _proto.optionalSpace = function optionalSpace(space) { + return this.options.lossy ? '' : space; + }; + _proto.lossySpace = function lossySpace(space, required) { + if (this.options.lossy) { + return required ? ' ' : ''; + } else { + return space; + } + }; + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + if (token[_tokenize.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || '') + namespace; + } + namespace = true; + } + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ''; + } + return this.current.append(node); + }; + _proto.content = function content(token) { + if (token === void 0) { + token = this.currToken; + } + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + var searchPosition = startPosition; + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + return -1; + }; + _createClass(Parser, [{ + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + }]); + return Parser; +}(); +exports["default"] = Parser; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/processor.js b/node_modules/postcss-selector-parser/dist/processor.js new file mode 100644 index 0000000..dbfa091 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/processor.js @@ -0,0 +1,170 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _parser = _interopRequireDefault(require("./parser")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +var Processor = /*#__PURE__*/function () { + function Processor(func, options) { + this.func = func || function noop() {}; + this.funcRes = null; + this.options = options; + } + var _proto = Processor.prototype; + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule !== "string"; + } + }; + _proto._isLossy = function _isLossy(options) { + if (options === void 0) { + options = {}; + } + var merged = Object.assign({}, this.options, options); + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + _proto._root = function _root(rule, options) { + if (options === void 0) { + options = {}; + } + var parser = new _parser["default"](rule, this._parseOptions(options)); + return parser.root; + }; + _proto._parseOptions = function _parseOptions(options) { + return { + lossy: this._isLossy(options) + }; + }; + _proto._run = function _run(rule, options) { + var _this = this; + if (options === void 0) { + options = {}; + } + return new Promise(function (resolve, reject) { + try { + var root = _this._root(rule, options); + Promise.resolve(_this.func(root)).then(function (transform) { + var string = undefined; + if (_this._shouldUpdateSelector(rule, options)) { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) { + options = {}; + } + var root = this._root(rule, options); + var transform = this.func(root); + if (transform && typeof transform.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + var string = undefined; + if (options.updateSelector && typeof rule !== "string") { + string = root.toString(); + rule.selector = string; + } + return { + transform: transform, + root: root, + string: string + }; + } + + /** + * Process rule into a selector AST. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise} The AST of the selector after processing it. + */; + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function (result) { + return result.root; + }); + } + + /** + * Process rule into a selector AST synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {parser.Root} The AST of the selector after processing it. + */; + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + } + + /** + * Process a selector into a transformed value asynchronously + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise} The value returned by the processor. + */; + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function (result) { + return result.transform; + }); + } + + /** + * Process a selector into a transformed value synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {any} The value returned by the processor. + */; + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + } + + /** + * Process a selector into a new selector string asynchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.process = function process(rule, options) { + return this._run(rule, options).then(function (result) { + return result.string || result.root.toString(); + }); + } + + /** + * Process a selector into a new selector string synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */; + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + return result.string || result.root.toString(); + }; + return Processor; +}(); +exports["default"] = Processor; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/attribute.js b/node_modules/postcss-selector-parser/dist/selectors/attribute.js new file mode 100644 index 0000000..0351a22 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/attribute.js @@ -0,0 +1,448 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +exports.unescapeValue = unescapeValue; +var _cssesc = _interopRequireDefault(require("cssesc")); +var _unesc = _interopRequireDefault(require("../util/unesc")); +var _namespace = _interopRequireDefault(require("./namespace")); +var _types = require("./types"); +var _CSSESC_QUOTE_OPTIONS; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var deprecate = require("util-deprecate"); +var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; +var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); +var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); +var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); +function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + unescaped = (0, _unesc["default"])(unescaped); + if (unescaped !== value) { + deprecatedUsage = true; + } + return { + deprecatedUsage: deprecatedUsage, + unescaped: unescaped, + quoteMark: quoteMark + }; +} +function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== undefined) { + return opts; + } + if (opts.value === undefined) { + return opts; + } + warnOfDeprecatedConstructor(); + var _unescapeValue = unescapeValue(opts.value), + quoteMark = _unescapeValue.quoteMark, + unescaped = _unescapeValue.unescaped; + if (!opts.raws) { + opts.raws = {}; + } + if (opts.raws.value === undefined) { + opts.raws.value = opts.value; + } + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; +} +var Attribute = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Attribute, _Namespace); + function Attribute(opts) { + var _this; + if (opts === void 0) { + opts = {}; + } + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, 'unquoted', { + get: deprecate(function () { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function () { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + var _proto = Attribute.prototype; + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) { + options = {}; + } + var quoteMark = this._determineQuoteMark(options); + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, _cssesc["default"])(this._value, cssescopts); + return escaped; + }; + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + } + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + */; + _proto.setValue = function setValue(value, options) { + if (options === void 0) { + options = {}; + } + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + this._syncRawValue(); + } + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + * + * @param options This takes the quoteMark and preferCurrentQuoteMark options + * from the quoteValue method. + */; + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, '').length; + var numDoubleQuotes = v.replace(/[^"]/g, '').length; + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped === v) { + return Attribute.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + if (pref === Attribute.NO_QUOTE) { + // pick a quote mark that isn't none and see if it's smaller + var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, _cssesc["default"])(v, opts); + if (quoteValue.length < escaped.length) { + return quote; + } + } + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute.DOUBLE_QUOTE; + } else { + return Attribute.SINGLE_QUOTE; + } + } + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */; + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + if (quoteMark === undefined) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + if (quoteMark === undefined) { + quoteMark = Attribute.DOUBLE_QUOTE; + } + return quoteMark; + }; + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { + isIdentifier: true + }); + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: '', + after: '' + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name; + } + if (concat === void 0) { + concat = defaultAttrConcat; + } + var attrSpaces = this._spacesFor(spaceName); + return concat(this.stringifyProperty(name), attrSpaces); + } + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */; + _proto.offsetOf = function offsetOf(name) { + var count = 1; + var attributeSpaces = this._spacesFor("attribute"); + count += attributeSpaces.before.length; + if (name === "namespace" || name === "ns") { + return this.namespace ? count : -1; + } + if (name === "attributeNS") { + return count; + } + count += this.namespaceString.length; + if (this.namespace) { + count += 1; + } + if (name === "attribute") { + return count; + } + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + var operatorSpaces = this._spacesFor("operator"); + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + if (name === "operator") { + return operator ? count : -1; + } + count += operator.length; + count += operatorSpaces.after.length; + var valueSpaces = this._spacesFor("value"); + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + if (name === "value") { + return value ? count : -1; + } + count += value.length; + count += valueSpaces.after.length; + var insensitiveSpaces = this._spacesFor("insensitive"); + count += insensitiveSpaces.before.length; + if (name === "insensitive") { + return this.insensitive ? count : -1; + } + return -1; + }; + _proto.toString = function toString() { + var _this2 = this; + var selector = [this.rawSpaceBefore, '[']; + selector.push(this._stringFor('qualifiedAttribute', 'attribute')); + if (this.operator && (this.value || this.value === '')) { + selector.push(this._stringFor('operator')); + selector.push(this._stringFor('value')); + selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { + attrSpaces.before = " "; + } + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + selector.push(']'); + selector.push(this.rawSpaceAfter); + return selector.join(''); + }; + _createClass(Attribute, [{ + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + }, { + key: "quoteMark", + get: function get() { + return this._quoteMark; + } + + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */, + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + this._syncRawValue(); + } + } + }, { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? 'i' : ''; + } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), + deprecatedUsage = _unescapeValue2.deprecatedUsage, + unescaped = _unescapeValue2.unescaped, + quoteMark = _unescapeValue2.quoteMark; + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + this._value = unescaped; + this._quoteMark = quoteMark; + this._syncRawValue(); + } else { + this._value = v; + } + } + }, { + key: "insensitive", + get: function get() { + return this._insensitive; + } + + /** + * Set the case insensitive flag. + * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag` + * of the attribute is updated accordingly. + * + * @param {true | false} insensitive true if the attribute should match case-insensitively. + */, + set: function set(insensitive) { + if (!insensitive) { + this._insensitive = false; + + // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation. + // When setting `attr.insensitive = false` both should be erased to ensure correct serialization. + if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) { + this.raws.insensitiveFlag = undefined; + } + } + this._insensitive = insensitive; + } + }, { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + this._attribute = name; + } + }]); + return Attribute; +}(_namespace["default"]); +exports["default"] = Attribute; +Attribute.NO_QUOTE = null; +Attribute.SINGLE_QUOTE = "'"; +Attribute.DOUBLE_QUOTE = '"'; +var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: 'single', + wrap: true + }, + '"': { + quotes: 'double', + wrap: true + } +}, _CSSESC_QUOTE_OPTIONS[null] = { + isIdentifier: true +}, _CSSESC_QUOTE_OPTIONS); +function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; +} \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/className.js b/node_modules/postcss-selector-parser/dist/selectors/className.js new file mode 100644 index 0000000..af32597 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/className.js @@ -0,0 +1,50 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _cssesc = _interopRequireDefault(require("cssesc")); +var _util = require("../util"); +var _node = _interopRequireDefault(require("./node")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var ClassName = /*#__PURE__*/function (_Node) { + _inheritsLoose(ClassName, _Node); + function ClassName(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.CLASS; + _this._constructed = true; + return _this; + } + var _proto = ClassName.prototype; + _proto.valueToString = function valueToString() { + return '.' + _Node.prototype.valueToString.call(this); + }; + _createClass(ClassName, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + if (escaped !== v) { + (0, _util.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + this._value = v; + } + }]); + return ClassName; +}(_node["default"]); +exports["default"] = ClassName; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/combinator.js b/node_modules/postcss-selector-parser/dist/selectors/combinator.js new file mode 100644 index 0000000..c6449f4 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/combinator.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _node = _interopRequireDefault(require("./node")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Combinator = /*#__PURE__*/function (_Node) { + _inheritsLoose(Combinator, _Node); + function Combinator(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMBINATOR; + return _this; + } + return Combinator; +}(_node["default"]); +exports["default"] = Combinator; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/comment.js b/node_modules/postcss-selector-parser/dist/selectors/comment.js new file mode 100644 index 0000000..1709d5b --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/comment.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _node = _interopRequireDefault(require("./node")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Comment = /*#__PURE__*/function (_Node) { + _inheritsLoose(Comment, _Node); + function Comment(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.COMMENT; + return _this; + } + return Comment; +}(_node["default"]); +exports["default"] = Comment; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/constructors.js b/node_modules/postcss-selector-parser/dist/selectors/constructors.js new file mode 100644 index 0000000..6882593 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/constructors.js @@ -0,0 +1,65 @@ +"use strict"; + +exports.__esModule = true; +exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; +var _attribute = _interopRequireDefault(require("./attribute")); +var _className = _interopRequireDefault(require("./className")); +var _combinator = _interopRequireDefault(require("./combinator")); +var _comment = _interopRequireDefault(require("./comment")); +var _id = _interopRequireDefault(require("./id")); +var _nesting = _interopRequireDefault(require("./nesting")); +var _pseudo = _interopRequireDefault(require("./pseudo")); +var _root = _interopRequireDefault(require("./root")); +var _selector = _interopRequireDefault(require("./selector")); +var _string = _interopRequireDefault(require("./string")); +var _tag = _interopRequireDefault(require("./tag")); +var _universal = _interopRequireDefault(require("./universal")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +var attribute = function attribute(opts) { + return new _attribute["default"](opts); +}; +exports.attribute = attribute; +var className = function className(opts) { + return new _className["default"](opts); +}; +exports.className = className; +var combinator = function combinator(opts) { + return new _combinator["default"](opts); +}; +exports.combinator = combinator; +var comment = function comment(opts) { + return new _comment["default"](opts); +}; +exports.comment = comment; +var id = function id(opts) { + return new _id["default"](opts); +}; +exports.id = id; +var nesting = function nesting(opts) { + return new _nesting["default"](opts); +}; +exports.nesting = nesting; +var pseudo = function pseudo(opts) { + return new _pseudo["default"](opts); +}; +exports.pseudo = pseudo; +var root = function root(opts) { + return new _root["default"](opts); +}; +exports.root = root; +var selector = function selector(opts) { + return new _selector["default"](opts); +}; +exports.selector = selector; +var string = function string(opts) { + return new _string["default"](opts); +}; +exports.string = string; +var tag = function tag(opts) { + return new _tag["default"](opts); +}; +exports.tag = tag; +var universal = function universal(opts) { + return new _universal["default"](opts); +}; +exports.universal = universal; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/container.js b/node_modules/postcss-selector-parser/dist/selectors/container.js new file mode 100644 index 0000000..8600c54 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/container.js @@ -0,0 +1,308 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _node = _interopRequireDefault(require("./node")); +var types = _interopRequireWildcard(require("./types")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Container = /*#__PURE__*/function (_Node) { + _inheritsLoose(Container, _Node); + function Container(opts) { + var _this; + _this = _Node.call(this, opts) || this; + if (!_this.nodes) { + _this.nodes = []; + } + return _this; + } + var _proto = Container.prototype; + _proto.append = function append(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + _proto.prepend = function prepend(selector) { + selector.parent = this; + this.nodes.unshift(selector); + return this; + }; + _proto.at = function at(index) { + return this.nodes[index]; + }; + _proto.index = function index(child) { + if (typeof child === 'number') { + return child; + } + return this.nodes.indexOf(child); + }; + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = undefined; + this.nodes.splice(child, 1); + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } + return this; + }; + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = undefined; + } + this.nodes = []; + return this; + }; + _proto.empty = function empty() { + return this.removeAll(); + }; + _proto.insertAfter = function insertAfter(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex + 1, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (oldIndex <= index) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto.insertBefore = function insertBefore(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex, 0, newNode); + newNode.parent = this; + var index; + for (var id in this.indexes) { + index = this.indexes[id]; + if (index <= oldIndex) { + this.indexes[id] = index + 1; + } + } + return this; + }; + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = undefined; + this.each(function (node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + } + + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param {number} line The line number of the node to find. (1-based index) + * @param {number} col The column number of the node to find. (1-based index) + */; + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return undefined; + } + }; + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + _proto.each = function each(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + if (!this.indexes) { + this.indexes = {}; + } + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + if (!this.length) { + return undefined; + } + var index, result; + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + if (result === false) { + break; + } + this.indexes[id] += 1; + } + delete this.indexes[id]; + if (result === false) { + return false; + } + }; + _proto.walk = function walk(callback) { + return this.each(function (node, i) { + var result = callback(node, i); + if (result !== false && node.length) { + result = node.walk(callback); + } + if (result === false) { + return false; + } + }); + }; + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + return this.walk(function (selector) { + if (selector.type === types.ATTRIBUTE) { + return callback.call(_this2, selector); + } + }); + }; + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + return this.walk(function (selector) { + if (selector.type === types.CLASS) { + return callback.call(_this3, selector); + } + }); + }; + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + return this.walk(function (selector) { + if (selector.type === types.COMBINATOR) { + return callback.call(_this4, selector); + } + }); + }; + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + return this.walk(function (selector) { + if (selector.type === types.COMMENT) { + return callback.call(_this5, selector); + } + }); + }; + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + return this.walk(function (selector) { + if (selector.type === types.ID) { + return callback.call(_this6, selector); + } + }); + }; + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + return this.walk(function (selector) { + if (selector.type === types.NESTING) { + return callback.call(_this7, selector); + } + }); + }; + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + return this.walk(function (selector) { + if (selector.type === types.PSEUDO) { + return callback.call(_this8, selector); + } + }); + }; + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + return this.walk(function (selector) { + if (selector.type === types.TAG) { + return callback.call(_this9, selector); + } + }); + }; + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + return this.walk(function (selector) { + if (selector.type === types.UNIVERSAL) { + return callback.call(_this10, selector); + } + }); + }; + _proto.split = function split(callback) { + var _this11 = this; + var current = []; + return this.reduce(function (memo, node, index) { + var split = callback.call(_this11, node); + current.push(node); + if (split) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) { + memo.push(current); + } + return memo; + }, []); + }; + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + _proto.toString = function toString() { + return this.map(String).join(''); + }; + _createClass(Container, [{ + key: "first", + get: function get() { + return this.at(0); + } + }, { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, { + key: "length", + get: function get() { + return this.nodes.length; + } + }]); + return Container; +}(_node["default"]); +exports["default"] = Container; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/guards.js b/node_modules/postcss-selector-parser/dist/selectors/guards.js new file mode 100644 index 0000000..f06161e --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/guards.js @@ -0,0 +1,58 @@ +"use strict"; + +exports.__esModule = true; +exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; +exports.isContainer = isContainer; +exports.isIdentifier = void 0; +exports.isNamespace = isNamespace; +exports.isNesting = void 0; +exports.isNode = isNode; +exports.isPseudo = void 0; +exports.isPseudoClass = isPseudoClass; +exports.isPseudoElement = isPseudoElement; +exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = void 0; +var _types = require("./types"); +var _IS_TYPE; +var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); +function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; +} +function isNodeType(type, node) { + return isNode(node) && node.type === type; +} +var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); +exports.isAttribute = isAttribute; +var isClassName = isNodeType.bind(null, _types.CLASS); +exports.isClassName = isClassName; +var isCombinator = isNodeType.bind(null, _types.COMBINATOR); +exports.isCombinator = isCombinator; +var isComment = isNodeType.bind(null, _types.COMMENT); +exports.isComment = isComment; +var isIdentifier = isNodeType.bind(null, _types.ID); +exports.isIdentifier = isIdentifier; +var isNesting = isNodeType.bind(null, _types.NESTING); +exports.isNesting = isNesting; +var isPseudo = isNodeType.bind(null, _types.PSEUDO); +exports.isPseudo = isPseudo; +var isRoot = isNodeType.bind(null, _types.ROOT); +exports.isRoot = isRoot; +var isSelector = isNodeType.bind(null, _types.SELECTOR); +exports.isSelector = isSelector; +var isString = isNodeType.bind(null, _types.STRING); +exports.isString = isString; +var isTag = isNodeType.bind(null, _types.TAG); +exports.isTag = isTag; +var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); +exports.isUniversal = isUniversal; +function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); +} +function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); +} +function isContainer(node) { + return !!(isNode(node) && node.walk); +} +function isNamespace(node) { + return isAttribute(node) || isTag(node); +} \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/id.js b/node_modules/postcss-selector-parser/dist/selectors/id.js new file mode 100644 index 0000000..8baef72 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/id.js @@ -0,0 +1,25 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _node = _interopRequireDefault(require("./node")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var ID = /*#__PURE__*/function (_Node) { + _inheritsLoose(ID, _Node); + function ID(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.ID; + return _this; + } + var _proto = ID.prototype; + _proto.valueToString = function valueToString() { + return '#' + _Node.prototype.valueToString.call(this); + }; + return ID; +}(_node["default"]); +exports["default"] = ID; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/index.js b/node_modules/postcss-selector-parser/dist/selectors/index.js new file mode 100644 index 0000000..f1f6b7f --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/index.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +var _types = require("./types"); +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; +}); +var _constructors = require("./constructors"); +Object.keys(_constructors).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; +}); +var _guards = require("./guards"); +Object.keys(_guards).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; +}); \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/namespace.js b/node_modules/postcss-selector-parser/dist/selectors/namespace.js new file mode 100644 index 0000000..cc97647 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/namespace.js @@ -0,0 +1,80 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _cssesc = _interopRequireDefault(require("cssesc")); +var _util = require("../util"); +var _node = _interopRequireDefault(require("./node")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Namespace = /*#__PURE__*/function (_Node) { + _inheritsLoose(Namespace, _Node); + function Namespace() { + return _Node.apply(this, arguments) || this; + } + var _proto = Namespace.prototype; + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) { + return this.namespaceString + "|" + value; + } else { + return value; + } + }; + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + _createClass(Namespace, [{ + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + if (this.raws) { + delete this.raws.namespace; + } + return; + } + var escaped = (0, _cssesc["default"])(namespace, { + isIdentifier: true + }); + this._namespace = namespace; + if (escaped !== namespace) { + (0, _util.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + } + }, { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + if (ns === true) { + return ''; + } else { + return ns; + } + } else { + return ''; + } + } + }]); + return Namespace; +}(_node["default"]); +exports["default"] = Namespace; +; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/nesting.js b/node_modules/postcss-selector-parser/dist/selectors/nesting.js new file mode 100644 index 0000000..2189928 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/nesting.js @@ -0,0 +1,22 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _node = _interopRequireDefault(require("./node")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Nesting = /*#__PURE__*/function (_Node) { + _inheritsLoose(Nesting, _Node); + function Nesting(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.NESTING; + _this.value = '&'; + return _this; + } + return Nesting; +}(_node["default"]); +exports["default"] = Nesting; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/node.js b/node_modules/postcss-selector-parser/dist/selectors/node.js new file mode 100644 index 0000000..9a82951 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/node.js @@ -0,0 +1,192 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _util = require("../util"); +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +var cloneNode = function cloneNode(obj, parent) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + var cloned = new obj.constructor(); + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + var value = obj[i]; + var type = typeof value; + if (i === 'parent' && type === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function (j) { + return cloneNode(j, cloned); + }); + } else { + cloned[i] = cloneNode(value, cloned); + } + } + return cloned; +}; +var Node = /*#__PURE__*/function () { + function Node(opts) { + if (opts === void 0) { + opts = {}; + } + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ''; + this.spaces.after = this.spaces.after || ''; + } + var _proto = Node.prototype; + _proto.remove = function remove() { + if (this.parent) { + this.parent.removeChild(this); + } + this.parent = undefined; + return this; + }; + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + this.remove(); + } + return this; + }; + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + _proto.clone = function clone(overrides) { + if (overrides === void 0) { + overrides = {}; + } + var cloned = cloneNode(this); + for (var name in overrides) { + cloned[name] = overrides[name]; + } + return cloned; + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */; + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. + if (originalEscaped || valueEscaped !== value) { + this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name]; // delete any escaped value that was created by the setter. + } + } + + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows the escaped value to be specified directly, allowing illegal + * characters to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped the escaped value of the property. + */; + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + this.raws[name] = valueEscaped; + } + + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param {string} name the property to set. + * @param {any} value The value that is both escaped and unescaped. + */; + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + if (this.raws) { + delete this.raws[name]; + } + } + + /** + * + * @param {number} line The number (starting with 1) + * @param {number} column The column number (starting with 1) + */; + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + if (this.source.end.line < line) { + return false; + } + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + return true; + } + return undefined; + }; + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + _proto.toString = function toString() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); + }; + _createClass(Node, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + if (rawSpace === undefined) { + rawSpace = this.spaces && this.spaces.before; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + if (rawSpace === undefined) { + rawSpace = this.spaces.after; + } + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + return Node; +}(); +exports["default"] = Node; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/pseudo.js b/node_modules/postcss-selector-parser/dist/selectors/pseudo.js new file mode 100644 index 0000000..4371e59 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/pseudo.js @@ -0,0 +1,26 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _container = _interopRequireDefault(require("./container")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Pseudo = /*#__PURE__*/function (_Container) { + _inheritsLoose(Pseudo, _Container); + function Pseudo(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.PSEUDO; + return _this; + } + var _proto = Pseudo.prototype; + _proto.toString = function toString() { + var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); + }; + return Pseudo; +}(_container["default"]); +exports["default"] = Pseudo; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/root.js b/node_modules/postcss-selector-parser/dist/selectors/root.js new file mode 100644 index 0000000..8c599d1 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/root.js @@ -0,0 +1,44 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _container = _interopRequireDefault(require("./container")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Root = /*#__PURE__*/function (_Container) { + _inheritsLoose(Root, _Container); + function Root(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.ROOT; + return _this; + } + var _proto = Root.prototype; + _proto.toString = function toString() { + var str = this.reduce(function (memo, selector) { + memo.push(String(selector)); + return memo; + }, []).join(','); + return this.trailingComma ? str + ',' : str; + }; + _proto.error = function error(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + _createClass(Root, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + return Root; +}(_container["default"]); +exports["default"] = Root; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/selector.js b/node_modules/postcss-selector-parser/dist/selectors/selector.js new file mode 100644 index 0000000..8cc4bc1 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/selector.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _container = _interopRequireDefault(require("./container")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Selector = /*#__PURE__*/function (_Container) { + _inheritsLoose(Selector, _Container); + function Selector(opts) { + var _this; + _this = _Container.call(this, opts) || this; + _this.type = _types.SELECTOR; + return _this; + } + return Selector; +}(_container["default"]); +exports["default"] = Selector; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/string.js b/node_modules/postcss-selector-parser/dist/selectors/string.js new file mode 100644 index 0000000..4749791 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/string.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _node = _interopRequireDefault(require("./node")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var String = /*#__PURE__*/function (_Node) { + _inheritsLoose(String, _Node); + function String(opts) { + var _this; + _this = _Node.call(this, opts) || this; + _this.type = _types.STRING; + return _this; + } + return String; +}(_node["default"]); +exports["default"] = String; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/tag.js b/node_modules/postcss-selector-parser/dist/selectors/tag.js new file mode 100644 index 0000000..224e74d --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/tag.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _namespace = _interopRequireDefault(require("./namespace")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Tag = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Tag, _Namespace); + function Tag(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.TAG; + return _this; + } + return Tag; +}(_namespace["default"]); +exports["default"] = Tag; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/types.js b/node_modules/postcss-selector-parser/dist/selectors/types.js new file mode 100644 index 0000000..824cc0c --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/types.js @@ -0,0 +1,28 @@ +"use strict"; + +exports.__esModule = true; +exports.UNIVERSAL = exports.TAG = exports.STRING = exports.SELECTOR = exports.ROOT = exports.PSEUDO = exports.NESTING = exports.ID = exports.COMMENT = exports.COMBINATOR = exports.CLASS = exports.ATTRIBUTE = void 0; +var TAG = 'tag'; +exports.TAG = TAG; +var STRING = 'string'; +exports.STRING = STRING; +var SELECTOR = 'selector'; +exports.SELECTOR = SELECTOR; +var ROOT = 'root'; +exports.ROOT = ROOT; +var PSEUDO = 'pseudo'; +exports.PSEUDO = PSEUDO; +var NESTING = 'nesting'; +exports.NESTING = NESTING; +var ID = 'id'; +exports.ID = ID; +var COMMENT = 'comment'; +exports.COMMENT = COMMENT; +var COMBINATOR = 'combinator'; +exports.COMBINATOR = COMBINATOR; +var CLASS = 'class'; +exports.CLASS = CLASS; +var ATTRIBUTE = 'attribute'; +exports.ATTRIBUTE = ATTRIBUTE; +var UNIVERSAL = 'universal'; +exports.UNIVERSAL = UNIVERSAL; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/universal.js b/node_modules/postcss-selector-parser/dist/selectors/universal.js new file mode 100644 index 0000000..5b58743 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/universal.js @@ -0,0 +1,22 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; +var _namespace = _interopRequireDefault(require("./namespace")); +var _types = require("./types"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +var Universal = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Universal, _Namespace); + function Universal(opts) { + var _this; + _this = _Namespace.call(this, opts) || this; + _this.type = _types.UNIVERSAL; + _this.value = '*'; + return _this; + } + return Universal; +}(_namespace["default"]); +exports["default"] = Universal; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/sortAscending.js b/node_modules/postcss-selector-parser/dist/sortAscending.js new file mode 100644 index 0000000..5666d5d --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/sortAscending.js @@ -0,0 +1,11 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = sortAscending; +function sortAscending(list) { + return list.sort(function (a, b) { + return a - b; + }); +} +; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/tokenTypes.js b/node_modules/postcss-selector-parser/dist/tokenTypes.js new file mode 100644 index 0000000..59d8e6c --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/tokenTypes.js @@ -0,0 +1,70 @@ +"use strict"; + +exports.__esModule = true; +exports.word = exports.tilde = exports.tab = exports.str = exports.space = exports.slash = exports.singleQuote = exports.semicolon = exports.plus = exports.pipe = exports.openSquare = exports.openParenthesis = exports.newline = exports.greaterThan = exports.feed = exports.equals = exports.doubleQuote = exports.dollar = exports.cr = exports.comment = exports.comma = exports.combinator = exports.colon = exports.closeSquare = exports.closeParenthesis = exports.caret = exports.bang = exports.backslash = exports.at = exports.asterisk = exports.ampersand = void 0; +var ampersand = 38; // `&`.charCodeAt(0); +exports.ampersand = ampersand; +var asterisk = 42; // `*`.charCodeAt(0); +exports.asterisk = asterisk; +var at = 64; // `@`.charCodeAt(0); +exports.at = at; +var comma = 44; // `,`.charCodeAt(0); +exports.comma = comma; +var colon = 58; // `:`.charCodeAt(0); +exports.colon = colon; +var semicolon = 59; // `;`.charCodeAt(0); +exports.semicolon = semicolon; +var openParenthesis = 40; // `(`.charCodeAt(0); +exports.openParenthesis = openParenthesis; +var closeParenthesis = 41; // `)`.charCodeAt(0); +exports.closeParenthesis = closeParenthesis; +var openSquare = 91; // `[`.charCodeAt(0); +exports.openSquare = openSquare; +var closeSquare = 93; // `]`.charCodeAt(0); +exports.closeSquare = closeSquare; +var dollar = 36; // `$`.charCodeAt(0); +exports.dollar = dollar; +var tilde = 126; // `~`.charCodeAt(0); +exports.tilde = tilde; +var caret = 94; // `^`.charCodeAt(0); +exports.caret = caret; +var plus = 43; // `+`.charCodeAt(0); +exports.plus = plus; +var equals = 61; // `=`.charCodeAt(0); +exports.equals = equals; +var pipe = 124; // `|`.charCodeAt(0); +exports.pipe = pipe; +var greaterThan = 62; // `>`.charCodeAt(0); +exports.greaterThan = greaterThan; +var space = 32; // ` `.charCodeAt(0); +exports.space = space; +var singleQuote = 39; // `'`.charCodeAt(0); +exports.singleQuote = singleQuote; +var doubleQuote = 34; // `"`.charCodeAt(0); +exports.doubleQuote = doubleQuote; +var slash = 47; // `/`.charCodeAt(0); +exports.slash = slash; +var bang = 33; // `!`.charCodeAt(0); +exports.bang = bang; +var backslash = 92; // '\\'.charCodeAt(0); +exports.backslash = backslash; +var cr = 13; // '\r'.charCodeAt(0); +exports.cr = cr; +var feed = 12; // '\f'.charCodeAt(0); +exports.feed = feed; +var newline = 10; // '\n'.charCodeAt(0); +exports.newline = newline; +var tab = 9; // '\t'.charCodeAt(0); + +// Expose aliases primarily for readability. +exports.tab = tab; +var str = singleQuote; + +// No good single character representation! +exports.str = str; +var comment = -1; +exports.comment = comment; +var word = -2; +exports.word = word; +var combinator = -3; +exports.combinator = combinator; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/tokenize.js b/node_modules/postcss-selector-parser/dist/tokenize.js new file mode 100644 index 0000000..bf61d26 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/tokenize.js @@ -0,0 +1,239 @@ +"use strict"; + +exports.__esModule = true; +exports.FIELDS = void 0; +exports["default"] = tokenize; +var t = _interopRequireWildcard(require("./tokenTypes")); +var _unescapable, _wordDelimiters; +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); +var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); +var hex = {}; +var hexChars = "0123456789abcdefABCDEF"; +for (var i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; +} + +/** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ +function consumeWord(css, start) { + var next = start; + var code; + do { + code = css.charCodeAt(next); + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + // All other characters are part of the word + next++; + } + } while (next < css.length); + return next - 1; +} + +/** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ +function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + if (unescapable[code]) { + // just consume the escape char + } else if (hex[code]) { + var hexDigits = 0; + // consume up to 6 hex chars + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); + // if fewer than 6 hex chars, a trailing space ends the escape + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + // the next char is part of the current word + next++; + } + return next; +} +var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 +}; +exports.FIELDS = FIELDS; +function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var _css = css, + length = _css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + function unclosed(what, fix) { + if (input.safe) { + // fyi: this is never set to true. + css += fix; + next = css.length - 1; + } else { + throw input.error('Unclosed ' + what, line, start - offset, start); + } + } + while (start < length) { + code = css.charCodeAt(start); + if (code === t.newline) { + offset = start; + line += 1; + } + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + + // Consume these characters as single tokens. + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + do { + escaped = false; + next = css.indexOf(quote, next + 1); + if (next === -1) { + unclosed('quote', quote); + } + escapePos = next; + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf('*/', start + 2) + 1; + if (next === 0) { + unclosed('comment', '*/'); + } + content = css.slice(start, next + 1); + lines = content.split('\n'); + last = lines.length - 1; + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + end = next + 1; + break; + } + + // Ensure that the token structure remains consistent + tokens.push([tokenType, + // [0] Token type + line, + // [1] Starting line + start - offset, + // [2] Starting column + endLine, + // [3] Ending line + endColumn, + // [4] Ending column + start, + // [5] Start position / Source index + end // [6] End position + ]); + + // Reset offset for the next token + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + start = end; + } + return tokens; +} \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/ensureObject.js b/node_modules/postcss-selector-parser/dist/util/ensureObject.js new file mode 100644 index 0000000..494941a --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/ensureObject.js @@ -0,0 +1,17 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = ensureObject; +function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + obj[prop] = {}; + } + obj = obj[prop]; + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/getProp.js b/node_modules/postcss-selector-parser/dist/util/getProp.js new file mode 100644 index 0000000..a2b7a07 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/getProp.js @@ -0,0 +1,18 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = getProp; +function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + while (props.length > 0) { + var prop = props.shift(); + if (!obj[prop]) { + return undefined; + } + obj = obj[prop]; + } + return obj; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/index.js b/node_modules/postcss-selector-parser/dist/util/index.js new file mode 100644 index 0000000..f96ec11 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/index.js @@ -0,0 +1,13 @@ +"use strict"; + +exports.__esModule = true; +exports.unesc = exports.stripComments = exports.getProp = exports.ensureObject = void 0; +var _unesc = _interopRequireDefault(require("./unesc")); +exports.unesc = _unesc["default"]; +var _getProp = _interopRequireDefault(require("./getProp")); +exports.getProp = _getProp["default"]; +var _ensureObject = _interopRequireDefault(require("./ensureObject")); +exports.ensureObject = _ensureObject["default"]; +var _stripComments = _interopRequireDefault(require("./stripComments")); +exports.stripComments = _stripComments["default"]; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/stripComments.js b/node_modules/postcss-selector-parser/dist/util/stripComments.js new file mode 100644 index 0000000..0baa0e0 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/stripComments.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = stripComments; +function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + if (commentEnd < 0) { + return s; + } + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + s = s + str.slice(lastEnd); + return s; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/unesc.js b/node_modules/postcss-selector-parser/dist/util/unesc.js new file mode 100644 index 0000000..87396be --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/unesc.js @@ -0,0 +1,76 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = unesc; +// Many thanks for this post which made this migration much easier. +// https://mathiasbynens.be/notes/css-escapes + +/** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ +function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ''; + var spaceTerminated = false; + for (var i = 0; i < 6 && lower[i] !== undefined; i++) { + var code = lower.charCodeAt(i); + // check to see if we are dealing with a valid hex char [a-f|0-9] + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; + // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point + spaceTerminated = code === 32; + if (!valid) { + break; + } + hex += lower[i]; + } + if (hex.length === 0) { + return undefined; + } + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; + // Add special case for + // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" + // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point + if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { + return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; + } + return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; +} +var CONTAINS_ESCAPE = /\\/; +function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + if (!needToProcess) { + return str; + } + var ret = ""; + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 7)); + if (gobbled !== undefined) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } + + // Retain a pair of \\ if double escaped `\\\\` + // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } + + // if \\ is at the end of the string retain it + // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb + if (str.length === i + 1) { + ret += str[i]; + } + continue; + } + ret += str[i]; + } + return ret; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/package.json b/node_modules/postcss-selector-parser/package.json new file mode 100644 index 0000000..dce071c --- /dev/null +++ b/node_modules/postcss-selector-parser/package.json @@ -0,0 +1,79 @@ +{ + "name": "postcss-selector-parser", + "version": "6.0.13", + "devDependencies": { + "@babel/cli": "^7.11.6", + "@babel/core": "^7.11.6", + "@babel/eslint-parser": "^7.11.5", + "@babel/eslint-plugin": "^7.11.5", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/preset-env": "^7.11.5", + "@babel/register": "^7.11.5", + "ava": "^5.1.0", + "babel-plugin-add-module-exports": "^1.0.4", + "coveralls": "^3.1.0", + "del-cli": "^5.0.0", + "eslint": "^8.28.0", + "eslint-plugin-import": "^2.26.0", + "glob": "^8.0.3", + "minimist": "^1.2.5", + "nyc": "^15.1.0", + "postcss": "^8.0.0", + "semver": "^7.3.2", + "typescript": "^4.0.3" + }, + "main": "dist/index.js", + "types": "postcss-selector-parser.d.ts", + "files": [ + "API.md", + "CHANGELOG.md", + "LICENSE-MIT", + "dist", + "postcss-selector-parser.d.ts", + "!**/__tests__" + ], + "scripts": { + "pretest": "eslint src && tsc --noEmit postcss-selector-parser.d.ts", + "prepare": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", + "lintfix": "eslint --fix src", + "report": "nyc report --reporter=html", + "test": "nyc ava src/__tests__/*.mjs", + "testone": "ava" + }, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "license": "MIT", + "engines": { + "node": ">=4" + }, + "homepage": "https://github.com/postcss/postcss-selector-parser", + "contributors": [ + { + "name": "Ben Briggs", + "email": "beneb.info@gmail.com", + "url": "http://beneb.info" + }, + { + "name": "Chris Eppstein", + "email": "chris@eppsteins.net", + "url": "http://twitter.com/chriseppstein" + } + ], + "repository": "postcss/postcss-selector-parser", + "ava": { + "require": [ + "@babel/register" + ], + "concurrency": 5, + "timeout": "25s", + "nodeArguments": [] + }, + "nyc": { + "exclude": [ + "node_modules", + "**/__tests__" + ] + } +} diff --git a/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts b/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts new file mode 100644 index 0000000..1512322 --- /dev/null +++ b/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts @@ -0,0 +1,555 @@ +// Type definitions for postcss-selector-parser 2.2.3 +// Definitions by: Chris Eppstein + +/*~ Note that ES6 modules cannot directly export callable functions. + *~ This file should be imported using the CommonJS-style: + *~ import x = require('someLibrary'); + *~ + *~ Refer to the documentation to understand common + *~ workarounds for this limitation of ES6 modules. + */ + +/*~ This declaration specifies that the function + *~ is the exported object from the file + */ +export = parser; + +// A type that's T but not U. +type Diff = T extends U ? never : T; + +// TODO: Conditional types in TS 1.8 will really clean this up. +declare function parser(): parser.Processor; +declare function parser(processor: parser.AsyncProcessor): parser.Processor; +declare function parser(processor: parser.AsyncProcessor): parser.Processor; +declare function parser(processor: parser.SyncProcessor): parser.Processor; +declare function parser(processor: parser.SyncProcessor): parser.Processor; +declare function parser(processor?: parser.SyncProcessor | parser.AsyncProcessor): parser.Processor; + +/*~ If you want to expose types from your module as well, you can + *~ place them in this block. Often you will want to describe the + *~ shape of the return type of the function; that type should + *~ be declared in here, as this example shows. + */ +declare namespace parser { + /* copied from postcss -- so we don't need to add a dependency */ + type ErrorOptions = { + plugin?: string; + word?: string; + index?: number + }; + /* the bits we use of postcss.Rule, copied from postcss -- so we don't need to add a dependency */ + type PostCSSRuleNode = { + selector: string + /** + * @returns postcss.CssSyntaxError but it's a complex object, caller + * should cast to it if they have a dependency on postcss. + */ + error(message: string, options?: ErrorOptions): Error; + }; + /** Accepts a string */ + type Selectors = string | PostCSSRuleNode + type ProcessorFn = (root: parser.Root) => ReturnType; + type SyncProcessor = ProcessorFn; + type AsyncProcessor = ProcessorFn>; + + const TAG: "tag"; + const STRING: "string"; + const SELECTOR: "selector"; + const ROOT: "root"; + const PSEUDO: "pseudo"; + const NESTING: "nesting"; + const ID: "id"; + const COMMENT: "comment"; + const COMBINATOR: "combinator"; + const CLASS: "class"; + const ATTRIBUTE: "attribute"; + const UNIVERSAL: "universal"; + + interface NodeTypes { + tag: Tag, + string: String, + selector: Selector, + root: Root, + pseudo: Pseudo, + nesting: Nesting, + id: Identifier, + comment: Comment, + combinator: Combinator, + class: ClassName, + attribute: Attribute, + universal: Universal + } + + type Node = NodeTypes[keyof NodeTypes]; + + function isNode(node: any): node is Node; + + interface Options { + /** + * Preserve whitespace when true. Default: false; + */ + lossless: boolean; + /** + * When true and a postcss.Rule is passed, set the result of + * processing back onto the rule when done. Default: false. + */ + updateSelector: boolean; + } + class Processor< + TransformType = never, + SyncSelectorsType extends Selectors | never = Selectors + > { + res: Root; + readonly result: String; + ast(selectors: Selectors, options?: Partial): Promise; + astSync(selectors: SyncSelectorsType, options?: Partial): Root; + transform(selectors: Selectors, options?: Partial): Promise; + transformSync(selectors: SyncSelectorsType, options?: Partial): TransformType; + process(selectors: Selectors, options?: Partial): Promise; + processSync(selectors: SyncSelectorsType, options?: Partial): string; + } + interface ParserOptions { + css: string; + error: (message: string, options: ErrorOptions) => Error; + options: Options; + } + class Parser { + input: ParserOptions; + lossy: boolean; + position: number; + root: Root; + selectors: string; + current: Selector; + constructor(input: ParserOptions); + /** + * Raises an error, if the processor is invoked on + * a postcss Rule node, a better error message is raised. + */ + error(message: string, options?: ErrorOptions): void; + } + interface NodeSource { + start?: { + line: number, + column: number + }, + end?: { + line: number, + column: number + } + } + interface SpaceAround { + before: string; + after: string; + } + interface Spaces extends SpaceAround { + [spaceType: string]: string | Partial | undefined; + } + interface NodeOptions { + value: Value; + spaces?: Partial; + source?: NodeSource; + sourceIndex?: number; + } + interface Base< + Value extends string | undefined = string, + ParentType extends Container | undefined = Container | undefined + > { + type: keyof NodeTypes; + parent: ParentType; + value: Value; + spaces: Spaces; + source?: NodeSource; + sourceIndex: number; + rawSpaceBefore: string; + rawSpaceAfter: string; + remove(): Node; + replaceWith(...nodes: Node[]): Node; + next(): Node; + prev(): Node; + clone(opts?: {[override: string]:any}): Node; + /** + * Return whether this node includes the character at the position of the given line and column. + * Returns undefined if the nodes lack sufficient source metadata to determine the position. + * @param line 1-index based line number relative to the start of the selector. + * @param column 1-index based column number relative to the start of the selector. + */ + isAtPosition(line: number, column: number): boolean | undefined; + /** + * Some non-standard syntax doesn't follow normal escaping rules for css, + * this allows the escaped value to be specified directly, allowing illegal characters to be + * directly inserted into css output. + * @param name the property to set + * @param value the unescaped value of the property + * @param valueEscaped optional. the escaped value of the property. + */ + setPropertyAndEscape(name: string, value: any, valueEscaped: string): void; + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param name the property to set. + * @param value The value that is both escaped and unescaped. + */ + setPropertyWithoutEscape(name: string, value: any): void; + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */ + appendToPropertyAndEscape(name: string, value: any, valueEscaped: string): void; + toString(): string; + } + interface ContainerOptions extends NodeOptions { + nodes?: Array; + } + interface Container< + Value extends string | undefined = string, + Child extends Node = Node + > extends Base { + nodes: Array; + append(selector: Selector): this; + prepend(selector: Selector): this; + at(index: number): Child; + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param line The line number of the node to find. (1-based index) + * @param col The column number of the node to find. (1-based index) + */ + atPosition(line: number, column: number): Child; + index(child: Child): number; + readonly first: Child; + readonly last: Child; + readonly length: number; + removeChild(child: Child): this; + removeAll(): Container; + empty(): Container; + insertAfter(oldNode: Child, newNode: Child): this; + insertBefore(oldNode: Child, newNode: Child): this; + each(callback: (node: Child) => boolean | void): boolean | undefined; + walk( + callback: (node: Node) => boolean | void + ): boolean | undefined; + walkAttributes( + callback: (node: Attribute) => boolean | void + ): boolean | undefined; + walkClasses( + callback: (node: ClassName) => boolean | void + ): boolean | undefined; + walkCombinators( + callback: (node: Combinator) => boolean | void + ): boolean | undefined; + walkComments( + callback: (node: Comment) => boolean | void + ): boolean | undefined; + walkIds( + callback: (node: Identifier) => boolean | void + ): boolean | undefined; + walkNesting( + callback: (node: Nesting) => boolean | void + ): boolean | undefined; + walkPseudos( + callback: (node: Pseudo) => boolean | void + ): boolean | undefined; + walkTags(callback: (node: Tag) => boolean | void): boolean | undefined; + split(callback: (node: Child) => boolean): [Child[], Child[]]; + map(callback: (node: Child) => T): T[]; + reduce( + callback: ( + previousValue: Child, + currentValue: Child, + currentIndex: number, + array: readonly Child[] + ) => Child + ): Child; + reduce( + callback: ( + previousValue: Child, + currentValue: Child, + currentIndex: number, + array: readonly Child[] + ) => Child, + initialValue: Child + ): Child; + reduce( + callback: ( + previousValue: T, + currentValue: Child, + currentIndex: number, + array: readonly Child[] + ) => T, + initialValue: T + ): T; + every(callback: (node: Child) => boolean): boolean; + some(callback: (node: Child) => boolean): boolean; + filter(callback: (node: Child) => boolean): Child[]; + sort(callback: (nodeA: Child, nodeB: Child) => number): Child[]; + toString(): string; + } + function isContainer(node: any): node is Root | Selector | Pseudo; + + interface NamespaceOptions extends NodeOptions { + namespace?: string | true; + } + interface Namespace extends Base { + /** alias for namespace */ + ns: string | true; + /** + * namespace prefix. + */ + namespace: string | true; + /** + * If a namespace exists, prefix the value provided with it, separated by |. + */ + qualifiedName(value: string): string; + /** + * A string representing the namespace suitable for output. + */ + readonly namespaceString: string; + } + function isNamespace(node: any): node is Attribute | Tag; + + interface Root extends Container { + type: "root"; + /** + * Raises an error, if the processor is invoked on + * a postcss Rule node, a better error message is raised. + */ + error(message: string, options?: ErrorOptions): Error; + nodeAt(line: number, column: number): Node + } + function root(opts: ContainerOptions): Root; + function isRoot(node: any): node is Root; + + interface _Selector extends Container> { + type: "selector"; + } + type Selector = _Selector; + function selector(opts: ContainerOptions): Selector; + function isSelector(node: any): node is Selector; + + interface CombinatorRaws { + value?: string; + spaces?: { + before?: string; + after?: string; + }; + } + interface Combinator extends Base { + type: "combinator"; + raws?: CombinatorRaws; + } + function combinator(opts: NodeOptions): Combinator; + function isCombinator(node: any): node is Combinator; + + interface ClassName extends Base { + type: "class"; + } + function className(opts: NamespaceOptions): ClassName; + function isClassName(node: any): node is ClassName; + + type AttributeOperator = "=" | "~=" | "|=" | "^=" | "$=" | "*="; + type QuoteMark = '"' | "'" | null; + interface PreferredQuoteMarkOptions { + quoteMark?: QuoteMark; + preferCurrentQuoteMark?: boolean; + } + interface SmartQuoteMarkOptions extends PreferredQuoteMarkOptions { + smart?: boolean; + } + interface AttributeOptions extends NamespaceOptions { + attribute: string; + operator?: AttributeOperator; + insensitive?: boolean; + quoteMark?: QuoteMark; + /** @deprecated Use quoteMark instead. */ + quoted?: boolean; + spaces?: { + before?: string; + after?: string; + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + raws: { + unquoted?: string; + attribute?: string; + operator?: string; + value?: string; + insensitive?: string; + spaces?: { + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + }; + } + interface Attribute extends Namespace { + type: "attribute"; + attribute: string; + operator?: AttributeOperator; + insensitive?: boolean; + quoteMark: QuoteMark; + quoted?: boolean; + spaces: { + before: string; + after: string; + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + raws: { + /** @deprecated The attribute value is unquoted, use that instead.. */ + unquoted?: string; + attribute?: string; + operator?: string; + /** The value of the attribute with quotes and escapes. */ + value?: string; + insensitive?: string; + spaces?: { + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + }; + /** + * The attribute name after having been qualified with a namespace. + */ + readonly qualifiedAttribute: string; + + /** + * The case insensitivity flag or an empty string depending on whether this + * attribute is case insensitive. + */ + readonly insensitiveFlag : 'i' | ''; + + /** + * Returns the attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute or + * `set quoteMark(mark)` if you want to change the quote settings of the current + * value. + * + * You can also change the quotation used for the current value by setting quoteMark. + **/ + getQuotedValue(options?: SmartQuoteMarkOptions): string; + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + * @param value + */ + setValue(value: string, options?: SmartQuoteMarkOptions): void; + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + **/ + smartQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark; + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */ + preferredQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */ + offsetOf(part: "ns" | "namespace" | "attribute" | "attributeNS" | "operator" | "value" | "insensitive"): number; + } + function attribute(opts: AttributeOptions): Attribute; + function isAttribute(node: any): node is Attribute; + + interface Pseudo extends Container { + type: "pseudo"; + } + function pseudo(opts: ContainerOptions): Pseudo; + /** + * Checks wether the node is the Psuedo subtype of node. + */ + function isPseudo(node: any): node is Pseudo; + + /** + * Checks wether the node is, specifically, a pseudo element instead of + * pseudo class. + */ + function isPseudoElement(node: any): node is Pseudo; + + /** + * Checks wether the node is, specifically, a pseudo class instead of + * pseudo element. + */ + function isPseudoClass(node: any): node is Pseudo; + + + interface Tag extends Namespace { + type: "tag"; + } + function tag(opts: NamespaceOptions): Tag; + function isTag(node: any): node is Tag; + + interface Comment extends Base { + type: "comment"; + } + function comment(opts: NodeOptions): Comment; + function isComment(node: any): node is Comment; + + interface Identifier extends Base { + type: "id"; + } + function id(opts: any): any; + function isIdentifier(node: any): node is Identifier; + + interface Nesting extends Base { + type: "nesting"; + } + function nesting(opts: any): any; + function isNesting(node: any): node is Nesting; + + interface String extends Base { + type: "string"; + } + function string(opts: NodeOptions): String; + function isString(node: any): node is String; + + interface Universal extends Base { + type: "universal"; + } + function universal(opts?: NamespaceOptions): any; + function isUniversal(node: any): node is Universal; +} diff --git a/node_modules/postcss-value-parser/LICENSE b/node_modules/postcss-value-parser/LICENSE new file mode 100644 index 0000000..6dcaefc --- /dev/null +++ b/node_modules/postcss-value-parser/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) Bogdan Chadkin + +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/postcss-value-parser/README.md b/node_modules/postcss-value-parser/README.md new file mode 100644 index 0000000..3bd6a0d --- /dev/null +++ b/node_modules/postcss-value-parser/README.md @@ -0,0 +1,263 @@ +# postcss-value-parser + +[![Travis CI](https://travis-ci.org/TrySound/postcss-value-parser.svg)](https://travis-ci.org/TrySound/postcss-value-parser) + +Transforms CSS declaration values and at-rule parameters into a tree of nodes, and provides a simple traversal API. + +## Usage + +```js +var valueParser = require('postcss-value-parser'); +var cssBackgroundValue = 'url(foo.png) no-repeat 40px 73%'; +var parsedValue = valueParser(cssBackgroundValue); +// parsedValue exposes an API described below, +// e.g. parsedValue.walk(..), parsedValue.toString(), etc. +``` + +For example, parsing the value `rgba(233, 45, 66, .5)` will return the following: + +```js +{ + nodes: [ + { + type: 'function', + value: 'rgba', + before: '', + after: '', + nodes: [ + { type: 'word', value: '233' }, + { type: 'div', value: ',', before: '', after: ' ' }, + { type: 'word', value: '45' }, + { type: 'div', value: ',', before: '', after: ' ' }, + { type: 'word', value: '66' }, + { type: 'div', value: ',', before: ' ', after: '' }, + { type: 'word', value: '.5' } + ] + } + ] +} +``` + +If you wanted to convert each `rgba()` value in `sourceCSS` to a hex value, you could do so like this: + +```js +var valueParser = require('postcss-value-parser'); + +var parsed = valueParser(sourceCSS); + +// walk() will visit all the of the nodes in the tree, +// invoking the callback for each. +parsed.walk(function (node) { + + // Since we only want to transform rgba() values, + // we can ignore anything else. + if (node.type !== 'function' && node.value !== 'rgba') return; + + // We can make an array of the rgba() arguments to feed to a + // convertToHex() function + var color = node.nodes.filter(function (node) { + return node.type === 'word'; + }).map(function (node) { + return Number(node.value); + }); // [233, 45, 66, .5] + + // Now we will transform the existing rgba() function node + // into a word node with the hex value + node.type = 'word'; + node.value = convertToHex(color); +}) + +parsed.toString(); // #E92D42 +``` + +## Nodes + +Each node is an object with these common properties: + +- **type**: The type of node (`word`, `string`, `div`, `space`, `comment`, or `function`). + Each type is documented below. +- **value**: Each node has a `value` property; but what exactly `value` means + is specific to the node type. Details are documented for each type below. +- **sourceIndex**: The starting index of the node within the original source + string. For example, given the source string `10px 20px`, the `word` node + whose value is `20px` will have a `sourceIndex` of `5`. + +### word + +The catch-all node type that includes keywords (e.g. `no-repeat`), +quantities (e.g. `20px`, `75%`, `1.5`), and hex colors (e.g. `#e6e6e6`). + +Node-specific properties: + +- **value**: The "word" itself. + +### string + +A quoted string value, e.g. `"something"` in `content: "something";`. + +Node-specific properties: + +- **value**: The text content of the string. +- **quote**: The quotation mark surrounding the string, either `"` or `'`. +- **unclosed**: `true` if the string was not closed properly. e.g. `"unclosed string `. + +### div + +A divider, for example + +- `,` in `animation-duration: 1s, 2s, 3s` +- `/` in `border-radius: 10px / 23px` +- `:` in `(min-width: 700px)` + +Node-specific properties: + +- **value**: The divider character. Either `,`, `/`, or `:` (see examples above). +- **before**: Whitespace before the divider. +- **after**: Whitespace after the divider. + +### space + +Whitespace used as a separator, e.g. ` ` occurring twice in `border: 1px solid black;`. + +Node-specific properties: + +- **value**: The whitespace itself. + +### comment + +A CSS comment starts with `/*` and ends with `*/` + +Node-specific properties: + +- **value**: The comment value without `/*` and `*/` +- **unclosed**: `true` if the comment was not closed properly. e.g. `/* comment without an end `. + +### function + +A CSS function, e.g. `rgb(0,0,0)` or `url(foo.bar)`. + +Function nodes have nodes nested within them: the function arguments. + +Additional properties: + +- **value**: The name of the function, e.g. `rgb` in `rgb(0,0,0)`. +- **before**: Whitespace after the opening parenthesis and before the first argument, + e.g. ` ` in `rgb( 0,0,0)`. +- **after**: Whitespace before the closing parenthesis and after the last argument, + e.g. ` ` in `rgb(0,0,0 )`. +- **nodes**: More nodes representing the arguments to the function. +- **unclosed**: `true` if the parentheses was not closed properly. e.g. `( unclosed-function `. + +Media features surrounded by parentheses are considered functions with an +empty value. For example, `(min-width: 700px)` parses to these nodes: + +```js +[ + { + type: 'function', value: '', before: '', after: '', + nodes: [ + { type: 'word', value: 'min-width' }, + { type: 'div', value: ':', before: '', after: ' ' }, + { type: 'word', value: '700px' } + ] + } +] +``` + +`url()` functions can be parsed a little bit differently depending on +whether the first character in the argument is a quotation mark. + +`url( /gfx/img/bg.jpg )` parses to: + +```js +{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [ + { type: 'word', sourceIndex: 5, value: '/gfx/img/bg.jpg' } +] } +``` + +`url( "/gfx/img/bg.jpg" )`, on the other hand, parses to: + +```js +{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [ + type: 'string', sourceIndex: 5, quote: '"', value: '/gfx/img/bg.jpg' }, +] } +``` + +### unicode-range + +The unicode-range CSS descriptor sets the specific range of characters to be +used from a font defined by @font-face and made available +for use on the current page (`unicode-range: U+0025-00FF`). + +Node-specific properties: + +- **value**: The "unicode-range" itself. + +## API + +``` +var valueParser = require('postcss-value-parser'); +``` + +### valueParser.unit(quantity) + +Parses `quantity`, distinguishing the number from the unit. Returns an object like the following: + +```js +// Given 2rem +{ + number: '2', + unit: 'rem' +} +``` + +If the `quantity` argument cannot be parsed as a number, returns `false`. + +*This function does not parse complete values*: you cannot pass it `1px solid black` and expect `px` as +the unit. Instead, you should pass it single quantities only. Parse `1px solid black`, then pass it +the stringified `1px` node (a `word` node) to parse the number and unit. + +### valueParser.stringify(nodes[, custom]) + +Stringifies a node or array of nodes. + +The `custom` function is called for each `node`; return a string to override the default behaviour. + +### valueParser.walk(nodes, callback[, bubble]) + +Walks each provided node, recursively walking all descendent nodes within functions. + +Returning `false` in the `callback` will prevent traversal of descendent nodes (within functions). +You can use this feature to for shallow iteration, walking over only the *immediate* children. +*Note: This only applies if `bubble` is `false` (which is the default).* + +By default, the tree is walked from the outermost node inwards. +To reverse the direction, pass `true` for the `bubble` argument. + +The `callback` is invoked with three arguments: `callback(node, index, nodes)`. + +- `node`: The current node. +- `index`: The index of the current node. +- `nodes`: The complete nodes array passed to `walk()`. + +Returns the `valueParser` instance. + +### var parsed = valueParser(value) + +Returns the parsed node tree. + +### parsed.nodes + +The array of nodes. + +### parsed.toString() + +Stringifies the node tree. + +### parsed.walk(callback[, bubble]) + +Walks each node inside `parsed.nodes`. See the documentation for `valueParser.walk()` above. + +# License + +MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru) diff --git a/node_modules/postcss-value-parser/lib/index.d.ts b/node_modules/postcss-value-parser/lib/index.d.ts new file mode 100644 index 0000000..8759f3f --- /dev/null +++ b/node_modules/postcss-value-parser/lib/index.d.ts @@ -0,0 +1,177 @@ +declare namespace postcssValueParser { + interface BaseNode { + /** + * The offset, inclusive, inside the CSS value at which the node starts. + */ + sourceIndex: number; + + /** + * The offset, exclusive, inside the CSS value at which the node ends. + */ + sourceEndIndex: number; + + /** + * The node's characteristic value + */ + value: string; + } + + interface ClosableNode { + /** + * Whether the parsed CSS value ended before the node was properly closed + */ + unclosed?: true; + } + + interface AdjacentAwareNode { + /** + * The token at the start of the node + */ + before: string; + + /** + * The token at the end of the node + */ + after: string; + } + + interface CommentNode extends BaseNode, ClosableNode { + type: "comment"; + } + + interface DivNode extends BaseNode, AdjacentAwareNode { + type: "div"; + } + + interface FunctionNode extends BaseNode, ClosableNode, AdjacentAwareNode { + type: "function"; + + /** + * Nodes inside the function + */ + nodes: Node[]; + } + + interface SpaceNode extends BaseNode { + type: "space"; + } + + interface StringNode extends BaseNode, ClosableNode { + type: "string"; + + /** + * The quote type delimiting the string + */ + quote: '"' | "'"; + } + + interface UnicodeRangeNode extends BaseNode { + type: "unicode-range"; + } + + interface WordNode extends BaseNode { + type: "word"; + } + + /** + * Any node parsed from a CSS value + */ + type Node = + | CommentNode + | DivNode + | FunctionNode + | SpaceNode + | StringNode + | UnicodeRangeNode + | WordNode; + + interface CustomStringifierCallback { + /** + * @param node The node to stringify + * @returns The serialized CSS representation of the node + */ + (nodes: Node): string | undefined; + } + + interface WalkCallback { + /** + * @param node The currently visited node + * @param index The index of the node in the series of parsed nodes + * @param nodes The series of parsed nodes + * @returns Returning `false` will prevent traversal of descendant nodes (only applies if `bubble` was set to `true` in the `walk()` call) + */ + (node: Node, index: number, nodes: Node[]): void | boolean; + } + + /** + * A CSS dimension, decomposed into its numeric and unit parts + */ + interface Dimension { + number: string; + unit: string; + } + + /** + * A wrapper around a parsed CSS value that allows for inspecting and walking nodes + */ + interface ParsedValue { + /** + * The series of parsed nodes + */ + nodes: Node[]; + + /** + * Walk all parsed nodes, applying a callback + * + * @param callback A visitor callback that will be executed for each node + * @param bubble When set to `true`, walking will be done inside-out instead of outside-in + */ + walk(callback: WalkCallback, bubble?: boolean): this; + } + + interface ValueParser { + /** + * Decompose a CSS dimension into its numeric and unit part + * + * @param value The dimension to decompose + * @returns An object representing `number` and `unit` part of the dimension or `false` if the decomposing fails + */ + unit(value: string): Dimension | false; + + /** + * Serialize a series of nodes into a CSS value + * + * @param nodes The nodes to stringify + * @param custom A custom stringifier callback + * @returns The generated CSS value + */ + stringify(nodes: Node | Node[], custom?: CustomStringifierCallback): string; + + /** + * Walk a series of nodes, applying a callback + * + * @param nodes The nodes to walk + * @param callback A visitor callback that will be executed for each node + * @param bubble When set to `true`, walking will be done inside-out instead of outside-in + */ + walk(nodes: Node[], callback: WalkCallback, bubble?: boolean): void; + + /** + * Parse a CSS value into a series of nodes to operate on + * + * @param value The value to parse + */ + new (value: string): ParsedValue; + + /** + * Parse a CSS value into a series of nodes to operate on + * + * @param value The value to parse + */ + (value: string): ParsedValue; + } +} + +declare const postcssValueParser: postcssValueParser.ValueParser; + +export = postcssValueParser; diff --git a/node_modules/postcss-value-parser/lib/index.js b/node_modules/postcss-value-parser/lib/index.js new file mode 100644 index 0000000..f9ac0e6 --- /dev/null +++ b/node_modules/postcss-value-parser/lib/index.js @@ -0,0 +1,28 @@ +var parse = require("./parse"); +var walk = require("./walk"); +var stringify = require("./stringify"); + +function ValueParser(value) { + if (this instanceof ValueParser) { + this.nodes = parse(value); + return this; + } + return new ValueParser(value); +} + +ValueParser.prototype.toString = function() { + return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; +}; + +ValueParser.prototype.walk = function(cb, bubble) { + walk(this.nodes, cb, bubble); + return this; +}; + +ValueParser.unit = require("./unit"); + +ValueParser.walk = walk; + +ValueParser.stringify = stringify; + +module.exports = ValueParser; diff --git a/node_modules/postcss-value-parser/lib/parse.js b/node_modules/postcss-value-parser/lib/parse.js new file mode 100644 index 0000000..950631c --- /dev/null +++ b/node_modules/postcss-value-parser/lib/parse.js @@ -0,0 +1,321 @@ +var openParentheses = "(".charCodeAt(0); +var closeParentheses = ")".charCodeAt(0); +var singleQuote = "'".charCodeAt(0); +var doubleQuote = '"'.charCodeAt(0); +var backslash = "\\".charCodeAt(0); +var slash = "/".charCodeAt(0); +var comma = ",".charCodeAt(0); +var colon = ":".charCodeAt(0); +var star = "*".charCodeAt(0); +var uLower = "u".charCodeAt(0); +var uUpper = "U".charCodeAt(0); +var plus = "+".charCodeAt(0); +var isUnicodeRange = /^[a-f0-9?-]+$/i; + +module.exports = function(input) { + var tokens = []; + var value = input; + + var next, + quote, + prev, + token, + escape, + escapePos, + whitespacePos, + parenthesesOpenPos; + var pos = 0; + var code = value.charCodeAt(pos); + var max = value.length; + var stack = [{ nodes: tokens }]; + var balanced = 0; + var parent; + + var name = ""; + var before = ""; + var after = ""; + + while (pos < max) { + // Whitespaces + if (code <= 32) { + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + token = value.slice(pos, next); + + prev = tokens[tokens.length - 1]; + if (code === closeParentheses && balanced) { + after = token; + } else if (prev && prev.type === "div") { + prev.after = token; + prev.sourceEndIndex += token.length; + } else if ( + code === comma || + code === colon || + (code === slash && + value.charCodeAt(next + 1) !== star && + (!parent || + (parent && parent.type === "function" && parent.value !== "calc"))) + ) { + before = token; + } else { + tokens.push({ + type: "space", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } + + pos = next; + + // Quotes + } else if (code === singleQuote || code === doubleQuote) { + next = pos; + quote = code === singleQuote ? "'" : '"'; + token = { + type: "string", + sourceIndex: pos, + quote: quote + }; + do { + escape = false; + next = value.indexOf(quote, next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += quote; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + token.value = value.slice(pos + 1, next); + token.sourceEndIndex = token.unclosed ? next : next + 1; + tokens.push(token); + pos = next + 1; + code = value.charCodeAt(pos); + + // Comments + } else if (code === slash && value.charCodeAt(pos + 1) === star) { + next = value.indexOf("*/", pos); + + token = { + type: "comment", + sourceIndex: pos, + sourceEndIndex: next + 2 + }; + + if (next === -1) { + token.unclosed = true; + next = value.length; + token.sourceEndIndex = next; + } + + token.value = value.slice(pos + 2, next); + tokens.push(token); + + pos = next + 2; + code = value.charCodeAt(pos); + + // Operation within calc + } else if ( + (code === slash || code === star) && + parent && + parent.type === "function" && + parent.value === "calc" + ) { + token = value[pos]; + tokens.push({ + type: "word", + sourceIndex: pos - before.length, + sourceEndIndex: pos + token.length, + value: token + }); + pos += 1; + code = value.charCodeAt(pos); + + // Dividers + } else if (code === slash || code === comma || code === colon) { + token = value[pos]; + + tokens.push({ + type: "div", + sourceIndex: pos - before.length, + sourceEndIndex: pos + token.length, + value: token, + before: before, + after: "" + }); + before = ""; + + pos += 1; + code = value.charCodeAt(pos); + + // Open parentheses + } else if (openParentheses === code) { + // Whitespaces after open parentheses + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + parenthesesOpenPos = pos; + token = { + type: "function", + sourceIndex: pos - name.length, + value: name, + before: value.slice(parenthesesOpenPos + 1, next) + }; + pos = next; + + if (name === "url" && code !== singleQuote && code !== doubleQuote) { + next -= 1; + do { + escape = false; + next = value.indexOf(")", next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += ")"; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + // Whitespaces before closed + whitespacePos = next; + do { + whitespacePos -= 1; + code = value.charCodeAt(whitespacePos); + } while (code <= 32); + if (parenthesesOpenPos < whitespacePos) { + if (pos !== whitespacePos + 1) { + token.nodes = [ + { + type: "word", + sourceIndex: pos, + sourceEndIndex: whitespacePos + 1, + value: value.slice(pos, whitespacePos + 1) + } + ]; + } else { + token.nodes = []; + } + if (token.unclosed && whitespacePos + 1 !== next) { + token.after = ""; + token.nodes.push({ + type: "space", + sourceIndex: whitespacePos + 1, + sourceEndIndex: next, + value: value.slice(whitespacePos + 1, next) + }); + } else { + token.after = value.slice(whitespacePos + 1, next); + token.sourceEndIndex = next; + } + } else { + token.after = ""; + token.nodes = []; + } + pos = next + 1; + token.sourceEndIndex = token.unclosed ? next : pos; + code = value.charCodeAt(pos); + tokens.push(token); + } else { + balanced += 1; + token.after = ""; + token.sourceEndIndex = pos + 1; + tokens.push(token); + stack.push(token); + tokens = token.nodes = []; + parent = token; + } + name = ""; + + // Close parentheses + } else if (closeParentheses === code && balanced) { + pos += 1; + code = value.charCodeAt(pos); + + parent.after = after; + parent.sourceEndIndex += after.length; + after = ""; + balanced -= 1; + stack[stack.length - 1].sourceEndIndex = pos; + stack.pop(); + parent = stack[balanced]; + tokens = parent.nodes; + + // Words + } else { + next = pos; + do { + if (code === backslash) { + next += 1; + } + next += 1; + code = value.charCodeAt(next); + } while ( + next < max && + !( + code <= 32 || + code === singleQuote || + code === doubleQuote || + code === comma || + code === colon || + code === slash || + code === openParentheses || + (code === star && + parent && + parent.type === "function" && + parent.value === "calc") || + (code === slash && + parent.type === "function" && + parent.value === "calc") || + (code === closeParentheses && balanced) + ) + ); + token = value.slice(pos, next); + + if (openParentheses === code) { + name = token; + } else if ( + (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && + plus === token.charCodeAt(1) && + isUnicodeRange.test(token.slice(2)) + ) { + tokens.push({ + type: "unicode-range", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } else { + tokens.push({ + type: "word", + sourceIndex: pos, + sourceEndIndex: next, + value: token + }); + } + + pos = next; + } + } + + for (pos = stack.length - 1; pos; pos -= 1) { + stack[pos].unclosed = true; + stack[pos].sourceEndIndex = value.length; + } + + return stack[0].nodes; +}; diff --git a/node_modules/postcss-value-parser/lib/stringify.js b/node_modules/postcss-value-parser/lib/stringify.js new file mode 100644 index 0000000..6079671 --- /dev/null +++ b/node_modules/postcss-value-parser/lib/stringify.js @@ -0,0 +1,48 @@ +function stringifyNode(node, custom) { + var type = node.type; + var value = node.value; + var buf; + var customResult; + + if (custom && (customResult = custom(node)) !== undefined) { + return customResult; + } else if (type === "word" || type === "space") { + return value; + } else if (type === "string") { + buf = node.quote || ""; + return buf + value + (node.unclosed ? "" : buf); + } else if (type === "comment") { + return "/*" + value + (node.unclosed ? "" : "*/"); + } else if (type === "div") { + return (node.before || "") + value + (node.after || ""); + } else if (Array.isArray(node.nodes)) { + buf = stringify(node.nodes, custom); + if (type !== "function") { + return buf; + } + return ( + value + + "(" + + (node.before || "") + + buf + + (node.after || "") + + (node.unclosed ? "" : ")") + ); + } + return value; +} + +function stringify(nodes, custom) { + var result, i; + + if (Array.isArray(nodes)) { + result = ""; + for (i = nodes.length - 1; ~i; i -= 1) { + result = stringifyNode(nodes[i], custom) + result; + } + return result; + } + return stringifyNode(nodes, custom); +} + +module.exports = stringify; diff --git a/node_modules/postcss-value-parser/lib/unit.js b/node_modules/postcss-value-parser/lib/unit.js new file mode 100644 index 0000000..c349661 --- /dev/null +++ b/node_modules/postcss-value-parser/lib/unit.js @@ -0,0 +1,120 @@ +var minus = "-".charCodeAt(0); +var plus = "+".charCodeAt(0); +var dot = ".".charCodeAt(0); +var exp = "e".charCodeAt(0); +var EXP = "E".charCodeAt(0); + +// Check if three code points would start a number +// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number +function likeNumber(value) { + var code = value.charCodeAt(0); + var nextCode; + + if (code === plus || code === minus) { + nextCode = value.charCodeAt(1); + + if (nextCode >= 48 && nextCode <= 57) { + return true; + } + + var nextNextCode = value.charCodeAt(2); + + if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { + return true; + } + + return false; + } + + if (code === dot) { + nextCode = value.charCodeAt(1); + + if (nextCode >= 48 && nextCode <= 57) { + return true; + } + + return false; + } + + if (code >= 48 && code <= 57) { + return true; + } + + return false; +} + +// Consume a number +// https://www.w3.org/TR/css-syntax-3/#consume-number +module.exports = function(value) { + var pos = 0; + var length = value.length; + var code; + var nextCode; + var nextNextCode; + + if (length === 0 || !likeNumber(value)) { + return false; + } + + code = value.charCodeAt(pos); + + if (code === plus || code === minus) { + pos++; + } + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + + code = value.charCodeAt(pos); + nextCode = value.charCodeAt(pos + 1); + + if (code === dot && nextCode >= 48 && nextCode <= 57) { + pos += 2; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + } + + code = value.charCodeAt(pos); + nextCode = value.charCodeAt(pos + 1); + nextNextCode = value.charCodeAt(pos + 2); + + if ( + (code === exp || code === EXP) && + ((nextCode >= 48 && nextCode <= 57) || + ((nextCode === plus || nextCode === minus) && + nextNextCode >= 48 && + nextNextCode <= 57)) + ) { + pos += nextCode === plus || nextCode === minus ? 3 : 2; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code < 48 || code > 57) { + break; + } + + pos += 1; + } + } + + return { + number: value.slice(0, pos), + unit: value.slice(pos) + }; +}; diff --git a/node_modules/postcss-value-parser/lib/walk.js b/node_modules/postcss-value-parser/lib/walk.js new file mode 100644 index 0000000..7666c5b --- /dev/null +++ b/node_modules/postcss-value-parser/lib/walk.js @@ -0,0 +1,22 @@ +module.exports = function walk(nodes, cb, bubble) { + var i, max, node, result; + + for (i = 0, max = nodes.length; i < max; i += 1) { + node = nodes[i]; + if (!bubble) { + result = cb(node, i, nodes); + } + + if ( + result !== false && + node.type === "function" && + Array.isArray(node.nodes) + ) { + walk(node.nodes, cb, bubble); + } + + if (bubble) { + cb(node, i, nodes); + } + } +}; diff --git a/node_modules/postcss-value-parser/package.json b/node_modules/postcss-value-parser/package.json new file mode 100644 index 0000000..02d744a --- /dev/null +++ b/node_modules/postcss-value-parser/package.json @@ -0,0 +1,58 @@ +{ + "name": "postcss-value-parser", + "version": "4.2.0", + "description": "Transforms css values and at-rule params into the tree", + "main": "lib/index.js", + "files": [ + "lib" + ], + "devDependencies": { + "eslint": "^5.16.0", + "husky": "^2.3.0", + "lint-staged": "^8.1.7", + "prettier": "^1.17.1", + "tap-spec": "^5.0.0", + "tape": "^4.10.2" + }, + "scripts": { + "lint:prettier": "prettier \"**/*.js\" \"**/*.ts\" --list-different", + "lint:js": "eslint . --cache", + "lint": "yarn lint:js && yarn lint:prettier", + "pretest": "yarn lint", + "test": "tape test/*.js | tap-spec" + }, + "eslintConfig": { + "env": { + "es6": true, + "node": true + }, + "extends": "eslint:recommended" + }, + "lint-staged": { + "*.js": [ + "eslint", + "prettier --write", + "git add" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "author": "Bogdan Chadkin ", + "license": "MIT", + "homepage": "https://github.com/TrySound/postcss-value-parser", + "repository": { + "type": "git", + "url": "https://github.com/TrySound/postcss-value-parser.git" + }, + "keywords": [ + "postcss", + "value", + "parser" + ], + "bugs": { + "url": "https://github.com/TrySound/postcss-value-parser/issues" + } +} diff --git a/node_modules/postcss/LICENSE b/node_modules/postcss/LICENSE new file mode 100644 index 0000000..da057b4 --- /dev/null +++ b/node_modules/postcss/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2013 Andrey Sitnik + +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/postcss/README.md b/node_modules/postcss/README.md new file mode 100644 index 0000000..ab7a4c4 --- /dev/null +++ b/node_modules/postcss/README.md @@ -0,0 +1,28 @@ +# PostCSS + +Philosopher’s stone, logo of PostCSS + +PostCSS is a tool for transforming styles with JS plugins. +These plugins can lint your CSS, support variables and mixins, +transpile future CSS syntax, inline images, and more. + +PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba, +and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins is one of the most popular CSS tools. + +--- + +  Made in Evil Martians, product consulting for developer tools. + +--- + +[Abstract Syntax Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree +[Evil Martians]: https://evilmartians.com/?utm_source=postcss +[Autoprefixer]: https://github.com/postcss/autoprefixer +[Stylelint]: https://stylelint.io/ +[plugins]: https://github.com/postcss/postcss#plugins + + +## Docs +Read full docs **[here](https://postcss.org/)**. diff --git a/node_modules/postcss/lib/at-rule.d.ts b/node_modules/postcss/lib/at-rule.d.ts new file mode 100644 index 0000000..8eebc48 --- /dev/null +++ b/node_modules/postcss/lib/at-rule.d.ts @@ -0,0 +1,115 @@ +import Container, { ContainerProps } from './container.js' + +declare namespace AtRule { + export interface AtRuleRaws extends Record { + /** + * The space symbols after the last child of the node to the end of the node. + */ + after?: string + + /** + * The space between the at-rule name and its parameters. + */ + afterName?: string + + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the last parameter and `{` for rules. + */ + between?: string + + /** + * The rule’s selector with comments. + */ + params?: { + raw: string + value: string + } + + /** + * Contains `true` if the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface AtRuleProps extends ContainerProps { + /** Name of the at-rule. */ + name: string + /** Parameters following the name of the at-rule. */ + params?: number | string + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: AtRuleRaws + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { AtRule_ as default } +} + +/** + * Represents an at-rule. + * + * ```js + * Once (root, { AtRule }) { + * let media = new AtRule({ name: 'media', params: 'print' }) + * media.append(…) + * root.append(media) + * } + * ``` + * + * If it’s followed in the CSS by a `{}` block, this node will have + * a nodes property representing its children. + * + * ```js + * const root = postcss.parse('@charset "UTF-8"; @media print {}') + * + * const charset = root.first + * charset.type //=> 'atrule' + * charset.nodes //=> undefined + * + * const media = root.last + * media.nodes //=> [] + * ``` + */ +declare class AtRule_ extends Container { + /** + * The at-rule’s name immediately follows the `@`. + * + * ```js + * const root = postcss.parse('@media print {}') + * media.name //=> 'media' + * const media = root.first + * ``` + */ + name: string + /** + * The at-rule’s parameters, the values that follow the at-rule’s name + * but precede any `{}` block. + * + * ```js + * const root = postcss.parse('@media print, screen {}') + * const media = root.first + * media.params //=> 'print, screen' + * ``` + */ + params: string + parent: Container | undefined + + raws: AtRule.AtRuleRaws + + type: 'atrule' + + constructor(defaults?: AtRule.AtRuleProps) + assign(overrides: AtRule.AtRuleProps | object): this + clone(overrides?: Partial): AtRule + cloneAfter(overrides?: Partial): AtRule + cloneBefore(overrides?: Partial): AtRule +} + +declare class AtRule extends AtRule_ {} + +export = AtRule diff --git a/node_modules/postcss/lib/at-rule.js b/node_modules/postcss/lib/at-rule.js new file mode 100644 index 0000000..9486447 --- /dev/null +++ b/node_modules/postcss/lib/at-rule.js @@ -0,0 +1,25 @@ +'use strict' + +let Container = require('./container') + +class AtRule extends Container { + constructor(defaults) { + super(defaults) + this.type = 'atrule' + } + + append(...children) { + if (!this.proxyOf.nodes) this.nodes = [] + return super.append(...children) + } + + prepend(...children) { + if (!this.proxyOf.nodes) this.nodes = [] + return super.prepend(...children) + } +} + +module.exports = AtRule +AtRule.default = AtRule + +Container.registerAtRule(AtRule) diff --git a/node_modules/postcss/lib/comment.d.ts b/node_modules/postcss/lib/comment.d.ts new file mode 100644 index 0000000..d244508 --- /dev/null +++ b/node_modules/postcss/lib/comment.d.ts @@ -0,0 +1,67 @@ +import Container from './container.js' +import Node, { NodeProps } from './node.js' + +declare namespace Comment { + export interface CommentRaws extends Record { + /** + * The space symbols before the node. + */ + before?: string + + /** + * The space symbols between `/*` and the comment’s text. + */ + left?: string + + /** + * The space symbols between the comment’s text. + */ + right?: string + } + + export interface CommentProps extends NodeProps { + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: CommentRaws + /** Content of the comment. */ + text: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Comment_ as default } +} + +/** + * It represents a class that handles + * [CSS comments](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments) + * + * ```js + * Once (root, { Comment }) { + * const note = new Comment({ text: 'Note: …' }) + * root.append(note) + * } + * ``` + * + * Remember that CSS comments inside selectors, at-rule parameters, + * or declaration values will be stored in the `raws` properties + * explained above. + */ +declare class Comment_ extends Node { + parent: Container | undefined + raws: Comment.CommentRaws + /** + * The comment's text. + */ + text: string + + type: 'comment' + + constructor(defaults?: Comment.CommentProps) + assign(overrides: Comment.CommentProps | object): this + clone(overrides?: Partial): Comment + cloneAfter(overrides?: Partial): Comment + cloneBefore(overrides?: Partial): Comment +} + +declare class Comment extends Comment_ {} + +export = Comment diff --git a/node_modules/postcss/lib/comment.js b/node_modules/postcss/lib/comment.js new file mode 100644 index 0000000..c566506 --- /dev/null +++ b/node_modules/postcss/lib/comment.js @@ -0,0 +1,13 @@ +'use strict' + +let Node = require('./node') + +class Comment extends Node { + constructor(defaults) { + super(defaults) + this.type = 'comment' + } +} + +module.exports = Comment +Comment.default = Comment diff --git a/node_modules/postcss/lib/container.d.ts b/node_modules/postcss/lib/container.d.ts new file mode 100644 index 0000000..bd6b1ba --- /dev/null +++ b/node_modules/postcss/lib/container.d.ts @@ -0,0 +1,452 @@ +import AtRule from './at-rule.js' +import Comment from './comment.js' +import Declaration from './declaration.js' +import Node, { ChildNode, ChildProps, NodeProps } from './node.js' +import Rule from './rule.js' + +declare namespace Container { + export interface ValueOptions { + /** + * String that’s used to narrow down values and speed up the regexp search. + */ + fast?: string + + /** + * An array of property names. + */ + props?: string[] + } + + export interface ContainerProps extends NodeProps { + nodes?: (ChildNode | ChildProps)[] + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Container_ as default } +} + +/** + * The `Root`, `AtRule`, and `Rule` container nodes + * inherit some common methods to help work with their children. + * + * Note that all containers can store any content. If you write a rule inside + * a rule, PostCSS will parse it. + */ +declare abstract class Container_ extends Node { + /** + * An array containing the container’s children. + * + * ```js + * const root = postcss.parse('a { color: black }') + * root.nodes.length //=> 1 + * root.nodes[0].selector //=> 'a' + * root.nodes[0].nodes[0].prop //=> 'color' + * ``` + */ + nodes: Child[] + + /** + * Inserts new nodes to the end of the container. + * + * ```js + * const decl1 = new Declaration({ prop: 'color', value: 'black' }) + * const decl2 = new Declaration({ prop: 'background-color', value: 'white' }) + * rule.append(decl1, decl2) + * + * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule + * root.append({ selector: 'a' }) // rule + * rule.append({ prop: 'color', value: 'black' }) // declaration + * rule.append({ text: 'Comment' }) // comment + * + * root.append('a {}') + * root.first.append('color: black; z-index: 1') + * ``` + * + * @param nodes New nodes. + * @return This node for methods chain. + */ + append( + ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[] + ): this + + assign(overrides: Container.ContainerProps | object): this + clone(overrides?: Partial): Container + cloneAfter(overrides?: Partial): Container + cloneBefore(overrides?: Partial): Container + + /** + * Iterates through the container’s immediate children, + * calling `callback` for each child. + * + * Returning `false` in the callback will break iteration. + * + * This method only iterates through the container’s immediate children. + * If you need to recursively iterate through all the container’s descendant + * nodes, use `Container#walk`. + * + * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe + * if you are mutating the array of child nodes during iteration. + * PostCSS will adjust the current index to match the mutations. + * + * ```js + * const root = postcss.parse('a { color: black; z-index: 1 }') + * const rule = root.first + * + * for (const decl of rule.nodes) { + * decl.cloneBefore({ prop: '-webkit-' + decl.prop }) + * // Cycle will be infinite, because cloneBefore moves the current node + * // to the next index + * } + * + * rule.each(decl => { + * decl.cloneBefore({ prop: '-webkit-' + decl.prop }) + * // Will be executed only for color and z-index + * }) + * ``` + * + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + each( + callback: (node: Child, index: number) => false | void + ): false | undefined + + /** + * Returns `true` if callback returns `true` + * for all of the container’s children. + * + * ```js + * const noPrefixes = rule.every(i => i.prop[0] !== '-') + * ``` + * + * @param condition Iterator returns true or false. + * @return Is every child pass condition. + */ + every( + condition: (node: Child, index: number, nodes: Child[]) => boolean + ): boolean + /** + * Returns a `child`’s index within the `Container#nodes` array. + * + * ```js + * rule.index( rule.nodes[2] ) //=> 2 + * ``` + * + * @param child Child of the current container. + * @return Child index. + */ + index(child: Child | number): number + + /** + * Insert new node after old node within the container. + * + * @param oldNode Child or child’s index. + * @param newNode New node. + * @return This node for methods chain. + */ + insertAfter( + oldNode: Child | number, + newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[] + ): this + /** + * Insert new node before old node within the container. + * + * ```js + * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop })) + * ``` + * + * @param oldNode Child or child’s index. + * @param newNode New node. + * @return This node for methods chain. + */ + insertBefore( + oldNode: Child | number, + newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[] + ): this + + /** + * Traverses the container’s descendant nodes, calling callback + * for each comment node. + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * ```js + * root.walkComments(comment => { + * comment.remove() + * }) + * ``` + * + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + + /** + * Inserts new nodes to the start of the container. + * + * ```js + * const decl1 = new Declaration({ prop: 'color', value: 'black' }) + * const decl2 = new Declaration({ prop: 'background-color', value: 'white' }) + * rule.prepend(decl1, decl2) + * + * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule + * root.append({ selector: 'a' }) // rule + * rule.append({ prop: 'color', value: 'black' }) // declaration + * rule.append({ text: 'Comment' }) // comment + * + * root.append('a {}') + * root.first.append('color: black; z-index: 1') + * ``` + * + * @param nodes New nodes. + * @return This node for methods chain. + */ + prepend( + ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[] + ): this + /** + * Add child to the end of the node. + * + * ```js + * rule.push(new Declaration({ prop: 'color', value: 'black' })) + * ``` + * + * @param child New node. + * @return This node for methods chain. + */ + push(child: Child): this + + /** + * Removes all children from the container + * and cleans their parent properties. + * + * ```js + * rule.removeAll() + * rule.nodes.length //=> 0 + * ``` + * + * @return This node for methods chain. + */ + removeAll(): this + + /** + * Removes node from the container and cleans the parent properties + * from the node and its children. + * + * ```js + * rule.nodes.length //=> 5 + * rule.removeChild(decl) + * rule.nodes.length //=> 4 + * decl.parent //=> undefined + * ``` + * + * @param child Child or child’s index. + * @return This node for methods chain. + */ + removeChild(child: Child | number): this + + replaceValues( + pattern: RegExp | string, + replaced: { (substring: string, ...args: any[]): string } | string + ): this + + /** + * Passes all declaration values within the container that match pattern + * through callback, replacing those values with the returned result + * of callback. + * + * This method is useful if you are using a custom unit or function + * and need to iterate through all values. + * + * ```js + * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => { + * return 15 * parseInt(string) + 'px' + * }) + * ``` + * + * @param pattern Replace pattern. + * @param {object} opts Options to speed up the search. + * @param callback String to replace pattern or callback + * that returns a new value. The callback + * will receive the same arguments + * as those passed to a function parameter + * of `String#replace`. + * @return This node for methods chain. + */ + replaceValues( + pattern: RegExp | string, + options: Container.ValueOptions, + replaced: { (substring: string, ...args: any[]): string } | string + ): this + + /** + * Returns `true` if callback returns `true` for (at least) one + * of the container’s children. + * + * ```js + * const hasPrefix = rule.some(i => i.prop[0] === '-') + * ``` + * + * @param condition Iterator returns true or false. + * @return Is some child pass condition. + */ + some( + condition: (node: Child, index: number, nodes: Child[]) => boolean + ): boolean + + /** + * Traverses the container’s descendant nodes, calling callback + * for each node. + * + * Like container.each(), this method is safe to use + * if you are mutating arrays during iteration. + * + * If you only need to iterate through the container’s immediate children, + * use `Container#each`. + * + * ```js + * root.walk(node => { + * // Traverses all descendant nodes. + * }) + * ``` + * + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walk( + callback: (node: ChildNode, index: number) => false | void + ): false | undefined + + /** + * Traverses the container’s descendant nodes, calling callback + * for each at-rule node. + * + * If you pass a filter, iteration will only happen over at-rules + * that have matching names. + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * ```js + * root.walkAtRules(rule => { + * if (isOld(rule.name)) rule.remove() + * }) + * + * let first = false + * root.walkAtRules('charset', rule => { + * if (!first) { + * first = true + * } else { + * rule.remove() + * } + * }) + * ``` + * + * @param name String or regular expression to filter at-rules by name. + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walkAtRules( + nameFilter: RegExp | string, + callback: (atRule: AtRule, index: number) => false | void + ): false | undefined + + walkAtRules( + callback: (atRule: AtRule, index: number) => false | void + ): false | undefined + walkComments( + callback: (comment: Comment, indexed: number) => false | void + ): false | undefined + + walkComments( + callback: (comment: Comment, indexed: number) => false | void + ): false | undefined + + /** + * Traverses the container’s descendant nodes, calling callback + * for each declaration node. + * + * If you pass a filter, iteration will only happen over declarations + * with matching properties. + * + * ```js + * root.walkDecls(decl => { + * checkPropertySupport(decl.prop) + * }) + * + * root.walkDecls('border-radius', decl => { + * decl.remove() + * }) + * + * root.walkDecls(/^background/, decl => { + * decl.value = takeFirstColorFromGradient(decl.value) + * }) + * ``` + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * @param prop String or regular expression to filter declarations + * by property name. + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walkDecls( + propFilter: RegExp | string, + callback: (decl: Declaration, index: number) => false | void + ): false | undefined + + walkDecls( + callback: (decl: Declaration, index: number) => false | void + ): false | undefined + + /** + * Traverses the container’s descendant nodes, calling callback + * for each rule node. + * + * If you pass a filter, iteration will only happen over rules + * with matching selectors. + * + * Like `Container#each`, this method is safe + * to use if you are mutating arrays during iteration. + * + * ```js + * const selectors = [] + * root.walkRules(rule => { + * selectors.push(rule.selector) + * }) + * console.log(`Your CSS uses ${ selectors.length } selectors`) + * ``` + * + * @param selector String or regular expression to filter rules by selector. + * @param callback Iterator receives each node and index. + * @return Returns `false` if iteration was broke. + */ + walkRules( + selectorFilter: RegExp | string, + callback: (rule: Rule, index: number) => false | void + ): false | undefined + walkRules( + callback: (rule: Rule, index: number) => false | void + ): false | undefined + /** + * The container’s first child. + * + * ```js + * rule.first === rules.nodes[0] + * ``` + */ + get first(): Child | undefined + /** + * The container’s last child. + * + * ```js + * rule.last === rule.nodes[rule.nodes.length - 1] + * ``` + */ + get last(): Child | undefined +} + +declare class Container extends Container_ {} + +export = Container diff --git a/node_modules/postcss/lib/container.js b/node_modules/postcss/lib/container.js new file mode 100644 index 0000000..914c053 --- /dev/null +++ b/node_modules/postcss/lib/container.js @@ -0,0 +1,439 @@ +'use strict' + +let { isClean, my } = require('./symbols') +let Declaration = require('./declaration') +let Comment = require('./comment') +let Node = require('./node') + +let parse, Rule, AtRule, Root + +function cleanSource(nodes) { + return nodes.map(i => { + if (i.nodes) i.nodes = cleanSource(i.nodes) + delete i.source + return i + }) +} + +function markDirtyUp(node) { + node[isClean] = false + if (node.proxyOf.nodes) { + for (let i of node.proxyOf.nodes) { + markDirtyUp(i) + } + } +} + +class Container extends Node { + append(...children) { + for (let child of children) { + let nodes = this.normalize(child, this.last) + for (let node of nodes) this.proxyOf.nodes.push(node) + } + + this.markDirty() + + return this + } + + cleanRaws(keepBetween) { + super.cleanRaws(keepBetween) + if (this.nodes) { + for (let node of this.nodes) node.cleanRaws(keepBetween) + } + } + + each(callback) { + if (!this.proxyOf.nodes) return undefined + let iterator = this.getIterator() + + let index, result + while (this.indexes[iterator] < this.proxyOf.nodes.length) { + index = this.indexes[iterator] + result = callback(this.proxyOf.nodes[index], index) + if (result === false) break + + this.indexes[iterator] += 1 + } + + delete this.indexes[iterator] + return result + } + + every(condition) { + return this.nodes.every(condition) + } + + getIterator() { + if (!this.lastEach) this.lastEach = 0 + if (!this.indexes) this.indexes = {} + + this.lastEach += 1 + let iterator = this.lastEach + this.indexes[iterator] = 0 + + return iterator + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (!node[prop]) { + return node[prop] + } else if ( + prop === 'each' || + (typeof prop === 'string' && prop.startsWith('walk')) + ) { + return (...args) => { + return node[prop]( + ...args.map(i => { + if (typeof i === 'function') { + return (child, index) => i(child.toProxy(), index) + } else { + return i + } + }) + ) + } + } else if (prop === 'every' || prop === 'some') { + return cb => { + return node[prop]((child, ...other) => + cb(child.toProxy(), ...other) + ) + } + } else if (prop === 'root') { + return () => node.root().toProxy() + } else if (prop === 'nodes') { + return node.nodes.map(i => i.toProxy()) + } else if (prop === 'first' || prop === 'last') { + return node[prop].toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value + if (prop === 'name' || prop === 'params' || prop === 'selector') { + node.markDirty() + } + return true + } + } + } + + index(child) { + if (typeof child === 'number') return child + if (child.proxyOf) child = child.proxyOf + return this.proxyOf.nodes.indexOf(child) + } + + insertAfter(exist, add) { + let existIndex = this.index(exist) + let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse() + existIndex = this.index(exist) + for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node) + + let index + for (let id in this.indexes) { + index = this.indexes[id] + if (existIndex < index) { + this.indexes[id] = index + nodes.length + } + } + + this.markDirty() + + return this + } + + insertBefore(exist, add) { + let existIndex = this.index(exist) + let type = existIndex === 0 ? 'prepend' : false + let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse() + existIndex = this.index(exist) + for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node) + + let index + for (let id in this.indexes) { + index = this.indexes[id] + if (existIndex <= index) { + this.indexes[id] = index + nodes.length + } + } + + this.markDirty() + + return this + } + + normalize(nodes, sample) { + if (typeof nodes === 'string') { + nodes = cleanSource(parse(nodes).nodes) + } else if (Array.isArray(nodes)) { + nodes = nodes.slice(0) + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, 'ignore') + } + } else if (nodes.type === 'root' && this.type !== 'document') { + nodes = nodes.nodes.slice(0) + for (let i of nodes) { + if (i.parent) i.parent.removeChild(i, 'ignore') + } + } else if (nodes.type) { + nodes = [nodes] + } else if (nodes.prop) { + if (typeof nodes.value === 'undefined') { + throw new Error('Value field is missed in node creation') + } else if (typeof nodes.value !== 'string') { + nodes.value = String(nodes.value) + } + nodes = [new Declaration(nodes)] + } else if (nodes.selector) { + nodes = [new Rule(nodes)] + } else if (nodes.name) { + nodes = [new AtRule(nodes)] + } else if (nodes.text) { + nodes = [new Comment(nodes)] + } else { + throw new Error('Unknown node type in node creation') + } + + let processed = nodes.map(i => { + /* c8 ignore next */ + if (!i[my]) Container.rebuild(i) + i = i.proxyOf + if (i.parent) i.parent.removeChild(i) + if (i[isClean]) markDirtyUp(i) + if (typeof i.raws.before === 'undefined') { + if (sample && typeof sample.raws.before !== 'undefined') { + i.raws.before = sample.raws.before.replace(/\S/g, '') + } + } + i.parent = this.proxyOf + return i + }) + + return processed + } + + prepend(...children) { + children = children.reverse() + for (let child of children) { + let nodes = this.normalize(child, this.first, 'prepend').reverse() + for (let node of nodes) this.proxyOf.nodes.unshift(node) + for (let id in this.indexes) { + this.indexes[id] = this.indexes[id] + nodes.length + } + } + + this.markDirty() + + return this + } + + push(child) { + child.parent = this + this.proxyOf.nodes.push(child) + return this + } + + removeAll() { + for (let node of this.proxyOf.nodes) node.parent = undefined + this.proxyOf.nodes = [] + + this.markDirty() + + return this + } + + removeChild(child) { + child = this.index(child) + this.proxyOf.nodes[child].parent = undefined + this.proxyOf.nodes.splice(child, 1) + + let index + for (let id in this.indexes) { + index = this.indexes[id] + if (index >= child) { + this.indexes[id] = index - 1 + } + } + + this.markDirty() + + return this + } + + replaceValues(pattern, opts, callback) { + if (!callback) { + callback = opts + opts = {} + } + + this.walkDecls(decl => { + if (opts.props && !opts.props.includes(decl.prop)) return + if (opts.fast && !decl.value.includes(opts.fast)) return + + decl.value = decl.value.replace(pattern, callback) + }) + + this.markDirty() + + return this + } + + some(condition) { + return this.nodes.some(condition) + } + + walk(callback) { + return this.each((child, i) => { + let result + try { + result = callback(child, i) + } catch (e) { + throw child.addToError(e) + } + if (result !== false && child.walk) { + result = child.walk(callback) + } + + return result + }) + } + + walkAtRules(name, callback) { + if (!callback) { + callback = name + return this.walk((child, i) => { + if (child.type === 'atrule') { + return callback(child, i) + } + }) + } + if (name instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'atrule' && name.test(child.name)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'atrule' && child.name === name) { + return callback(child, i) + } + }) + } + + walkComments(callback) { + return this.walk((child, i) => { + if (child.type === 'comment') { + return callback(child, i) + } + }) + } + + walkDecls(prop, callback) { + if (!callback) { + callback = prop + return this.walk((child, i) => { + if (child.type === 'decl') { + return callback(child, i) + } + }) + } + if (prop instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'decl' && prop.test(child.prop)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'decl' && child.prop === prop) { + return callback(child, i) + } + }) + } + + walkRules(selector, callback) { + if (!callback) { + callback = selector + + return this.walk((child, i) => { + if (child.type === 'rule') { + return callback(child, i) + } + }) + } + if (selector instanceof RegExp) { + return this.walk((child, i) => { + if (child.type === 'rule' && selector.test(child.selector)) { + return callback(child, i) + } + }) + } + return this.walk((child, i) => { + if (child.type === 'rule' && child.selector === selector) { + return callback(child, i) + } + }) + } + + get first() { + if (!this.proxyOf.nodes) return undefined + return this.proxyOf.nodes[0] + } + + get last() { + if (!this.proxyOf.nodes) return undefined + return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] + } +} + +Container.registerParse = dependant => { + parse = dependant +} + +Container.registerRule = dependant => { + Rule = dependant +} + +Container.registerAtRule = dependant => { + AtRule = dependant +} + +Container.registerRoot = dependant => { + Root = dependant +} + +module.exports = Container +Container.default = Container + +/* c8 ignore start */ +Container.rebuild = node => { + if (node.type === 'atrule') { + Object.setPrototypeOf(node, AtRule.prototype) + } else if (node.type === 'rule') { + Object.setPrototypeOf(node, Rule.prototype) + } else if (node.type === 'decl') { + Object.setPrototypeOf(node, Declaration.prototype) + } else if (node.type === 'comment') { + Object.setPrototypeOf(node, Comment.prototype) + } else if (node.type === 'root') { + Object.setPrototypeOf(node, Root.prototype) + } + + node[my] = true + + if (node.nodes) { + node.nodes.forEach(child => { + Container.rebuild(child) + }) + } +} +/* c8 ignore stop */ diff --git a/node_modules/postcss/lib/css-syntax-error.d.ts b/node_modules/postcss/lib/css-syntax-error.d.ts new file mode 100644 index 0000000..d2d11bf --- /dev/null +++ b/node_modules/postcss/lib/css-syntax-error.d.ts @@ -0,0 +1,248 @@ +import { FilePosition } from './input.js' + +declare namespace CssSyntaxError { + /** + * A position that is part of a range. + */ + export interface RangePosition { + /** + * The column number in the input. + */ + column: number + + /** + * The line number in the input. + */ + line: number + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { CssSyntaxError_ as default } +} + +/** + * The CSS parser throws this error for broken CSS. + * + * Custom parsers can throw this error for broken custom syntax using + * the `Node#error` method. + * + * PostCSS will use the input source map to detect the original error location. + * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS, + * PostCSS will show the original position in the Sass file. + * + * If you need the position in the PostCSS input + * (e.g., to debug the previous compiler), use `error.input.file`. + * + * ```js + * // Raising error from plugin + * throw node.error('Unknown variable', { plugin: 'postcss-vars' }) + * ``` + * + * ```js + * // Catching and checking syntax error + * try { + * postcss.parse('a{') + * } catch (error) { + * if (error.name === 'CssSyntaxError') { + * error //=> CssSyntaxError + * } + * } + * ``` + */ +declare class CssSyntaxError_ { + /** + * Source column of the error. + * + * ```js + * error.column //=> 1 + * error.input.column //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.column`. + */ + column?: number + + /** + * Source column of the error's end, exclusive. Provided if the error pertains + * to a range. + * + * ```js + * error.endColumn //=> 1 + * error.input.endColumn //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.endColumn`. + */ + endColumn?: number + + /** + * Source line of the error's end, exclusive. Provided if the error pertains + * to a range. + * + * ```js + * error.endLine //=> 3 + * error.input.endLine //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.endLine`. + */ + endLine?: number + + /** + * Absolute path to the broken file. + * + * ```js + * error.file //=> 'a.sass' + * error.input.file //=> 'a.css' + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.file`. + */ + file?: string + + /** + * Input object with PostCSS internal information + * about input file. If input has source map + * from previous tool, PostCSS will use origin + * (for example, Sass) source. You can use this + * object to get PostCSS input source. + * + * ```js + * error.input.file //=> 'a.css' + * error.file //=> 'a.sass' + * ``` + */ + input?: FilePosition + + /** + * Source line of the error. + * + * ```js + * error.line //=> 2 + * error.input.line //=> 4 + * ``` + * + * PostCSS will use the input source map to detect the original location. + * If you need the position in the PostCSS input, use `error.input.line`. + */ + line?: number + + /** + * Full error text in the GNU error format + * with plugin, file, line and column. + * + * ```js + * error.message //=> 'a.css:1:1: Unclosed block' + * ``` + */ + message: string + + /** + * Always equal to `'CssSyntaxError'`. You should always check error type + * by `error.name === 'CssSyntaxError'` + * instead of `error instanceof CssSyntaxError`, + * because npm could have several PostCSS versions. + * + * ```js + * if (error.name === 'CssSyntaxError') { + * error //=> CssSyntaxError + * } + * ``` + */ + name: 'CssSyntaxError' + + /** + * Plugin name, if error came from plugin. + * + * ```js + * error.plugin //=> 'postcss-vars' + * ``` + */ + plugin?: string + + /** + * Error message. + * + * ```js + * error.message //=> 'Unclosed block' + * ``` + */ + reason: string + + /** + * Source code of the broken file. + * + * ```js + * error.source //=> 'a { b {} }' + * error.input.source //=> 'a b { }' + * ``` + */ + source?: string + + stack: string + + /** + * Instantiates a CSS syntax error. Can be instantiated for a single position + * or for a range. + * @param message Error message. + * @param lineOrStartPos If for a single position, the line number, or if for + * a range, the inclusive start position of the error. + * @param columnOrEndPos If for a single position, the column number, or if for + * a range, the exclusive end position of the error. + * @param source Source code of the broken file. + * @param file Absolute path to the broken file. + * @param plugin PostCSS plugin name, if error came from plugin. + */ + constructor( + message: string, + lineOrStartPos?: CssSyntaxError.RangePosition | number, + columnOrEndPos?: CssSyntaxError.RangePosition | number, + source?: string, + file?: string, + plugin?: string + ) + + /** + * Returns a few lines of CSS source that caused the error. + * + * If the CSS has an input source map without `sourceContent`, + * this method will return an empty string. + * + * ```js + * error.showSourceCode() //=> " 4 | } + * // 5 | a { + * // > 6 | bad + * // | ^ + * // 7 | } + * // 8 | b {" + * ``` + * + * @param color Whether arrow will be colored red by terminal + * color codes. By default, PostCSS will detect + * color support by `process.stdout.isTTY` + * and `process.env.NODE_DISABLE_COLORS`. + * @return Few lines of CSS source that caused the error. + */ + showSourceCode(color?: boolean): string + + /** + * Returns error position, message and source code of the broken part. + * + * ```js + * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block + * // > 1 | a { + * // | ^" + * ``` + * + * @return Error position, message and source code. + */ + toString(): string +} + +declare class CssSyntaxError extends CssSyntaxError_ {} + +export = CssSyntaxError diff --git a/node_modules/postcss/lib/css-syntax-error.js b/node_modules/postcss/lib/css-syntax-error.js new file mode 100644 index 0000000..1693033 --- /dev/null +++ b/node_modules/postcss/lib/css-syntax-error.js @@ -0,0 +1,100 @@ +'use strict' + +let pico = require('picocolors') + +let terminalHighlight = require('./terminal-highlight') + +class CssSyntaxError extends Error { + constructor(message, line, column, source, file, plugin) { + super(message) + this.name = 'CssSyntaxError' + this.reason = message + + if (file) { + this.file = file + } + if (source) { + this.source = source + } + if (plugin) { + this.plugin = plugin + } + if (typeof line !== 'undefined' && typeof column !== 'undefined') { + if (typeof line === 'number') { + this.line = line + this.column = column + } else { + this.line = line.line + this.column = line.column + this.endLine = column.line + this.endColumn = column.column + } + } + + this.setMessage() + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, CssSyntaxError) + } + } + + setMessage() { + this.message = this.plugin ? this.plugin + ': ' : '' + this.message += this.file ? this.file : '' + if (typeof this.line !== 'undefined') { + this.message += ':' + this.line + ':' + this.column + } + this.message += ': ' + this.reason + } + + showSourceCode(color) { + if (!this.source) return '' + + let css = this.source + if (color == null) color = pico.isColorSupported + if (terminalHighlight) { + if (color) css = terminalHighlight(css) + } + + let lines = css.split(/\r?\n/) + let start = Math.max(this.line - 3, 0) + let end = Math.min(this.line + 2, lines.length) + + let maxWidth = String(end).length + + let mark, aside + if (color) { + let { bold, gray, red } = pico.createColors(true) + mark = text => bold(red(text)) + aside = text => gray(text) + } else { + mark = aside = str => str + } + + return lines + .slice(start, end) + .map((line, index) => { + let number = start + 1 + index + let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ' + if (number === this.line) { + let spacing = + aside(gutter.replace(/\d/g, ' ')) + + line.slice(0, this.column - 1).replace(/[^\t]/g, ' ') + return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^') + } + return ' ' + aside(gutter) + line + }) + .join('\n') + } + + toString() { + let code = this.showSourceCode() + if (code) { + code = '\n\n' + code + '\n' + } + return this.name + ': ' + this.message + code + } +} + +module.exports = CssSyntaxError +CssSyntaxError.default = CssSyntaxError diff --git a/node_modules/postcss/lib/declaration.d.ts b/node_modules/postcss/lib/declaration.d.ts new file mode 100644 index 0000000..655deea --- /dev/null +++ b/node_modules/postcss/lib/declaration.d.ts @@ -0,0 +1,148 @@ +import Container from './container.js' +import Node from './node.js' + +declare namespace Declaration { + export interface DeclarationRaws extends Record { + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the property and value for declarations. + */ + between?: string + + /** + * The content of the important statement, if it is not just `!important`. + */ + important?: string + + /** + * Declaration value with comments. + */ + value?: { + raw: string + value: string + } + } + + export interface DeclarationProps { + /** Whether the declaration has an `!important` annotation. */ + important?: boolean + /** Name of the declaration. */ + prop: string + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: DeclarationRaws + /** Value of the declaration. */ + value: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Declaration_ as default } +} + +/** + * It represents a class that handles + * [CSS declarations](https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_declarations) + * + * ```js + * Once (root, { Declaration }) { + * const color = new Declaration({ prop: 'color', value: 'black' }) + * root.append(color) + * } + * ``` + * + * ```js + * const root = postcss.parse('a { color: black }') + * const decl = root.first?.first + * + * decl.type //=> 'decl' + * decl.toString() //=> ' color: black' + * ``` + */ +declare class Declaration_ extends Node { + /** + * It represents a specificity of the declaration. + * + * If true, the CSS declaration will have an + * [important](https://developer.mozilla.org/en-US/docs/Web/CSS/important) + * specifier. + * + * ```js + * const root = postcss.parse('a { color: black !important; color: red }') + * + * root.first.first.important //=> true + * root.first.last.important //=> undefined + * ``` + */ + important: boolean + + parent: Container | undefined + + /** + * The property name for a CSS declaration. + * + * ```js + * const root = postcss.parse('a { color: black }') + * const decl = root.first.first + * + * decl.prop //=> 'color' + * ``` + */ + prop: string + + raws: Declaration.DeclarationRaws + + type: 'decl' + + /** + * The property value for a CSS declaration. + * + * Any CSS comments inside the value string will be filtered out. + * CSS comments present in the source value will be available in + * the `raws` property. + * + * Assigning new `value` would ignore the comments in `raws` + * property while compiling node to string. + * + * ```js + * const root = postcss.parse('a { color: black }') + * const decl = root.first.first + * + * decl.value //=> 'black' + * ``` + */ + value: string + + /** + * It represents a getter that returns `true` if a declaration starts with + * `--` or `$`, which are used to declare variables in CSS and SASS/SCSS. + * + * ```js + * const root = postcss.parse(':root { --one: 1 }') + * const one = root.first.first + * + * one.variable //=> true + * ``` + * + * ```js + * const root = postcss.parse('$one: 1') + * const one = root.first + * + * one.variable //=> true + * ``` + */ + variable: boolean + + constructor(defaults?: Declaration.DeclarationProps) + assign(overrides: Declaration.DeclarationProps | object): this + clone(overrides?: Partial): Declaration + cloneAfter(overrides?: Partial): Declaration + cloneBefore(overrides?: Partial): Declaration +} + +declare class Declaration extends Declaration_ {} + +export = Declaration diff --git a/node_modules/postcss/lib/declaration.js b/node_modules/postcss/lib/declaration.js new file mode 100644 index 0000000..a04bdec --- /dev/null +++ b/node_modules/postcss/lib/declaration.js @@ -0,0 +1,24 @@ +'use strict' + +let Node = require('./node') + +class Declaration extends Node { + constructor(defaults) { + if ( + defaults && + typeof defaults.value !== 'undefined' && + typeof defaults.value !== 'string' + ) { + defaults = { ...defaults, value: String(defaults.value) } + } + super(defaults) + this.type = 'decl' + } + + get variable() { + return this.prop.startsWith('--') || this.prop[0] === '$' + } +} + +module.exports = Declaration +Declaration.default = Declaration diff --git a/node_modules/postcss/lib/document.d.ts b/node_modules/postcss/lib/document.d.ts new file mode 100644 index 0000000..f018f6e --- /dev/null +++ b/node_modules/postcss/lib/document.d.ts @@ -0,0 +1,68 @@ +import Container, { ContainerProps } from './container.js' +import { ProcessOptions } from './postcss.js' +import Result from './result.js' +import Root from './root.js' + +declare namespace Document { + export interface DocumentProps extends ContainerProps { + nodes?: Root[] + + /** + * Information to generate byte-to-byte equal node string as it was + * in the origin input. + * + * Every parser saves its own properties. + */ + raws?: Record + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Document_ as default } +} + +/** + * Represents a file and contains all its parsed nodes. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + * + * ```js + * const document = htmlParser( + * '' + * ) + * document.type //=> 'document' + * document.nodes.length //=> 2 + * ``` + */ +declare class Document_ extends Container { + parent: undefined + type: 'document' + + constructor(defaults?: Document.DocumentProps) + + assign(overrides: Document.DocumentProps | object): this + clone(overrides?: Partial): Document + cloneAfter(overrides?: Partial): Document + cloneBefore(overrides?: Partial): Document + + /** + * Returns a `Result` instance representing the document’s CSS roots. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * const document = postcss.document() + * document.append(root1) + * document.append(root2) + * const result = document.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param opts Options. + * @return Result with current document’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Document extends Document_ {} + +export = Document diff --git a/node_modules/postcss/lib/document.js b/node_modules/postcss/lib/document.js new file mode 100644 index 0000000..4468991 --- /dev/null +++ b/node_modules/postcss/lib/document.js @@ -0,0 +1,33 @@ +'use strict' + +let Container = require('./container') + +let LazyResult, Processor + +class Document extends Container { + constructor(defaults) { + // type needs to be passed to super, otherwise child roots won't be normalized correctly + super({ type: 'document', ...defaults }) + + if (!this.nodes) { + this.nodes = [] + } + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts) + + return lazy.stringify() + } +} + +Document.registerLazyResult = dependant => { + LazyResult = dependant +} + +Document.registerProcessor = dependant => { + Processor = dependant +} + +module.exports = Document +Document.default = Document diff --git a/node_modules/postcss/lib/fromJSON.d.ts b/node_modules/postcss/lib/fromJSON.d.ts new file mode 100644 index 0000000..e1deedb --- /dev/null +++ b/node_modules/postcss/lib/fromJSON.d.ts @@ -0,0 +1,9 @@ +import { JSONHydrator } from './postcss.js' + +interface FromJSON extends JSONHydrator { + default: FromJSON +} + +declare const fromJSON: FromJSON + +export = fromJSON diff --git a/node_modules/postcss/lib/fromJSON.js b/node_modules/postcss/lib/fromJSON.js new file mode 100644 index 0000000..09f2b89 --- /dev/null +++ b/node_modules/postcss/lib/fromJSON.js @@ -0,0 +1,54 @@ +'use strict' + +let Declaration = require('./declaration') +let PreviousMap = require('./previous-map') +let Comment = require('./comment') +let AtRule = require('./at-rule') +let Input = require('./input') +let Root = require('./root') +let Rule = require('./rule') + +function fromJSON(json, inputs) { + if (Array.isArray(json)) return json.map(n => fromJSON(n)) + + let { inputs: ownInputs, ...defaults } = json + if (ownInputs) { + inputs = [] + for (let input of ownInputs) { + let inputHydrated = { ...input, __proto__: Input.prototype } + if (inputHydrated.map) { + inputHydrated.map = { + ...inputHydrated.map, + __proto__: PreviousMap.prototype + } + } + inputs.push(inputHydrated) + } + } + if (defaults.nodes) { + defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)) + } + if (defaults.source) { + let { inputId, ...source } = defaults.source + defaults.source = source + if (inputId != null) { + defaults.source.input = inputs[inputId] + } + } + if (defaults.type === 'root') { + return new Root(defaults) + } else if (defaults.type === 'decl') { + return new Declaration(defaults) + } else if (defaults.type === 'rule') { + return new Rule(defaults) + } else if (defaults.type === 'comment') { + return new Comment(defaults) + } else if (defaults.type === 'atrule') { + return new AtRule(defaults) + } else { + throw new Error('Unknown node type: ' + json.type) + } +} + +module.exports = fromJSON +fromJSON.default = fromJSON diff --git a/node_modules/postcss/lib/input.d.ts b/node_modules/postcss/lib/input.d.ts new file mode 100644 index 0000000..c718bd1 --- /dev/null +++ b/node_modules/postcss/lib/input.d.ts @@ -0,0 +1,194 @@ +import { CssSyntaxError, ProcessOptions } from './postcss.js' +import PreviousMap from './previous-map.js' + +declare namespace Input { + export interface FilePosition { + /** + * Column of inclusive start position in source file. + */ + column: number + + /** + * Column of exclusive end position in source file. + */ + endColumn?: number + + /** + * Line of exclusive end position in source file. + */ + endLine?: number + + /** + * Absolute path to the source file. + */ + file?: string + + /** + * Line of inclusive start position in source file. + */ + line: number + + /** + * Source code. + */ + source?: string + + /** + * URL for the source file. + */ + url: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Input_ as default } +} + +/** + * Represents the source CSS. + * + * ```js + * const root = postcss.parse(css, { from: file }) + * const input = root.source.input + * ``` + */ +declare class Input_ { + /** + * Input CSS source. + * + * ```js + * const input = postcss.parse('a{}', { from: file }).input + * input.css //=> "a{}" + * ``` + */ + css: string + + /** + * The absolute path to the CSS source file defined + * with the `from` option. + * + * ```js + * const root = postcss.parse(css, { from: 'a.css' }) + * root.source.input.file //=> '/home/ai/a.css' + * ``` + */ + file?: string + + /** + * The flag to indicate whether or not the source code has Unicode BOM. + */ + hasBOM: boolean + + /** + * The unique ID of the CSS source. It will be created if `from` option + * is not provided (because PostCSS does not know the file path). + * + * ```js + * const root = postcss.parse(css) + * root.source.input.file //=> undefined + * root.source.input.id //=> "" + * ``` + */ + id?: string + + /** + * The input source map passed from a compilation step before PostCSS + * (for example, from Sass compiler). + * + * ```js + * root.source.input.map.consumer().sources //=> ['a.sass'] + * ``` + */ + map: PreviousMap + + /** + * @param css Input CSS source. + * @param opts Process options. + */ + constructor(css: string, opts?: ProcessOptions) + + error( + message: string, + start: + | { + column: number + line: number + } + | { + offset: number + }, + end: + | { + column: number + line: number + } + | { + offset: number + }, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + /** + * Returns `CssSyntaxError` with information about the error and its position. + */ + error( + message: string, + line: number, + column: number, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + error( + message: string, + offset: number, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + /** + * Converts source offset to line and column. + * + * @param offset Source offset. + */ + fromOffset(offset: number): { col: number; line: number } | null + /** + * Reads the input source map and returns a symbol position + * in the input source (e.g., in a Sass file that was compiled + * to CSS before being passed to PostCSS). Optionally takes an + * end position, exclusive. + * + * ```js + * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 } + * root.source.input.origin(1, 1, 1, 4) + * //=> { file: 'a.css', line: 3, column: 1, endLine: 3, endColumn: 4 } + * ``` + * + * @param line Line for inclusive start position in input CSS. + * @param column Column for inclusive start position in input CSS. + * @param endLine Line for exclusive end position in input CSS. + * @param endColumn Column for exclusive end position in input CSS. + * + * @return Position in input source. + */ + origin( + line: number, + column: number, + endLine?: number, + endColumn?: number + ): false | Input.FilePosition + /** + * The CSS source identifier. Contains `Input#file` if the user + * set the `from` option, or `Input#id` if they did not. + * + * ```js + * const root = postcss.parse(css, { from: 'a.css' }) + * root.source.input.from //=> "/home/ai/a.css" + * + * const root = postcss.parse(css) + * root.source.input.from //=> "" + * ``` + */ + get from(): string +} + +declare class Input extends Input_ {} + +export = Input diff --git a/node_modules/postcss/lib/input.js b/node_modules/postcss/lib/input.js new file mode 100644 index 0000000..4b5ee5e --- /dev/null +++ b/node_modules/postcss/lib/input.js @@ -0,0 +1,248 @@ +'use strict' + +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { fileURLToPath, pathToFileURL } = require('url') +let { isAbsolute, resolve } = require('path') +let { nanoid } = require('nanoid/non-secure') + +let terminalHighlight = require('./terminal-highlight') +let CssSyntaxError = require('./css-syntax-error') +let PreviousMap = require('./previous-map') + +let fromOffsetCache = Symbol('fromOffsetCache') + +let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) +let pathAvailable = Boolean(resolve && isAbsolute) + +class Input { + constructor(css, opts = {}) { + if ( + css === null || + typeof css === 'undefined' || + (typeof css === 'object' && !css.toString) + ) { + throw new Error(`PostCSS received ${css} instead of CSS string`) + } + + this.css = css.toString() + + if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { + this.hasBOM = true + this.css = this.css.slice(1) + } else { + this.hasBOM = false + } + + if (opts.from) { + if ( + !pathAvailable || + /^\w+:\/\//.test(opts.from) || + isAbsolute(opts.from) + ) { + this.file = opts.from + } else { + this.file = resolve(opts.from) + } + } + + if (pathAvailable && sourceMapAvailable) { + let map = new PreviousMap(this.css, opts) + if (map.text) { + this.map = map + let file = map.consumer().file + if (!this.file && file) this.file = this.mapResolve(file) + } + } + + if (!this.file) { + this.id = '' + } + if (this.map) this.map.file = this.from + } + + error(message, line, column, opts = {}) { + let result, endLine, endColumn + + if (line && typeof line === 'object') { + let start = line + let end = column + if (typeof start.offset === 'number') { + let pos = this.fromOffset(start.offset) + line = pos.line + column = pos.col + } else { + line = start.line + column = start.column + } + if (typeof end.offset === 'number') { + let pos = this.fromOffset(end.offset) + endLine = pos.line + endColumn = pos.col + } else { + endLine = end.line + endColumn = end.column + } + } else if (!column) { + let pos = this.fromOffset(line) + line = pos.line + column = pos.col + } + + let origin = this.origin(line, column, endLine, endColumn) + if (origin) { + result = new CssSyntaxError( + message, + origin.endLine === undefined + ? origin.line + : { column: origin.column, line: origin.line }, + origin.endLine === undefined + ? origin.column + : { column: origin.endColumn, line: origin.endLine }, + origin.source, + origin.file, + opts.plugin + ) + } else { + result = new CssSyntaxError( + message, + endLine === undefined ? line : { column, line }, + endLine === undefined ? column : { column: endColumn, line: endLine }, + this.css, + this.file, + opts.plugin + ) + } + + result.input = { column, endColumn, endLine, line, source: this.css } + if (this.file) { + if (pathToFileURL) { + result.input.url = pathToFileURL(this.file).toString() + } + result.input.file = this.file + } + + return result + } + + fromOffset(offset) { + let lastLine, lineToIndex + if (!this[fromOffsetCache]) { + let lines = this.css.split('\n') + lineToIndex = new Array(lines.length) + let prevIndex = 0 + + for (let i = 0, l = lines.length; i < l; i++) { + lineToIndex[i] = prevIndex + prevIndex += lines[i].length + 1 + } + + this[fromOffsetCache] = lineToIndex + } else { + lineToIndex = this[fromOffsetCache] + } + lastLine = lineToIndex[lineToIndex.length - 1] + + let min = 0 + if (offset >= lastLine) { + min = lineToIndex.length - 1 + } else { + let max = lineToIndex.length - 2 + let mid + while (min < max) { + mid = min + ((max - min) >> 1) + if (offset < lineToIndex[mid]) { + max = mid - 1 + } else if (offset >= lineToIndex[mid + 1]) { + min = mid + 1 + } else { + min = mid + break + } + } + } + return { + col: offset - lineToIndex[min] + 1, + line: min + 1 + } + } + + mapResolve(file) { + if (/^\w+:\/\//.test(file)) { + return file + } + return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) + } + + origin(line, column, endLine, endColumn) { + if (!this.map) return false + let consumer = this.map.consumer() + + let from = consumer.originalPositionFor({ column, line }) + if (!from.source) return false + + let to + if (typeof endLine === 'number') { + to = consumer.originalPositionFor({ column: endColumn, line: endLine }) + } + + let fromUrl + + if (isAbsolute(from.source)) { + fromUrl = pathToFileURL(from.source) + } else { + fromUrl = new URL( + from.source, + this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) + ) + } + + let result = { + column: from.column, + endColumn: to && to.column, + endLine: to && to.line, + line: from.line, + url: fromUrl.toString() + } + + if (fromUrl.protocol === 'file:') { + if (fileURLToPath) { + result.file = fileURLToPath(fromUrl) + } else { + /* c8 ignore next 2 */ + throw new Error(`file: protocol is not available in this PostCSS build`) + } + } + + let source = consumer.sourceContentFor(from.source) + if (source) result.source = source + + return result + } + + toJSON() { + let json = {} + for (let name of ['hasBOM', 'css', 'file', 'id']) { + if (this[name] != null) { + json[name] = this[name] + } + } + if (this.map) { + json.map = { ...this.map } + if (json.map.consumerCache) { + json.map.consumerCache = undefined + } + } + return json + } + + get from() { + return this.file || this.id + } +} + +module.exports = Input +Input.default = Input + +if (terminalHighlight && terminalHighlight.registerInput) { + terminalHighlight.registerInput(Input) +} diff --git a/node_modules/postcss/lib/lazy-result.d.ts b/node_modules/postcss/lib/lazy-result.d.ts new file mode 100644 index 0000000..dd291aa --- /dev/null +++ b/node_modules/postcss/lib/lazy-result.d.ts @@ -0,0 +1,190 @@ +import Document from './document.js' +import { SourceMap } from './postcss.js' +import Processor from './processor.js' +import Result, { Message, ResultOptions } from './result.js' +import Root from './root.js' +import Warning from './warning.js' + +declare namespace LazyResult { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { LazyResult_ as default } +} + +/** + * A Promise proxy for the result of PostCSS transformations. + * + * A `LazyResult` instance is returned by `Processor#process`. + * + * ```js + * const lazy = postcss([autoprefixer]).process(css) + * ``` + */ +declare class LazyResult_ + implements PromiseLike> +{ + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls onRejected for each error thrown in any plugin. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css).then(result => { + * console.log(result.css) + * }).catch(error => { + * console.error(error) + * }) + * ``` + */ + catch: Promise>['catch'] + + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls onFinally on any error or when all plugins will finish work. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css).finally(() => { + * console.log('processing ended') + * }) + * ``` + */ + finally: Promise>['finally'] + + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls `onFulfilled` with a Result instance. If a plugin throws + * an error, the `onRejected` callback will be executed. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css, { from: cssPath }).then(result => { + * console.log(result.css) + * }) + * ``` + */ + then: Promise>['then'] + + /** + * @param processor Processor used for this transformation. + * @param css CSS to parse and transform. + * @param opts Options from the `Processor#process` or `Root#toResult`. + */ + constructor(processor: Processor, css: string, opts: ResultOptions) + + /** + * Run plugin in async way and return `Result`. + * + * @return Result with output content. + */ + async(): Promise> + + /** + * Run plugin in sync way and return `Result`. + * + * @return Result with output content. + */ + sync(): Result + + /** + * Alias for the `LazyResult#css` property. + * + * ```js + * lazy + '' === lazy.css + * ``` + * + * @return Output CSS. + */ + toString(): string + + /** + * Processes input CSS through synchronous plugins + * and calls `Result#warnings`. + * + * @return Warnings from plugins. + */ + warnings(): Warning[] + + /** + * An alias for the `css` property. Use it with syntaxes + * that generate non-CSS output. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get content(): string + + /** + * Processes input CSS through synchronous plugins, converts `Root` + * to a CSS string and returns `Result#css`. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get css(): string + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#map`. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get map(): SourceMap + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#messages`. + * + * This property will only work with synchronous plugins. If the processor + * contains any asynchronous plugins it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get messages(): Message[] + + /** + * Options from the `Processor#process` call. + */ + get opts(): ResultOptions + + /** + * Returns a `Processor` instance, which will be used + * for CSS transformations. + */ + get processor(): Processor + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#root`. + * + * This property will only work with synchronous plugins. If the processor + * contains any asynchronous plugins it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get root(): RootNode + + /** + * Returns the default string description of an object. + * Required to implement the Promise interface. + */ + get [Symbol.toStringTag](): string +} + +declare class LazyResult< + RootNode = Document | Root +> extends LazyResult_ {} + +export = LazyResult diff --git a/node_modules/postcss/lib/lazy-result.js b/node_modules/postcss/lib/lazy-result.js new file mode 100644 index 0000000..126f40c --- /dev/null +++ b/node_modules/postcss/lib/lazy-result.js @@ -0,0 +1,550 @@ +'use strict' + +let { isClean, my } = require('./symbols') +let MapGenerator = require('./map-generator') +let stringify = require('./stringify') +let Container = require('./container') +let Document = require('./document') +let warnOnce = require('./warn-once') +let Result = require('./result') +let parse = require('./parse') +let Root = require('./root') + +const TYPE_TO_CLASS_NAME = { + atrule: 'AtRule', + comment: 'Comment', + decl: 'Declaration', + document: 'Document', + root: 'Root', + rule: 'Rule' +} + +const PLUGIN_PROPS = { + AtRule: true, + AtRuleExit: true, + Comment: true, + CommentExit: true, + Declaration: true, + DeclarationExit: true, + Document: true, + DocumentExit: true, + Once: true, + OnceExit: true, + postcssPlugin: true, + prepare: true, + Root: true, + RootExit: true, + Rule: true, + RuleExit: true +} + +const NOT_VISITORS = { + Once: true, + postcssPlugin: true, + prepare: true +} + +const CHILDREN = 0 + +function isPromise(obj) { + return typeof obj === 'object' && typeof obj.then === 'function' +} + +function getEvents(node) { + let key = false + let type = TYPE_TO_CLASS_NAME[node.type] + if (node.type === 'decl') { + key = node.prop.toLowerCase() + } else if (node.type === 'atrule') { + key = node.name.toLowerCase() + } + + if (key && node.append) { + return [ + type, + type + '-' + key, + CHILDREN, + type + 'Exit', + type + 'Exit-' + key + ] + } else if (key) { + return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] + } else if (node.append) { + return [type, CHILDREN, type + 'Exit'] + } else { + return [type, type + 'Exit'] + } +} + +function toStack(node) { + let events + if (node.type === 'document') { + events = ['Document', CHILDREN, 'DocumentExit'] + } else if (node.type === 'root') { + events = ['Root', CHILDREN, 'RootExit'] + } else { + events = getEvents(node) + } + + return { + eventIndex: 0, + events, + iterator: 0, + node, + visitorIndex: 0, + visitors: [] + } +} + +function cleanMarks(node) { + node[isClean] = false + if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) + return node +} + +let postcss = {} + +class LazyResult { + constructor(processor, css, opts) { + this.stringified = false + this.processed = false + + let root + if ( + typeof css === 'object' && + css !== null && + (css.type === 'root' || css.type === 'document') + ) { + root = cleanMarks(css) + } else if (css instanceof LazyResult || css instanceof Result) { + root = cleanMarks(css.root) + if (css.map) { + if (typeof opts.map === 'undefined') opts.map = {} + if (!opts.map.inline) opts.map.inline = false + opts.map.prev = css.map + } + } else { + let parser = parse + if (opts.syntax) parser = opts.syntax.parse + if (opts.parser) parser = opts.parser + if (parser.parse) parser = parser.parse + + try { + root = parser(css, opts) + } catch (error) { + this.processed = true + this.error = error + } + + if (root && !root[my]) { + /* c8 ignore next 2 */ + Container.rebuild(root) + } + } + + this.result = new Result(processor, root, opts) + this.helpers = { ...postcss, postcss, result: this.result } + this.plugins = this.processor.plugins.map(plugin => { + if (typeof plugin === 'object' && plugin.prepare) { + return { ...plugin, ...plugin.prepare(this.result) } + } else { + return plugin + } + }) + } + + async() { + if (this.error) return Promise.reject(this.error) + if (this.processed) return Promise.resolve(this.result) + if (!this.processing) { + this.processing = this.runAsync() + } + return this.processing + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + getAsyncError() { + throw new Error('Use process(css).then(cb) to work with async plugins') + } + + handleError(error, node) { + let plugin = this.result.lastPlugin + try { + if (node) node.addToError(error) + this.error = error + if (error.name === 'CssSyntaxError' && !error.plugin) { + error.plugin = plugin.postcssPlugin + error.setMessage() + } else if (plugin.postcssVersion) { + if (process.env.NODE_ENV !== 'production') { + let pluginName = plugin.postcssPlugin + let pluginVer = plugin.postcssVersion + let runtimeVer = this.result.processor.version + let a = pluginVer.split('.') + let b = runtimeVer.split('.') + + if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { + // eslint-disable-next-line no-console + console.error( + 'Unknown error from PostCSS plugin. Your current PostCSS ' + + 'version is ' + + runtimeVer + + ', but ' + + pluginName + + ' uses ' + + pluginVer + + '. Perhaps this is the source of the error below.' + ) + } + } + } + } catch (err) { + /* c8 ignore next 3 */ + // eslint-disable-next-line no-console + if (console && console.error) console.error(err) + } + return error + } + + prepareVisitors() { + this.listeners = {} + let add = (plugin, type, cb) => { + if (!this.listeners[type]) this.listeners[type] = [] + this.listeners[type].push([plugin, cb]) + } + for (let plugin of this.plugins) { + if (typeof plugin === 'object') { + for (let event in plugin) { + if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { + throw new Error( + `Unknown event ${event} in ${plugin.postcssPlugin}. ` + + `Try to update PostCSS (${this.processor.version} now).` + ) + } + if (!NOT_VISITORS[event]) { + if (typeof plugin[event] === 'object') { + for (let filter in plugin[event]) { + if (filter === '*') { + add(plugin, event, plugin[event][filter]) + } else { + add( + plugin, + event + '-' + filter.toLowerCase(), + plugin[event][filter] + ) + } + } + } else if (typeof plugin[event] === 'function') { + add(plugin, event, plugin[event]) + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0 + } + + async runAsync() { + this.plugin = 0 + for (let i = 0; i < this.plugins.length; i++) { + let plugin = this.plugins[i] + let promise = this.runOnRoot(plugin) + if (isPromise(promise)) { + try { + await promise + } catch (error) { + throw this.handleError(error) + } + } + } + + this.prepareVisitors() + if (this.hasListener) { + let root = this.result.root + while (!root[isClean]) { + root[isClean] = true + let stack = [toStack(root)] + while (stack.length > 0) { + let promise = this.visitTick(stack) + if (isPromise(promise)) { + try { + await promise + } catch (e) { + let node = stack[stack.length - 1].node + throw this.handleError(e, node) + } + } + } + } + + if (this.listeners.OnceExit) { + for (let [plugin, visitor] of this.listeners.OnceExit) { + this.result.lastPlugin = plugin + try { + if (root.type === 'document') { + let roots = root.nodes.map(subRoot => + visitor(subRoot, this.helpers) + ) + + await Promise.all(roots) + } else { + await visitor(root, this.helpers) + } + } catch (e) { + throw this.handleError(e) + } + } + } + } + + this.processed = true + return this.stringify() + } + + runOnRoot(plugin) { + this.result.lastPlugin = plugin + try { + if (typeof plugin === 'object' && plugin.Once) { + if (this.result.root.type === 'document') { + let roots = this.result.root.nodes.map(root => + plugin.Once(root, this.helpers) + ) + + if (isPromise(roots[0])) { + return Promise.all(roots) + } + + return roots + } + + return plugin.Once(this.result.root, this.helpers) + } else if (typeof plugin === 'function') { + return plugin(this.result.root, this.result) + } + } catch (error) { + throw this.handleError(error) + } + } + + stringify() { + if (this.error) throw this.error + if (this.stringified) return this.result + this.stringified = true + + this.sync() + + let opts = this.result.opts + let str = stringify + if (opts.syntax) str = opts.syntax.stringify + if (opts.stringifier) str = opts.stringifier + if (str.stringify) str = str.stringify + + let map = new MapGenerator(str, this.result.root, this.result.opts) + let data = map.generate() + this.result.css = data[0] + this.result.map = data[1] + + return this.result + } + + sync() { + if (this.error) throw this.error + if (this.processed) return this.result + this.processed = true + + if (this.processing) { + throw this.getAsyncError() + } + + for (let plugin of this.plugins) { + let promise = this.runOnRoot(plugin) + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + + this.prepareVisitors() + if (this.hasListener) { + let root = this.result.root + while (!root[isClean]) { + root[isClean] = true + this.walkSync(root) + } + if (this.listeners.OnceExit) { + if (root.type === 'document') { + for (let subRoot of root.nodes) { + this.visitSync(this.listeners.OnceExit, subRoot) + } + } else { + this.visitSync(this.listeners.OnceExit, root) + } + } + } + + return this.result + } + + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== 'production') { + if (!('from' in this.opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ) + } + } + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this.css + } + + visitSync(visitors, node) { + for (let [plugin, visitor] of visitors) { + this.result.lastPlugin = plugin + let promise + try { + promise = visitor(node, this.helpers) + } catch (e) { + throw this.handleError(e, node.proxyOf) + } + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + return true + } + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + } + + visitTick(stack) { + let visit = stack[stack.length - 1] + let { node, visitors } = visit + + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + stack.pop() + return + } + + if (visitors.length > 0 && visit.visitorIndex < visitors.length) { + let [plugin, visitor] = visitors[visit.visitorIndex] + visit.visitorIndex += 1 + if (visit.visitorIndex === visitors.length) { + visit.visitors = [] + visit.visitorIndex = 0 + } + this.result.lastPlugin = plugin + try { + return visitor(node.toProxy(), this.helpers) + } catch (e) { + throw this.handleError(e, node) + } + } + + if (visit.iterator !== 0) { + let iterator = visit.iterator + let child + while ((child = node.nodes[node.indexes[iterator]])) { + node.indexes[iterator] += 1 + if (!child[isClean]) { + child[isClean] = true + stack.push(toStack(child)) + return + } + } + visit.iterator = 0 + delete node.indexes[iterator] + } + + let events = visit.events + while (visit.eventIndex < events.length) { + let event = events[visit.eventIndex] + visit.eventIndex += 1 + if (event === CHILDREN) { + if (node.nodes && node.nodes.length) { + node[isClean] = true + visit.iterator = node.getIterator() + } + return + } else if (this.listeners[event]) { + visit.visitors = this.listeners[event] + return + } + } + stack.pop() + } + + walkSync(node) { + node[isClean] = true + let events = getEvents(node) + for (let event of events) { + if (event === CHILDREN) { + if (node.nodes) { + node.each(child => { + if (!child[isClean]) this.walkSync(child) + }) + } + } else { + let visitors = this.listeners[event] + if (visitors) { + if (this.visitSync(visitors, node.toProxy())) return + } + } + } + } + + warnings() { + return this.sync().warnings() + } + + get content() { + return this.stringify().content + } + + get css() { + return this.stringify().css + } + + get map() { + return this.stringify().map + } + + get messages() { + return this.sync().messages + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + return this.sync().root + } + + get [Symbol.toStringTag]() { + return 'LazyResult' + } +} + +LazyResult.registerPostcss = dependant => { + postcss = dependant +} + +module.exports = LazyResult +LazyResult.default = LazyResult + +Root.registerLazyResult(LazyResult) +Document.registerLazyResult(LazyResult) diff --git a/node_modules/postcss/lib/list.d.ts b/node_modules/postcss/lib/list.d.ts new file mode 100644 index 0000000..1a74d74 --- /dev/null +++ b/node_modules/postcss/lib/list.d.ts @@ -0,0 +1,57 @@ +declare namespace list { + type List = { + /** + * Safely splits comma-separated values (such as those for `transition-*` + * and `background` properties). + * + * ```js + * Once (root, { list }) { + * list.comma('black, linear-gradient(white, black)') + * //=> ['black', 'linear-gradient(white, black)'] + * } + * ``` + * + * @param str Comma-separated values. + * @return Split values. + */ + comma(str: string): string[] + + default: List + + /** + * Safely splits space-separated values (such as those for `background`, + * `border-radius`, and other shorthand properties). + * + * ```js + * Once (root, { list }) { + * list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)'] + * } + * ``` + * + * @param str Space-separated values. + * @return Split values. + */ + space(str: string): string[] + + /** + * Safely splits values. + * + * ```js + * Once (root, { list }) { + * list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)'] + * } + * ``` + * + * @param string separated values. + * @param separators array of separators. + * @param last boolean indicator. + * @return Split values. + */ + split(string: string, separators: string[], last: boolean): string[] + } +} + +// eslint-disable-next-line @typescript-eslint/no-redeclare +declare const list: list.List + +export = list diff --git a/node_modules/postcss/lib/list.js b/node_modules/postcss/lib/list.js new file mode 100644 index 0000000..1b31f98 --- /dev/null +++ b/node_modules/postcss/lib/list.js @@ -0,0 +1,58 @@ +'use strict' + +let list = { + comma(string) { + return list.split(string, [','], true) + }, + + space(string) { + let spaces = [' ', '\n', '\t'] + return list.split(string, spaces) + }, + + split(string, separators, last) { + let array = [] + let current = '' + let split = false + + let func = 0 + let inQuote = false + let prevQuote = '' + let escape = false + + for (let letter of string) { + if (escape) { + escape = false + } else if (letter === '\\') { + escape = true + } else if (inQuote) { + if (letter === prevQuote) { + inQuote = false + } + } else if (letter === '"' || letter === "'") { + inQuote = true + prevQuote = letter + } else if (letter === '(') { + func += 1 + } else if (letter === ')') { + if (func > 0) func -= 1 + } else if (func === 0) { + if (separators.includes(letter)) split = true + } + + if (split) { + if (current !== '') array.push(current.trim()) + current = '' + split = false + } else { + current += letter + } + } + + if (last || current !== '') array.push(current.trim()) + return array + } +} + +module.exports = list +list.default = list diff --git a/node_modules/postcss/lib/map-generator.js b/node_modules/postcss/lib/map-generator.js new file mode 100644 index 0000000..523b463 --- /dev/null +++ b/node_modules/postcss/lib/map-generator.js @@ -0,0 +1,359 @@ +'use strict' + +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { dirname, relative, resolve, sep } = require('path') +let { pathToFileURL } = require('url') + +let Input = require('./input') + +let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) +let pathAvailable = Boolean(dirname && resolve && relative && sep) + +class MapGenerator { + constructor(stringify, root, opts, cssString) { + this.stringify = stringify + this.mapOpts = opts.map || {} + this.root = root + this.opts = opts + this.css = cssString + this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute + + this.memoizedFileURLs = new Map() + this.memoizedPaths = new Map() + this.memoizedURLs = new Map() + } + + addAnnotation() { + let content + + if (this.isInline()) { + content = + 'data:application/json;base64,' + this.toBase64(this.map.toString()) + } else if (typeof this.mapOpts.annotation === 'string') { + content = this.mapOpts.annotation + } else if (typeof this.mapOpts.annotation === 'function') { + content = this.mapOpts.annotation(this.opts.to, this.root) + } else { + content = this.outputFile() + '.map' + } + let eol = '\n' + if (this.css.includes('\r\n')) eol = '\r\n' + + this.css += eol + '/*# sourceMappingURL=' + content + ' */' + } + + applyPrevMaps() { + for (let prev of this.previous()) { + let from = this.toUrl(this.path(prev.file)) + let root = prev.root || dirname(prev.file) + let map + + if (this.mapOpts.sourcesContent === false) { + map = new SourceMapConsumer(prev.text) + if (map.sourcesContent) { + map.sourcesContent = map.sourcesContent.map(() => null) + } + } else { + map = prev.consumer() + } + + this.map.applySourceMap(map, from, this.toUrl(this.path(root))) + } + } + + clearAnnotation() { + if (this.mapOpts.annotation === false) return + + if (this.root) { + let node + for (let i = this.root.nodes.length - 1; i >= 0; i--) { + node = this.root.nodes[i] + if (node.type !== 'comment') continue + if (node.text.indexOf('# sourceMappingURL=') === 0) { + this.root.removeChild(i) + } + } + } else if (this.css) { + this.css = this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm, '') + } + } + + generate() { + this.clearAnnotation() + if (pathAvailable && sourceMapAvailable && this.isMap()) { + return this.generateMap() + } else { + let result = '' + this.stringify(this.root, i => { + result += i + }) + return [result] + } + } + + generateMap() { + if (this.root) { + this.generateString() + } else if (this.previous().length === 1) { + let prev = this.previous()[0].consumer() + prev.file = this.outputFile() + this.map = SourceMapGenerator.fromSourceMap(prev) + } else { + this.map = new SourceMapGenerator({ file: this.outputFile() }) + this.map.addMapping({ + generated: { column: 0, line: 1 }, + original: { column: 0, line: 1 }, + source: this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '' + }) + } + + if (this.isSourcesContent()) this.setSourcesContent() + if (this.root && this.previous().length > 0) this.applyPrevMaps() + if (this.isAnnotation()) this.addAnnotation() + + if (this.isInline()) { + return [this.css] + } else { + return [this.css, this.map] + } + } + + generateString() { + this.css = '' + this.map = new SourceMapGenerator({ file: this.outputFile() }) + + let line = 1 + let column = 1 + + let noSource = '' + let mapping = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: '' + } + + let lines, last + this.stringify(this.root, (str, node, type) => { + this.css += str + + if (node && type !== 'end') { + mapping.generated.line = line + mapping.generated.column = column - 1 + if (node.source && node.source.start) { + mapping.source = this.sourcePath(node) + mapping.original.line = node.source.start.line + mapping.original.column = node.source.start.column - 1 + this.map.addMapping(mapping) + } else { + mapping.source = noSource + mapping.original.line = 1 + mapping.original.column = 0 + this.map.addMapping(mapping) + } + } + + lines = str.match(/\n/g) + if (lines) { + line += lines.length + last = str.lastIndexOf('\n') + column = str.length - last + } else { + column += str.length + } + + if (node && type !== 'start') { + let p = node.parent || { raws: {} } + let childless = + node.type === 'decl' || (node.type === 'atrule' && !node.nodes) + if (!childless || node !== p.last || p.raws.semicolon) { + if (node.source && node.source.end) { + mapping.source = this.sourcePath(node) + mapping.original.line = node.source.end.line + mapping.original.column = node.source.end.column - 1 + mapping.generated.line = line + mapping.generated.column = column - 2 + this.map.addMapping(mapping) + } else { + mapping.source = noSource + mapping.original.line = 1 + mapping.original.column = 0 + mapping.generated.line = line + mapping.generated.column = column - 1 + this.map.addMapping(mapping) + } + } + } + }) + } + + isAnnotation() { + if (this.isInline()) { + return true + } + if (typeof this.mapOpts.annotation !== 'undefined') { + return this.mapOpts.annotation + } + if (this.previous().length) { + return this.previous().some(i => i.annotation) + } + return true + } + + isInline() { + if (typeof this.mapOpts.inline !== 'undefined') { + return this.mapOpts.inline + } + + let annotation = this.mapOpts.annotation + if (typeof annotation !== 'undefined' && annotation !== true) { + return false + } + + if (this.previous().length) { + return this.previous().some(i => i.inline) + } + return true + } + + isMap() { + if (typeof this.opts.map !== 'undefined') { + return !!this.opts.map + } + return this.previous().length > 0 + } + + isSourcesContent() { + if (typeof this.mapOpts.sourcesContent !== 'undefined') { + return this.mapOpts.sourcesContent + } + if (this.previous().length) { + return this.previous().some(i => i.withContent()) + } + return true + } + + outputFile() { + if (this.opts.to) { + return this.path(this.opts.to) + } else if (this.opts.from) { + return this.path(this.opts.from) + } else { + return 'to.css' + } + } + + path(file) { + if (this.mapOpts.absolute) return file + if (file.charCodeAt(0) === 60 /* `<` */) return file + if (/^\w+:\/\//.test(file)) return file + let cached = this.memoizedPaths.get(file) + if (cached) return cached + + let from = this.opts.to ? dirname(this.opts.to) : '.' + + if (typeof this.mapOpts.annotation === 'string') { + from = dirname(resolve(from, this.mapOpts.annotation)) + } + + let path = relative(from, file) + this.memoizedPaths.set(file, path) + + return path + } + + previous() { + if (!this.previousMaps) { + this.previousMaps = [] + if (this.root) { + this.root.walk(node => { + if (node.source && node.source.input.map) { + let map = node.source.input.map + if (!this.previousMaps.includes(map)) { + this.previousMaps.push(map) + } + } + }) + } else { + let input = new Input(this.css, this.opts) + if (input.map) this.previousMaps.push(input.map) + } + } + + return this.previousMaps + } + + setSourcesContent() { + let already = {} + if (this.root) { + this.root.walk(node => { + if (node.source) { + let from = node.source.input.from + if (from && !already[from]) { + already[from] = true + let fromUrl = this.usesFileUrls + ? this.toFileUrl(from) + : this.toUrl(this.path(from)) + this.map.setSourceContent(fromUrl, node.source.input.css) + } + } + }) + } else if (this.css) { + let from = this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '' + this.map.setSourceContent(from, this.css) + } + } + + sourcePath(node) { + if (this.mapOpts.from) { + return this.toUrl(this.mapOpts.from) + } else if (this.usesFileUrls) { + return this.toFileUrl(node.source.input.from) + } else { + return this.toUrl(this.path(node.source.input.from)) + } + } + + toBase64(str) { + if (Buffer) { + return Buffer.from(str).toString('base64') + } else { + return window.btoa(unescape(encodeURIComponent(str))) + } + } + + toFileUrl(path) { + let cached = this.memoizedFileURLs.get(path) + if (cached) return cached + + if (pathToFileURL) { + let fileURL = pathToFileURL(path).toString() + this.memoizedFileURLs.set(path, fileURL) + + return fileURL + } else { + throw new Error( + '`map.absolute` option is not available in this PostCSS build' + ) + } + } + + toUrl(path) { + let cached = this.memoizedURLs.get(path) + if (cached) return cached + + if (sep === '\\') { + path = path.replace(/\\/g, '/') + } + + let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent) + this.memoizedURLs.set(path, url) + + return url + } +} + +module.exports = MapGenerator diff --git a/node_modules/postcss/lib/no-work-result.d.ts b/node_modules/postcss/lib/no-work-result.d.ts new file mode 100644 index 0000000..8039076 --- /dev/null +++ b/node_modules/postcss/lib/no-work-result.d.ts @@ -0,0 +1,46 @@ +import LazyResult from './lazy-result.js' +import { SourceMap } from './postcss.js' +import Processor from './processor.js' +import Result, { Message, ResultOptions } from './result.js' +import Root from './root.js' +import Warning from './warning.js' + +declare namespace NoWorkResult { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { NoWorkResult_ as default } +} + +/** + * A Promise proxy for the result of PostCSS transformations. + * This lazy result instance doesn't parse css unless `NoWorkResult#root` or `Result#root` + * are accessed. See the example below for details. + * A `NoWork` instance is returned by `Processor#process` ONLY when no plugins defined. + * + * ```js + * const noWorkResult = postcss().process(css) // No plugins are defined. + * // CSS is not parsed + * let root = noWorkResult.root // now css is parsed because we accessed the root + * ``` + */ +declare class NoWorkResult_ implements LazyResult { + catch: Promise>['catch'] + finally: Promise>['finally'] + then: Promise>['then'] + constructor(processor: Processor, css: string, opts: ResultOptions) + async(): Promise> + sync(): Result + toString(): string + warnings(): Warning[] + get content(): string + get css(): string + get map(): SourceMap + get messages(): Message[] + get opts(): ResultOptions + get processor(): Processor + get root(): Root + get [Symbol.toStringTag](): string +} + +declare class NoWorkResult extends NoWorkResult_ {} + +export = NoWorkResult diff --git a/node_modules/postcss/lib/no-work-result.js b/node_modules/postcss/lib/no-work-result.js new file mode 100644 index 0000000..a0609f7 --- /dev/null +++ b/node_modules/postcss/lib/no-work-result.js @@ -0,0 +1,135 @@ +'use strict' + +let MapGenerator = require('./map-generator') +let stringify = require('./stringify') +let warnOnce = require('./warn-once') +let parse = require('./parse') +const Result = require('./result') + +class NoWorkResult { + constructor(processor, css, opts) { + css = css.toString() + this.stringified = false + + this._processor = processor + this._css = css + this._opts = opts + this._map = undefined + let root + + let str = stringify + this.result = new Result(this._processor, root, this._opts) + this.result.css = css + + let self = this + Object.defineProperty(this.result, 'root', { + get() { + return self.root + } + }) + + let map = new MapGenerator(str, root, this._opts, css) + if (map.isMap()) { + let [generatedCSS, generatedMap] = map.generate() + if (generatedCSS) { + this.result.css = generatedCSS + } + if (generatedMap) { + this.result.map = generatedMap + } + } + } + + async() { + if (this.error) return Promise.reject(this.error) + return Promise.resolve(this.result) + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + sync() { + if (this.error) throw this.error + return this.result + } + + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== 'production') { + if (!('from' in this._opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ) + } + } + + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this._css + } + + warnings() { + return [] + } + + get content() { + return this.result.css + } + + get css() { + return this.result.css + } + + get map() { + return this.result.map + } + + get messages() { + return [] + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + if (this._root) { + return this._root + } + + let root + let parser = parse + + try { + root = parser(this._css, this._opts) + } catch (error) { + this.error = error + } + + if (this.error) { + throw this.error + } else { + this._root = root + return root + } + } + + get [Symbol.toStringTag]() { + return 'NoWorkResult' + } +} + +module.exports = NoWorkResult +NoWorkResult.default = NoWorkResult diff --git a/node_modules/postcss/lib/node.d.ts b/node_modules/postcss/lib/node.d.ts new file mode 100644 index 0000000..71b3015 --- /dev/null +++ b/node_modules/postcss/lib/node.d.ts @@ -0,0 +1,536 @@ +import AtRule = require('./at-rule.js') + +import { AtRuleProps } from './at-rule.js' +import Comment, { CommentProps } from './comment.js' +import Container from './container.js' +import CssSyntaxError from './css-syntax-error.js' +import Declaration, { DeclarationProps } from './declaration.js' +import Document from './document.js' +import Input from './input.js' +import { Stringifier, Syntax } from './postcss.js' +import Result from './result.js' +import Root from './root.js' +import Rule, { RuleProps } from './rule.js' +import Warning, { WarningOptions } from './warning.js' + +declare namespace Node { + export type ChildNode = AtRule.default | Comment | Declaration | Rule + + export type AnyNode = + | AtRule.default + | Comment + | Declaration + | Document + | Root + | Rule + + export type ChildProps = + | AtRuleProps + | CommentProps + | DeclarationProps + | RuleProps + + export interface Position { + /** + * Source line in file. In contrast to `offset` it starts from 1. + */ + column: number + + /** + * Source column in file. + */ + line: number + + /** + * Source offset in file. It starts from 0. + */ + offset: number + } + + export interface Range { + /** + * End position, exclusive. + */ + end: Position + + /** + * Start position, inclusive. + */ + start: Position + } + + /** + * Source represents an interface for the {@link Node.source} property. + */ + export interface Source { + /** + * The inclusive ending position for the source + * code of a node. + */ + end?: Position + + /** + * The source file from where a node has originated. + */ + input: Input + + /** + * The inclusive starting position for the source + * code of a node. + */ + start?: Position + } + + /** + * Interface represents an interface for an object received + * as parameter by Node class constructor. + */ + export interface NodeProps { + source?: Source + } + + export interface NodeErrorOptions { + /** + * An ending index inside a node's string that should be highlighted as + * source of error. + */ + endIndex?: number + /** + * An index inside a node's string that should be highlighted as source + * of error. + */ + index?: number + /** + * Plugin name that created this error. PostCSS will set it automatically. + */ + plugin?: string + /** + * A word inside a node's string, that should be highlighted as source + * of error. + */ + word?: string + } + + // eslint-disable-next-line @typescript-eslint/no-shadow + class Node extends Node_ {} + export { Node as default } +} + +/** + * It represents an abstract class that handles common + * methods for other CSS abstract syntax tree nodes. + * + * Any node that represents CSS selector or value should + * not extend the `Node` class. + */ +declare abstract class Node_ { + /** + * It represents parent of the current node. + * + * ```js + * root.nodes[0].parent === root //=> true + * ``` + */ + parent: Container | Document | undefined + + /** + * It represents unnecessary whitespace and characters present + * in the css source code. + * + * Information to generate byte-to-byte equal node string as it was + * in the origin input. + * + * The properties of the raws object are decided by parser, + * the default parser uses the following properties: + * + * * `before`: the space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + * * `after`: the space symbols after the last child of the node + * to the end of the node. + * * `between`: the symbols between the property and value + * for declarations, selector and `{` for rules, or last parameter + * and `{` for at-rules. + * * `semicolon`: contains true if the last child has + * an (optional) semicolon. + * * `afterName`: the space between the at-rule name and its parameters. + * * `left`: the space symbols between `/*` and the comment’s text. + * * `right`: the space symbols between the comment’s text + * and */. + * - `important`: the content of the important statement, + * if it is not just `!important`. + * + * PostCSS filters out the comments inside selectors, declaration values + * and at-rule parameters but it stores the origin content in raws. + * + * ```js + * const root = postcss.parse('a {\n color:black\n}') + * root.first.first.raws //=> { before: '\n ', between: ':' } + * ``` + */ + raws: any + + /** + * It represents information related to origin of a node and is required + * for generating source maps. + * + * The nodes that are created manually using the public APIs + * provided by PostCSS will have `source` undefined and + * will be absent in the source map. + * + * For this reason, the plugin developer should consider + * duplicating nodes as the duplicate node will have the + * same source as the original node by default or assign + * source to a node created manually. + * + * ```js + * decl.source.input.from //=> '/home/ai/source.css' + * decl.source.start //=> { line: 10, column: 2 } + * decl.source.end //=> { line: 10, column: 12 } + * ``` + * + * ```js + * // Incorrect method, source not specified! + * const prefixed = postcss.decl({ + * prop: '-moz-' + decl.prop, + * value: decl.value + * }) + * + * // Correct method, source is inherited when duplicating. + * const prefixed = decl.clone({ + * prop: '-moz-' + decl.prop + * }) + * ``` + * + * ```js + * if (atrule.name === 'add-link') { + * const rule = postcss.rule({ + * selector: 'a', + * source: atrule.source + * }) + * + * atrule.parent.insertBefore(atrule, rule) + * } + * ``` + */ + source?: Node.Source + + /** + * It represents type of a node in + * an abstract syntax tree. + * + * A type of node helps in identification of a node + * and perform operation based on it's type. + * + * ```js + * const declaration = new Declaration({ + * prop: 'color', + * value: 'black' + * }) + * + * declaration.type //=> 'decl' + * ``` + */ + type: string + + constructor(defaults?: object) + + /** + * Insert new node after current node to current node’s parent. + * + * Just alias for `node.parent.insertAfter(node, add)`. + * + * ```js + * decl.after('color: black') + * ``` + * + * @param newNode New node. + * @return This node for methods chain. + */ + after(newNode: Node | Node.ChildProps | Node[] | string): this + + /** + * It assigns properties to an existing node instance. + * + * ```js + * decl.assign({ prop: 'word-wrap', value: 'break-word' }) + * ``` + * + * @param overrides New properties to override the node. + * + * @return `this` for method chaining. + */ + assign(overrides: object): this + + /** + * Insert new node before current node to current node’s parent. + * + * Just alias for `node.parent.insertBefore(node, add)`. + * + * ```js + * decl.before('content: ""') + * ``` + * + * @param newNode New node. + * @return This node for methods chain. + */ + before(newNode: Node | Node.ChildProps | Node[] | string): this + + /** + * Clear the code style properties for the node and its children. + * + * ```js + * node.raws.before //=> ' ' + * node.cleanRaws() + * node.raws.before //=> undefined + * ``` + * + * @param keepBetween Keep the `raws.between` symbols. + */ + cleanRaws(keepBetween?: boolean): void + + /** + * It creates clone of an existing node, which includes all the properties + * and their values, that includes `raws` but not `type`. + * + * ```js + * decl.raws.before //=> "\n " + * const cloned = decl.clone({ prop: '-moz-' + decl.prop }) + * cloned.raws.before //=> "\n " + * cloned.toString() //=> -moz-transform: scale(0) + * ``` + * + * @param overrides New properties to override in the clone. + * + * @return Duplicate of the node instance. + */ + clone(overrides?: object): Node + + /** + * Shortcut to clone the node and insert the resulting cloned node + * after the current node. + * + * @param overrides New properties to override in the clone. + * @return New node. + */ + cloneAfter(overrides?: object): Node + + /** + * Shortcut to clone the node and insert the resulting cloned node + * before the current node. + * + * ```js + * decl.cloneBefore({ prop: '-moz-' + decl.prop }) + * ``` + * + * @param overrides Mew properties to override in the clone. + * + * @return New node + */ + cloneBefore(overrides?: object): Node + + /** + * It creates an instance of the class `CssSyntaxError` and parameters passed + * to this method are assigned to the error instance. + * + * The error instance will have description for the + * error, original position of the node in the + * source, showing line and column number. + * + * If any previous map is present, it would be used + * to get original position of the source. + * + * The Previous Map here is referred to the source map + * generated by previous compilation, example: Less, + * Stylus and Sass. + * + * This method returns the error instance instead of + * throwing it. + * + * ```js + * if (!variables[name]) { + * throw decl.error(`Unknown variable ${name}`, { word: name }) + * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black + * // color: $black + * // a + * // ^ + * // background: white + * } + * ``` + * + * @param message Description for the error instance. + * @param options Options for the error instance. + * + * @return Error instance is returned. + */ + error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError + + /** + * Returns the next child of the node’s parent. + * Returns `undefined` if the current node is the last child. + * + * ```js + * if (comment.text === 'delete next') { + * const next = comment.next() + * if (next) { + * next.remove() + * } + * } + * ``` + * + * @return Next node. + */ + next(): Node.ChildNode | undefined + + /** + * Get the position for a word or an index inside the node. + * + * @param opts Options. + * @return Position. + */ + positionBy(opts?: Pick): Node.Position + + /** + * Convert string index to line/column. + * + * @param index The symbol number in the node’s string. + * @return Symbol position in file. + */ + positionInside(index: number): Node.Position + + /** + * Returns the previous child of the node’s parent. + * Returns `undefined` if the current node is the first child. + * + * ```js + * const annotation = decl.prev() + * if (annotation.type === 'comment') { + * readAnnotation(annotation.text) + * } + * ``` + * + * @return Previous node. + */ + prev(): Node.ChildNode | undefined + + /** + * Get the range for a word or start and end index inside the node. + * The start index is inclusive; the end index is exclusive. + * + * @param opts Options. + * @return Range. + */ + rangeBy( + opts?: Pick + ): Node.Range + + /** + * Returns a `raws` value. If the node is missing + * the code style property (because the node was manually built or cloned), + * PostCSS will try to autodetect the code style property by looking + * at other nodes in the tree. + * + * ```js + * const root = postcss.parse('a { background: white }') + * root.nodes[0].append({ prop: 'color', value: 'black' }) + * root.nodes[0].nodes[1].raws.before //=> undefined + * root.nodes[0].nodes[1].raw('before') //=> ' ' + * ``` + * + * @param prop Name of code style property. + * @param defaultType Name of default value, it can be missed + * if the value is the same as prop. + * @return {string} Code style value. + */ + raw(prop: string, defaultType?: string): string + + /** + * It removes the node from its parent and deletes its parent property. + * + * ```js + * if (decl.prop.match(/^-webkit-/)) { + * decl.remove() + * } + * ``` + * + * @return `this` for method chaining. + */ + remove(): this + + /** + * Inserts node(s) before the current node and removes the current node. + * + * ```js + * AtRule: { + * mixin: atrule => { + * atrule.replaceWith(mixinRules[atrule.params]) + * } + * } + * ``` + * + * @param nodes Mode(s) to replace current one. + * @return Current node to methods chain. + */ + replaceWith( + ...nodes: ( + | Node.ChildNode + | Node.ChildNode[] + | Node.ChildProps + | Node.ChildProps[] + )[] + ): this + + /** + * Finds the Root instance of the node’s tree. + * + * ```js + * root.nodes[0].nodes[0].root() === root + * ``` + * + * @return Root parent. + */ + root(): Root + + /** + * Fix circular links on `JSON.stringify()`. + * + * @return Cleaned object. + */ + toJSON(): object + + /** + * It compiles the node to browser readable cascading style sheets string + * depending on it's type. + * + * ```js + * new Rule({ selector: 'a' }).toString() //=> "a {}" + * ``` + * + * @param stringifier A syntax to use in string generation. + * @return CSS string of this node. + */ + toString(stringifier?: Stringifier | Syntax): string + + /** + * It is a wrapper for {@link Result#warn}, providing convenient + * way of generating warnings. + * + * ```js + * Declaration: { + * bad: (decl, { result }) => { + * decl.warn(result, 'Deprecated property: bad') + * } + * } + * ``` + * + * @param result The `Result` instance that will receive the warning. + * @param message Description for the warning. + * @param options Options for the warning. + * + * @return `Warning` instance is returned + */ + warn(result: Result, message: string, options?: WarningOptions): Warning +} + +declare class Node extends Node_ { } + +export = Node diff --git a/node_modules/postcss/lib/node.js b/node_modules/postcss/lib/node.js new file mode 100644 index 0000000..d79dd56 --- /dev/null +++ b/node_modules/postcss/lib/node.js @@ -0,0 +1,381 @@ +'use strict' + +let { isClean, my } = require('./symbols') +let CssSyntaxError = require('./css-syntax-error') +let Stringifier = require('./stringifier') +let stringify = require('./stringify') + +function cloneNode(obj, parent) { + let cloned = new obj.constructor() + + for (let i in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, i)) { + /* c8 ignore next 2 */ + continue + } + if (i === 'proxyCache') continue + let value = obj[i] + let type = typeof value + + if (i === 'parent' && type === 'object') { + if (parent) cloned[i] = parent + } else if (i === 'source') { + cloned[i] = value + } else if (Array.isArray(value)) { + cloned[i] = value.map(j => cloneNode(j, cloned)) + } else { + if (type === 'object' && value !== null) value = cloneNode(value) + cloned[i] = value + } + } + + return cloned +} + +class Node { + constructor(defaults = {}) { + this.raws = {} + this[isClean] = false + this[my] = true + + for (let name in defaults) { + if (name === 'nodes') { + this.nodes = [] + for (let node of defaults[name]) { + if (typeof node.clone === 'function') { + this.append(node.clone()) + } else { + this.append(node) + } + } + } else { + this[name] = defaults[name] + } + } + } + + addToError(error) { + error.postcssNode = this + if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { + let s = this.source + error.stack = error.stack.replace( + /\n\s{4}at /, + `$&${s.input.from}:${s.start.line}:${s.start.column}$&` + ) + } + return error + } + + after(add) { + this.parent.insertAfter(this, add) + return this + } + + assign(overrides = {}) { + for (let name in overrides) { + this[name] = overrides[name] + } + return this + } + + before(add) { + this.parent.insertBefore(this, add) + return this + } + + cleanRaws(keepBetween) { + delete this.raws.before + delete this.raws.after + if (!keepBetween) delete this.raws.between + } + + clone(overrides = {}) { + let cloned = cloneNode(this) + for (let name in overrides) { + cloned[name] = overrides[name] + } + return cloned + } + + cloneAfter(overrides = {}) { + let cloned = this.clone(overrides) + this.parent.insertAfter(this, cloned) + return cloned + } + + cloneBefore(overrides = {}) { + let cloned = this.clone(overrides) + this.parent.insertBefore(this, cloned) + return cloned + } + + error(message, opts = {}) { + if (this.source) { + let { end, start } = this.rangeBy(opts) + return this.source.input.error( + message, + { column: start.column, line: start.line }, + { column: end.column, line: end.line }, + opts + ) + } + return new CssSyntaxError(message) + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (prop === 'root') { + return () => node.root().toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value + if ( + prop === 'prop' || + prop === 'value' || + prop === 'name' || + prop === 'params' || + prop === 'important' || + /* c8 ignore next */ + prop === 'text' + ) { + node.markDirty() + } + return true + } + } + } + + markDirty() { + if (this[isClean]) { + this[isClean] = false + let next = this + while ((next = next.parent)) { + next[isClean] = false + } + } + } + + next() { + if (!this.parent) return undefined + let index = this.parent.index(this) + return this.parent.nodes[index + 1] + } + + positionBy(opts, stringRepresentation) { + let pos = this.source.start + if (opts.index) { + pos = this.positionInside(opts.index, stringRepresentation) + } else if (opts.word) { + stringRepresentation = this.toString() + let index = stringRepresentation.indexOf(opts.word) + if (index !== -1) pos = this.positionInside(index, stringRepresentation) + } + return pos + } + + positionInside(index, stringRepresentation) { + let string = stringRepresentation || this.toString() + let column = this.source.start.column + let line = this.source.start.line + + for (let i = 0; i < index; i++) { + if (string[i] === '\n') { + column = 1 + line += 1 + } else { + column += 1 + } + } + + return { column, line } + } + + prev() { + if (!this.parent) return undefined + let index = this.parent.index(this) + return this.parent.nodes[index - 1] + } + + rangeBy(opts) { + let start = { + column: this.source.start.column, + line: this.source.start.line + } + let end = this.source.end + ? { + column: this.source.end.column + 1, + line: this.source.end.line + } + : { + column: start.column + 1, + line: start.line + } + + if (opts.word) { + let stringRepresentation = this.toString() + let index = stringRepresentation.indexOf(opts.word) + if (index !== -1) { + start = this.positionInside(index, stringRepresentation) + end = this.positionInside(index + opts.word.length, stringRepresentation) + } + } else { + if (opts.start) { + start = { + column: opts.start.column, + line: opts.start.line + } + } else if (opts.index) { + start = this.positionInside(opts.index) + } + + if (opts.end) { + end = { + column: opts.end.column, + line: opts.end.line + } + } else if (opts.endIndex) { + end = this.positionInside(opts.endIndex) + } else if (opts.index) { + end = this.positionInside(opts.index + 1) + } + } + + if ( + end.line < start.line || + (end.line === start.line && end.column <= start.column) + ) { + end = { column: start.column + 1, line: start.line } + } + + return { end, start } + } + + raw(prop, defaultType) { + let str = new Stringifier() + return str.raw(this, prop, defaultType) + } + + remove() { + if (this.parent) { + this.parent.removeChild(this) + } + this.parent = undefined + return this + } + + replaceWith(...nodes) { + if (this.parent) { + let bookmark = this + let foundSelf = false + for (let node of nodes) { + if (node === this) { + foundSelf = true + } else if (foundSelf) { + this.parent.insertAfter(bookmark, node) + bookmark = node + } else { + this.parent.insertBefore(bookmark, node) + } + } + + if (!foundSelf) { + this.remove() + } + } + + return this + } + + root() { + let result = this + while (result.parent && result.parent.type !== 'document') { + result = result.parent + } + return result + } + + toJSON(_, inputs) { + let fixed = {} + let emitInputs = inputs == null + inputs = inputs || new Map() + let inputsNextIndex = 0 + + for (let name in this) { + if (!Object.prototype.hasOwnProperty.call(this, name)) { + /* c8 ignore next 2 */ + continue + } + if (name === 'parent' || name === 'proxyCache') continue + let value = this[name] + + if (Array.isArray(value)) { + fixed[name] = value.map(i => { + if (typeof i === 'object' && i.toJSON) { + return i.toJSON(null, inputs) + } else { + return i + } + }) + } else if (typeof value === 'object' && value.toJSON) { + fixed[name] = value.toJSON(null, inputs) + } else if (name === 'source') { + let inputId = inputs.get(value.input) + if (inputId == null) { + inputId = inputsNextIndex + inputs.set(value.input, inputsNextIndex) + inputsNextIndex++ + } + fixed[name] = { + end: value.end, + inputId, + start: value.start + } + } else { + fixed[name] = value + } + } + + if (emitInputs) { + fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) + } + + return fixed + } + + toProxy() { + if (!this.proxyCache) { + this.proxyCache = new Proxy(this, this.getProxyProcessor()) + } + return this.proxyCache + } + + toString(stringifier = stringify) { + if (stringifier.stringify) stringifier = stringifier.stringify + let result = '' + stringifier(this, i => { + result += i + }) + return result + } + + warn(result, text, opts) { + let data = { node: this } + for (let i in opts) data[i] = opts[i] + return result.warn(text, data) + } + + get proxyOf() { + return this + } +} + +module.exports = Node +Node.default = Node diff --git a/node_modules/postcss/lib/parse.d.ts b/node_modules/postcss/lib/parse.d.ts new file mode 100644 index 0000000..4c943a4 --- /dev/null +++ b/node_modules/postcss/lib/parse.d.ts @@ -0,0 +1,9 @@ +import { Parser } from './postcss.js' + +interface Parse extends Parser { + default: Parse +} + +declare const parse: Parse + +export = parse diff --git a/node_modules/postcss/lib/parse.js b/node_modules/postcss/lib/parse.js new file mode 100644 index 0000000..971431f --- /dev/null +++ b/node_modules/postcss/lib/parse.js @@ -0,0 +1,42 @@ +'use strict' + +let Container = require('./container') +let Parser = require('./parser') +let Input = require('./input') + +function parse(css, opts) { + let input = new Input(css, opts) + let parser = new Parser(input) + try { + parser.parse() + } catch (e) { + if (process.env.NODE_ENV !== 'production') { + if (e.name === 'CssSyntaxError' && opts && opts.from) { + if (/\.scss$/i.test(opts.from)) { + e.message += + '\nYou tried to parse SCSS with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-scss parser' + } else if (/\.sass/i.test(opts.from)) { + e.message += + '\nYou tried to parse Sass with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-sass parser' + } else if (/\.less$/i.test(opts.from)) { + e.message += + '\nYou tried to parse Less with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-less parser' + } + } + } + throw e + } + + return parser.root +} + +module.exports = parse +parse.default = parse + +Container.registerParse(parse) diff --git a/node_modules/postcss/lib/parser.js b/node_modules/postcss/lib/parser.js new file mode 100644 index 0000000..e1e2e19 --- /dev/null +++ b/node_modules/postcss/lib/parser.js @@ -0,0 +1,610 @@ +'use strict' + +let Declaration = require('./declaration') +let tokenizer = require('./tokenize') +let Comment = require('./comment') +let AtRule = require('./at-rule') +let Root = require('./root') +let Rule = require('./rule') + +const SAFE_COMMENT_NEIGHBOR = { + empty: true, + space: true +} + +function findLastWithPosition(tokens) { + for (let i = tokens.length - 1; i >= 0; i--) { + let token = tokens[i] + let pos = token[3] || token[2] + if (pos) return pos + } +} + +class Parser { + constructor(input) { + this.input = input + + this.root = new Root() + this.current = this.root + this.spaces = '' + this.semicolon = false + this.customProperty = false + + this.createTokenizer() + this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } + } + + atrule(token) { + let node = new AtRule() + node.name = token[1].slice(1) + if (node.name === '') { + this.unnamedAtrule(node, token) + } + this.init(node, token[2]) + + let type + let prev + let shift + let last = false + let open = false + let params = [] + let brackets = [] + + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken() + type = token[0] + + if (type === '(' || type === '[') { + brackets.push(type === '(' ? ')' : ']') + } else if (type === '{' && brackets.length > 0) { + brackets.push('}') + } else if (type === brackets[brackets.length - 1]) { + brackets.pop() + } + + if (brackets.length === 0) { + if (type === ';') { + node.source.end = this.getPosition(token[2]) + node.source.end.offset++ + this.semicolon = true + break + } else if (type === '{') { + open = true + break + } else if (type === '}') { + if (params.length > 0) { + shift = params.length - 1 + prev = params[shift] + while (prev && prev[0] === 'space') { + prev = params[--shift] + } + if (prev) { + node.source.end = this.getPosition(prev[3] || prev[2]) + node.source.end.offset++ + } + } + this.end(token) + break + } else { + params.push(token) + } + } else { + params.push(token) + } + + if (this.tokenizer.endOfFile()) { + last = true + break + } + } + + node.raws.between = this.spacesAndCommentsFromEnd(params) + if (params.length) { + node.raws.afterName = this.spacesAndCommentsFromStart(params) + this.raw(node, 'params', params) + if (last) { + token = params[params.length - 1] + node.source.end = this.getPosition(token[3] || token[2]) + node.source.end.offset++ + this.spaces = node.raws.between + node.raws.between = '' + } + } else { + node.raws.afterName = '' + node.params = '' + } + + if (open) { + node.nodes = [] + this.current = node + } + } + + checkMissedSemicolon(tokens) { + let colon = this.colon(tokens) + if (colon === false) return + + let founded = 0 + let token + for (let j = colon - 1; j >= 0; j--) { + token = tokens[j] + if (token[0] !== 'space') { + founded += 1 + if (founded === 2) break + } + } + // If the token is a word, e.g. `!important`, `red` or any other valid property's value. + // Then we need to return the colon after that word token. [3] is the "end" colon of that word. + // And because we need it after that one we do +1 to get the next one. + throw this.input.error( + 'Missed semicolon', + token[0] === 'word' ? token[3] + 1 : token[2] + ) + } + + colon(tokens) { + let brackets = 0 + let token, type, prev + for (let [i, element] of tokens.entries()) { + token = element + type = token[0] + + if (type === '(') { + brackets += 1 + } + if (type === ')') { + brackets -= 1 + } + if (brackets === 0 && type === ':') { + if (!prev) { + this.doubleColon(token) + } else if (prev[0] === 'word' && prev[1] === 'progid') { + continue + } else { + return i + } + } + + prev = token + } + return false + } + + comment(token) { + let node = new Comment() + this.init(node, token[2]) + node.source.end = this.getPosition(token[3] || token[2]) + node.source.end.offset++ + + let text = token[1].slice(2, -2) + if (/^\s*$/.test(text)) { + node.text = '' + node.raws.left = text + node.raws.right = '' + } else { + let match = text.match(/^(\s*)([^]*\S)(\s*)$/) + node.text = match[2] + node.raws.left = match[1] + node.raws.right = match[3] + } + } + + createTokenizer() { + this.tokenizer = tokenizer(this.input) + } + + decl(tokens, customProperty) { + let node = new Declaration() + this.init(node, tokens[0][2]) + + let last = tokens[tokens.length - 1] + if (last[0] === ';') { + this.semicolon = true + tokens.pop() + } + + node.source.end = this.getPosition( + last[3] || last[2] || findLastWithPosition(tokens) + ) + node.source.end.offset++ + + while (tokens[0][0] !== 'word') { + if (tokens.length === 1) this.unknownWord(tokens) + node.raws.before += tokens.shift()[1] + } + node.source.start = this.getPosition(tokens[0][2]) + + node.prop = '' + while (tokens.length) { + let type = tokens[0][0] + if (type === ':' || type === 'space' || type === 'comment') { + break + } + node.prop += tokens.shift()[1] + } + + node.raws.between = '' + + let token + while (tokens.length) { + token = tokens.shift() + + if (token[0] === ':') { + node.raws.between += token[1] + break + } else { + if (token[0] === 'word' && /\w/.test(token[1])) { + this.unknownWord([token]) + } + node.raws.between += token[1] + } + } + + if (node.prop[0] === '_' || node.prop[0] === '*') { + node.raws.before += node.prop[0] + node.prop = node.prop.slice(1) + } + + let firstSpaces = [] + let next + while (tokens.length) { + next = tokens[0][0] + if (next !== 'space' && next !== 'comment') break + firstSpaces.push(tokens.shift()) + } + + this.precheckMissedSemicolon(tokens) + + for (let i = tokens.length - 1; i >= 0; i--) { + token = tokens[i] + if (token[1].toLowerCase() === '!important') { + node.important = true + let string = this.stringFrom(tokens, i) + string = this.spacesFromEnd(tokens) + string + if (string !== ' !important') node.raws.important = string + break + } else if (token[1].toLowerCase() === 'important') { + let cache = tokens.slice(0) + let str = '' + for (let j = i; j > 0; j--) { + let type = cache[j][0] + if (str.trim().indexOf('!') === 0 && type !== 'space') { + break + } + str = cache.pop()[1] + str + } + if (str.trim().indexOf('!') === 0) { + node.important = true + node.raws.important = str + tokens = cache + } + } + + if (token[0] !== 'space' && token[0] !== 'comment') { + break + } + } + + let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') + + if (hasWord) { + node.raws.between += firstSpaces.map(i => i[1]).join('') + firstSpaces = [] + } + this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) + + if (node.value.includes(':') && !customProperty) { + this.checkMissedSemicolon(tokens) + } + } + + doubleColon(token) { + throw this.input.error( + 'Double colon', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } + + emptyRule(token) { + let node = new Rule() + this.init(node, token[2]) + node.selector = '' + node.raws.between = '' + this.current = node + } + + end(token) { + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon + } + this.semicolon = false + + this.current.raws.after = (this.current.raws.after || '') + this.spaces + this.spaces = '' + + if (this.current.parent) { + this.current.source.end = this.getPosition(token[2]) + this.current.source.end.offset++ + this.current = this.current.parent + } else { + this.unexpectedClose(token) + } + } + + endFile() { + if (this.current.parent) this.unclosedBlock() + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon + } + this.current.raws.after = (this.current.raws.after || '') + this.spaces + this.root.source.end = this.getPosition(this.tokenizer.position()) + } + + freeSemicolon(token) { + this.spaces += token[1] + if (this.current.nodes) { + let prev = this.current.nodes[this.current.nodes.length - 1] + if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { + prev.raws.ownSemicolon = this.spaces + this.spaces = '' + } + } + } + + // Helpers + + getPosition(offset) { + let pos = this.input.fromOffset(offset) + return { + column: pos.col, + line: pos.line, + offset + } + } + + init(node, offset) { + this.current.push(node) + node.source = { + input: this.input, + start: this.getPosition(offset) + } + node.raws.before = this.spaces + this.spaces = '' + if (node.type !== 'comment') this.semicolon = false + } + + other(start) { + let end = false + let type = null + let colon = false + let bracket = null + let brackets = [] + let customProperty = start[1].startsWith('--') + + let tokens = [] + let token = start + while (token) { + type = token[0] + tokens.push(token) + + if (type === '(' || type === '[') { + if (!bracket) bracket = token + brackets.push(type === '(' ? ')' : ']') + } else if (customProperty && colon && type === '{') { + if (!bracket) bracket = token + brackets.push('}') + } else if (brackets.length === 0) { + if (type === ';') { + if (colon) { + this.decl(tokens, customProperty) + return + } else { + break + } + } else if (type === '{') { + this.rule(tokens) + return + } else if (type === '}') { + this.tokenizer.back(tokens.pop()) + end = true + break + } else if (type === ':') { + colon = true + } + } else if (type === brackets[brackets.length - 1]) { + brackets.pop() + if (brackets.length === 0) bracket = null + } + + token = this.tokenizer.nextToken() + } + + if (this.tokenizer.endOfFile()) end = true + if (brackets.length > 0) this.unclosedBracket(bracket) + + if (end && colon) { + if (!customProperty) { + while (tokens.length) { + token = tokens[tokens.length - 1][0] + if (token !== 'space' && token !== 'comment') break + this.tokenizer.back(tokens.pop()) + } + } + this.decl(tokens, customProperty) + } else { + this.unknownWord(tokens) + } + } + + parse() { + let token + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken() + + switch (token[0]) { + case 'space': + this.spaces += token[1] + break + + case ';': + this.freeSemicolon(token) + break + + case '}': + this.end(token) + break + + case 'comment': + this.comment(token) + break + + case 'at-word': + this.atrule(token) + break + + case '{': + this.emptyRule(token) + break + + default: + this.other(token) + break + } + } + this.endFile() + } + + precheckMissedSemicolon(/* tokens */) { + // Hook for Safe Parser + } + + raw(node, prop, tokens, customProperty) { + let token, type + let length = tokens.length + let value = '' + let clean = true + let next, prev + + for (let i = 0; i < length; i += 1) { + token = tokens[i] + type = token[0] + if (type === 'space' && i === length - 1 && !customProperty) { + clean = false + } else if (type === 'comment') { + prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' + next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' + if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { + if (value.slice(-1) === ',') { + clean = false + } else { + value += token[1] + } + } else { + clean = false + } + } else { + value += token[1] + } + } + if (!clean) { + let raw = tokens.reduce((all, i) => all + i[1], '') + node.raws[prop] = { raw, value } + } + node[prop] = value + } + + rule(tokens) { + tokens.pop() + + let node = new Rule() + this.init(node, tokens[0][2]) + + node.raws.between = this.spacesAndCommentsFromEnd(tokens) + this.raw(node, 'selector', tokens) + this.current = node + } + + spacesAndCommentsFromEnd(tokens) { + let lastTokenType + let spaces = '' + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0] + if (lastTokenType !== 'space' && lastTokenType !== 'comment') break + spaces = tokens.pop()[1] + spaces + } + return spaces + } + + // Errors + + spacesAndCommentsFromStart(tokens) { + let next + let spaces = '' + while (tokens.length) { + next = tokens[0][0] + if (next !== 'space' && next !== 'comment') break + spaces += tokens.shift()[1] + } + return spaces + } + + spacesFromEnd(tokens) { + let lastTokenType + let spaces = '' + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0] + if (lastTokenType !== 'space') break + spaces = tokens.pop()[1] + spaces + } + return spaces + } + + stringFrom(tokens, from) { + let result = '' + for (let i = from; i < tokens.length; i++) { + result += tokens[i][1] + } + tokens.splice(from, tokens.length - from) + return result + } + + unclosedBlock() { + let pos = this.current.source.start + throw this.input.error('Unclosed block', pos.line, pos.column) + } + + unclosedBracket(bracket) { + throw this.input.error( + 'Unclosed bracket', + { offset: bracket[2] }, + { offset: bracket[2] + 1 } + ) + } + + unexpectedClose(token) { + throw this.input.error( + 'Unexpected }', + { offset: token[2] }, + { offset: token[2] + 1 } + ) + } + + unknownWord(tokens) { + throw this.input.error( + 'Unknown word', + { offset: tokens[0][2] }, + { offset: tokens[0][2] + tokens[0][1].length } + ) + } + + unnamedAtrule(node, token) { + throw this.input.error( + 'At-rule without name', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } +} + +module.exports = Parser diff --git a/node_modules/postcss/lib/postcss.d.mts b/node_modules/postcss/lib/postcss.d.mts new file mode 100644 index 0000000..a8ca8c7 --- /dev/null +++ b/node_modules/postcss/lib/postcss.d.mts @@ -0,0 +1,72 @@ +export { + // postcss function / namespace + default, + + // Value exports from postcss.mjs + stringify, + fromJSON, + // @ts-expect-error This value exists, but it’s untyped. + plugin, + parse, + list, + + document, + comment, + atRule, + rule, + decl, + root, + + CssSyntaxError, + Declaration, + Container, + Processor, + Document, + Comment, + Warning, + AtRule, + Result, + Input, + Rule, + Root, + Node, + + // Type-only exports + AcceptedPlugin, + AnyNode, + AtRuleProps, + Builder, + ChildNode, + ChildProps, + CommentProps, + ContainerProps, + DeclarationProps, + DocumentProps, + FilePosition, + Helpers, + JSONHydrator, + Message, + NodeErrorOptions, + NodeProps, + OldPlugin, + Parser, + Plugin, + PluginCreator, + Position, + Postcss, + ProcessOptions, + RootProps, + RuleProps, + Source, + SourceMap, + SourceMapOptions, + Stringifier, + Syntax, + TransformCallback, + Transformer, + WarningOptions, + + // This is a class, but it’s not re-exported. That’s why it’s exported as type-only here. + type LazyResult, + +} from './postcss.js' diff --git a/node_modules/postcss/lib/postcss.d.ts b/node_modules/postcss/lib/postcss.d.ts new file mode 100644 index 0000000..70d7589 --- /dev/null +++ b/node_modules/postcss/lib/postcss.d.ts @@ -0,0 +1,441 @@ +import { RawSourceMap, SourceMapGenerator } from 'source-map-js' + +import AtRule, { AtRuleProps } from './at-rule.js' +import Comment, { CommentProps } from './comment.js' +import Container, { ContainerProps } from './container.js' +import CssSyntaxError from './css-syntax-error.js' +import Declaration, { DeclarationProps } from './declaration.js' +import Document, { DocumentProps } from './document.js' +import Input, { FilePosition } from './input.js' +import LazyResult from './lazy-result.js' +import list from './list.js' +import Node, { + AnyNode, + ChildNode, + ChildProps, + NodeErrorOptions, + NodeProps, + Position, + Source +} from './node.js' +import Processor from './processor.js' +import Result, { Message } from './result.js' +import Root, { RootProps } from './root.js' +import Rule, { RuleProps } from './rule.js' +import Warning, { WarningOptions } from './warning.js' + +type DocumentProcessor = ( + document: Document, + helper: postcss.Helpers +) => Promise | void +type RootProcessor = (root: Root, helper: postcss.Helpers) => Promise | void +type DeclarationProcessor = ( + decl: Declaration, + helper: postcss.Helpers +) => Promise | void +type RuleProcessor = (rule: Rule, helper: postcss.Helpers) => Promise | void +type AtRuleProcessor = (atRule: AtRule, helper: postcss.Helpers) => Promise | void +type CommentProcessor = ( + comment: Comment, + helper: postcss.Helpers +) => Promise | void + +interface Processors { + /** + * Will be called on all`AtRule` nodes. + * + * Will be called again on node or children changes. + */ + AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor + + /** + * Will be called on all `AtRule` nodes, when all children will be processed. + * + * Will be called again on node or children changes. + */ + AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor + + /** + * Will be called on all `Comment` nodes. + * + * Will be called again on node or children changes. + */ + Comment?: CommentProcessor + + /** + * Will be called on all `Comment` nodes after listeners + * for `Comment` event. + * + * Will be called again on node or children changes. + */ + CommentExit?: CommentProcessor + + /** + * Will be called on all `Declaration` nodes after listeners + * for `Declaration` event. + * + * Will be called again on node or children changes. + */ + Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor + + /** + * Will be called on all `Declaration` nodes. + * + * Will be called again on node or children changes. + */ + DeclarationExit?: + | { [prop: string]: DeclarationProcessor } + | DeclarationProcessor + + /** + * Will be called on `Document` node. + * + * Will be called again on children changes. + */ + Document?: DocumentProcessor + + /** + * Will be called on `Document` node, when all children will be processed. + * + * Will be called again on children changes. + */ + DocumentExit?: DocumentProcessor + + /** + * Will be called on `Root` node once. + */ + Once?: RootProcessor + + /** + * Will be called on `Root` node once, when all children will be processed. + */ + OnceExit?: RootProcessor + + /** + * Will be called on `Root` node. + * + * Will be called again on children changes. + */ + Root?: RootProcessor + + /** + * Will be called on `Root` node, when all children will be processed. + * + * Will be called again on children changes. + */ + RootExit?: RootProcessor + + /** + * Will be called on all `Rule` nodes. + * + * Will be called again on node or children changes. + */ + Rule?: RuleProcessor + + /** + * Will be called on all `Rule` nodes, when all children will be processed. + * + * Will be called again on node or children changes. + */ + RuleExit?: RuleProcessor +} + +declare namespace postcss { + export { + AnyNode, + AtRule, + AtRuleProps, + ChildNode, + ChildProps, + Comment, + CommentProps, + Container, + ContainerProps, + CssSyntaxError, + Declaration, + DeclarationProps, + Document, + DocumentProps, + FilePosition, + Input, + LazyResult, + list, + Message, + Node, + NodeErrorOptions, + NodeProps, + Position, + Processor, + Result, + Root, + RootProps, + Rule, + RuleProps, + Source, + Warning, + WarningOptions + } + + export type SourceMap = SourceMapGenerator & { + toJSON(): RawSourceMap + } + + export type Helpers = { postcss: Postcss; result: Result } & Postcss + + export interface Plugin extends Processors { + postcssPlugin: string + prepare?: (result: Result) => Processors + } + + export interface PluginCreator { + (opts?: PluginOptions): Plugin | Processor + postcss: true + } + + export interface Transformer extends TransformCallback { + postcssPlugin: string + postcssVersion: string + } + + export interface TransformCallback { + (root: Root, result: Result): Promise | void + } + + export interface OldPlugin extends Transformer { + (opts?: T): Transformer + postcss: Transformer + } + + export type AcceptedPlugin = + | { + postcss: Processor | TransformCallback + } + | OldPlugin + | Plugin + | PluginCreator + | Processor + | TransformCallback + + export interface Parser { + ( + css: { toString(): string } | string, + opts?: Pick + ): RootNode + } + + export interface Builder { + (part: string, node?: AnyNode, type?: 'end' | 'start'): void + } + + export interface Stringifier { + (node: AnyNode, builder: Builder): void + } + + export interface JSONHydrator { + (data: object): Node + (data: object[]): Node[] + } + + export interface Syntax { + /** + * Function to generate AST by string. + */ + parse?: Parser + + /** + * Class to generate string by AST. + */ + stringify?: Stringifier + } + + export interface SourceMapOptions { + /** + * Use absolute path in generated source map. + */ + absolute?: boolean + + /** + * Indicates that PostCSS should add annotation comments to the CSS. + * By default, PostCSS will always add a comment with a path + * to the source map. PostCSS will not add annotations to CSS files + * that do not contain any comments. + * + * By default, PostCSS presumes that you want to save the source map as + * `opts.to + '.map'` and will use this path in the annotation comment. + * A different path can be set by providing a string value for annotation. + * + * If you have set `inline: true`, annotation cannot be disabled. + */ + annotation?: ((file: string, root: Root) => string) | boolean | string + + /** + * Override `from` in map’s sources. + */ + from?: string + + /** + * Indicates that the source map should be embedded in the output CSS + * as a Base64-encoded comment. By default, it is `true`. + * But if all previous maps are external, not inline, PostCSS will not embed + * the map even if you do not set this option. + * + * If you have an inline source map, the result.map property will be empty, + * as the source map will be contained within the text of `result.css`. + */ + inline?: boolean + + /** + * Source map content from a previous processing step (e.g., Sass). + * + * PostCSS will try to read the previous source map + * automatically (based on comments within the source CSS), but you can use + * this option to identify it manually. + * + * If desired, you can omit the previous map with prev: `false`. + */ + prev?: ((file: string) => string) | boolean | object | string + + /** + * Indicates that PostCSS should set the origin content (e.g., Sass source) + * of the source map. By default, it is true. But if all previous maps do not + * contain sources content, PostCSS will also leave it out even if you + * do not set this option. + */ + sourcesContent?: boolean + } + + export interface ProcessOptions { + /** + * The path of the CSS source file. You should always set `from`, + * because it is used in source map generation and syntax error messages. + */ + from?: string + + /** + * Source map options + */ + map?: boolean | SourceMapOptions + + /** + * Function to generate AST by string. + */ + parser?: Parser | Syntax + + /** + * Class to generate string by AST. + */ + stringifier?: Stringifier | Syntax + + /** + * Object with parse and stringify. + */ + syntax?: Syntax + + /** + * The path where you'll put the output CSS file. You should always set `to` + * to generate correct source maps. + */ + to?: string + } + + export type Postcss = typeof postcss + + /** + * Default function to convert a node tree into a CSS string. + */ + export let stringify: Stringifier + + /** + * Parses source css and returns a new `Root` or `Document` node, + * which contains the source CSS nodes. + * + * ```js + * // Simple CSS concatenation with source map support + * const root1 = postcss.parse(css1, { from: file1 }) + * const root2 = postcss.parse(css2, { from: file2 }) + * root1.append(root2).toResult().css + * ``` + */ + export let parse: Parser + + /** + * Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes. + * + * ```js + * const json = root.toJSON() + * // save to file, send by network, etc + * const root2 = postcss.fromJSON(json) + * ``` + */ + export let fromJSON: JSONHydrator + + /** + * Creates a new `Comment` node. + * + * @param defaults Properties for the new node. + * @return New comment node + */ + export function comment(defaults?: CommentProps): Comment + + /** + * Creates a new `AtRule` node. + * + * @param defaults Properties for the new node. + * @return New at-rule node. + */ + export function atRule(defaults?: AtRuleProps): AtRule + + /** + * Creates a new `Declaration` node. + * + * @param defaults Properties for the new node. + * @return New declaration node. + */ + export function decl(defaults?: DeclarationProps): Declaration + + /** + * Creates a new `Rule` node. + * + * @param default Properties for the new node. + * @return New rule node. + */ + export function rule(defaults?: RuleProps): Rule + + /** + * Creates a new `Root` node. + * + * @param defaults Properties for the new node. + * @return New root node. + */ + export function root(defaults?: RootProps): Root + + /** + * Creates a new `Document` node. + * + * @param defaults Properties for the new node. + * @return New document node. + */ + export function document(defaults?: DocumentProps): Document + + export { postcss as default } +} + +/** + * Create a new `Processor` instance that will apply `plugins` + * as CSS processors. + * + * ```js + * let postcss = require('postcss') + * + * postcss(plugins).process(css, { from, to }).then(result => { + * console.log(result.css) + * }) + * ``` + * + * @param plugins PostCSS plugins. + * @return Processor to process multiple CSS. + */ +declare function postcss(plugins?: postcss.AcceptedPlugin[]): Processor +declare function postcss(...plugins: postcss.AcceptedPlugin[]): Processor + +export = postcss diff --git a/node_modules/postcss/lib/postcss.js b/node_modules/postcss/lib/postcss.js new file mode 100644 index 0000000..080ee83 --- /dev/null +++ b/node_modules/postcss/lib/postcss.js @@ -0,0 +1,101 @@ +'use strict' + +let CssSyntaxError = require('./css-syntax-error') +let Declaration = require('./declaration') +let LazyResult = require('./lazy-result') +let Container = require('./container') +let Processor = require('./processor') +let stringify = require('./stringify') +let fromJSON = require('./fromJSON') +let Document = require('./document') +let Warning = require('./warning') +let Comment = require('./comment') +let AtRule = require('./at-rule') +let Result = require('./result.js') +let Input = require('./input') +let parse = require('./parse') +let list = require('./list') +let Rule = require('./rule') +let Root = require('./root') +let Node = require('./node') + +function postcss(...plugins) { + if (plugins.length === 1 && Array.isArray(plugins[0])) { + plugins = plugins[0] + } + return new Processor(plugins) +} + +postcss.plugin = function plugin(name, initializer) { + let warningPrinted = false + function creator(...args) { + // eslint-disable-next-line no-console + if (console && console.warn && !warningPrinted) { + warningPrinted = true + // eslint-disable-next-line no-console + console.warn( + name + + ': postcss.plugin was deprecated. Migration guide:\n' + + 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' + ) + if (process.env.LANG && process.env.LANG.startsWith('cn')) { + /* c8 ignore next 7 */ + // eslint-disable-next-line no-console + console.warn( + name + + ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + + 'https://www.w3ctech.com/topic/2226' + ) + } + } + let transformer = initializer(...args) + transformer.postcssPlugin = name + transformer.postcssVersion = new Processor().version + return transformer + } + + let cache + Object.defineProperty(creator, 'postcss', { + get() { + if (!cache) cache = creator() + return cache + } + }) + + creator.process = function (css, processOpts, pluginOpts) { + return postcss([creator(pluginOpts)]).process(css, processOpts) + } + + return creator +} + +postcss.stringify = stringify +postcss.parse = parse +postcss.fromJSON = fromJSON +postcss.list = list + +postcss.comment = defaults => new Comment(defaults) +postcss.atRule = defaults => new AtRule(defaults) +postcss.decl = defaults => new Declaration(defaults) +postcss.rule = defaults => new Rule(defaults) +postcss.root = defaults => new Root(defaults) +postcss.document = defaults => new Document(defaults) + +postcss.CssSyntaxError = CssSyntaxError +postcss.Declaration = Declaration +postcss.Container = Container +postcss.Processor = Processor +postcss.Document = Document +postcss.Comment = Comment +postcss.Warning = Warning +postcss.AtRule = AtRule +postcss.Result = Result +postcss.Input = Input +postcss.Rule = Rule +postcss.Root = Root +postcss.Node = Node + +LazyResult.registerPostcss(postcss) + +module.exports = postcss +postcss.default = postcss diff --git a/node_modules/postcss/lib/postcss.mjs b/node_modules/postcss/lib/postcss.mjs new file mode 100644 index 0000000..3507598 --- /dev/null +++ b/node_modules/postcss/lib/postcss.mjs @@ -0,0 +1,30 @@ +import postcss from './postcss.js' + +export default postcss + +export const stringify = postcss.stringify +export const fromJSON = postcss.fromJSON +export const plugin = postcss.plugin +export const parse = postcss.parse +export const list = postcss.list + +export const document = postcss.document +export const comment = postcss.comment +export const atRule = postcss.atRule +export const rule = postcss.rule +export const decl = postcss.decl +export const root = postcss.root + +export const CssSyntaxError = postcss.CssSyntaxError +export const Declaration = postcss.Declaration +export const Container = postcss.Container +export const Processor = postcss.Processor +export const Document = postcss.Document +export const Comment = postcss.Comment +export const Warning = postcss.Warning +export const AtRule = postcss.AtRule +export const Result = postcss.Result +export const Input = postcss.Input +export const Rule = postcss.Rule +export const Root = postcss.Root +export const Node = postcss.Node diff --git a/node_modules/postcss/lib/previous-map.d.ts b/node_modules/postcss/lib/previous-map.d.ts new file mode 100644 index 0000000..23edeb5 --- /dev/null +++ b/node_modules/postcss/lib/previous-map.d.ts @@ -0,0 +1,81 @@ +import { SourceMapConsumer } from 'source-map-js' + +import { ProcessOptions } from './postcss.js' + +declare namespace PreviousMap { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { PreviousMap_ as default } +} + +/** + * Source map information from input CSS. + * For example, source map after Sass compiler. + * + * This class will automatically find source map in input CSS or in file system + * near input file (according `from` option). + * + * ```js + * const root = parse(css, { from: 'a.sass.css' }) + * root.input.map //=> PreviousMap + * ``` + */ +declare class PreviousMap_ { + /** + * `sourceMappingURL` content. + */ + annotation?: string + + /** + * The CSS source identifier. Contains `Input#file` if the user + * set the `from` option, or `Input#id` if they did not. + */ + file?: string + + /** + * Was source map inlined by data-uri to input CSS. + */ + inline: boolean + + /** + * Path to source map file. + */ + mapFile?: string + + /** + * The directory with source map file, if source map is in separated file. + */ + root?: string + + /** + * Source map file content. + */ + text?: string + + /** + * @param css Input CSS source. + * @param opts Process options. + */ + constructor(css: string, opts?: ProcessOptions) + + /** + * Create a instance of `SourceMapGenerator` class + * from the `source-map` library to work with source map information. + * + * It is lazy method, so it will create object only on first call + * and then it will use cache. + * + * @return Object with source map information. + */ + consumer(): SourceMapConsumer + + /** + * Does source map contains `sourcesContent` with input source text. + * + * @return Is `sourcesContent` present. + */ + withContent(): boolean +} + +declare class PreviousMap extends PreviousMap_ {} + +export = PreviousMap diff --git a/node_modules/postcss/lib/previous-map.js b/node_modules/postcss/lib/previous-map.js new file mode 100644 index 0000000..f3093df --- /dev/null +++ b/node_modules/postcss/lib/previous-map.js @@ -0,0 +1,142 @@ +'use strict' + +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { existsSync, readFileSync } = require('fs') +let { dirname, join } = require('path') + +function fromBase64(str) { + if (Buffer) { + return Buffer.from(str, 'base64').toString() + } else { + /* c8 ignore next 2 */ + return window.atob(str) + } +} + +class PreviousMap { + constructor(css, opts) { + if (opts.map === false) return + this.loadAnnotation(css) + this.inline = this.startWith(this.annotation, 'data:') + + let prev = opts.map ? opts.map.prev : undefined + let text = this.loadMap(opts.from, prev) + if (!this.mapFile && opts.from) { + this.mapFile = opts.from + } + if (this.mapFile) this.root = dirname(this.mapFile) + if (text) this.text = text + } + + consumer() { + if (!this.consumerCache) { + this.consumerCache = new SourceMapConsumer(this.text) + } + return this.consumerCache + } + + decodeInline(text) { + let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ + let baseUri = /^data:application\/json;base64,/ + let charsetUri = /^data:application\/json;charset=utf-?8,/ + let uri = /^data:application\/json,/ + + if (charsetUri.test(text) || uri.test(text)) { + return decodeURIComponent(text.substr(RegExp.lastMatch.length)) + } + + if (baseCharsetUri.test(text) || baseUri.test(text)) { + return fromBase64(text.substr(RegExp.lastMatch.length)) + } + + let encoding = text.match(/data:application\/json;([^,]+),/)[1] + throw new Error('Unsupported source map encoding ' + encoding) + } + + getAnnotationURL(sourceMapString) { + return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() + } + + isMap(map) { + if (typeof map !== 'object') return false + return ( + typeof map.mappings === 'string' || + typeof map._mappings === 'string' || + Array.isArray(map.sections) + ) + } + + loadAnnotation(css) { + let comments = css.match(/\/\*\s*# sourceMappingURL=/gm) + if (!comments) return + + // sourceMappingURLs from comments, strings, etc. + let start = css.lastIndexOf(comments.pop()) + let end = css.indexOf('*/', start) + + if (start > -1 && end > -1) { + // Locate the last sourceMappingURL to avoid pickin + this.annotation = this.getAnnotationURL(css.substring(start, end)) + } + } + + loadFile(path) { + this.root = dirname(path) + if (existsSync(path)) { + this.mapFile = path + return readFileSync(path, 'utf-8').toString().trim() + } + } + + loadMap(file, prev) { + if (prev === false) return false + + if (prev) { + if (typeof prev === 'string') { + return prev + } else if (typeof prev === 'function') { + let prevPath = prev(file) + if (prevPath) { + let map = this.loadFile(prevPath) + if (!map) { + throw new Error( + 'Unable to load previous source map: ' + prevPath.toString() + ) + } + return map + } + } else if (prev instanceof SourceMapConsumer) { + return SourceMapGenerator.fromSourceMap(prev).toString() + } else if (prev instanceof SourceMapGenerator) { + return prev.toString() + } else if (this.isMap(prev)) { + return JSON.stringify(prev) + } else { + throw new Error( + 'Unsupported previous source map format: ' + prev.toString() + ) + } + } else if (this.inline) { + return this.decodeInline(this.annotation) + } else if (this.annotation) { + let map = this.annotation + if (file) map = join(dirname(file), map) + return this.loadFile(map) + } + } + + startWith(string, start) { + if (!string) return false + return string.substr(0, start.length) === start + } + + withContent() { + return !!( + this.consumer().sourcesContent && + this.consumer().sourcesContent.length > 0 + ) + } +} + +module.exports = PreviousMap +PreviousMap.default = PreviousMap diff --git a/node_modules/postcss/lib/processor.d.ts b/node_modules/postcss/lib/processor.d.ts new file mode 100644 index 0000000..50c9a07 --- /dev/null +++ b/node_modules/postcss/lib/processor.d.ts @@ -0,0 +1,115 @@ +import Document from './document.js' +import LazyResult from './lazy-result.js' +import NoWorkResult from './no-work-result.js' +import { + AcceptedPlugin, + Plugin, + ProcessOptions, + TransformCallback, + Transformer +} from './postcss.js' +import Result from './result.js' +import Root from './root.js' + +declare namespace Processor { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Processor_ as default } +} + +/** + * Contains plugins to process CSS. Create one `Processor` instance, + * initialize its plugins, and then use that instance on numerous CSS files. + * + * ```js + * const processor = postcss([autoprefixer, postcssNested]) + * processor.process(css1).then(result => console.log(result.css)) + * processor.process(css2).then(result => console.log(result.css)) + * ``` + */ +declare class Processor_ { + /** + * Plugins added to this processor. + * + * ```js + * const processor = postcss([autoprefixer, postcssNested]) + * processor.plugins.length //=> 2 + * ``` + */ + plugins: (Plugin | TransformCallback | Transformer)[] + + /** + * Current PostCSS version. + * + * ```js + * if (result.processor.version.split('.')[0] !== '6') { + * throw new Error('This plugin works only with PostCSS 6') + * } + * ``` + */ + version: string + + /** + * @param plugins PostCSS plugins + */ + constructor(plugins?: AcceptedPlugin[]) + + /** + * Parses source CSS and returns a `LazyResult` Promise proxy. + * Because some plugins can be asynchronous it doesn’t make + * any transformations. Transformations will be applied + * in the `LazyResult` methods. + * + * ```js + * processor.process(css, { from: 'a.css', to: 'a.out.css' }) + * .then(result => { + * console.log(result.css) + * }) + * ``` + * + * @param css String with input CSS or any object with a `toString()` method, + * like a Buffer. Optionally, send a `Result` instance + * and the processor will take the `Root` from it. + * @param opts Options. + * @return Promise proxy. + */ + process( + css: { toString(): string } | LazyResult | Result | Root | string + ): LazyResult | NoWorkResult + process( + css: { toString(): string } | LazyResult | Result | Root | string, + options: ProcessOptions + ): LazyResult + + /** + * Adds a plugin to be used as a CSS processor. + * + * PostCSS plugin can be in 4 formats: + * * A plugin in `Plugin` format. + * * A plugin creator function with `pluginCreator.postcss = true`. + * PostCSS will call this function without argument to get plugin. + * * A function. PostCSS will pass the function a {@link Root} + * as the first argument and current `Result` instance + * as the second. + * * Another `Processor` instance. PostCSS will copy plugins + * from that instance into this one. + * + * Plugins can also be added by passing them as arguments when creating + * a `postcss` instance (see [`postcss(plugins)`]). + * + * Asynchronous plugins should return a `Promise` instance. + * + * ```js + * const processor = postcss() + * .use(autoprefixer) + * .use(postcssNested) + * ``` + * + * @param plugin PostCSS plugin or `Processor` with plugins. + * @return Current processor to make methods chain. + */ + use(plugin: AcceptedPlugin): this +} + +declare class Processor extends Processor_ {} + +export = Processor diff --git a/node_modules/postcss/lib/processor.js b/node_modules/postcss/lib/processor.js new file mode 100644 index 0000000..92842b6 --- /dev/null +++ b/node_modules/postcss/lib/processor.js @@ -0,0 +1,67 @@ +'use strict' + +let NoWorkResult = require('./no-work-result') +let LazyResult = require('./lazy-result') +let Document = require('./document') +let Root = require('./root') + +class Processor { + constructor(plugins = []) { + this.version = '8.4.31' + this.plugins = this.normalize(plugins) + } + + normalize(plugins) { + let normalized = [] + for (let i of plugins) { + if (i.postcss === true) { + i = i() + } else if (i.postcss) { + i = i.postcss + } + + if (typeof i === 'object' && Array.isArray(i.plugins)) { + normalized = normalized.concat(i.plugins) + } else if (typeof i === 'object' && i.postcssPlugin) { + normalized.push(i) + } else if (typeof i === 'function') { + normalized.push(i) + } else if (typeof i === 'object' && (i.parse || i.stringify)) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + + 'one of the syntax/parser/stringifier options as outlined ' + + 'in your PostCSS runner documentation.' + ) + } + } else { + throw new Error(i + ' is not a PostCSS plugin') + } + } + return normalized + } + + process(css, opts = {}) { + if ( + this.plugins.length === 0 && + typeof opts.parser === 'undefined' && + typeof opts.stringifier === 'undefined' && + typeof opts.syntax === 'undefined' + ) { + return new NoWorkResult(this, css, opts) + } else { + return new LazyResult(this, css, opts) + } + } + + use(plugin) { + this.plugins = this.plugins.concat(this.normalize([plugin])) + return this + } +} + +module.exports = Processor +Processor.default = Processor + +Root.registerProcessor(Processor) +Document.registerProcessor(Processor) diff --git a/node_modules/postcss/lib/result.d.ts b/node_modules/postcss/lib/result.d.ts new file mode 100644 index 0000000..c3dcbda --- /dev/null +++ b/node_modules/postcss/lib/result.d.ts @@ -0,0 +1,206 @@ +import { + Document, + Node, + Plugin, + ProcessOptions, + Root, + SourceMap, + TransformCallback, + Warning, + WarningOptions +} from './postcss.js' +import Processor from './processor.js' + +declare namespace Result { + export interface Message { + [others: string]: any + + /** + * Source PostCSS plugin name. + */ + plugin?: string + + /** + * Message type. + */ + type: string + } + + export interface ResultOptions extends ProcessOptions { + /** + * The CSS node that was the source of the warning. + */ + node?: Node + + /** + * Name of plugin that created this warning. `Result#warn` will fill it + * automatically with `Plugin#postcssPlugin` value. + */ + plugin?: string + } + + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Result_ as default } +} + +/** + * Provides the result of the PostCSS transformations. + * + * A Result instance is returned by `LazyResult#then` + * or `Root#toResult` methods. + * + * ```js + * postcss([autoprefixer]).process(css).then(result => { + * console.log(result.css) + * }) + * ``` + * + * ```js + * const result2 = postcss.parse(css).toResult() + * ``` + */ +declare class Result_ { + /** + * A CSS string representing of `Result#root`. + * + * ```js + * postcss.parse('a{}').toResult().css //=> "a{}" + * ``` + */ + css: string + + /** + * Last runned PostCSS plugin. + */ + lastPlugin: Plugin | TransformCallback + + /** + * An instance of `SourceMapGenerator` class from the `source-map` library, + * representing changes to the `Result#root` instance. + * + * ```js + * result.map.toJSON() //=> { version: 3, file: 'a.css', … } + * ``` + * + * ```js + * if (result.map) { + * fs.writeFileSync(result.opts.to + '.map', result.map.toString()) + * } + * ``` + */ + map: SourceMap + + /** + * Contains messages from plugins (e.g., warnings or custom messages). + * Each message should have type and plugin properties. + * + * ```js + * AtRule: { + * import: (atRule, { result }) { + * const importedFile = parseImport(atRule) + * result.messages.push({ + * type: 'dependency', + * plugin: 'postcss-import', + * file: importedFile, + * parent: result.opts.from + * }) + * } + * } + * ``` + */ + messages: Result.Message[] + + /** + * Options from the `Processor#process` or `Root#toResult` call + * that produced this Result instance.] + * + * ```js + * root.toResult(opts).opts === opts + * ``` + */ + opts: Result.ResultOptions + + /** + * The Processor instance used for this transformation. + * + * ```js + * for (const plugin of result.processor.plugins) { + * if (plugin.postcssPlugin === 'postcss-bad') { + * throw 'postcss-good is incompatible with postcss-bad' + * } + * }) + * ``` + */ + processor: Processor + + /** + * Root node after all transformations. + * + * ```js + * root.toResult().root === root + * ``` + */ + root: RootNode + + /** + * @param processor Processor used for this transformation. + * @param root Root node after all transformations. + * @param opts Options from the `Processor#process` or `Root#toResult`. + */ + constructor(processor: Processor, root: RootNode, opts: Result.ResultOptions) + + /** + * Returns for `Result#css` content. + * + * ```js + * result + '' === result.css + * ``` + * + * @return String representing of `Result#root`. + */ + toString(): string + + /** + * Creates an instance of `Warning` and adds it to `Result#messages`. + * + * ```js + * if (decl.important) { + * result.warn('Avoid !important', { node: decl, word: '!important' }) + * } + * ``` + * + * @param text Warning message. + * @param opts Warning options. + * @return Created warning. + */ + warn(message: string, options?: WarningOptions): Warning + + /** + * Returns warnings from plugins. Filters `Warning` instances + * from `Result#messages`. + * + * ```js + * result.warnings().forEach(warn => { + * console.warn(warn.toString()) + * }) + * ``` + * + * @return Warnings from plugins. + */ + warnings(): Warning[] + + /** + * An alias for the `Result#css` property. + * Use it with syntaxes that generate non-CSS output. + * + * ```js + * result.css === result.content + * ``` + */ + get content(): string +} + +declare class Result extends Result_ {} + +export = Result diff --git a/node_modules/postcss/lib/result.js b/node_modules/postcss/lib/result.js new file mode 100644 index 0000000..a39751d --- /dev/null +++ b/node_modules/postcss/lib/result.js @@ -0,0 +1,42 @@ +'use strict' + +let Warning = require('./warning') + +class Result { + constructor(processor, root, opts) { + this.processor = processor + this.messages = [] + this.root = root + this.opts = opts + this.css = undefined + this.map = undefined + } + + toString() { + return this.css + } + + warn(text, opts = {}) { + if (!opts.plugin) { + if (this.lastPlugin && this.lastPlugin.postcssPlugin) { + opts.plugin = this.lastPlugin.postcssPlugin + } + } + + let warning = new Warning(text, opts) + this.messages.push(warning) + + return warning + } + + warnings() { + return this.messages.filter(i => i.type === 'warning') + } + + get content() { + return this.css + } +} + +module.exports = Result +Result.default = Result diff --git a/node_modules/postcss/lib/root.d.ts b/node_modules/postcss/lib/root.d.ts new file mode 100644 index 0000000..98fb4bc --- /dev/null +++ b/node_modules/postcss/lib/root.d.ts @@ -0,0 +1,86 @@ +import Container, { ContainerProps } from './container.js' +import Document from './document.js' +import { ProcessOptions } from './postcss.js' +import Result from './result.js' + +declare namespace Root { + export interface RootRaws extends Record { + /** + * The space symbols after the last child to the end of file. + */ + after?: string + + /** + * Non-CSS code after `Root`, when `Root` is inside `Document`. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + */ + codeAfter?: string + + /** + * Non-CSS code before `Root`, when `Root` is inside `Document`. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + */ + codeBefore?: string + + /** + * Is the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface RootProps extends ContainerProps { + /** + * Information used to generate byte-to-byte equal node string + * as it was in the origin input. + * */ + raws?: RootRaws + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Root_ as default } +} + +/** + * Represents a CSS file and contains all its parsed nodes. + * + * ```js + * const root = postcss.parse('a{color:black} b{z-index:2}') + * root.type //=> 'root' + * root.nodes.length //=> 2 + * ``` + */ +declare class Root_ extends Container { + parent: Document | undefined + raws: Root.RootRaws + type: 'root' + + constructor(defaults?: Root.RootProps) + + assign(overrides: object | Root.RootProps): this + clone(overrides?: Partial): Root + cloneAfter(overrides?: Partial): Root + cloneBefore(overrides?: Partial): Root + + /** + * Returns a `Result` instance representing the root’s CSS. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * root1.append(root2) + * const result = root1.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param opts Options. + * @return Result with current root’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Root extends Root_ {} + +export = Root diff --git a/node_modules/postcss/lib/root.js b/node_modules/postcss/lib/root.js new file mode 100644 index 0000000..ea574ed --- /dev/null +++ b/node_modules/postcss/lib/root.js @@ -0,0 +1,61 @@ +'use strict' + +let Container = require('./container') + +let LazyResult, Processor + +class Root extends Container { + constructor(defaults) { + super(defaults) + this.type = 'root' + if (!this.nodes) this.nodes = [] + } + + normalize(child, sample, type) { + let nodes = super.normalize(child) + + if (sample) { + if (type === 'prepend') { + if (this.nodes.length > 1) { + sample.raws.before = this.nodes[1].raws.before + } else { + delete sample.raws.before + } + } else if (this.first !== sample) { + for (let node of nodes) { + node.raws.before = sample.raws.before + } + } + } + + return nodes + } + + removeChild(child, ignore) { + let index = this.index(child) + + if (!ignore && index === 0 && this.nodes.length > 1) { + this.nodes[1].raws.before = this.nodes[index].raws.before + } + + return super.removeChild(child) + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts) + return lazy.stringify() + } +} + +Root.registerLazyResult = dependant => { + LazyResult = dependant +} + +Root.registerProcessor = dependant => { + Processor = dependant +} + +module.exports = Root +Root.default = Root + +Container.registerRoot(Root) diff --git a/node_modules/postcss/lib/rule.d.ts b/node_modules/postcss/lib/rule.d.ts new file mode 100644 index 0000000..04be5d6 --- /dev/null +++ b/node_modules/postcss/lib/rule.d.ts @@ -0,0 +1,113 @@ +import Container, { ContainerProps } from './container.js' + +declare namespace Rule { + export interface RuleRaws extends Record { + /** + * The space symbols after the last child of the node to the end of the node. + */ + after?: string + + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the selector and `{` for rules. + */ + between?: string + + /** + * Contains `true` if there is semicolon after rule. + */ + ownSemicolon?: string + + /** + * The rule’s selector with comments. + */ + selector?: { + raw: string + value: string + } + + /** + * Contains `true` if the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface RuleProps extends ContainerProps { + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: RuleRaws + /** Selector or selectors of the rule. */ + selector?: string + /** Selectors of the rule represented as an array of strings. */ + selectors?: string[] + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Rule_ as default } +} + +/** + * Represents a CSS rule: a selector followed by a declaration block. + * + * ```js + * Once (root, { Rule }) { + * let a = new Rule({ selector: 'a' }) + * a.append(…) + * root.append(a) + * } + * ``` + * + * ```js + * const root = postcss.parse('a{}') + * const rule = root.first + * rule.type //=> 'rule' + * rule.toString() //=> 'a{}' + * ``` + */ +declare class Rule_ extends Container { + parent: Container | undefined + raws: Rule.RuleRaws + /** + * The rule’s full selector represented as a string. + * + * ```js + * const root = postcss.parse('a, b { }') + * const rule = root.first + * rule.selector //=> 'a, b' + * ``` + */ + selector: string + + /** + * An array containing the rule’s individual selectors. + * Groups of selectors are split at commas. + * + * ```js + * const root = postcss.parse('a, b { }') + * const rule = root.first + * + * rule.selector //=> 'a, b' + * rule.selectors //=> ['a', 'b'] + * + * rule.selectors = ['a', 'strong'] + * rule.selector //=> 'a, strong' + * ``` + */ + selectors: string[] + + type: 'rule' + + constructor(defaults?: Rule.RuleProps) + assign(overrides: object | Rule.RuleProps): this + clone(overrides?: Partial): Rule + cloneAfter(overrides?: Partial): Rule + cloneBefore(overrides?: Partial): Rule +} + +declare class Rule extends Rule_ {} + +export = Rule diff --git a/node_modules/postcss/lib/rule.js b/node_modules/postcss/lib/rule.js new file mode 100644 index 0000000..a93ab25 --- /dev/null +++ b/node_modules/postcss/lib/rule.js @@ -0,0 +1,27 @@ +'use strict' + +let Container = require('./container') +let list = require('./list') + +class Rule extends Container { + constructor(defaults) { + super(defaults) + this.type = 'rule' + if (!this.nodes) this.nodes = [] + } + + get selectors() { + return list.comma(this.selector) + } + + set selectors(values) { + let match = this.selector ? this.selector.match(/,\s*/) : null + let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') + this.selector = values.join(sep) + } +} + +module.exports = Rule +Rule.default = Rule + +Container.registerRule(Rule) diff --git a/node_modules/postcss/lib/stringifier.d.ts b/node_modules/postcss/lib/stringifier.d.ts new file mode 100644 index 0000000..f707a6a --- /dev/null +++ b/node_modules/postcss/lib/stringifier.d.ts @@ -0,0 +1,46 @@ +import { + AnyNode, + AtRule, + Builder, + Comment, + Container, + Declaration, + Document, + Root, + Rule +} from './postcss.js' + +declare namespace Stringifier { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Stringifier_ as default } +} + +declare class Stringifier_ { + builder: Builder + constructor(builder: Builder) + atrule(node: AtRule, semicolon?: boolean): void + beforeAfter(node: AnyNode, detect: 'after' | 'before'): string + block(node: AnyNode, start: string): void + body(node: Container): void + comment(node: Comment): void + decl(node: Declaration, semicolon?: boolean): void + document(node: Document): void + raw(node: AnyNode, own: null | string, detect?: string): string + rawBeforeClose(root: Root): string | undefined + rawBeforeComment(root: Root, node: Comment): string | undefined + rawBeforeDecl(root: Root, node: Declaration): string | undefined + rawBeforeOpen(root: Root): string | undefined + rawBeforeRule(root: Root): string | undefined + rawColon(root: Root): string | undefined + rawEmptyBody(root: Root): string | undefined + rawIndent(root: Root): string | undefined + rawSemicolon(root: Root): boolean | undefined + rawValue(node: AnyNode, prop: string): string + root(node: Root): void + rule(node: Rule): void + stringify(node: AnyNode, semicolon?: boolean): void +} + +declare class Stringifier extends Stringifier_ {} + +export = Stringifier diff --git a/node_modules/postcss/lib/stringifier.js b/node_modules/postcss/lib/stringifier.js new file mode 100644 index 0000000..e07ad12 --- /dev/null +++ b/node_modules/postcss/lib/stringifier.js @@ -0,0 +1,353 @@ +'use strict' + +const DEFAULT_RAW = { + after: '\n', + beforeClose: '\n', + beforeComment: '\n', + beforeDecl: '\n', + beforeOpen: ' ', + beforeRule: '\n', + colon: ': ', + commentLeft: ' ', + commentRight: ' ', + emptyBody: '', + indent: ' ', + semicolon: false +} + +function capitalize(str) { + return str[0].toUpperCase() + str.slice(1) +} + +class Stringifier { + constructor(builder) { + this.builder = builder + } + + atrule(node, semicolon) { + let name = '@' + node.name + let params = node.params ? this.rawValue(node, 'params') : '' + + if (typeof node.raws.afterName !== 'undefined') { + name += node.raws.afterName + } else if (params) { + name += ' ' + } + + if (node.nodes) { + this.block(node, name + params) + } else { + let end = (node.raws.between || '') + (semicolon ? ';' : '') + this.builder(name + params + end, node) + } + } + + beforeAfter(node, detect) { + let value + if (node.type === 'decl') { + value = this.raw(node, null, 'beforeDecl') + } else if (node.type === 'comment') { + value = this.raw(node, null, 'beforeComment') + } else if (detect === 'before') { + value = this.raw(node, null, 'beforeRule') + } else { + value = this.raw(node, null, 'beforeClose') + } + + let buf = node.parent + let depth = 0 + while (buf && buf.type !== 'root') { + depth += 1 + buf = buf.parent + } + + if (value.includes('\n')) { + let indent = this.raw(node, null, 'indent') + if (indent.length) { + for (let step = 0; step < depth; step++) value += indent + } + } + + return value + } + + block(node, start) { + let between = this.raw(node, 'between', 'beforeOpen') + this.builder(start + between + '{', node, 'start') + + let after + if (node.nodes && node.nodes.length) { + this.body(node) + after = this.raw(node, 'after') + } else { + after = this.raw(node, 'after', 'emptyBody') + } + + if (after) this.builder(after) + this.builder('}', node, 'end') + } + + body(node) { + let last = node.nodes.length - 1 + while (last > 0) { + if (node.nodes[last].type !== 'comment') break + last -= 1 + } + + let semicolon = this.raw(node, 'semicolon') + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i] + let before = this.raw(child, 'before') + if (before) this.builder(before) + this.stringify(child, last !== i || semicolon) + } + } + + comment(node) { + let left = this.raw(node, 'left', 'commentLeft') + let right = this.raw(node, 'right', 'commentRight') + this.builder('/*' + left + node.text + right + '*/', node) + } + + decl(node, semicolon) { + let between = this.raw(node, 'between', 'colon') + let string = node.prop + between + this.rawValue(node, 'value') + + if (node.important) { + string += node.raws.important || ' !important' + } + + if (semicolon) string += ';' + this.builder(string, node) + } + + document(node) { + this.body(node) + } + + raw(node, own, detect) { + let value + if (!detect) detect = own + + // Already had + if (own) { + value = node.raws[own] + if (typeof value !== 'undefined') return value + } + + let parent = node.parent + + if (detect === 'before') { + // Hack for first rule in CSS + if (!parent || (parent.type === 'root' && parent.first === node)) { + return '' + } + + // `root` nodes in `document` should use only their own raws + if (parent && parent.type === 'document') { + return '' + } + } + + // Floating child without parent + if (!parent) return DEFAULT_RAW[detect] + + // Detect style by other nodes + let root = node.root() + if (!root.rawCache) root.rawCache = {} + if (typeof root.rawCache[detect] !== 'undefined') { + return root.rawCache[detect] + } + + if (detect === 'before' || detect === 'after') { + return this.beforeAfter(node, detect) + } else { + let method = 'raw' + capitalize(detect) + if (this[method]) { + value = this[method](root, node) + } else { + root.walk(i => { + value = i.raws[own] + if (typeof value !== 'undefined') return false + }) + } + } + + if (typeof value === 'undefined') value = DEFAULT_RAW[detect] + + root.rawCache[detect] = value + return value + } + + rawBeforeClose(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length > 0) { + if (typeof i.raws.after !== 'undefined') { + value = i.raws.after + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + } + }) + if (value) value = value.replace(/\S/g, '') + return value + } + + rawBeforeComment(root, node) { + let value + root.walkComments(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + }) + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeDecl') + } else if (value) { + value = value.replace(/\S/g, '') + } + return value + } + + rawBeforeDecl(root, node) { + let value + root.walkDecls(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + }) + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeRule') + } else if (value) { + value = value.replace(/\S/g, '') + } + return value + } + + rawBeforeOpen(root) { + let value + root.walk(i => { + if (i.type !== 'decl') { + value = i.raws.between + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawBeforeRule(root) { + let value + root.walk(i => { + if (i.nodes && (i.parent !== root || root.first !== i)) { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + } + }) + if (value) value = value.replace(/\S/g, '') + return value + } + + rawColon(root) { + let value + root.walkDecls(i => { + if (typeof i.raws.between !== 'undefined') { + value = i.raws.between.replace(/[^\s:]/g, '') + return false + } + }) + return value + } + + rawEmptyBody(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length === 0) { + value = i.raws.after + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawIndent(root) { + if (root.raws.indent) return root.raws.indent + let value + root.walk(i => { + let p = i.parent + if (p && p !== root && p.parent && p.parent === root) { + if (typeof i.raws.before !== 'undefined') { + let parts = i.raws.before.split('\n') + value = parts[parts.length - 1] + value = value.replace(/\S/g, '') + return false + } + } + }) + return value + } + + rawSemicolon(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length && i.last.type === 'decl') { + value = i.raws.semicolon + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawValue(node, prop) { + let value = node[prop] + let raw = node.raws[prop] + if (raw && raw.value === value) { + return raw.raw + } + + return value + } + + root(node) { + this.body(node) + if (node.raws.after) this.builder(node.raws.after) + } + + rule(node) { + this.block(node, this.rawValue(node, 'selector')) + if (node.raws.ownSemicolon) { + this.builder(node.raws.ownSemicolon, node, 'end') + } + } + + stringify(node, semicolon) { + /* c8 ignore start */ + if (!this[node.type]) { + throw new Error( + 'Unknown AST node type ' + + node.type + + '. ' + + 'Maybe you need to change PostCSS stringifier.' + ) + } + /* c8 ignore stop */ + this[node.type](node, semicolon) + } +} + +module.exports = Stringifier +Stringifier.default = Stringifier diff --git a/node_modules/postcss/lib/stringify.d.ts b/node_modules/postcss/lib/stringify.d.ts new file mode 100644 index 0000000..06ad0b4 --- /dev/null +++ b/node_modules/postcss/lib/stringify.d.ts @@ -0,0 +1,9 @@ +import { Stringifier } from './postcss.js' + +interface Stringify extends Stringifier { + default: Stringify +} + +declare const stringify: Stringify + +export = stringify diff --git a/node_modules/postcss/lib/stringify.js b/node_modules/postcss/lib/stringify.js new file mode 100644 index 0000000..77bd017 --- /dev/null +++ b/node_modules/postcss/lib/stringify.js @@ -0,0 +1,11 @@ +'use strict' + +let Stringifier = require('./stringifier') + +function stringify(node, builder) { + let str = new Stringifier(builder) + str.stringify(node) +} + +module.exports = stringify +stringify.default = stringify diff --git a/node_modules/postcss/lib/symbols.js b/node_modules/postcss/lib/symbols.js new file mode 100644 index 0000000..a142c26 --- /dev/null +++ b/node_modules/postcss/lib/symbols.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports.isClean = Symbol('isClean') + +module.exports.my = Symbol('my') diff --git a/node_modules/postcss/lib/terminal-highlight.js b/node_modules/postcss/lib/terminal-highlight.js new file mode 100644 index 0000000..6196c9d --- /dev/null +++ b/node_modules/postcss/lib/terminal-highlight.js @@ -0,0 +1,70 @@ +'use strict' + +let pico = require('picocolors') + +let tokenizer = require('./tokenize') + +let Input + +function registerInput(dependant) { + Input = dependant +} + +const HIGHLIGHT_THEME = { + ';': pico.yellow, + ':': pico.yellow, + '(': pico.cyan, + ')': pico.cyan, + '[': pico.yellow, + ']': pico.yellow, + '{': pico.yellow, + '}': pico.yellow, + 'at-word': pico.cyan, + 'brackets': pico.cyan, + 'call': pico.cyan, + 'class': pico.yellow, + 'comment': pico.gray, + 'hash': pico.magenta, + 'string': pico.green +} + +function getTokenType([type, value], processor) { + if (type === 'word') { + if (value[0] === '.') { + return 'class' + } + if (value[0] === '#') { + return 'hash' + } + } + + if (!processor.endOfFile()) { + let next = processor.nextToken() + processor.back(next) + if (next[0] === 'brackets' || next[0] === '(') return 'call' + } + + return type +} + +function terminalHighlight(css) { + let processor = tokenizer(new Input(css), { ignoreErrors: true }) + let result = '' + while (!processor.endOfFile()) { + let token = processor.nextToken() + let color = HIGHLIGHT_THEME[getTokenType(token, processor)] + if (color) { + result += token[1] + .split(/\r?\n/) + .map(i => color(i)) + .join('\n') + } else { + result += token[1] + } + } + return result +} + +terminalHighlight.registerInput = registerInput + +module.exports = terminalHighlight diff --git a/node_modules/postcss/lib/tokenize.js b/node_modules/postcss/lib/tokenize.js new file mode 100644 index 0000000..39a20a3 --- /dev/null +++ b/node_modules/postcss/lib/tokenize.js @@ -0,0 +1,266 @@ +'use strict' + +const SINGLE_QUOTE = "'".charCodeAt(0) +const DOUBLE_QUOTE = '"'.charCodeAt(0) +const BACKSLASH = '\\'.charCodeAt(0) +const SLASH = '/'.charCodeAt(0) +const NEWLINE = '\n'.charCodeAt(0) +const SPACE = ' '.charCodeAt(0) +const FEED = '\f'.charCodeAt(0) +const TAB = '\t'.charCodeAt(0) +const CR = '\r'.charCodeAt(0) +const OPEN_SQUARE = '['.charCodeAt(0) +const CLOSE_SQUARE = ']'.charCodeAt(0) +const OPEN_PARENTHESES = '('.charCodeAt(0) +const CLOSE_PARENTHESES = ')'.charCodeAt(0) +const OPEN_CURLY = '{'.charCodeAt(0) +const CLOSE_CURLY = '}'.charCodeAt(0) +const SEMICOLON = ';'.charCodeAt(0) +const ASTERISK = '*'.charCodeAt(0) +const COLON = ':'.charCodeAt(0) +const AT = '@'.charCodeAt(0) + +const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g +const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g +const RE_BAD_BRACKET = /.[\r\n"'(/\\]/ +const RE_HEX_ESCAPE = /[\da-f]/i + +module.exports = function tokenizer(input, options = {}) { + let css = input.css.valueOf() + let ignore = options.ignoreErrors + + let code, next, quote, content, escape + let escaped, escapePos, prev, n, currentToken + + let length = css.length + let pos = 0 + let buffer = [] + let returned = [] + + function position() { + return pos + } + + function unclosed(what) { + throw input.error('Unclosed ' + what, pos) + } + + function endOfFile() { + return returned.length === 0 && pos >= length + } + + function nextToken(opts) { + if (returned.length) return returned.pop() + if (pos >= length) return + + let ignoreUnclosed = opts ? opts.ignoreUnclosed : false + + code = css.charCodeAt(pos) + + switch (code) { + case NEWLINE: + case SPACE: + case TAB: + case CR: + case FEED: { + next = pos + do { + next += 1 + code = css.charCodeAt(next) + } while ( + code === SPACE || + code === NEWLINE || + code === TAB || + code === CR || + code === FEED + ) + + currentToken = ['space', css.slice(pos, next)] + pos = next - 1 + break + } + + case OPEN_SQUARE: + case CLOSE_SQUARE: + case OPEN_CURLY: + case CLOSE_CURLY: + case COLON: + case SEMICOLON: + case CLOSE_PARENTHESES: { + let controlChar = String.fromCharCode(code) + currentToken = [controlChar, controlChar, pos] + break + } + + case OPEN_PARENTHESES: { + prev = buffer.length ? buffer.pop()[1] : '' + n = css.charCodeAt(pos + 1) + if ( + prev === 'url' && + n !== SINGLE_QUOTE && + n !== DOUBLE_QUOTE && + n !== SPACE && + n !== NEWLINE && + n !== TAB && + n !== FEED && + n !== CR + ) { + next = pos + do { + escaped = false + next = css.indexOf(')', next + 1) + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + break + } else { + unclosed('bracket') + } + } + escapePos = next + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1 + escaped = !escaped + } + } while (escaped) + + currentToken = ['brackets', css.slice(pos, next + 1), pos, next] + + pos = next + } else { + next = css.indexOf(')', pos + 1) + content = css.slice(pos, next + 1) + + if (next === -1 || RE_BAD_BRACKET.test(content)) { + currentToken = ['(', '(', pos] + } else { + currentToken = ['brackets', content, pos, next] + pos = next + } + } + + break + } + + case SINGLE_QUOTE: + case DOUBLE_QUOTE: { + quote = code === SINGLE_QUOTE ? "'" : '"' + next = pos + do { + escaped = false + next = css.indexOf(quote, next + 1) + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + 1 + break + } else { + unclosed('string') + } + } + escapePos = next + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1 + escaped = !escaped + } + } while (escaped) + + currentToken = ['string', css.slice(pos, next + 1), pos, next] + pos = next + break + } + + case AT: { + RE_AT_END.lastIndex = pos + 1 + RE_AT_END.test(css) + if (RE_AT_END.lastIndex === 0) { + next = css.length - 1 + } else { + next = RE_AT_END.lastIndex - 2 + } + + currentToken = ['at-word', css.slice(pos, next + 1), pos, next] + + pos = next + break + } + + case BACKSLASH: { + next = pos + escape = true + while (css.charCodeAt(next + 1) === BACKSLASH) { + next += 1 + escape = !escape + } + code = css.charCodeAt(next + 1) + if ( + escape && + code !== SLASH && + code !== SPACE && + code !== NEWLINE && + code !== TAB && + code !== CR && + code !== FEED + ) { + next += 1 + if (RE_HEX_ESCAPE.test(css.charAt(next))) { + while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { + next += 1 + } + if (css.charCodeAt(next + 1) === SPACE) { + next += 1 + } + } + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next] + + pos = next + break + } + + default: { + if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { + next = css.indexOf('*/', pos + 2) + 1 + if (next === 0) { + if (ignore || ignoreUnclosed) { + next = css.length + } else { + unclosed('comment') + } + } + + currentToken = ['comment', css.slice(pos, next + 1), pos, next] + pos = next + } else { + RE_WORD_END.lastIndex = pos + 1 + RE_WORD_END.test(css) + if (RE_WORD_END.lastIndex === 0) { + next = css.length - 1 + } else { + next = RE_WORD_END.lastIndex - 2 + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next] + buffer.push(currentToken) + pos = next + } + + break + } + } + + pos++ + return currentToken + } + + function back(token) { + returned.push(token) + } + + return { + back, + endOfFile, + nextToken, + position + } +} diff --git a/node_modules/postcss/lib/warn-once.js b/node_modules/postcss/lib/warn-once.js new file mode 100644 index 0000000..316e1cf --- /dev/null +++ b/node_modules/postcss/lib/warn-once.js @@ -0,0 +1,13 @@ +/* eslint-disable no-console */ +'use strict' + +let printed = {} + +module.exports = function warnOnce(message) { + if (printed[message]) return + printed[message] = true + + if (typeof console !== 'undefined' && console.warn) { + console.warn(message) + } +} diff --git a/node_modules/postcss/lib/warning.d.ts b/node_modules/postcss/lib/warning.d.ts new file mode 100644 index 0000000..b25bba8 --- /dev/null +++ b/node_modules/postcss/lib/warning.d.ts @@ -0,0 +1,147 @@ +import { RangePosition } from './css-syntax-error.js' +import Node from './node.js' + +declare namespace Warning { + export interface WarningOptions { + /** + * End position, exclusive, in CSS node string that caused the warning. + */ + end?: RangePosition + + /** + * End index, exclusive, in CSS node string that caused the warning. + */ + endIndex?: number + + /** + * Start index, inclusive, in CSS node string that caused the warning. + */ + index?: number + + /** + * CSS node that caused the warning. + */ + node?: Node + + /** + * Name of the plugin that created this warning. `Result#warn` fills + * this property automatically. + */ + plugin?: string + + /** + * Start position, inclusive, in CSS node string that caused the warning. + */ + start?: RangePosition + + /** + * Word in CSS source that caused the warning. + */ + word?: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Warning_ as default } +} + +/** + * Represents a plugin’s warning. It can be created using `Node#warn`. + * + * ```js + * if (decl.important) { + * decl.warn(result, 'Avoid !important', { word: '!important' }) + * } + * ``` + */ +declare class Warning_ { + /** + * Column for inclusive start position in the input file with this warning’s source. + * + * ```js + * warning.column //=> 6 + * ``` + */ + column: number + + /** + * Column for exclusive end position in the input file with this warning’s source. + * + * ```js + * warning.endColumn //=> 4 + * ``` + */ + endColumn?: number + + /** + * Line for exclusive end position in the input file with this warning’s source. + * + * ```js + * warning.endLine //=> 6 + * ``` + */ + endLine?: number + + /** + * Line for inclusive start position in the input file with this warning’s source. + * + * ```js + * warning.line //=> 5 + * ``` + */ + line: number + + /** + * Contains the CSS node that caused the warning. + * + * ```js + * warning.node.toString() //=> 'color: white !important' + * ``` + */ + node: Node + + /** + * The name of the plugin that created this warning. + * When you call `Node#warn` it will fill this property automatically. + * + * ```js + * warning.plugin //=> 'postcss-important' + * ``` + */ + plugin: string + + /** + * The warning message. + * + * ```js + * warning.text //=> 'Try to avoid !important' + * ``` + */ + text: string + + /** + * Type to filter warnings from `Result#messages`. + * Always equal to `"warning"`. + */ + type: 'warning' + + /** + * @param text Warning message. + * @param opts Warning options. + */ + constructor(text: string, opts?: Warning.WarningOptions) + + /** + * Returns a warning position and message. + * + * ```js + * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important' + * ``` + * + * @return Warning position and message. + */ + toString(): string +} + +declare class Warning extends Warning_ {} + +export = Warning diff --git a/node_modules/postcss/lib/warning.js b/node_modules/postcss/lib/warning.js new file mode 100644 index 0000000..3a3d79c --- /dev/null +++ b/node_modules/postcss/lib/warning.js @@ -0,0 +1,37 @@ +'use strict' + +class Warning { + constructor(text, opts = {}) { + this.type = 'warning' + this.text = text + + if (opts.node && opts.node.source) { + let range = opts.node.rangeBy(opts) + this.line = range.start.line + this.column = range.start.column + this.endLine = range.end.line + this.endColumn = range.end.column + } + + for (let opt in opts) this[opt] = opts[opt] + } + + toString() { + if (this.node) { + return this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word + }).message + } + + if (this.plugin) { + return this.plugin + ': ' + this.text + } + + return this.text + } +} + +module.exports = Warning +Warning.default = Warning diff --git a/node_modules/postcss/package.json b/node_modules/postcss/package.json new file mode 100644 index 0000000..d68db86 --- /dev/null +++ b/node_modules/postcss/package.json @@ -0,0 +1,88 @@ +{ + "name": "postcss", + "version": "8.4.31", + "description": "Tool for transforming styles with JS plugins", + "engines": { + "node": "^10 || ^12 || >=14" + }, + "exports": { + ".": { + "require": "./lib/postcss.js", + "import": "./lib/postcss.mjs" + }, + "./lib/at-rule": "./lib/at-rule.js", + "./lib/comment": "./lib/comment.js", + "./lib/container": "./lib/container.js", + "./lib/css-syntax-error": "./lib/css-syntax-error.js", + "./lib/declaration": "./lib/declaration.js", + "./lib/fromJSON": "./lib/fromJSON.js", + "./lib/input": "./lib/input.js", + "./lib/lazy-result": "./lib/lazy-result.js", + "./lib/no-work-result": "./lib/no-work-result.js", + "./lib/list": "./lib/list.js", + "./lib/map-generator": "./lib/map-generator.js", + "./lib/node": "./lib/node.js", + "./lib/parse": "./lib/parse.js", + "./lib/parser": "./lib/parser.js", + "./lib/postcss": "./lib/postcss.js", + "./lib/previous-map": "./lib/previous-map.js", + "./lib/processor": "./lib/processor.js", + "./lib/result": "./lib/result.js", + "./lib/root": "./lib/root.js", + "./lib/rule": "./lib/rule.js", + "./lib/stringifier": "./lib/stringifier.js", + "./lib/stringify": "./lib/stringify.js", + "./lib/symbols": "./lib/symbols.js", + "./lib/terminal-highlight": "./lib/terminal-highlight.js", + "./lib/tokenize": "./lib/tokenize.js", + "./lib/warn-once": "./lib/warn-once.js", + "./lib/warning": "./lib/warning.js", + "./package.json": "./package.json" + }, + "main": "./lib/postcss.js", + "types": "./lib/postcss.d.ts", + "keywords": [ + "css", + "postcss", + "rework", + "preprocessor", + "parser", + "source map", + "transform", + "manipulation", + "transpiler" + ], + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "homepage": "https://postcss.org/", + "repository": "postcss/postcss", + "bugs": { + "url": "https://github.com/postcss/postcss/issues" + }, + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "browser": { + "./lib/terminal-highlight": false, + "source-map-js": false, + "path": false, + "url": false, + "fs": false + } +} diff --git a/node_modules/queue-microtask/LICENSE b/node_modules/queue-microtask/LICENSE new file mode 100644 index 0000000..c7e6852 --- /dev/null +++ b/node_modules/queue-microtask/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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/queue-microtask/README.md b/node_modules/queue-microtask/README.md new file mode 100644 index 0000000..0be05a6 --- /dev/null +++ b/node_modules/queue-microtask/README.md @@ -0,0 +1,90 @@ +# queue-microtask [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[ci-image]: https://img.shields.io/github/workflow/status/feross/queue-microtask/ci/master +[ci-url]: https://github.com/feross/queue-microtask/actions +[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg +[npm-url]: https://npmjs.org/package/queue-microtask +[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg +[downloads-url]: https://npmjs.org/package/queue-microtask +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines + +- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all modern JS engines. +- No dependencies. Less than 10 lines. No shims or complicated fallbacks. +- Optimal performance in all modern environments + - Uses `queueMicrotask` in modern environments + - Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (same performance as `queueMicrotask`) + +## install + +``` +npm install queue-microtask +``` + +## usage + +```js +const queueMicrotask = require('queue-microtask') + +queueMicrotask(() => { /* this will run soon */ }) +``` + +## What is `queueMicrotask` and why would one use it? + +The `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop. + +A microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop. + +The code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node. + +Using microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context. + +See the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information. + +## Who is this package for? + +This package allows you to use `queueMicrotask` safely in all modern JS engines. Use it if you prioritize small JS bundle size over support for old browsers. + +If you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package. + +## Why not use `process.nextTick`? + +In Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations. + +You can think of `queueMicrotask` as a standardized version of `process.nextTick` that works in the browser. No need to rely on your browser bundler to shim `process` for the browser environment. + +## Why not use `setTimeout(fn, 0)`? + +This approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program. + +## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)? + +These packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package. + +This package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically. + +Note: This package throws an exception in JS environments which lack `Promise` support -- which are usually very old browsers and Node.js versions. + +Since the `queueMicrotask` API is supported in Node.js, Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get optimal performance**. Any JS environment with `Promise`, which is almost all of them, also get optimal performance. If you need support for JS environments which lack `Promise` support, use one of the alternative packages. + +## What is a shim? + +> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. – [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing)) + +This package could also be described as a "ponyfill". + +> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. – [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills) + +## API + +### `queueMicrotask(fn)` + +The `queueMicrotask()` method queues a microtask. + +The `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop. + +## license + +MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org). diff --git a/node_modules/queue-microtask/index.d.ts b/node_modules/queue-microtask/index.d.ts new file mode 100644 index 0000000..b6a8646 --- /dev/null +++ b/node_modules/queue-microtask/index.d.ts @@ -0,0 +1,2 @@ +declare const queueMicrotask: (cb: () => void) => void +export = queueMicrotask diff --git a/node_modules/queue-microtask/index.js b/node_modules/queue-microtask/index.js new file mode 100644 index 0000000..5560534 --- /dev/null +++ b/node_modules/queue-microtask/index.js @@ -0,0 +1,9 @@ +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ +let promise + +module.exports = typeof queueMicrotask === 'function' + ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) + // reuse resolved promise, and allocate it lazily + : cb => (promise || (promise = Promise.resolve())) + .then(cb) + .catch(err => setTimeout(() => { throw err }, 0)) diff --git a/node_modules/queue-microtask/package.json b/node_modules/queue-microtask/package.json new file mode 100644 index 0000000..d29a401 --- /dev/null +++ b/node_modules/queue-microtask/package.json @@ -0,0 +1,55 @@ +{ + "name": "queue-microtask", + "description": "fast, tiny `queueMicrotask` shim for modern engines", + "version": "1.2.3", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/queue-microtask/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.2.2" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "homepage": "https://github.com/feross/queue-microtask", + "keywords": [ + "asap", + "immediate", + "micro task", + "microtask", + "nextTick", + "process.nextTick", + "queue micro task", + "queue microtask", + "queue-microtask", + "queueMicrotask", + "setImmediate", + "task" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/queue-microtask.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/read-cache/LICENSE b/node_modules/read-cache/LICENSE new file mode 100644 index 0000000..4b98a41 --- /dev/null +++ b/node_modules/read-cache/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2016 Bogdan Chadkin + +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/read-cache/README.md b/node_modules/read-cache/README.md new file mode 100644 index 0000000..16a5c36 --- /dev/null +++ b/node_modules/read-cache/README.md @@ -0,0 +1,46 @@ +# read-cache [![Build Status](https://travis-ci.org/TrySound/read-cache.svg?branch=master)](https://travis-ci.org/TrySound/read-cache) + +Reads and caches the entire contents of a file until it is modified. + + +## Install + +``` +$ npm i read-cache +``` + + +## Usage + +```js +// foo.js +var readCache = require('read-cache'); + +readCache('foo.js').then(function (contents) { + console.log(contents); +}); +``` + + +## API + +### readCache(path[, encoding]) + +Returns a promise that resolves with the file's contents. + +### readCache.sync(path[, encoding]) + +Returns the content of the file. + +### readCache.get(path[, encoding]) + +Returns the content of cached file or null. + +### readCache.clear() + +Clears the contents of the cache. + + +## License + +MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru) diff --git a/node_modules/read-cache/index.js b/node_modules/read-cache/index.js new file mode 100644 index 0000000..b5263e6 --- /dev/null +++ b/node_modules/read-cache/index.js @@ -0,0 +1,78 @@ +var fs = require('fs'); +var path = require('path'); +var pify = require('pify'); + +var stat = pify(fs.stat); +var readFile = pify(fs.readFile); +var resolve = path.resolve; + +var cache = Object.create(null); + +function convert(content, encoding) { + if (Buffer.isEncoding(encoding)) { + return content.toString(encoding); + } + return content; +} + +module.exports = function (path, encoding) { + path = resolve(path); + + return stat(path).then(function (stats) { + var item = cache[path]; + + if (item && item.mtime.getTime() === stats.mtime.getTime()) { + return convert(item.content, encoding); + } + + return readFile(path).then(function (data) { + cache[path] = { + mtime: stats.mtime, + content: data + }; + + return convert(data, encoding); + }); + }).catch(function (err) { + cache[path] = null; + return Promise.reject(err); + }); +}; + +module.exports.sync = function (path, encoding) { + path = resolve(path); + + try { + var stats = fs.statSync(path); + var item = cache[path]; + + if (item && item.mtime.getTime() === stats.mtime.getTime()) { + return convert(item.content, encoding); + } + + var data = fs.readFileSync(path); + + cache[path] = { + mtime: stats.mtime, + content: data + }; + + return convert(data, encoding); + } catch (err) { + cache[path] = null; + throw err; + } + +}; + +module.exports.get = function (path, encoding) { + path = resolve(path); + if (cache[path]) { + return convert(cache[path].content, encoding); + } + return null; +}; + +module.exports.clear = function () { + cache = Object.create(null); +}; diff --git a/node_modules/read-cache/package.json b/node_modules/read-cache/package.json new file mode 100644 index 0000000..87199b0 --- /dev/null +++ b/node_modules/read-cache/package.json @@ -0,0 +1,34 @@ +{ + "name": "read-cache", + "version": "1.0.0", + "description": "Reads and caches the entire contents of a file until it is modified", + "files": [ + "index.js" + ], + "main": "index.js", + "scripts": { + "test": "ava" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/TrySound/read-cache.git" + }, + "keywords": [ + "fs", + "read", + "cache" + ], + "author": "Bogdan Chadkin ", + "license": "MIT", + "bugs": { + "url": "https://github.com/TrySound/read-cache/issues" + }, + "homepage": "https://github.com/TrySound/read-cache#readme", + "devDependencies": { + "ava": "^0.9.1", + "del": "^2.2.0" + }, + "dependencies": { + "pify": "^2.3.0" + } +} diff --git a/node_modules/readdirp/LICENSE b/node_modules/readdirp/LICENSE new file mode 100644 index 0000000..037cbb4 --- /dev/null +++ b/node_modules/readdirp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) + +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/readdirp/README.md b/node_modules/readdirp/README.md new file mode 100644 index 0000000..465593c --- /dev/null +++ b/node_modules/readdirp/README.md @@ -0,0 +1,122 @@ +# readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp) + +Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. + + +```sh +npm install readdirp +``` + +```javascript +const readdirp = require('readdirp'); + +// Use streams to achieve small RAM & CPU footprint. +// 1) Streams example with for-await. +for await (const entry of readdirp('.')) { + const {path} = entry; + console.log(`${JSON.stringify({path})}`); +} + +// 2) Streams example, non for-await. +// Print out all JS files along with their size within the current folder & subfolders. +readdirp('.', {fileFilter: '*.js', alwaysStat: true}) + .on('data', (entry) => { + const {path, stats: {size}} = entry; + console.log(`${JSON.stringify({path, size})}`); + }) + // Optionally call stream.destroy() in `warn()` in order to abort and cause 'close' to be emitted + .on('warn', error => console.error('non-fatal error', error)) + .on('error', error => console.error('fatal error', error)) + .on('end', () => console.log('done')); + +// 3) Promise example. More RAM and CPU than streams / for-await. +const files = await readdirp.promise('.'); +console.log(files.map(file => file.path)); + +// Other options. +readdirp('test', { + fileFilter: '*.js', + directoryFilter: ['!.git', '!*modules'] + // directoryFilter: (di) => di.basename.length === 9 + type: 'files_directories', + depth: 1 +}); +``` + +For more examples, check out `examples` directory. + +## API + +`const stream = readdirp(root[, options])` — **Stream API** + +- Reads given root recursively and returns a `stream` of [entry infos](#entryinfo) +- Optionally can be used like `for await (const entry of stream)` with node.js 10+ (`asyncIterator`). +- `on('data', (entry) => {})` [entry info](#entryinfo) for every file / dir. +- `on('warn', (error) => {})` non-fatal `Error` that prevents a file / dir from being processed. Example: inaccessible to the user. +- `on('error', (error) => {})` fatal `Error` which also ends the stream. Example: illegal options where passed. +- `on('end')` — we are done. Called when all entries were found and no more will be emitted. +- `on('close')` — stream is destroyed via `stream.destroy()`. + Could be useful if you want to manually abort even on a non fatal error. + At that point the stream is no longer `readable` and no more entries, warning or errors are emitted +- To learn more about streams, consult the very detailed [nodejs streams documentation](https://nodejs.org/api/stream.html) + or the [stream-handbook](https://github.com/substack/stream-handbook) + +`const entries = await readdirp.promise(root[, options])` — **Promise API**. Returns a list of [entry infos](#entryinfo). + +First argument is awalys `root`, path in which to start reading and recursing into subdirectories. + +### options + +- `fileFilter: ["*.js"]`: filter to include or exclude files. A `Function`, Glob string or Array of glob strings. + - **Function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry + - **Glob string**: a string (e.g., `*.js`) which is matched using [picomatch](https://github.com/micromatch/picomatch), so go there for more + information. Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense. Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files. + - **Array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown. + `['*.json', '*.js']` includes all JavaScript and Json files. + `['!.git', '!node_modules']` includes all directories except the '.git' and 'node_modules'. + - Directories that do not pass a filter will not be recursed into. +- `directoryFilter: ['!.git']`: filter to include/exclude directories found and to recurse into. Directories that do not pass a filter will not be recursed into. +- `depth: 5`: depth at which to stop recursing even if more subdirectories are found +- `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. +- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. +- `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat` + +### `EntryInfo` + +Has the following properties: + +- `path: 'assets/javascripts/react.js'`: path to the file/directory (relative to given root) +- `fullPath: '/Users/dev/projects/app/assets/javascripts/react.js'`: full path to the file/directory found +- `basename: 'react.js'`: name of the file/directory +- `dirent: fs.Dirent`: built-in [dir entry object](https://nodejs.org/api/fs.html#fs_class_fs_dirent) - only with `alwaysStat: false` +- `stats: fs.Stats`: built in [stat object](https://nodejs.org/api/fs.html#fs_class_fs_stats) - only with `alwaysStat: true` + +## Changelog + +- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks. + Before, it could have entered infinite loop. +- 3.4 (Mar 19, 2020) adds support for directory-based symlinks. +- 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping. +- 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic. +- 3.1 (Jul 7, 2019) brings `bigint` support to `stat` output on Windows. This is backwards-incompatible for some cases. Be careful. It you use it incorrectly, you'll see "TypeError: Cannot mix BigInt and other types, use explicit conversions". +- 3.0 brings huge performance improvements and stream backpressure support. +- Upgrading 2.x to 3.x: + - Signature changed from `readdirp(options)` to `readdirp(root, options)` + - Replaced callback API with promise API. + - Renamed `entryType` option to `type` + - Renamed `entryType: 'both'` to `'files_directories'` + - `EntryInfo` + - Renamed `stat` to `stats` + - Emitted only when `alwaysStat: true` + - `dirent` is emitted instead of `stats` by default with `alwaysStat: false` + - Renamed `name` to `basename` + - Removed `parentDir` and `fullParentDir` properties +- Supported node.js versions: + - 3.x: node 8+ + - 2.x: node 0.6+ + +## License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller () + +MIT License, see [LICENSE](LICENSE) file. diff --git a/node_modules/readdirp/index.d.ts b/node_modules/readdirp/index.d.ts new file mode 100644 index 0000000..cbbd76c --- /dev/null +++ b/node_modules/readdirp/index.d.ts @@ -0,0 +1,43 @@ +// TypeScript Version: 3.2 + +/// + +import * as fs from 'fs'; +import { Readable } from 'stream'; + +declare namespace readdir { + interface EntryInfo { + path: string; + fullPath: string; + basename: string; + stats?: fs.Stats; + dirent?: fs.Dirent; + } + + interface ReaddirpOptions { + root?: string; + fileFilter?: string | string[] | ((entry: EntryInfo) => boolean); + directoryFilter?: string | string[] | ((entry: EntryInfo) => boolean); + type?: 'files' | 'directories' | 'files_directories' | 'all'; + lstat?: boolean; + depth?: number; + alwaysStat?: boolean; + } + + interface ReaddirpStream extends Readable, AsyncIterable { + read(): EntryInfo; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + function promise( + root: string, + options?: ReaddirpOptions + ): Promise; +} + +declare function readdir( + root: string, + options?: readdir.ReaddirpOptions +): readdir.ReaddirpStream; + +export = readdir; diff --git a/node_modules/readdirp/index.js b/node_modules/readdirp/index.js new file mode 100644 index 0000000..cf739b2 --- /dev/null +++ b/node_modules/readdirp/index.js @@ -0,0 +1,287 @@ +'use strict'; + +const fs = require('fs'); +const { Readable } = require('stream'); +const sysPath = require('path'); +const { promisify } = require('util'); +const picomatch = require('picomatch'); + +const readdir = promisify(fs.readdir); +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const realpath = promisify(fs.realpath); + +/** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + +const BANG = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } +}; + +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } +} + +/** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); +}; + +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; + +readdirp.promise = readdirpPromise; +readdirp.ReaddirpStream = ReaddirpStream; +readdirp.default = readdirp; + +module.exports = readdirp; diff --git a/node_modules/readdirp/package.json b/node_modules/readdirp/package.json new file mode 100644 index 0000000..dba5388 --- /dev/null +++ b/node_modules/readdirp/package.json @@ -0,0 +1,122 @@ +{ + "name": "readdirp", + "description": "Recursive version of fs.readdir with streaming API.", + "version": "3.6.0", + "homepage": "https://github.com/paulmillr/readdirp", + "repository": { + "type": "git", + "url": "git://github.com/paulmillr/readdirp.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/paulmillr/readdirp/issues" + }, + "author": "Thorsten Lorenz (thlorenz.com)", + "contributors": [ + "Thorsten Lorenz (thlorenz.com)", + "Paul Miller (https://paulmillr.com)" + ], + "main": "index.js", + "engines": { + "node": ">=8.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "recursive", + "fs", + "stream", + "streams", + "readdir", + "filesystem", + "find", + "filter" + ], + "scripts": { + "dtslint": "dtslint", + "nyc": "nyc", + "mocha": "mocha --exit", + "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", + "test": "npm run lint && nyc npm run mocha" + }, + "dependencies": { + "picomatch": "^2.2.1" + }, + "devDependencies": { + "@types/node": "^14", + "chai": "^4.2", + "chai-subset": "^1.6", + "dtslint": "^3.3.0", + "eslint": "^7.0.0", + "mocha": "^7.1.1", + "nyc": "^15.0.0", + "rimraf": "^3.0.0", + "typescript": "^4.0.3" + }, + "nyc": { + "reporter": [ + "html", + "text" + ] + }, + "eslintConfig": { + "root": true, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "script" + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "array-callback-return": "error", + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], + "no-else-return": [ + "error", + { + "allowElseIf": false + } + ], + "no-lonely-if": "error", + "no-var": "error", + "object-shorthand": "error", + "prefer-arrow-callback": [ + "error", + { + "allowNamedFunctions": true + } + ], + "prefer-const": [ + "error", + { + "ignoreReadBeforeAssign": true + } + ], + "prefer-destructuring": [ + "error", + { + "object": true, + "array": false + } + ], + "prefer-spread": "error", + "prefer-template": "error", + "radix": "error", + "semi": "error", + "strict": "error", + "quotes": [ + "error", + "single" + ] + } + } +} diff --git a/node_modules/resolve/.editorconfig b/node_modules/resolve/.editorconfig new file mode 100644 index 0000000..d63f0bb --- /dev/null +++ b/node_modules/resolve/.editorconfig @@ -0,0 +1,37 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 200 + +[*.js] +block_comment_start = /* +block_comment = * +block_comment_end = */ + +[*.yml] +indent_size = 1 + +[package.json] +indent_style = tab + +[lib/core.json] +indent_style = tab + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[{*.json,Makefile}] +max_line_length = off + +[test/{dotdot,resolver,module_dir,multirepo,node_path,pathfilter,precedence}/**/*] +indent_style = off +indent_size = off +max_line_length = off +insert_final_newline = off diff --git a/node_modules/resolve/.eslintrc b/node_modules/resolve/.eslintrc new file mode 100644 index 0000000..ad05dd8 --- /dev/null +++ b/node_modules/resolve/.eslintrc @@ -0,0 +1,65 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "indent": [2, 4], + "strict": 0, + "complexity": 0, + "consistent-return": 0, + "curly": 0, + "dot-notation": [2, { "allowKeywords": true }], + "func-name-matching": 0, + "func-style": 0, + "global-require": 1, + "id-length": [2, { "min": 1, "max": 40 }], + "max-lines": [2, 350], + "max-lines-per-function": 0, + "max-nested-callbacks": 0, + "max-params": 0, + "max-statements-per-line": [2, { "max": 2 }], + "max-statements": 0, + "no-magic-numbers": 0, + "no-shadow": 0, + "no-use-before-define": 0, + "sort-keys": 0, + }, + "overrides": [ + { + "files": "bin/**", + "rules": { + "no-process-exit": "off", + }, + }, + { + "files": "example/**", + "rules": { + "no-console": 0, + }, + }, + { + "files": "test/resolver/nested_symlinks/mylib/*.js", + "rules": { + "no-throw-literal": 0, + }, + }, + { + "files": "test/**", + "parserOptions": { + "ecmaVersion": 5, + "allowReserved": false, + }, + "rules": { + "dot-notation": [2, { "allowPattern": "throws" }], + "max-lines": 0, + "max-lines-per-function": 0, + "no-unused-vars": [2, { "vars": "all", "args": "none" }], + }, + }, + ], + + "ignorePatterns": [ + "./test/resolver/malformed_package_json/package.json", + ], +} diff --git a/node_modules/resolve/.github/FUNDING.yml b/node_modules/resolve/.github/FUNDING.yml new file mode 100644 index 0000000..d9c0595 --- /dev/null +++ b/node_modules/resolve/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/resolve +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/resolve/LICENSE b/node_modules/resolve/LICENSE new file mode 100644 index 0000000..ff4fce2 --- /dev/null +++ b/node_modules/resolve/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012 James Halliday + +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/resolve/SECURITY.md b/node_modules/resolve/SECURITY.md new file mode 100644 index 0000000..82e4285 --- /dev/null +++ b/node_modules/resolve/SECURITY.md @@ -0,0 +1,3 @@ +# Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. diff --git a/node_modules/resolve/async.js b/node_modules/resolve/async.js new file mode 100644 index 0000000..f38c581 --- /dev/null +++ b/node_modules/resolve/async.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/async'); diff --git a/node_modules/resolve/bin/resolve b/node_modules/resolve/bin/resolve new file mode 100644 index 0000000..21d1a87 --- /dev/null +++ b/node_modules/resolve/bin/resolve @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +if ( + String(process.env.npm_lifecycle_script).slice(0, 8) !== 'resolve ' + && ( + !process.argv + || process.argv.length < 2 + || (process.argv[1] !== __filename && fs.statSync(process.argv[1]).ino !== fs.statSync(__filename).ino) + || (process.env.npm_lifecycle_event !== 'npx' && process.env._ && fs.realpathSync(path.resolve(process.env._)) !== __filename) + ) +) { + console.error('Error: `resolve` must be run directly as an executable'); + process.exit(1); +} + +var supportsPreserveSymlinkFlag = require('supports-preserve-symlinks-flag'); + +var preserveSymlinks = false; +for (var i = 2; i < process.argv.length; i += 1) { + if (process.argv[i].slice(0, 2) === '--') { + if (supportsPreserveSymlinkFlag && process.argv[i] === '--preserve-symlinks') { + preserveSymlinks = true; + } else if (process.argv[i].length > 2) { + console.error('Unknown argument ' + process.argv[i].replace(/[=].*$/, '')); + process.exit(2); + } + process.argv.splice(i, 1); + i -= 1; + if (process.argv[i] === '--') { break; } // eslint-disable-line no-restricted-syntax + } +} + +if (process.argv.length < 3) { + console.error('Error: `resolve` expects a specifier'); + process.exit(2); +} + +var resolve = require('../'); + +var result = resolve.sync(process.argv[2], { + basedir: process.cwd(), + preserveSymlinks: preserveSymlinks +}); + +console.log(result); diff --git a/node_modules/resolve/example/async.js b/node_modules/resolve/example/async.js new file mode 100644 index 0000000..20e65dc --- /dev/null +++ b/node_modules/resolve/example/async.js @@ -0,0 +1,5 @@ +var resolve = require('../'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); diff --git a/node_modules/resolve/example/sync.js b/node_modules/resolve/example/sync.js new file mode 100644 index 0000000..54b2cc1 --- /dev/null +++ b/node_modules/resolve/example/sync.js @@ -0,0 +1,3 @@ +var resolve = require('../'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); diff --git a/node_modules/resolve/index.js b/node_modules/resolve/index.js new file mode 100644 index 0000000..125d814 --- /dev/null +++ b/node_modules/resolve/index.js @@ -0,0 +1,6 @@ +var async = require('./lib/async'); +async.core = require('./lib/core'); +async.isCore = require('./lib/is-core'); +async.sync = require('./lib/sync'); + +module.exports = async; diff --git a/node_modules/resolve/lib/async.js b/node_modules/resolve/lib/async.js new file mode 100644 index 0000000..60d2555 --- /dev/null +++ b/node_modules/resolve/lib/async.js @@ -0,0 +1,329 @@ +var fs = require('fs'); +var getHomedir = require('./homedir'); +var path = require('path'); +var caller = require('./caller'); +var nodeModulesPaths = require('./node-modules-paths'); +var normalizeOptions = require('./normalize-options'); +var isCore = require('is-core-module'); + +var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + +var homedir = getHomedir(); +var defaultPaths = function () { + return [ + path.join(homedir, '.node_modules'), + path.join(homedir, '.node_libraries') + ]; +}; + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultIsDir = function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultRealpath = function realpath(x, cb) { + realpathFS(x, function (realpathErr, realPath) { + if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); + else cb(null, realpathErr ? x : realPath); + }); +}; + +var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { + if (opts && opts.preserveSymlinks === false) { + realpath(x, cb); + } else { + cb(null, x); + } +}; + +var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) { + readFile(pkgfile, function (readFileErr, body) { + if (readFileErr) cb(readFileErr); + else { + try { + var pkg = JSON.parse(body); + cb(null, pkg); + } catch (jsonErr) { + cb(null); + } + } + }); +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + var isFile = opts.isFile || defaultIsFile; + var isDirectory = opts.isDirectory || defaultIsDir; + var readFile = opts.readFile || fs.readFile; + var realpath = opts.realpath || defaultRealpath; + var readPackage = opts.readPackage || defaultReadPackage; + if (opts.readFile && opts.readPackage) { + var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.'); + return process.nextTick(function () { + cb(conflictErr); + }); + } + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || defaultPaths(); + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + maybeRealpath( + realpath, + absoluteStart, + opts, + function (err, realStart) { + if (err) cb(err); + else init(realStart); + } + ); + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + if ((/\/$/).test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else if (includeCoreModules && isCore(x)) { + return cb(null, x); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) { + return maybeRealpath(realpath, n, opts, function (err, realN) { + if (err) { + cb(err); + } else { + cb(null, realN, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) { + maybeRealpath(realpath, d, opts, function (err, realD) { + if (err) { + cb(err); + } else { + cb(null, realD, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return loadpkg(path.dirname(dir), cb); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readPackage(readFile, pkgfile, function (err, pkgParam) { + if (err) cb(err); + + var pkg = pkgParam; + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return cb(unwrapErr); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readPackage(readFile, pkgfile, function (err, pkgParam) { + if (err) return cb(err); + + var pkg = pkgParam; + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + isDirectory(path.dirname(dir), isdir); + + function isdir(err, isdir) { + if (err) return cb(err); + if (!isdir) return processDirs(cb, dirs.slice(1)); + loadAsFile(dir, opts.package, onfile); + } + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(dir, opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + processDirs( + cb, + packageIterator ? packageIterator(x, start, thunk, opts) : thunk() + ); + } +}; diff --git a/node_modules/resolve/lib/caller.js b/node_modules/resolve/lib/caller.js new file mode 100644 index 0000000..b14a280 --- /dev/null +++ b/node_modules/resolve/lib/caller.js @@ -0,0 +1,8 @@ +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; diff --git a/node_modules/resolve/lib/core.js b/node_modules/resolve/lib/core.js new file mode 100644 index 0000000..57b048f --- /dev/null +++ b/node_modules/resolve/lib/core.js @@ -0,0 +1,12 @@ +'use strict'; + +var isCoreModule = require('is-core-module'); +var data = require('./core.json'); + +var core = {}; +for (var mod in data) { // eslint-disable-line no-restricted-syntax + if (Object.prototype.hasOwnProperty.call(data, mod)) { + core[mod] = isCoreModule(mod); + } +} +module.exports = core; diff --git a/node_modules/resolve/lib/core.json b/node_modules/resolve/lib/core.json new file mode 100644 index 0000000..3cda693 --- /dev/null +++ b/node_modules/resolve/lib/core.json @@ -0,0 +1,158 @@ +{ + "assert": true, + "node:assert": [">= 14.18 && < 15", ">= 16"], + "assert/strict": ">= 15", + "node:assert/strict": ">= 16", + "async_hooks": ">= 8", + "node:async_hooks": [">= 14.18 && < 15", ">= 16"], + "buffer_ieee754": ">= 0.5 && < 0.9.7", + "buffer": true, + "node:buffer": [">= 14.18 && < 15", ">= 16"], + "child_process": true, + "node:child_process": [">= 14.18 && < 15", ">= 16"], + "cluster": ">= 0.5", + "node:cluster": [">= 14.18 && < 15", ">= 16"], + "console": true, + "node:console": [">= 14.18 && < 15", ">= 16"], + "constants": true, + "node:constants": [">= 14.18 && < 15", ">= 16"], + "crypto": true, + "node:crypto": [">= 14.18 && < 15", ">= 16"], + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "node:dgram": [">= 14.18 && < 15", ">= 16"], + "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"], + "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], + "dns": true, + "node:dns": [">= 14.18 && < 15", ">= 16"], + "dns/promises": ">= 15", + "node:dns/promises": ">= 16", + "domain": ">= 0.7.12", + "node:domain": [">= 14.18 && < 15", ">= 16"], + "events": true, + "node:events": [">= 14.18 && < 15", ">= 16"], + "freelist": "< 6", + "fs": true, + "node:fs": [">= 14.18 && < 15", ">= 16"], + "fs/promises": [">= 10 && < 10.1", ">= 14"], + "node:fs/promises": [">= 14.18 && < 15", ">= 16"], + "_http_agent": ">= 0.11.1", + "node:_http_agent": [">= 14.18 && < 15", ">= 16"], + "_http_client": ">= 0.11.1", + "node:_http_client": [">= 14.18 && < 15", ">= 16"], + "_http_common": ">= 0.11.1", + "node:_http_common": [">= 14.18 && < 15", ">= 16"], + "_http_incoming": ">= 0.11.1", + "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], + "_http_outgoing": ">= 0.11.1", + "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], + "_http_server": ">= 0.11.1", + "node:_http_server": [">= 14.18 && < 15", ">= 16"], + "http": true, + "node:http": [">= 14.18 && < 15", ">= 16"], + "http2": ">= 8.8", + "node:http2": [">= 14.18 && < 15", ">= 16"], + "https": true, + "node:https": [">= 14.18 && < 15", ">= 16"], + "inspector": ">= 8", + "node:inspector": [">= 14.18 && < 15", ">= 16"], + "inspector/promises": [">= 19"], + "node:inspector/promises": [">= 19"], + "_linklist": "< 8", + "module": true, + "node:module": [">= 14.18 && < 15", ">= 16"], + "net": true, + "node:net": [">= 14.18 && < 15", ">= 16"], + "node-inspect/lib/_inspect": ">= 7.6 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", + "os": true, + "node:os": [">= 14.18 && < 15", ">= 16"], + "path": true, + "node:path": [">= 14.18 && < 15", ">= 16"], + "path/posix": ">= 15.3", + "node:path/posix": ">= 16", + "path/win32": ">= 15.3", + "node:path/win32": ">= 16", + "perf_hooks": ">= 8.5", + "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], + "process": ">= 1", + "node:process": [">= 14.18 && < 15", ">= 16"], + "punycode": ">= 0.5", + "node:punycode": [">= 14.18 && < 15", ">= 16"], + "querystring": true, + "node:querystring": [">= 14.18 && < 15", ">= 16"], + "readline": true, + "node:readline": [">= 14.18 && < 15", ">= 16"], + "readline/promises": ">= 17", + "node:readline/promises": ">= 17", + "repl": true, + "node:repl": [">= 14.18 && < 15", ">= 16"], + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], + "_stream_transform": ">= 0.9.4", + "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], + "_stream_wrap": ">= 1.4.1", + "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], + "_stream_passthrough": ">= 0.9.4", + "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], + "_stream_readable": ">= 0.9.4", + "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], + "_stream_writable": ">= 0.9.4", + "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], + "stream": true, + "node:stream": [">= 14.18 && < 15", ">= 16"], + "stream/consumers": ">= 16.7", + "node:stream/consumers": ">= 16.7", + "stream/promises": ">= 15", + "node:stream/promises": ">= 16", + "stream/web": ">= 16.5", + "node:stream/web": ">= 16.5", + "string_decoder": true, + "node:string_decoder": [">= 14.18 && < 15", ">= 16"], + "sys": [">= 0.4 && < 0.7", ">= 0.8"], + "node:sys": [">= 14.18 && < 15", ">= 16"], + "test/reporters": ">= 19.9 && < 20.2", + "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], + "node:test": [">= 16.17 && < 17", ">= 18"], + "timers": true, + "node:timers": [">= 14.18 && < 15", ">= 16"], + "timers/promises": ">= 15", + "node:timers/promises": ">= 16", + "_tls_common": ">= 0.11.13", + "node:_tls_common": [">= 14.18 && < 15", ">= 16"], + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], + "tls": true, + "node:tls": [">= 14.18 && < 15", ">= 16"], + "trace_events": ">= 10", + "node:trace_events": [">= 14.18 && < 15", ">= 16"], + "tty": true, + "node:tty": [">= 14.18 && < 15", ">= 16"], + "url": true, + "node:url": [">= 14.18 && < 15", ">= 16"], + "util": true, + "node:util": [">= 14.18 && < 15", ">= 16"], + "util/types": ">= 15.3", + "node:util/types": ">= 16", + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], + "v8": ">= 1", + "node:v8": [">= 14.18 && < 15", ">= 16"], + "vm": true, + "node:vm": [">= 14.18 && < 15", ">= 16"], + "wasi": [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], + "node:wasi": [">= 18.17 && < 19", ">= 20"], + "worker_threads": ">= 11.7", + "node:worker_threads": [">= 14.18 && < 15", ">= 16"], + "zlib": ">= 0.5", + "node:zlib": [">= 14.18 && < 15", ">= 16"] +} diff --git a/node_modules/resolve/lib/homedir.js b/node_modules/resolve/lib/homedir.js new file mode 100644 index 0000000..5ffdf73 --- /dev/null +++ b/node_modules/resolve/lib/homedir.js @@ -0,0 +1,24 @@ +'use strict'; + +var os = require('os'); + +// adapted from https://github.com/sindresorhus/os-homedir/blob/11e089f4754db38bb535e5a8416320c4446e8cfd/index.js + +module.exports = os.homedir || function homedir() { + var home = process.env.HOME; + var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; + + if (process.platform === 'win32') { + return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null; + } + + if (process.platform === 'darwin') { + return home || (user ? '/Users/' + user : null); + } + + if (process.platform === 'linux') { + return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); // eslint-disable-line no-extra-parens + } + + return home || null; +}; diff --git a/node_modules/resolve/lib/is-core.js b/node_modules/resolve/lib/is-core.js new file mode 100644 index 0000000..537f5c7 --- /dev/null +++ b/node_modules/resolve/lib/is-core.js @@ -0,0 +1,5 @@ +var isCoreModule = require('is-core-module'); + +module.exports = function isCore(x) { + return isCoreModule(x); +}; diff --git a/node_modules/resolve/lib/node-modules-paths.js b/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 0000000..1cff010 --- /dev/null +++ b/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,42 @@ +var path = require('path'); +var parse = path.parse || require('path-parse'); // eslint-disable-line global-require + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.resolve(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; diff --git a/node_modules/resolve/lib/normalize-options.js b/node_modules/resolve/lib/normalize-options.js new file mode 100644 index 0000000..4b56904 --- /dev/null +++ b/node_modules/resolve/lib/normalize-options.js @@ -0,0 +1,10 @@ +module.exports = function (x, opts) { + /** + * This file is purposefully a passthrough. It's expected that third-party + * environments will override it at runtime in order to inject special logic + * into `resolve` (by manipulating the options). One such example is the PnP + * code path in Yarn. + */ + + return opts || {}; +}; diff --git a/node_modules/resolve/lib/sync.js b/node_modules/resolve/lib/sync.js new file mode 100644 index 0000000..0b6cd58 --- /dev/null +++ b/node_modules/resolve/lib/sync.js @@ -0,0 +1,208 @@ +var isCore = require('is-core-module'); +var fs = require('fs'); +var path = require('path'); +var getHomedir = require('./homedir'); +var caller = require('./caller'); +var nodeModulesPaths = require('./node-modules-paths'); +var normalizeOptions = require('./normalize-options'); + +var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + +var homedir = getHomedir(); +var defaultPaths = function () { + return [ + path.join(homedir, '.node_modules'), + path.join(homedir, '.node_libraries') + ]; +}; + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file, { throwIfNoEntry: false }); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return !!stat && (stat.isFile() || stat.isFIFO()); +}; + +var defaultIsDir = function isDirectory(dir) { + try { + var stat = fs.statSync(dir, { throwIfNoEntry: false }); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return !!stat && stat.isDirectory(); +}; + +var defaultRealpathSync = function realpathSync(x) { + try { + return realpathFS(x); + } catch (realpathErr) { + if (realpathErr.code !== 'ENOENT') { + throw realpathErr; + } + } + return x; +}; + +var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { + if (opts && opts.preserveSymlinks === false) { + return realpathSync(x); + } + return x; +}; + +var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) { + var body = readFileSync(pkgfile); + try { + var pkg = JSON.parse(body); + return pkg; + } catch (jsonErr) {} +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolveSync(x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = normalizeOptions(x, options); + + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + var isDirectory = opts.isDirectory || defaultIsDir; + var realpathSync = opts.realpathSync || defaultRealpathSync; + var readPackageSync = opts.readPackageSync || defaultReadPackageSync; + if (opts.readFileSync && opts.readPackageSync) { + throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.'); + } + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || defaultPaths(); + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return maybeRealpathSync(realpathSync, m, opts); + } else if (includeCoreModules && isCore(x)) { + return x; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return maybeRealpathSync(realpathSync, n, opts); + } + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var pkg = readPackageSync(readFileSync, pkgfile); + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); + if (isFile(pkgfile)) { + try { + var pkg = readPackageSync(readFileSync, pkgfile); + } catch (e) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); + + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + if (isDirectory(path.dirname(dir))) { + var m = loadAsFileSync(dir); + if (m) return m; + var n = loadAsDirectorySync(dir); + if (n) return n; + } + } + } +}; diff --git a/node_modules/resolve/package.json b/node_modules/resolve/package.json new file mode 100644 index 0000000..537388d --- /dev/null +++ b/node_modules/resolve/package.json @@ -0,0 +1,72 @@ +{ + "name": "resolve", + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "version": "1.22.8", + "repository": { + "type": "git", + "url": "git://github.com/browserify/resolve.git" + }, + "bin": { + "resolve": "./bin/resolve" + }, + "main": "index.js", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && cp node_modules/is-core-module/core.json ./lib/ ||:", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'", + "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", + "tests-only": "tape test/*.js", + "pretest": "npm run lint", + "test": "npm run --silent tests-only", + "posttest": "npm run test:multirepo && aud --production", + "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "array.prototype.map": "^1.0.6", + "aud": "^2.0.3", + "copy-dir": "^1.3.0", + "eclint": "^2.8.1", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "mkdirp": "^0.5.5", + "mv": "^2.1.1", + "npmignore": "^0.3.0", + "object-keys": "^1.1.1", + "rimraf": "^2.7.1", + "safe-publish-latest": "^2.0.0", + "semver": "^6.3.1", + "tap": "0.4.13", + "tape": "^5.7.0", + "tmp": "^0.0.31" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "appveyor.yml", + "test/resolver/malformed_package_json" + ] + } +} diff --git a/node_modules/resolve/readme.markdown b/node_modules/resolve/readme.markdown new file mode 100644 index 0000000..ad34d60 --- /dev/null +++ b/node_modules/resolve/readme.markdown @@ -0,0 +1,301 @@ +# resolve [![Version Badge][2]][1] + +implements the [node `require.resolve()` algorithm](https://nodejs.org/api/modules.html#modules_all_together) such that you can `require.resolve()` on behalf of a file asynchronously and synchronously + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +# example + +asynchronously resolve: + +```js +var resolve = require('resolve/async'); // or, require('resolve') +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +```js +var resolve = require('resolve/sync'); // or, `require('resolve').sync +var res = resolve('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +```js +var resolve = require('resolve'); +var async = require('resolve/async'); +var sync = require('resolve/sync'); +``` + +For both the synchronous and asynchronous methods, errors may have any of the following `err.code` values: + +- `MODULE_NOT_FOUND`: the given path string (`id`) could not be resolved to a module +- `INVALID_BASEDIR`: the specified `opts.basedir` doesn't exist, or is not a directory +- `INVALID_PACKAGE_MAIN`: a `package.json` was encountered with an invalid `main` property (eg. not a string) + +## resolve(id, opts={}, cb) + +Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* opts.isDirectory - function to asynchronously test whether a file exists and is a directory + +* opts.realpath - function to asynchronously resolve a potential symlink to its real path + +* `opts.readPackage(readFile, pkgfile, cb)` - function to asynchronously read and parse a package.json file + * readFile - the passed `opts.readFile` or `fs.readFile` if not specified + * pkgfile - path to package.json + * cb - callback + +* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * pkgfile - path to package.json + * dir - directory that contains package.json + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + includeCoreModules: true, + readFile: fs.readFile, + isFile: function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + isDirectory: function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + realpath: function realpath(file, cb) { + var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + realpath(file, function (realPathErr, realPath) { + if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); + else cb(null, realPathErr ? file : realPath); + }); + }, + readPackage: function defaultReadPackage(readFile, pkgfile, cb) { + readFile(pkgfile, function (readFileErr, body) { + if (readFileErr) cb(readFileErr); + else { + try { + var pkg = JSON.parse(body); + cb(null, pkg); + } catch (jsonErr) { + cb(null); + } + } + }); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search + +* opts.readFileSync - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* opts.isDirectory - function to synchronously test whether a file exists and is a directory + +* opts.realpathSync - function to synchronously resolve a potential symlink to its real path + +* `opts.readPackageSync(readFileSync, pkgfile)` - function to synchronously read and parse a package.json file + * readFileSync - the passed `opts.readFileSync` or `fs.readFileSync` if not specified + * pkgfile - path to package.json + +* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * dir - directory that contains package.json (Note: the second argument will change to "pkgfile" in v2) + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + includeCoreModules: true, + readFileSync: fs.readFileSync, + isFile: function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); + }, + isDirectory: function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); + }, + realpathSync: function realpathSync(file) { + try { + var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + return realpath(file); + } catch (realPathErr) { + if (realPathErr.code !== 'ENOENT') { + throw realPathErr; + } + } + return file; + }, + readPackageSync: function defaultReadPackageSync(readFileSync, pkgfile) { + var body = readFileSync(pkgfile); + try { + var pkg = JSON.parse(body); + return pkg; + } catch (jsonErr) {} + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +# install + +With [npm](https://npmjs.org) do: + +```sh +npm install resolve +``` + +# license + +MIT + +[1]: https://npmjs.org/package/resolve +[2]: https://versionbadg.es/browserify/resolve.svg +[5]: https://david-dm.org/browserify/resolve.svg +[6]: https://david-dm.org/browserify/resolve +[7]: https://david-dm.org/browserify/resolve/dev-status.svg +[8]: https://david-dm.org/browserify/resolve#info=devDependencies +[11]: https://nodei.co/npm/resolve.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/resolve.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/resolve.svg +[downloads-url]: https://npm-stat.com/charts.html?package=resolve +[codecov-image]: https://codecov.io/gh/browserify/resolve/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/browserify/resolve/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/resolve +[actions-url]: https://github.com/browserify/resolve/actions diff --git a/node_modules/resolve/sync.js b/node_modules/resolve/sync.js new file mode 100644 index 0000000..cd0ee04 --- /dev/null +++ b/node_modules/resolve/sync.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/sync'); diff --git a/node_modules/resolve/test/core.js b/node_modules/resolve/test/core.js new file mode 100644 index 0000000..a477adc --- /dev/null +++ b/node_modules/resolve/test/core.js @@ -0,0 +1,88 @@ +var test = require('tape'); +var keys = require('object-keys'); +var semver = require('semver'); + +var resolve = require('../'); + +var brokenNode = semver.satisfies(process.version, '11.11 - 11.13'); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(resolve.isCore('fs')); + st.ok(resolve.isCore('net')); + st.ok(resolve.isCore('http')); + + st.ok(!resolve.isCore('seq')); + st.ok(!resolve.isCore('../')); + + st.ok(!resolve.isCore('toString')); + + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(resolve.core); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + // note: this must be require, not require.resolve, due to https://github.com/nodejs/node/issues/43274 + var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func + t.comment(mod + ': ' + resolve.core[mod]); + if (resolve.core[mod]) { + st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw'); + } else if (brokenNode) { + st.ok(true, 'this version of node is broken: attempting to require things that fail to resolve breaks "home_paths" tests'); + } else { + st.throws(requireFunc, mod + ' not supported; requiring throws'); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + var blacklist = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (blacklist.indexOf(mod) === -1) { + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + } + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/resolve/test/dotdot.js b/node_modules/resolve/test/dotdot.js new file mode 100644 index 0000000..3080665 --- /dev/null +++ b/node_modules/resolve/test/dotdot.js @@ -0,0 +1,29 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('dotdot', function (t) { + t.plan(4); + var dir = path.join(__dirname, '/dotdot/abc'); + + resolve('..', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'dotdot/index.js')); + }); + + resolve('.', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('dotdot sync', function (t) { + t.plan(2); + var dir = path.join(__dirname, '/dotdot/abc'); + + var a = resolve.sync('..', { basedir: dir }); + t.equal(a, path.join(__dirname, 'dotdot/index.js')); + + var b = resolve.sync('.', { basedir: dir }); + t.equal(b, path.join(dir, 'index.js')); +}); diff --git a/node_modules/resolve/test/dotdot/abc/index.js b/node_modules/resolve/test/dotdot/abc/index.js new file mode 100644 index 0000000..67f2534 --- /dev/null +++ b/node_modules/resolve/test/dotdot/abc/index.js @@ -0,0 +1,2 @@ +var x = require('..'); +console.log(x); diff --git a/node_modules/resolve/test/dotdot/index.js b/node_modules/resolve/test/dotdot/index.js new file mode 100644 index 0000000..643f9fc --- /dev/null +++ b/node_modules/resolve/test/dotdot/index.js @@ -0,0 +1 @@ +module.exports = 'whatever'; diff --git a/node_modules/resolve/test/faulty_basedir.js b/node_modules/resolve/test/faulty_basedir.js new file mode 100644 index 0000000..5f2141a --- /dev/null +++ b/node_modules/resolve/test/faulty_basedir.js @@ -0,0 +1,29 @@ +var test = require('tape'); +var path = require('path'); +var resolve = require('../'); + +test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { + t.plan(1); + + var resolverDir = 'C:\\a\\b\\c\\d'; + + resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { + t.equal(!!err, true); + }); +}); + +test('non-existent basedir should not throw when preserveSymlinks is false', function (t) { + t.plan(2); + + var opts = { + basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'), + preserveSymlinks: false + }; + + var module = './dotdot/abc'; + + resolve(module, opts, function (err, res) { + t.equal(err.code, 'MODULE_NOT_FOUND'); + t.equal(res, undefined); + }); +}); diff --git a/node_modules/resolve/test/filter.js b/node_modules/resolve/test/filter.js new file mode 100644 index 0000000..8f8cccd --- /dev/null +++ b/node_modules/resolve/test/filter.js @@ -0,0 +1,34 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + resolve('./baz', { + basedir: dir, + packageFilter: function (pkg, pkgfile) { + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = [pkg, pkgfile]; + return pkg; + } + }, function (err, res, pkg) { + if (err) t.fail(err); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + var packageFile = packageFilterArgs[1]; + t.equal( + packageFile, + path.join(dir, 'baz/package.json'), + 'second packageFilter argument is "pkgfile"' + ); + + t.end(); + }); +}); diff --git a/node_modules/resolve/test/filter_sync.js b/node_modules/resolve/test/filter_sync.js new file mode 100644 index 0000000..8a43b98 --- /dev/null +++ b/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,33 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + var res = resolve.sync('./baz', { + basedir: dir, + // NOTE: in v2.x, this will be `pkg, pkgfile, dir`, but must remain "broken" here in v1.x for compatibility + packageFilter: function (pkg, /*pkgfile,*/ dir) { // eslint-disable-line spaced-comment + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = 'is 1.x' ? [pkg, dir] : [pkg, pkgfile, dir]; // eslint-disable-line no-constant-condition, no-undef + return pkg; + } + }); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + if (!'is 1.x') { // eslint-disable-line no-constant-condition + var packageFile = packageFilterArgs[1]; + t.equal(packageFile, path.join(dir, 'baz', 'package.json'), 'package.json path is correct'); + } + + var packageDir = packageFilterArgs['is 1.x' ? 1 : 2]; // eslint-disable-line no-constant-condition + // eslint-disable-next-line no-constant-condition + t.equal(packageDir, path.join(dir, 'baz'), ('is 1.x' ? 'second' : 'third') + ' packageFilter argument is "dir"'); + + t.end(); +}); diff --git a/node_modules/resolve/test/home_paths.js b/node_modules/resolve/test/home_paths.js new file mode 100644 index 0000000..3b8c9b3 --- /dev/null +++ b/node_modules/resolve/test/home_paths.js @@ -0,0 +1,127 @@ +'use strict'; + +var fs = require('fs'); +var homedir = require('../lib/homedir'); +var path = require('path'); + +var test = require('tape'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var mv = require('mv'); +var copyDir = require('copy-dir'); +var tmp = require('tmp'); + +var HOME = homedir(); + +var hnm = path.join(HOME, '.node_modules'); +var hnl = path.join(HOME, '.node_libraries'); + +var resolve = require('../async'); + +function makeDir(t, dir, cb) { + mkdirp(dir, function (err) { + if (err) { + cb(err); + } else { + t.teardown(function cleanup() { + rimraf.sync(dir); + }); + cb(); + } + }); +} + +function makeTempDir(t, dir, cb) { + if (fs.existsSync(dir)) { + var tmpResult = tmp.dirSync(); + t.teardown(tmpResult.removeCallback); + var backup = path.join(tmpResult.name, path.basename(dir)); + mv(dir, backup, function (err) { + if (err) { + cb(err); + } else { + t.teardown(function () { + mv(backup, dir, cb); + }); + makeDir(t, dir, cb); + } + }); + } else { + makeDir(t, dir, cb); + } +} + +test('homedir module paths', function (t) { + t.plan(7); + + makeTempDir(t, hnm, function (err) { + t.error(err, 'no error with HNM temp dir'); + if (err) { + return t.end(); + } + + var bazHNMDir = path.join(hnm, 'baz'); + var dotMainDir = path.join(hnm, 'dot_main'); + copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNMDir); + copyDir.sync(path.join(__dirname, 'resolver/dot_main'), dotMainDir); + + var bazPkg = { name: 'baz', main: 'quux.js' }; + var dotMainPkg = { main: 'index' }; + + var bazHNMmain = path.join(bazHNMDir, 'quux.js'); + t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); + var dotMainMain = path.join(dotMainDir, 'index.js'); + t.equal(require.resolve('dot_main'), dotMainMain, 'sanity check: require.resolve finds `dot_main`'); + + makeTempDir(t, hnl, function (err) { + t.error(err, 'no error with HNL temp dir'); + if (err) { + return t.end(); + } + var bazHNLDir = path.join(hnl, 'baz'); + copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNLDir); + + var dotSlashMainDir = path.join(hnl, 'dot_slash_main'); + var dotSlashMainMain = path.join(dotSlashMainDir, 'index.js'); + var dotSlashMainPkg = { main: 'index' }; + copyDir.sync(path.join(__dirname, 'resolver/dot_slash_main'), dotSlashMainDir); + + t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); + t.equal(require.resolve('dot_slash_main'), dotSlashMainMain, 'sanity check: require.resolve finds HNL `dot_slash_main`'); + + t.test('with temp dirs', function (st) { + st.plan(3); + + st.test('just in `$HOME/.node_modules`', function (s2t) { + s2t.plan(3); + + resolve('dot_main', function (err, res, pkg) { + s2t.error(err, 'no error resolving `dot_main`'); + s2t.equal(res, dotMainMain, '`dot_main` resolves in `$HOME/.node_modules`'); + s2t.deepEqual(pkg, dotMainPkg); + }); + }); + + st.test('just in `$HOME/.node_libraries`', function (s2t) { + s2t.plan(3); + + resolve('dot_slash_main', function (err, res, pkg) { + s2t.error(err, 'no error resolving `dot_slash_main`'); + s2t.equal(res, dotSlashMainMain, '`dot_slash_main` resolves in `$HOME/.node_libraries`'); + s2t.deepEqual(pkg, dotSlashMainPkg); + }); + }); + + st.test('in `$HOME/.node_libraries` and `$HOME/.node_modules`', function (s2t) { + s2t.plan(3); + + resolve('baz', function (err, res, pkg) { + s2t.error(err, 'no error resolving `baz`'); + s2t.equal(res, bazHNMmain, '`baz` resolves in `$HOME/.node_modules` when in both'); + s2t.deepEqual(pkg, bazPkg); + }); + }); + }); + }); + }); +}); diff --git a/node_modules/resolve/test/home_paths_sync.js b/node_modules/resolve/test/home_paths_sync.js new file mode 100644 index 0000000..5d2c56f --- /dev/null +++ b/node_modules/resolve/test/home_paths_sync.js @@ -0,0 +1,114 @@ +'use strict'; + +var fs = require('fs'); +var homedir = require('../lib/homedir'); +var path = require('path'); + +var test = require('tape'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var mv = require('mv'); +var copyDir = require('copy-dir'); +var tmp = require('tmp'); + +var HOME = homedir(); + +var hnm = path.join(HOME, '.node_modules'); +var hnl = path.join(HOME, '.node_libraries'); + +var resolve = require('../sync'); + +function makeDir(t, dir, cb) { + mkdirp(dir, function (err) { + if (err) { + cb(err); + } else { + t.teardown(function cleanup() { + rimraf.sync(dir); + }); + cb(); + } + }); +} + +function makeTempDir(t, dir, cb) { + if (fs.existsSync(dir)) { + var tmpResult = tmp.dirSync(); + t.teardown(tmpResult.removeCallback); + var backup = path.join(tmpResult.name, path.basename(dir)); + mv(dir, backup, function (err) { + if (err) { + cb(err); + } else { + t.teardown(function () { + mv(backup, dir, cb); + }); + makeDir(t, dir, cb); + } + }); + } else { + makeDir(t, dir, cb); + } +} + +test('homedir module paths', function (t) { + t.plan(7); + + makeTempDir(t, hnm, function (err) { + t.error(err, 'no error with HNM temp dir'); + if (err) { + return t.end(); + } + + var bazHNMDir = path.join(hnm, 'baz'); + var dotMainDir = path.join(hnm, 'dot_main'); + copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNMDir); + copyDir.sync(path.join(__dirname, 'resolver/dot_main'), dotMainDir); + + var bazHNMmain = path.join(bazHNMDir, 'quux.js'); + t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); + var dotMainMain = path.join(dotMainDir, 'index.js'); + t.equal(require.resolve('dot_main'), dotMainMain, 'sanity check: require.resolve finds `dot_main`'); + + makeTempDir(t, hnl, function (err) { + t.error(err, 'no error with HNL temp dir'); + if (err) { + return t.end(); + } + var bazHNLDir = path.join(hnl, 'baz'); + copyDir.sync(path.join(__dirname, 'resolver/baz'), bazHNLDir); + + var dotSlashMainDir = path.join(hnl, 'dot_slash_main'); + var dotSlashMainMain = path.join(dotSlashMainDir, 'index.js'); + copyDir.sync(path.join(__dirname, 'resolver/dot_slash_main'), dotSlashMainDir); + + t.equal(require.resolve('baz'), bazHNMmain, 'sanity check: require.resolve finds HNM `baz`'); + t.equal(require.resolve('dot_slash_main'), dotSlashMainMain, 'sanity check: require.resolve finds HNL `dot_slash_main`'); + + t.test('with temp dirs', function (st) { + st.plan(3); + + st.test('just in `$HOME/.node_modules`', function (s2t) { + s2t.plan(1); + + var res = resolve('dot_main'); + s2t.equal(res, dotMainMain, '`dot_main` resolves in `$HOME/.node_modules`'); + }); + + st.test('just in `$HOME/.node_libraries`', function (s2t) { + s2t.plan(1); + + var res = resolve('dot_slash_main'); + s2t.equal(res, dotSlashMainMain, '`dot_slash_main` resolves in `$HOME/.node_libraries`'); + }); + + st.test('in `$HOME/.node_libraries` and `$HOME/.node_modules`', function (s2t) { + s2t.plan(1); + + var res = resolve('baz'); + s2t.equal(res, bazHNMmain, '`baz` resolves in `$HOME/.node_modules` when in both'); + }); + }); + }); + }); +}); diff --git a/node_modules/resolve/test/mock.js b/node_modules/resolve/test/mock.js new file mode 100644 index 0000000..6116275 --- /dev/null +++ b/node_modules/resolve/test/mock.js @@ -0,0 +1,315 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock from package', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, file)); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[file]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('mock package from package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('symlinked', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + cb(null, resolved); + return; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + cb(null, path.join(dir, 'symlinked', base)); + } else { + cb(null, path.join(resolved, 'symlinked')); + } + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); +}); + +test('readPackage', function (t) { + t.plan(3); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/something-else.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'boop'; + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + t.test('with readFile', function (st) { + st.plan(3); + + resolve('bar', opts('/foo'), function (err, res, pkg) { + st.error(err); + st.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + st.equal(pkg && pkg.main, './baz.js'); + }); + }); + + var readPackage = function (readFile, file, cb) { + var barPackage = path.join('bar', 'package.json'); + if (file.slice(-barPackage.length) === barPackage) { + cb(null, { main: './something-else.js' }); + } else { + cb(null, JSON.parse(files[path.resolve(file)])); + } + }; + + t.test('with readPackage', function (st) { + st.plan(3); + + var options = opts('/foo'); + delete options.readFile; + options.readPackage = readPackage; + resolve('bar', options, function (err, res, pkg) { + st.error(err); + st.equal(res, path.resolve('/foo/node_modules/bar/something-else.js')); + st.equal(pkg && pkg.main, './something-else.js'); + }); + }); + + t.test('with readFile and readPackage', function (st) { + st.plan(1); + + var options = opts('/foo'); + options.readPackage = readPackage; + resolve('bar', options, function (err) { + st.throws(function () { throw err; }, TypeError, 'errors when both readFile and readPackage are provided'); + }); + }); +}); diff --git a/node_modules/resolve/test/mock_sync.js b/node_modules/resolve/test/mock_sync.js new file mode 100644 index 0000000..c5a7e2a --- /dev/null +++ b/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,214 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('bar', opts('/foo')), + path.resolve('/foo/node_modules/bar/baz.js') + ); +}); + +test('symlinked', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + return resolved; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + return path.join(dir, 'symlinked', base); + } + return path.join(resolved, 'symlinked'); + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); +}); + +test('readPackageSync', function (t) { + t.plan(3); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/something-else.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'boop'; + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir, useReadPackage) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: useReadPackage ? null : function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + t.test('with readFile', function (st) { + st.plan(1); + + st.equal( + resolve.sync('bar', opts('/foo')), + path.resolve('/foo/node_modules/bar/baz.js') + ); + }); + + var readPackageSync = function (readFileSync, file) { + if (file.indexOf(path.join('bar', 'package.json')) >= 0) { + return { main: './something-else.js' }; + } + return JSON.parse(files[path.resolve(file)]); + }; + + t.test('with readPackage', function (st) { + st.plan(1); + + var options = opts('/foo'); + delete options.readFileSync; + options.readPackageSync = readPackageSync; + + st.equal( + resolve.sync('bar', options), + path.resolve('/foo/node_modules/bar/something-else.js') + ); + }); + + t.test('with readFile and readPackage', function (st) { + st.plan(1); + + var options = opts('/foo'); + options.readPackageSync = readPackageSync; + st.throws( + function () { resolve.sync('bar', options); }, + TypeError, + 'errors when both readFile and readPackage are provided' + ); + }); +}); + diff --git a/node_modules/resolve/test/module_dir.js b/node_modules/resolve/test/module_dir.js new file mode 100644 index 0000000..b50e5bb --- /dev/null +++ b/node_modules/resolve/test/module_dir.js @@ -0,0 +1,56 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('moduleDirectory strings', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'module_dir'); + var xopts = { + basedir: dir, + moduleDirectory: 'xmodules' + }; + resolve('aaa', xopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var yopts = { + basedir: dir, + moduleDirectory: 'ymodules' + }; + resolve('aaa', yopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); +}); + +test('moduleDirectory array', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'module_dir'); + var aopts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('aaa', aopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var bopts = { + basedir: dir, + moduleDirectory: ['zmodules', 'ymodules', 'xmodules'] + }; + resolve('aaa', bopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); + + var copts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('bbb', copts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/zmodules/bbb/main.js')); + }); +}); diff --git a/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/node_modules/resolve/test/module_dir/xmodules/aaa/index.js new file mode 100644 index 0000000..dd7cf7b --- /dev/null +++ b/node_modules/resolve/test/module_dir/xmodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x * 100; }; diff --git a/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/node_modules/resolve/test/module_dir/ymodules/aaa/index.js new file mode 100644 index 0000000..ef2d4d4 --- /dev/null +++ b/node_modules/resolve/test/module_dir/ymodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + 100; }; diff --git a/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/node_modules/resolve/test/module_dir/zmodules/bbb/main.js new file mode 100644 index 0000000..e8ba629 --- /dev/null +++ b/node_modules/resolve/test/module_dir/zmodules/bbb/main.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 111; }; diff --git a/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/node_modules/resolve/test/module_dir/zmodules/bbb/package.json new file mode 100644 index 0000000..c13b8cf --- /dev/null +++ b/node_modules/resolve/test/module_dir/zmodules/bbb/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} diff --git a/node_modules/resolve/test/node-modules-paths.js b/node_modules/resolve/test/node-modules-paths.js new file mode 100644 index 0000000..675441d --- /dev/null +++ b/node_modules/resolve/test/node-modules-paths.js @@ -0,0 +1,143 @@ +var test = require('tape'); +var path = require('path'); +var parse = path.parse || require('path-parse'); +var keys = require('object-keys'); + +var nodeModulesPaths = require('../lib/node-modules-paths'); + +var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { + var moduleDirs = [].concat(moduleDirectories || 'node_modules'); + if (paths) { + for (var k = 0; k < paths.length; ++k) { + moduleDirs.push(path.basename(paths[k])); + } + } + + var foundModuleDirs = {}; + var uniqueDirs = {}; + var parsedDirs = {}; + for (var i = 0; i < dirs.length; ++i) { + var parsed = parse(dirs[i]); + if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } + foundModuleDirs[parsed.base] += 1; + parsedDirs[parsed.dir] = true; + uniqueDirs[dirs[i]] = true; + } + t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); + var foundModuleDirNames = keys(foundModuleDirs); + t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); + t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); + + var counts = {}; + for (var j = 0; j < foundModuleDirNames.length; ++j) { + counts[foundModuleDirs[j]] = true; + } + t.equal(keys(counts).length, 1, 'all found module directories had the same count'); +}; + +test('node-modules-paths', function (t) { + t.test('no options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('empty options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, {}); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('with paths=array option', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var dirs = nodeModulesPaths(start, { paths: paths }); + + verifyDirs(t, start, dirs, null, paths); + + t.end(); + }); + + t.test('with paths=function option', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); + }; + + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); + + verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); + + t.end(); + }); + + t.test('with paths=function skipping node modules resolution', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return []; + }; + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }); + t.deepEqual(dirs, [], 'no node_modules was computed'); + t.end(); + }); + + t.test('with moduleDirectory option', function (t) { + var start = path.join(__dirname, 'resolver'); + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory); + + t.end(); + }); + + t.test('with 1 moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory, paths); + + t.end(); + }); + + t.test('with 1+ moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectories = ['not node modules', 'other modules']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + verifyDirs(t, start, dirs, moduleDirectories, paths); + + t.end(); + }); + + t.test('combine paths correctly on Windows', function (t) { + var start = 'C:\\Users\\username\\myProject\\src'; + var paths = []; + var moduleDirectories = ['node_modules', start]; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); + + t.test('combine paths correctly on non-Windows', { skip: process.platform === 'win32' }, function (t) { + var start = '/Users/username/git/myProject/src'; + var paths = []; + var moduleDirectories = ['node_modules', '/Users/username/git/myProject/src']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); +}); diff --git a/node_modules/resolve/test/node_path.js b/node_modules/resolve/test/node_path.js new file mode 100644 index 0000000..e463d6c --- /dev/null +++ b/node_modules/resolve/test/node_path.js @@ -0,0 +1,70 @@ +var fs = require('fs'); +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('$NODE_PATH', function (t) { + t.plan(8); + + var isDir = function (dir, cb) { + if (dir === '/node_path' || dir === 'node_path/x') { + return cb(null, true); + } + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }; + + resolve('aaa', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves'); + }); + + resolve('bbb', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves'); + }); + + resolve('ccc', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves'); + }); + + // ensure that relative paths still resolve against the regular `node_modules` correctly + resolve('tap', { + paths: [ + 'node_path' + ], + basedir: path.join(__dirname, 'node_path/x'), + isDirectory: isDir + }, function (err, res) { + var root = require('tap/package.json').main; // eslint-disable-line global-require + t.error(err); + t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves'); + }); +}); diff --git a/node_modules/resolve/test/node_path/x/aaa/index.js b/node_modules/resolve/test/node_path/x/aaa/index.js new file mode 100644 index 0000000..ad70d0b --- /dev/null +++ b/node_modules/resolve/test/node_path/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'A'; diff --git a/node_modules/resolve/test/node_path/x/ccc/index.js b/node_modules/resolve/test/node_path/x/ccc/index.js new file mode 100644 index 0000000..a64132e --- /dev/null +++ b/node_modules/resolve/test/node_path/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'C'; diff --git a/node_modules/resolve/test/node_path/y/bbb/index.js b/node_modules/resolve/test/node_path/y/bbb/index.js new file mode 100644 index 0000000..4d0f32e --- /dev/null +++ b/node_modules/resolve/test/node_path/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'B'; diff --git a/node_modules/resolve/test/node_path/y/ccc/index.js b/node_modules/resolve/test/node_path/y/ccc/index.js new file mode 100644 index 0000000..793315e --- /dev/null +++ b/node_modules/resolve/test/node_path/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY'; diff --git a/node_modules/resolve/test/nonstring.js b/node_modules/resolve/test/nonstring.js new file mode 100644 index 0000000..ef63c40 --- /dev/null +++ b/node_modules/resolve/test/nonstring.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var resolve = require('../'); + +test('nonstring', function (t) { + t.plan(1); + resolve(555, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/resolve/test/pathfilter.js b/node_modules/resolve/test/pathfilter.js new file mode 100644 index 0000000..16519ae --- /dev/null +++ b/node_modules/resolve/test/pathfilter.js @@ -0,0 +1,75 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +var resolverDir = path.join(__dirname, '/pathfilter/deep_ref'); + +var pathFilterFactory = function (t) { + return function (pkg, x, remainder) { + t.equal(pkg.version, '1.2.3'); + t.equal(x, path.join(resolverDir, 'node_modules/deep/ref')); + t.equal(remainder, 'ref'); + return 'alt'; + }; +}; + +test('#62: deep module references and the pathFilter', function (t) { + t.test('deep/ref.js', function (st) { + st.plan(3); + + resolve('deep/ref', { basedir: resolverDir }, function (err, res, pkg) { + if (err) st.fail(err); + + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + var res = resolve.sync('deep/ref', { basedir: resolverDir }); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + t.test('deep/deeper/ref', function (st) { + st.plan(4); + + resolve( + 'deep/deeper/ref', + { basedir: resolverDir }, + function (err, res, pkg) { + if (err) t.fail(err); + st.notEqual(pkg, undefined); + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + } + ); + + var res = resolve.sync( + 'deep/deeper/ref', + { basedir: resolverDir } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + }); + + t.test('deep/ref alt', function (st) { + st.plan(8); + + var pathFilter = pathFilterFactory(st); + + var res = resolve.sync( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + + resolve( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter }, + function (err, res, pkg) { + if (err) st.fail(err); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + st.end(); + } + ); + }); + + t.end(); +}); diff --git a/node_modules/resolve/test/pathfilter/deep_ref/main.js b/node_modules/resolve/test/pathfilter/deep_ref/main.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/precedence.js b/node_modules/resolve/test/precedence.js new file mode 100644 index 0000000..2febb59 --- /dev/null +++ b/node_modules/resolve/test/precedence.js @@ -0,0 +1,23 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('precedence', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'precedence/aaa'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg.name, 'resolve'); + }); +}); + +test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string + t.plan(1); + var dir = path.join(__dirname, 'precedence/bbb'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/resolve/test/precedence/aaa.js b/node_modules/resolve/test/precedence/aaa.js new file mode 100644 index 0000000..b83a3e7 --- /dev/null +++ b/node_modules/resolve/test/precedence/aaa.js @@ -0,0 +1 @@ +module.exports = 'wtf'; diff --git a/node_modules/resolve/test/precedence/aaa/index.js b/node_modules/resolve/test/precedence/aaa/index.js new file mode 100644 index 0000000..e0f8f6a --- /dev/null +++ b/node_modules/resolve/test/precedence/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'okok'; diff --git a/node_modules/resolve/test/precedence/aaa/main.js b/node_modules/resolve/test/precedence/aaa/main.js new file mode 100644 index 0000000..93542a9 --- /dev/null +++ b/node_modules/resolve/test/precedence/aaa/main.js @@ -0,0 +1 @@ +console.log(require('./')); diff --git a/node_modules/resolve/test/precedence/bbb.js b/node_modules/resolve/test/precedence/bbb.js new file mode 100644 index 0000000..2298f47 --- /dev/null +++ b/node_modules/resolve/test/precedence/bbb.js @@ -0,0 +1 @@ +module.exports = '>_<'; diff --git a/node_modules/resolve/test/precedence/bbb/main.js b/node_modules/resolve/test/precedence/bbb/main.js new file mode 100644 index 0000000..716b81d --- /dev/null +++ b/node_modules/resolve/test/precedence/bbb/main.js @@ -0,0 +1 @@ +console.log(require('./')); // should throw diff --git a/node_modules/resolve/test/resolver.js b/node_modules/resolve/test/resolver.js new file mode 100644 index 0000000..df8211a --- /dev/null +++ b/node_modules/resolve/test/resolver.js @@ -0,0 +1,597 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); +var resolve = require('../'); +var async = require('../async'); + +test('`./async` entry point', function (t) { + t.equal(resolve, async, '`./async` entry point is the same as `main`'); + t.end(); +}); + +test('async foo', function (t) { + t.plan(12); + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo.js', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.main, 'resolver'); + }); + + resolve('./foo.js', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg.main, 'resolver'); + }); + + resolve('./foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + }); + + resolve('foo', { basedir: dir }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.join(dir, 'baz.js') + "'"); + }); +}); + +test('bar', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'resolver'); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar', 'package': { main: 'bar' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg.main, 'bar'); + }); +}); + +test('baz', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + + resolve('./baz', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); + + resolve('./baz', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); +}); + +test('biz', function (t) { + t.plan(24); + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + + resolve('./grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('./grux', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'biz'); + }); + + resolve('./garply', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('./garply', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('tiv', { basedir: dir + '/grux' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/grux', 'package': { main: 'grux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, 'grux'); + }); + + resolve('tiv', { basedir: dir + '/garply' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/garply', 'package': { main: './lib' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('grux', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('grux', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'tiv'); + }); + + resolve('garply', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('garply', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); +}); + +test('quux', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/quux'); + + resolve('./foo', { basedir: dir, 'package': { main: 'quux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo/index.js')); + t.equal(pkg.main, 'quux'); + }); +}); + +test('normalize', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + + resolve('../grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg, undefined); + }); +}); + +test('cup', function (t) { + t.plan(5); + var dir = path.join(__dirname, 'resolver'); + + resolve('./cup', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup.coffee', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup', { basedir: dir, extensions: ['.js'] }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('./cup', { basedir: dir, extensions: ['.js'], filename: path.join(dir, 'cupboard.js') }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.join(dir, 'cupboard.js') + "'"); + }); +}); + +test('mug', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'resolver'); + + resolve('./mug', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'mug.js')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.coffee', '.js'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, '/mug.coffee')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + t.equal(res, path.join(dir, '/mug.js')); + }); +}); + +test('other path', function (t) { + t.plan(6); + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + resolve('root', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/root.js')); + }); + + resolve('lib/other-lib', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/lib/other-lib.js')); + }); + + resolve('root', { basedir: dir }, function (err, res) { + t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('zzz', { basedir: dir, paths: [otherDir] }, function (err, res) { + t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('path iterator', function (t) { + t.plan(2); + + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + resolve('baz', { packageIterator: exactIterator }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'baz/quux.js')); + t.equal(pkg && pkg.name, 'baz'); + }); +}); + +test('incorrect main', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + resolve('./incorrect_main', { basedir: resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('missing index', function (t) { + t.plan(2); + + var resolverDir = path.join(__dirname, 'resolver'); + resolve('./missing_index', { basedir: resolverDir }, function (err, res, pkg) { + t.ok(err instanceof Error); + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + }); +}); + +test('missing main', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver'); + + resolve('./missing_main', { basedir: resolverDir }, function (err, res, pkg) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + }); +}); + +test('null main', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver'); + + resolve('./null_main', { basedir: resolverDir }, function (err, res, pkg) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + }); +}); + +test('main: false', function (t) { + t.plan(2); + + var basedir = path.join(__dirname, 'resolver'); + var dir = path.join(basedir, 'false_main'); + resolve('./false_main', { basedir: basedir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal( + res, + path.join(dir, 'index.js'), + '`"main": false`: resolves to `index.js`' + ); + t.deepEqual(pkg, { + name: 'false_main', + main: false + }); + }); +}); + +test('without basedir', function (t) { + t.plan(1); + + var dir = path.join(__dirname, 'resolver/without_basedir'); + var tester = require(path.join(dir, 'main.js')); // eslint-disable-line global-require + + tester(t, function (err, res, pkg) { + if (err) { + t.fail(err); + } else { + t.equal(res, path.join(dir, 'node_modules/mymodule.js')); + } + }); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo.js')); + }); + + resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); + + resolve('.', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('async: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.plan(1); + resolve('./' + testFile, function (err, res, pkg) { + if (err) t.fail(err); + st.equal(res, __filename, 'sanity check'); + }); + }); + + t.test('with a fake directory', function (st) { + st.plan(4); + + resolve('./' + testFile + '/blah', function (err, res, pkg) { + st.ok(err, 'there is an error'); + st.notOk(res, 'no result'); + + st.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + err && err.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + st.end(); + }); + }); + + t.end(); +}); + +test('async dot main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('async dot slash main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_slash_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('not a directory', function (t) { + t.plan(6); + var path = './foo'; + resolve(path, { basedir: __filename }, function (err, res, pkg) { + t.ok(err, 'a non-directory errors'); + t.equal(arguments.length, 1); + t.equal(res, undefined); + t.equal(pkg, undefined); + + t.equal(err && err.message, 'Cannot find module \'' + path + '\' from \'' + __filename + '\''); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid_main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid_main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('browser field in package.json', function (t) { + t.plan(3); + + var dir = path.join(__dirname, 'resolver'); + resolve( + './browser_field', + { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign + } + return pkg; + } + }, + function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.equal(pkg && pkg.main, 'b'); + t.equal(pkg && pkg.browser, undefined); + } + ); +}); + +test('absolute paths', function (t) { + t.plan(4); + + var extensionless = __filename.slice(0, -path.extname(__filename).length); + + resolve(__filename, function (err, res) { + t.equal( + res, + __filename, + 'absolute path to this file resolves' + ); + }); + resolve(extensionless, function (err, res) { + t.equal( + res, + __filename, + 'extensionless absolute path to this file resolves' + ); + }); + resolve(__filename, { basedir: process.cwd() }, function (err, res) { + t.equal( + res, + __filename, + 'absolute path to this file with a basedir resolves' + ); + }); + resolve(extensionless, { basedir: process.cwd() }, function (err, res) { + t.equal( + res, + __filename, + 'extensionless absolute path to this file with a basedir resolves' + ); + }); +}); + +var malformedDir = path.join(__dirname, 'resolver/malformed_package_json'); +test('malformed package.json', { skip: !fs.existsSync(malformedDir) }, function (t) { + /* eslint operator-linebreak: ["error", "before"], function-paren-newline: "off" */ + t.plan( + (3 * 3) // 3 sets of 3 assertions in the final callback + + 2 // 1 readPackage call with malformed package.json + ); + + var basedir = malformedDir; + var expected = path.join(basedir, 'index.js'); + + resolve('./index.js', { basedir: basedir }, function (err, res, pkg) { + t.error(err, 'no error'); + t.equal(res, expected, 'malformed package.json is silently ignored'); + t.equal(pkg, undefined, 'malformed package.json gives an undefined `pkg` argument'); + }); + + resolve( + './index.js', + { + basedir: basedir, + packageFilter: function (pkg, pkgfile, dir) { + t.fail('should not reach here'); + } + }, + function (err, res, pkg) { + t.error(err, 'with packageFilter: no error'); + t.equal(res, expected, 'with packageFilter: malformed package.json is silently ignored'); + t.equal(pkg, undefined, 'with packageFilter: malformed package.json gives an undefined `pkg` argument'); + } + ); + + resolve( + './index.js', + { + basedir: basedir, + readPackage: function (readFile, pkgfile, cb) { + t.equal(pkgfile, path.join(basedir, 'package.json'), 'readPackageSync: `pkgfile` is package.json path'); + readFile(pkgfile, function (err, result) { + try { + cb(null, JSON.parse(result)); + } catch (e) { + t.ok(e instanceof SyntaxError, 'readPackage: malformed package.json parses as a syntax error'); + cb(null); + } + }); + } + }, + function (err, res, pkg) { + t.error(err, 'with readPackage: no error'); + t.equal(res, expected, 'with readPackage: malformed package.json is silently ignored'); + t.equal(pkg, undefined, 'with readPackage: malformed package.json gives an undefined `pkg` argument'); + } + ); +}); diff --git a/node_modules/resolve/test/resolver/baz/doom.js b/node_modules/resolve/test/resolver/baz/doom.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/baz/package.json b/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 0000000..2f77720 --- /dev/null +++ b/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,4 @@ +{ + "name": "baz", + "main": "quux.js" +} diff --git a/node_modules/resolve/test/resolver/baz/quux.js b/node_modules/resolve/test/resolver/baz/quux.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/baz/quux.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/browser_field/a.js b/node_modules/resolve/test/resolver/browser_field/a.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/browser_field/b.js b/node_modules/resolve/test/resolver/browser_field/b.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/browser_field/package.json b/node_modules/resolve/test/resolver/browser_field/package.json new file mode 100644 index 0000000..bf406f0 --- /dev/null +++ b/node_modules/resolve/test/resolver/browser_field/package.json @@ -0,0 +1,5 @@ +{ + "name": "browser_field", + "main": "a", + "browser": "b" +} diff --git a/node_modules/resolve/test/resolver/cup.coffee b/node_modules/resolve/test/resolver/cup.coffee new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/node_modules/resolve/test/resolver/cup.coffee @@ -0,0 +1 @@ + diff --git a/node_modules/resolve/test/resolver/dot_main/index.js b/node_modules/resolve/test/resolver/dot_main/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/dot_main/package.json b/node_modules/resolve/test/resolver/dot_main/package.json new file mode 100644 index 0000000..d7f4fc8 --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "." +} diff --git a/node_modules/resolve/test/resolver/dot_slash_main/index.js b/node_modules/resolve/test/resolver/dot_slash_main/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_slash_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/dot_slash_main/package.json b/node_modules/resolve/test/resolver/dot_slash_main/package.json new file mode 100644 index 0000000..f51287b --- /dev/null +++ b/node_modules/resolve/test/resolver/dot_slash_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "./" +} diff --git a/node_modules/resolve/test/resolver/false_main/index.js b/node_modules/resolve/test/resolver/false_main/index.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/false_main/package.json b/node_modules/resolve/test/resolver/false_main/package.json new file mode 100644 index 0000000..a7416c0 --- /dev/null +++ b/node_modules/resolve/test/resolver/false_main/package.json @@ -0,0 +1,4 @@ +{ + "name": "false_main", + "main": false +} diff --git a/node_modules/resolve/test/resolver/foo.js b/node_modules/resolve/test/resolver/foo.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/foo.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/incorrect_main/index.js b/node_modules/resolve/test/resolver/incorrect_main/index.js new file mode 100644 index 0000000..bc1fb0a --- /dev/null +++ b/node_modules/resolve/test/resolver/incorrect_main/index.js @@ -0,0 +1,2 @@ +// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/incorrect_main/package.json b/node_modules/resolve/test/resolver/incorrect_main/package.json new file mode 100644 index 0000000..b718804 --- /dev/null +++ b/node_modules/resolve/test/resolver/incorrect_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "wrong.js" +} diff --git a/node_modules/resolve/test/resolver/invalid_main/package.json b/node_modules/resolve/test/resolver/invalid_main/package.json new file mode 100644 index 0000000..0590748 --- /dev/null +++ b/node_modules/resolve/test/resolver/invalid_main/package.json @@ -0,0 +1,7 @@ +{ + "name": "invalid_main", + "main": [ + "why is this a thing", + "srsly omg wtf" + ] +} diff --git a/node_modules/resolve/test/resolver/mug.coffee b/node_modules/resolve/test/resolver/mug.coffee new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/mug.js b/node_modules/resolve/test/resolver/mug.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/multirepo/lerna.json b/node_modules/resolve/test/resolver/multirepo/lerna.json new file mode 100644 index 0000000..d6707ca --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "0.0.0" +} diff --git a/node_modules/resolve/test/resolver/multirepo/package.json b/node_modules/resolve/test/resolver/multirepo/package.json new file mode 100644 index 0000000..4391d39 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/package.json @@ -0,0 +1,20 @@ +{ + "name": "ljharb-monorepo-symlink-test", + "private": true, + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "postinstall": "lerna bootstrap", + "test": "node packages/package-a" + }, + "author": "", + "license": "MIT", + "dependencies": { + "jquery": "^3.3.1", + "resolve": "../../../" + }, + "devDependencies": { + "lerna": "^3.4.3" + } +} diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js b/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js new file mode 100644 index 0000000..8875a32 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var assert = require('assert'); +var path = require('path'); +var resolve = require('resolve'); + +var basedir = __dirname + '/node_modules/@my-scope/package-b'; + +var expected = path.join(__dirname, '../../node_modules/jquery/dist/jquery.js'); + +/* + * preserveSymlinks === false + * will search NPM package from + * - packages/package-b/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: false }), expected); +assert.equal(resolve.sync('../../node_modules/jquery', { basedir: basedir, preserveSymlinks: false }), expected); + +/* + * preserveSymlinks === true + * will search NPM package from + * - packages/package-a/node_modules/@my-scope/packages/package-b/node_modules + * - packages/package-a/node_modules/@my-scope/packages/node_modules + * - packages/package-a/node_modules/@my-scope/node_modules + * - packages/package-a/node_modules/node_modules + * - packages/package-a/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: true }), expected); +assert.equal(resolve.sync('../../../../../node_modules/jquery', { basedir: basedir, preserveSymlinks: true }), expected); + +console.log(' * all monorepo paths successfully resolved through symlinks'); diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json b/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json new file mode 100644 index 0000000..204de51 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-a", + "version": "0.0.0", + "private": true, + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-b": "^0.0.0" + } +} diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js b/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json b/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json new file mode 100644 index 0000000..f57c3b5 --- /dev/null +++ b/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-b", + "private": true, + "version": "0.0.0", + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-a": "^0.0.0" + } +} diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js b/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js new file mode 100644 index 0000000..9b4846a --- /dev/null +++ b/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js @@ -0,0 +1,26 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b; +var c; + +var test = function test() { + console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); + console.log(b, ': preserveSymlinks true'); + console.log(c, ': preserveSymlinks false'); + + if (a !== b && a !== c) { + throw 'async: no match'; + } + console.log('async: success! a matched either b or c\n'); +}; + +require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) { + if (err) { throw err; } + b = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); +require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) { + if (err) { throw err; } + c = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); + diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json b/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json new file mode 100644 index 0000000..acfe9e9 --- /dev/null +++ b/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json @@ -0,0 +1,15 @@ +{ + "name": "mylib", + "version": "0.0.0", + "description": "", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "buffer": "*" + } +} diff --git a/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js b/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js new file mode 100644 index 0000000..3283efc --- /dev/null +++ b/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js @@ -0,0 +1,12 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD'); +var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD'); + +console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); +console.log(b, ': preserveSymlinks true'); +console.log(c, ': preserveSymlinks false'); + +if (a !== b && a !== c) { + throw 'sync: no match'; +} +console.log('sync: success! a matched either b or c\n'); diff --git a/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/node_modules/resolve/test/resolver/other_path/lib/other-lib.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/other_path/root.js b/node_modules/resolve/test/resolver/other_path/root.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/quux/foo/index.js b/node_modules/resolve/test/resolver/quux/foo/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/quux/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/same_names/foo.js b/node_modules/resolve/test/resolver/same_names/foo.js new file mode 100644 index 0000000..888cae3 --- /dev/null +++ b/node_modules/resolve/test/resolver/same_names/foo.js @@ -0,0 +1 @@ +module.exports = 42; diff --git a/node_modules/resolve/test/resolver/same_names/foo/index.js b/node_modules/resolve/test/resolver/same_names/foo/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/resolve/test/resolver/same_names/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js b/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/resolver/symlinked/package/bar.js b/node_modules/resolve/test/resolver/symlinked/package/bar.js new file mode 100644 index 0000000..cb1c2c0 --- /dev/null +++ b/node_modules/resolve/test/resolver/symlinked/package/bar.js @@ -0,0 +1 @@ +module.exports = 'bar'; diff --git a/node_modules/resolve/test/resolver/symlinked/package/package.json b/node_modules/resolve/test/resolver/symlinked/package/package.json new file mode 100644 index 0000000..8e1b585 --- /dev/null +++ b/node_modules/resolve/test/resolver/symlinked/package/package.json @@ -0,0 +1,3 @@ +{ + "main": "bar.js" +} \ No newline at end of file diff --git a/node_modules/resolve/test/resolver/without_basedir/main.js b/node_modules/resolve/test/resolver/without_basedir/main.js new file mode 100644 index 0000000..5b31975 --- /dev/null +++ b/node_modules/resolve/test/resolver/without_basedir/main.js @@ -0,0 +1,5 @@ +var resolve = require('../../../'); + +module.exports = function (t, cb) { + resolve('mymodule', null, cb); +}; diff --git a/node_modules/resolve/test/resolver_sync.js b/node_modules/resolve/test/resolver_sync.js new file mode 100644 index 0000000..a6df8ce --- /dev/null +++ b/node_modules/resolve/test/resolver_sync.js @@ -0,0 +1,730 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); + +var resolve = require('../'); +var sync = require('../sync'); + +var requireResolveSupportsPaths = require.resolve.length > 1 + && !(/^v12\.[012]\./).test(process.version); // broken in v12.0-12.2, see https://github.com/nodejs/node/issues/27794 + +var requireResolveDefaultPathsBroken = (/^v8\.9\.|^v9\.[01]\.0|^v9\.2\./).test(process.version); +// broken in node v8.9.x, v9.0, v9.1, v9.2.x. see https://github.com/nodejs/node/pull/17113 + +test('`./sync` entry point', function (t) { + t.equal(resolve.sync, sync, '`./sync` entry point is the same as `.sync` on `main`'); + t.end(); +}); + +test('foo', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: dir }), + path.join(dir, 'foo.js'), + './foo' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./foo', { basedir: dir }), + require.resolve('./foo', { paths: [dir] }), + './foo: resolve.sync === require.resolve' + ); + } + + t.equal( + resolve.sync('./foo.js', { basedir: dir }), + path.join(dir, 'foo.js'), + './foo.js' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./foo.js', { basedir: dir }), + require.resolve('./foo.js', { paths: [dir] }), + './foo.js: resolve.sync === require.resolve' + ); + } + + t.equal( + resolve.sync('./foo.js', { basedir: dir, filename: path.join(dir, 'bar.js') }), + path.join(dir, 'foo.js') + ); + + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }); + + // Test that filename is reported as the "from" value when passed. + t.throws( + function () { + resolve.sync('foo', { basedir: dir, filename: path.join(dir, 'bar.js') }); + }, + { + name: 'Error', + message: "Cannot find module 'foo' from '" + path.join(dir, 'bar.js') + "'" + } + ); + + t.end(); +}); + +test('bar', function (t) { + var dir = path.join(__dirname, 'resolver'); + + var basedir = path.join(dir, 'bar'); + + t.equal( + resolve.sync('foo', { basedir: basedir }), + path.join(dir, 'bar/node_modules/foo/index.js'), + 'foo in bar' + ); + if (!requireResolveDefaultPathsBroken && requireResolveSupportsPaths) { + t.equal( + resolve.sync('foo', { basedir: basedir }), + require.resolve('foo', { paths: [basedir] }), + 'foo in bar: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('baz', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./baz', { basedir: dir }), + path.join(dir, 'baz/quux.js'), + './baz' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./baz', { basedir: dir }), + require.resolve('./baz', { paths: [dir] }), + './baz: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('biz', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + + t.equal( + resolve.sync('./grux', { basedir: dir }), + path.join(dir, 'grux/index.js') + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./grux', { basedir: dir }), + require.resolve('./grux', { paths: [dir] }), + './grux: resolve.sync === require.resolve' + ); + } + + var tivDir = path.join(dir, 'grux'); + t.equal( + resolve.sync('tiv', { basedir: tivDir }), + path.join(dir, 'tiv/index.js') + ); + if (!requireResolveDefaultPathsBroken && requireResolveSupportsPaths) { + t.equal( + resolve.sync('tiv', { basedir: tivDir }), + require.resolve('tiv', { paths: [tivDir] }), + 'tiv: resolve.sync === require.resolve' + ); + } + + var gruxDir = path.join(dir, 'tiv'); + t.equal( + resolve.sync('grux', { basedir: gruxDir }), + path.join(dir, 'grux/index.js') + ); + if (!requireResolveDefaultPathsBroken && requireResolveSupportsPaths) { + t.equal( + resolve.sync('grux', { basedir: gruxDir }), + require.resolve('grux', { paths: [gruxDir] }), + 'grux: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('normalize', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + + t.equal( + resolve.sync('../grux', { basedir: dir }), + path.join(dir, 'index.js') + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('../grux', { basedir: dir }), + require.resolve('../grux', { paths: [dir] }), + '../grux: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('cup', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'cup.coffee'), + './cup -> ./cup.coffee' + ); + + t.equal( + resolve.sync('./cup.coffee', { basedir: dir }), + path.join(dir, 'cup.coffee'), + './cup.coffee' + ); + + t.throws(function () { + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js'] + }); + }); + + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./cup.coffee', { basedir: dir, extensions: ['.js', '.coffee'] }), + require.resolve('./cup.coffee', { paths: [dir] }), + './cup.coffee: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('mug', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./mug', { basedir: dir }), + path.join(dir, 'mug.js'), + './mug -> ./mug.js' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./mug', { basedir: dir }), + require.resolve('./mug', { paths: [dir] }), + './mug: resolve.sync === require.resolve' + ); + } + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.coffee', '.js'] + }), + path.join(dir, 'mug.coffee'), + './mug -> ./mug.coffee' + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'mug.js'), + './mug -> ./mug.js' + ); + + t.end(); +}); + +test('other path', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + t.equal( + resolve.sync('root', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/root.js') + ); + + t.equal( + resolve.sync('lib/other-lib', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/lib/other-lib.js') + ); + + t.throws(function () { + resolve.sync('root', { basedir: dir }); + }); + + t.throws(function () { + resolve.sync('zzz', { + basedir: dir, + paths: [otherDir] + }); + }); + + t.end(); +}); + +test('path iterator', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + t.equal( + resolve.sync('baz', { packageIterator: exactIterator }), + path.join(resolverDir, 'baz/quux.js') + ); + + t.end(); +}); + +test('incorrect main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + t.equal( + resolve.sync('./incorrect_main', { basedir: resolverDir }), + path.join(dir, 'index.js') + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./incorrect_main', { basedir: resolverDir }), + require.resolve('./incorrect_main', { paths: [resolverDir] }), + './incorrect_main: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('missing index', function (t) { + t.plan(requireResolveSupportsPaths ? 2 : 1); + + var resolverDir = path.join(__dirname, 'resolver'); + try { + resolve.sync('./missing_index', { basedir: resolverDir }); + t.fail('did not fail'); + } catch (err) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + } + if (requireResolveSupportsPaths) { + try { + require.resolve('./missing_index', { basedir: resolverDir }); + t.fail('require.resolve did not fail'); + } catch (err) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + } + } +}); + +test('missing main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + + try { + resolve.sync('./missing_main', { basedir: resolverDir }); + t.fail('require.resolve did not fail'); + } catch (err) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + } + if (requireResolveSupportsPaths) { + try { + resolve.sync('./missing_main', { basedir: resolverDir }); + t.fail('require.resolve did not fail'); + } catch (err) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + } + } + + t.end(); +}); + +test('null main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + + try { + resolve.sync('./null_main', { basedir: resolverDir }); + t.fail('require.resolve did not fail'); + } catch (err) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + } + if (requireResolveSupportsPaths) { + try { + resolve.sync('./null_main', { basedir: resolverDir }); + t.fail('require.resolve did not fail'); + } catch (err) { + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code'); + } + } + + t.end(); +}); + +test('main: false', function (t) { + var basedir = path.join(__dirname, 'resolver'); + var dir = path.join(basedir, 'false_main'); + t.equal( + resolve.sync('./false_main', { basedir: basedir }), + path.join(dir, 'index.js'), + '`"main": false`: resolves to `index.js`' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./false_main', { basedir: basedir }), + require.resolve('./false_main', { paths: [basedir] }), + '`"main": false`: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +var stubStatSync = function stubStatSync(fn) { + var statSync = fs.statSync; + try { + fs.statSync = function () { + throw new EvalError('Unknown Error'); + }; + return fn(); + } finally { + fs.statSync = statSync; + } +}; + +test('#79 - re-throw non ENOENT errors from stat', function (t) { + var dir = path.join(__dirname, 'resolver'); + + stubStatSync(function () { + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }, /Unknown Error/); + }); + + t.end(); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + var basedir = path.join(dir, 'same_names'); + + t.equal( + resolve.sync('./foo', { basedir: basedir }), + path.join(dir, 'same_names/foo.js') + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./foo', { basedir: basedir }), + require.resolve('./foo', { paths: [basedir] }), + './foo: resolve.sync === require.resolve' + ); + } + + t.equal( + resolve.sync('./foo/', { basedir: basedir }), + path.join(dir, 'same_names/foo/index.js') + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./foo/', { basedir: basedir }), + require.resolve('./foo/', { paths: [basedir] }), + './foo/: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + var basedir = path.join(dir, 'same_names/foo'); + + t.equal( + resolve.sync('./', { basedir: basedir }), + path.join(dir, 'same_names/foo/index.js'), + './' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./', { basedir: basedir }), + require.resolve('./', { paths: [basedir] }), + './: resolve.sync === require.resolve' + ); + } + + t.equal( + resolve.sync('.', { basedir: basedir }), + path.join(dir, 'same_names/foo/index.js'), + '.' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('.', { basedir: basedir }), + require.resolve('.', { paths: [basedir] }), + '.: resolve.sync === require.resolve', + { todo: true } + ); + } + + t.end(); +}); + +test('sync: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.equal( + resolve.sync('./' + testFile), + __filename, + 'sanity check' + ); + st.equal( + resolve.sync('./' + testFile), + require.resolve('./' + testFile), + 'sanity check: resolve.sync === require.resolve' + ); + + st.end(); + }); + + t.test('with a fake directory', function (st) { + function run() { return resolve.sync('./' + testFile + '/blah'); } + + st.throws(run, 'throws an error'); + + try { + run(); + } catch (e) { + st.equal(e.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + e.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + } + + st.end(); + }); + + t.end(); +}); + +test('sync dot main', function (t) { + var start = new Date(); + + t.equal( + resolve.sync('./resolver/dot_main'), + path.join(__dirname, 'resolver/dot_main/index.js'), + './resolver/dot_main' + ); + t.equal( + resolve.sync('./resolver/dot_main'), + require.resolve('./resolver/dot_main'), + './resolver/dot_main: resolve.sync === require.resolve' + ); + + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + + t.end(); +}); + +test('sync dot slash main', function (t) { + var start = new Date(); + + t.equal( + resolve.sync('./resolver/dot_slash_main'), + path.join(__dirname, 'resolver/dot_slash_main/index.js') + ); + t.equal( + resolve.sync('./resolver/dot_slash_main'), + require.resolve('./resolver/dot_slash_main'), + './resolver/dot_slash_main: resolve.sync === require.resolve' + ); + + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + + t.end(); +}); + +test('not a directory', function (t) { + var path = './foo'; + try { + resolve.sync(path, { basedir: __filename }); + t.fail(); + } catch (err) { + t.ok(err, 'a non-directory errors'); + t.equal(err && err.message, 'Cannot find module \'' + path + "' from '" + __filename + "'"); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid_main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid_main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('browser field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + var res = resolve.sync('./browser_field', { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign + } + return pkg; + } + }); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.end(); +}); + +test('absolute paths', function (t) { + var extensionless = __filename.slice(0, -path.extname(__filename).length); + + t.equal( + resolve.sync(__filename), + __filename, + 'absolute path to this file resolves' + ); + t.equal( + resolve.sync(__filename), + require.resolve(__filename), + 'absolute path to this file: resolve.sync === require.resolve' + ); + + t.equal( + resolve.sync(extensionless), + __filename, + 'extensionless absolute path to this file resolves' + ); + t.equal( + resolve.sync(__filename), + require.resolve(__filename), + 'absolute path to this file: resolve.sync === require.resolve' + ); + + t.equal( + resolve.sync(__filename, { basedir: process.cwd() }), + __filename, + 'absolute path to this file with a basedir resolves' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync(__filename, { basedir: process.cwd() }), + require.resolve(__filename, { paths: [process.cwd()] }), + 'absolute path to this file + basedir: resolve.sync === require.resolve' + ); + } + + t.equal( + resolve.sync(extensionless, { basedir: process.cwd() }), + __filename, + 'extensionless absolute path to this file with a basedir resolves' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync(extensionless, { basedir: process.cwd() }), + require.resolve(extensionless, { paths: [process.cwd()] }), + 'extensionless absolute path to this file + basedir: resolve.sync === require.resolve' + ); + } + + t.end(); +}); + +var malformedDir = path.join(__dirname, 'resolver/malformed_package_json'); +test('malformed package.json', { skip: !fs.existsSync(malformedDir) }, function (t) { + t.plan(5 + (requireResolveSupportsPaths ? 1 : 0)); + + var basedir = malformedDir; + var expected = path.join(basedir, 'index.js'); + + t.equal( + resolve.sync('./index.js', { basedir: basedir }), + expected, + 'malformed package.json is silently ignored' + ); + if (requireResolveSupportsPaths) { + t.equal( + resolve.sync('./index.js', { basedir: basedir }), + require.resolve('./index.js', { paths: [basedir] }), + 'malformed package.json: resolve.sync === require.resolve' + ); + } + + var res1 = resolve.sync( + './index.js', + { + basedir: basedir, + packageFilter: function (pkg, pkgfile, dir) { + t.fail('should not reach here'); + } + } + ); + + t.equal( + res1, + expected, + 'with packageFilter: malformed package.json is silently ignored' + ); + + var res2 = resolve.sync( + './index.js', + { + basedir: basedir, + readPackageSync: function (readFileSync, pkgfile) { + t.equal(pkgfile, path.join(basedir, 'package.json'), 'readPackageSync: `pkgfile` is package.json path'); + var result = String(readFileSync(pkgfile)); + try { + return JSON.parse(result); + } catch (e) { + t.ok(e instanceof SyntaxError, 'readPackageSync: malformed package.json parses as a syntax error'); + } + } + } + ); + + t.equal( + res2, + expected, + 'with readPackageSync: malformed package.json is silently ignored' + ); +}); diff --git a/node_modules/resolve/test/shadowed_core.js b/node_modules/resolve/test/shadowed_core.js new file mode 100644 index 0000000..3a5f4fc --- /dev/null +++ b/node_modules/resolve/test/shadowed_core.js @@ -0,0 +1,54 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('shadowed core modules still return core module', function (t) { + t.plan(2); + + resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, 'util'); + }); +}); + +test('shadowed core modules still return core module [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, 'util'); +}); + +test('shadowed core modules return shadow when appending `/`', function (t) { + t.plan(2); + + resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); + }); +}); + +test('shadowed core modules return shadow when appending `/` [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); +}); + +test('shadowed core modules return shadow with `includeCoreModules: false`', function (t) { + t.plan(2); + + resolve('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); + }); +}); + +test('shadowed core modules return shadow with `includeCoreModules: false` [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }); + + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); +}); diff --git a/node_modules/resolve/test/shadowed_core/node_modules/util/index.js b/node_modules/resolve/test/shadowed_core/node_modules/util/index.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/resolve/test/subdirs.js b/node_modules/resolve/test/subdirs.js new file mode 100644 index 0000000..b7b8450 --- /dev/null +++ b/node_modules/resolve/test/subdirs.js @@ -0,0 +1,13 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('subdirs', function (t) { + t.plan(2); + + var dir = path.join(__dirname, '/subdirs'); + resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); + }); +}); diff --git a/node_modules/resolve/test/symlinks.js b/node_modules/resolve/test/symlinks.js new file mode 100644 index 0000000..35f881a --- /dev/null +++ b/node_modules/resolve/test/symlinks.js @@ -0,0 +1,176 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); +var map = require('array.prototype.map'); +var resolve = require('../'); + +var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); +var packageDir = path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'package'); +var modADir = path.join(__dirname, 'symlinks', 'source', 'node_modules', 'mod-a'); +var symlinkModADir = path.join(__dirname, 'symlinks', 'dest', 'node_modules', 'mod-a'); +try { + fs.unlinkSync(symlinkDir); +} catch (err) {} +try { + fs.unlinkSync(packageDir); +} catch (err) {} +try { + fs.unlinkSync(modADir); +} catch (err) {} +try { + fs.unlinkSync(symlinkModADir); +} catch (err) {} + +try { + fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); +} +try { + fs.symlinkSync('../../package', packageDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'package') + '\\', packageDir, 'junction'); +} +try { + fs.symlinkSync('../../source/node_modules/mod-a', symlinkModADir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'source', 'node_modules', 'mod-a') + '\\', symlinkModADir, 'junction'); +} + +test('symlink', function (t) { + t.plan(2); + + resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { + t.error(err); + t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.plan(4); + + resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { + t.ok(err, 'there is an error'); + t.notOk(res, 'no result'); + + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + t.equal( + err && err.message, + 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', + 'can not find nonexistent module' + ); + }); +}); + +test('sync symlink', function (t) { + var start = new Date(); + t.doesNotThrow(function () { + t.equal( + resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), + path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js') + ); + }); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.throws(function () { + resolve.sync('foo', { basedir: symlinkDir }); + }, /Cannot find module 'foo'/); + t.end(); +}); + +test('sync symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + var fn = resolve.sync('package', { basedir: basedir, preserveSymlinks: false }); + + t.equal(fn, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + t.end(); +}); + +test('async symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + t.plan(2); + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + resolve('package', { basedir: basedir, preserveSymlinks: false }, function (err, result) { + t.notOk(err, 'no error'); + t.equal(result, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + }); +}); + +test('packageFilter', function (t) { + function relative(x) { + return path.relative(__dirname, x); + } + + function testPackageFilter(preserveSymlinks) { + return function (st) { + st.plan('is 1.x' ? 3 : 5); // eslint-disable-line no-constant-condition + + var destMain = 'symlinks/dest/node_modules/mod-a/index.js'; + var destPkg = 'symlinks/dest/node_modules/mod-a/package.json'; + var sourceMain = 'symlinks/source/node_modules/mod-a/index.js'; + var sourcePkg = 'symlinks/source/node_modules/mod-a/package.json'; + var destDir = path.join(__dirname, 'symlinks', 'dest'); + + /* eslint multiline-comment-style: 0 */ + /* v2.x will restore these tests + var packageFilterPath = []; + var actualPath = resolve.sync('mod-a', { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile, dir) { + packageFilterPath.push(pkgfile); + } + }); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'sync: actual path is correct' + ); + st.deepEqual( + map(packageFilterPath, relative), + map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize), + 'sync: packageFilter pkgfile arg is correct' + ); + */ + + var asyncPackageFilterPath = []; + resolve( + 'mod-a', + { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile) { + asyncPackageFilterPath.push(pkgfile); + } + }, + function (err, actualPath) { + st.error(err, 'no error'); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'async: actual path is correct' + ); + st.deepEqual( + map(asyncPackageFilterPath, relative), + map( + preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg], + path.normalize + ), + 'async: packageFilter pkgfile arg is correct' + ); + } + ); + }; + } + + t.test('preserveSymlinks: false', testPackageFilter(false)); + + t.test('preserveSymlinks: true', testPackageFilter(true)); + + t.end(); +}); diff --git a/node_modules/reusify/.coveralls.yml b/node_modules/reusify/.coveralls.yml new file mode 100644 index 0000000..359f683 --- /dev/null +++ b/node_modules/reusify/.coveralls.yml @@ -0,0 +1 @@ +repo_token: yIxhFqtaaz5iGVYfie9mODehFYogm8S8L diff --git a/node_modules/reusify/.travis.yml b/node_modules/reusify/.travis.yml new file mode 100644 index 0000000..1970476 --- /dev/null +++ b/node_modules/reusify/.travis.yml @@ -0,0 +1,28 @@ +language: node_js +sudo: false + +node_js: + - 9 + - 8 + - 7 + - 6 + - 5 + - 4 + - 4.0 + - iojs-v3 + - iojs-v2 + - iojs-v1 + - 0.12 + - 0.10 + +cache: + directories: + - node_modules + +after_script: +- npm run coverage + +notifications: + email: + on_success: never + on_failure: always diff --git a/node_modules/reusify/LICENSE b/node_modules/reusify/LICENSE new file mode 100644 index 0000000..fbf3a01 --- /dev/null +++ b/node_modules/reusify/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Matteo Collina + +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/reusify/README.md b/node_modules/reusify/README.md new file mode 100644 index 0000000..badcb7c --- /dev/null +++ b/node_modules/reusify/README.md @@ -0,0 +1,145 @@ +# reusify + +[![npm version][npm-badge]][npm-url] +[![Build Status][travis-badge]][travis-url] +[![Coverage Status][coveralls-badge]][coveralls-url] + +Reuse your objects and functions for maximum speed. This technique will +make any function run ~10% faster. You call your functions a +lot, and it adds up quickly in hot code paths. + +``` +$ node benchmarks/createNoCodeFunction.js +Total time 53133 +Total iterations 100000000 +Iteration/s 1882069.5236482036 + +$ node benchmarks/reuseNoCodeFunction.js +Total time 50617 +Total iterations 100000000 +Iteration/s 1975620.838848608 +``` + +The above benchmark uses fibonacci to simulate a real high-cpu load. +The actual numbers might differ for your use case, but the difference +should not. + +The benchmark was taken using Node v6.10.0. + +This library was extracted from +[fastparallel](http://npm.im/fastparallel). + +## Example + +```js +var reusify = require('reusify') +var fib = require('reusify/benchmarks/fib') +var instance = reusify(MyObject) + +// get an object from the cache, +// or creates a new one when cache is empty +var obj = instance.get() + +// set the state +obj.num = 100 +obj.func() + +// reset the state. +// if the state contains any external object +// do not use delete operator (it is slow) +// prefer set them to null +obj.num = 0 + +// store an object in the cache +instance.release(obj) + +function MyObject () { + // you need to define this property + // so V8 can compile MyObject into an + // hidden class + this.next = null + this.num = 0 + + var that = this + + // this function is never reallocated, + // so it can be optimized by V8 + this.func = function () { + if (null) { + // do nothing + } else { + // calculates fibonacci + fib(that.num) + } + } +} +``` + +The above example was intended for synchronous code, let's see async: +```js +var reusify = require('reusify') +var instance = reusify(MyObject) + +for (var i = 0; i < 100; i++) { + getData(i, console.log) +} + +function getData (value, cb) { + var obj = instance.get() + + obj.value = value + obj.cb = cb + obj.run() +} + +function MyObject () { + this.next = null + this.value = null + + var that = this + + this.run = function () { + asyncOperation(that.value, that.handle) + } + + this.handle = function (err, result) { + that.cb(err, result) + that.value = null + that.cb = null + instance.release(that) + } +} +``` + +Also note how in the above examples, the code, that consumes an istance of `MyObject`, +reset the state to initial condition, just before storing it in the cache. +That's needed so that every subsequent request for an instance from the cache, +could get a clean instance. + +## Why + +It is faster because V8 doesn't have to collect all the functions you +create. On a short-lived benchmark, it is as fast as creating the +nested function, but on a longer time frame it creates less +pressure on the garbage collector. + +## Other examples +If you want to see some complex example, checkout [middie](https://github.com/fastify/middie) and [steed](https://github.com/mcollina/steed). + +## Acknowledgements + +Thanks to [Trevor Norris](https://github.com/trevnorris) for +getting me down the rabbit hole of performance, and thanks to [Mathias +Buss](http://github.com/mafintosh) for suggesting me to share this +trick. + +## License + +MIT + +[npm-badge]: https://badge.fury.io/js/reusify.svg +[npm-url]: https://badge.fury.io/js/reusify +[travis-badge]: https://api.travis-ci.org/mcollina/reusify.svg +[travis-url]: https://travis-ci.org/mcollina/reusify +[coveralls-badge]: https://coveralls.io/repos/mcollina/reusify/badge.svg?branch=master&service=github +[coveralls-url]: https://coveralls.io/github/mcollina/reusify?branch=master diff --git a/node_modules/reusify/benchmarks/createNoCodeFunction.js b/node_modules/reusify/benchmarks/createNoCodeFunction.js new file mode 100644 index 0000000..ce1aac7 --- /dev/null +++ b/node_modules/reusify/benchmarks/createNoCodeFunction.js @@ -0,0 +1,30 @@ +'use strict' + +var fib = require('./fib') +var max = 100000000 +var start = Date.now() + +// create a funcion with the typical error +// pattern, that delegates the heavy load +// to something else +function createNoCodeFunction () { + /* eslint no-constant-condition: "off" */ + var num = 100 + + ;(function () { + if (null) { + // do nothing + } else { + fib(num) + } + })() +} + +for (var i = 0; i < max; i++) { + createNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/benchmarks/fib.js b/node_modules/reusify/benchmarks/fib.js new file mode 100644 index 0000000..e22cc48 --- /dev/null +++ b/node_modules/reusify/benchmarks/fib.js @@ -0,0 +1,13 @@ +'use strict' + +function fib (num) { + var fib = [] + + fib[0] = 0 + fib[1] = 1 + for (var i = 2; i <= num; i++) { + fib[i] = fib[i - 2] + fib[i - 1] + } +} + +module.exports = fib diff --git a/node_modules/reusify/benchmarks/reuseNoCodeFunction.js b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js new file mode 100644 index 0000000..3358d6e --- /dev/null +++ b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js @@ -0,0 +1,38 @@ +'use strict' + +var reusify = require('../') +var fib = require('./fib') +var instance = reusify(MyObject) +var max = 100000000 +var start = Date.now() + +function reuseNoCodeFunction () { + var obj = instance.get() + obj.num = 100 + obj.func() + obj.num = 0 + instance.release(obj) +} + +function MyObject () { + this.next = null + var that = this + this.num = 0 + this.func = function () { + /* eslint no-constant-condition: "off" */ + if (null) { + // do nothing + } else { + fib(that.num) + } + } +} + +for (var i = 0; i < max; i++) { + reuseNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/package.json b/node_modules/reusify/package.json new file mode 100644 index 0000000..ee66aee --- /dev/null +++ b/node_modules/reusify/package.json @@ -0,0 +1,45 @@ +{ + "name": "reusify", + "version": "1.0.4", + "description": "Reuse objects and functions with style", + "main": "reusify.js", + "scripts": { + "lint": "standard", + "test": "tape test.js | faucet", + "istanbul": "istanbul cover tape test.js", + "coverage": "npm run istanbul; cat coverage/lcov.info | coveralls" + }, + "pre-commit": [ + "lint", + "test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/reusify.git" + }, + "keywords": [ + "reuse", + "object", + "performance", + "function", + "fast" + ], + "author": "Matteo Collina ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mcollina/reusify/issues" + }, + "homepage": "https://github.com/mcollina/reusify#readme", + "engines": { + "node": ">=0.10.0", + "iojs": ">=1.0.0" + }, + "devDependencies": { + "coveralls": "^2.13.3", + "faucet": "0.0.1", + "istanbul": "^0.4.5", + "pre-commit": "^1.2.2", + "standard": "^10.0.3", + "tape": "^4.8.0" + } +} diff --git a/node_modules/reusify/reusify.js b/node_modules/reusify/reusify.js new file mode 100644 index 0000000..e6f36f3 --- /dev/null +++ b/node_modules/reusify/reusify.js @@ -0,0 +1,33 @@ +'use strict' + +function reusify (Constructor) { + var head = new Constructor() + var tail = head + + function get () { + var current = head + + if (current.next) { + head = current.next + } else { + head = new Constructor() + tail = head + } + + current.next = null + + return current + } + + function release (obj) { + tail.next = obj + tail = obj + } + + return { + get: get, + release: release + } +} + +module.exports = reusify diff --git a/node_modules/reusify/test.js b/node_modules/reusify/test.js new file mode 100644 index 0000000..929cfd7 --- /dev/null +++ b/node_modules/reusify/test.js @@ -0,0 +1,66 @@ +'use strict' + +var test = require('tape') +var reusify = require('./') + +test('reuse objects', function (t) { + t.plan(6) + + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + + t.notEqual(obj, instance.get(), 'two instance created') + t.notOk(obj.next, 'next must be null') + + instance.release(obj) + + // the internals keeps a hot copy ready for reuse + // putting this one back in the queue + instance.release(instance.get()) + + // comparing the old one with the one we got + // never do this in real code, after release you + // should never reuse that instance + t.equal(obj, instance.get(), 'instance must be reused') +}) + +test('reuse more than 2 objects', function (t) { + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + var obj2 = instance.get() + var obj3 = instance.get() + + t.notOk(obj.next, 'next must be null') + t.notOk(obj2.next, 'next must be null') + t.notOk(obj3.next, 'next must be null') + + t.notEqual(obj, obj2) + t.notEqual(obj, obj3) + t.notEqual(obj3, obj2) + + instance.release(obj) + instance.release(obj2) + instance.release(obj3) + + // skip one + instance.get() + + var obj4 = instance.get() + var obj5 = instance.get() + var obj6 = instance.get() + + t.equal(obj4, obj) + t.equal(obj5, obj2) + t.equal(obj6, obj3) + t.end() +}) diff --git a/node_modules/run-parallel/LICENSE b/node_modules/run-parallel/LICENSE new file mode 100644 index 0000000..c7e6852 --- /dev/null +++ b/node_modules/run-parallel/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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/run-parallel/README.md b/node_modules/run-parallel/README.md new file mode 100644 index 0000000..edc3da4 --- /dev/null +++ b/node_modules/run-parallel/README.md @@ -0,0 +1,85 @@ +# run-parallel [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/run-parallel/master.svg +[travis-url]: https://travis-ci.org/feross/run-parallel +[npm-image]: https://img.shields.io/npm/v/run-parallel.svg +[npm-url]: https://npmjs.org/package/run-parallel +[downloads-image]: https://img.shields.io/npm/dm/run-parallel.svg +[downloads-url]: https://npmjs.org/package/run-parallel +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### Run an array of functions in parallel + +![parallel](https://raw.githubusercontent.com/feross/run-parallel/master/img.png) [![Sauce Test Status](https://saucelabs.com/browser-matrix/run-parallel.svg)](https://saucelabs.com/u/run-parallel) + +### install + +``` +npm install run-parallel +``` + +### usage + +#### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its callback, the main +`callback` is immediately called with the value of the error. Once the `tasks` have +completed, the results are passed to the final `callback` as an array. + +It is also possible to use an object instead of an array. Each property will be run as a +function and the results will be passed to the final `callback` as an object instead of +an array. This can be a more readable way of handling the results. + +##### arguments + +- `tasks` - An array or object containing functions to run. Each function is passed a +`callback(err, result)` which it must call on completion with an error `err` (which can +be `null`) and an optional `result` value. +- `callback(err, results)` - An optional callback to run once all the functions have +completed. This function gets a results array (or object) containing all the result +arguments passed to the task callbacks. + +##### example + +```js +var parallel = require('run-parallel') + +parallel([ + function (callback) { + setTimeout(function () { + callback(null, 'one') + }, 200) + }, + function (callback) { + setTimeout(function () { + callback(null, 'two') + }, 100) + } +], +// optional callback +function (err, results) { + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}) +``` + +This module is basically equavalent to +[`async.parallel`](https://github.com/caolan/async#paralleltasks-callback), but it's +handy to just have the one function you need instead of the kitchen sink. Modularity! +Especially handy if you're serving to the browser and need to reduce your javascript +bundle size. + +Works great in the browser with [browserify](http://browserify.org/)! + +### see also + +- [run-auto](https://github.com/feross/run-auto) +- [run-parallel-limit](https://github.com/feross/run-parallel-limit) +- [run-series](https://github.com/feross/run-series) +- [run-waterfall](https://github.com/feross/run-waterfall) + +### license + +MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/run-parallel/index.js b/node_modules/run-parallel/index.js new file mode 100644 index 0000000..6307141 --- /dev/null +++ b/node_modules/run-parallel/index.js @@ -0,0 +1,51 @@ +/*! run-parallel. MIT License. Feross Aboukhadijeh */ +module.exports = runParallel + +const queueMicrotask = require('queue-microtask') + +function runParallel (tasks, cb) { + let results, pending, keys + let isSync = true + + if (Array.isArray(tasks)) { + results = [] + pending = tasks.length + } else { + keys = Object.keys(tasks) + results = {} + pending = keys.length + } + + function done (err) { + function end () { + if (cb) cb(err, results) + cb = null + } + if (isSync) queueMicrotask(end) + else end() + } + + function each (i, err, result) { + results[i] = result + if (--pending === 0 || err) { + done(err) + } + } + + if (!pending) { + // empty + done(null) + } else if (keys) { + // object + keys.forEach(function (key) { + tasks[key](function (err, result) { each(key, err, result) }) + }) + } else { + // array + tasks.forEach(function (task, i) { + task(function (err, result) { each(i, err, result) }) + }) + } + + isSync = false +} diff --git a/node_modules/run-parallel/package.json b/node_modules/run-parallel/package.json new file mode 100644 index 0000000..1f14757 --- /dev/null +++ b/node_modules/run-parallel/package.json @@ -0,0 +1,58 @@ +{ + "name": "run-parallel", + "description": "Run an array of functions in parallel", + "version": "1.2.0", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/run-parallel/issues" + }, + "dependencies": { + "queue-microtask": "^1.2.2" + }, + "devDependencies": { + "airtap": "^3.0.0", + "standard": "*", + "tape": "^5.0.1" + }, + "homepage": "https://github.com/feross/run-parallel", + "keywords": [ + "parallel", + "async", + "function", + "callback", + "asynchronous", + "run", + "array", + "run parallel" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/run-parallel.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/source-map-js/CHANGELOG.md b/node_modules/source-map-js/CHANGELOG.md new file mode 100644 index 0000000..4cd5307 --- /dev/null +++ b/node_modules/source-map-js/CHANGELOG.md @@ -0,0 +1,320 @@ +# Change Log + +## 1.0.2 + +* Add types for path imports ([#13](https://github.com/7rulnik/source-map-js/pull/13)) [@TrySound](https://github.com/TrySound) + +## 1.0.1 + +* Remove cleanComments optimization ([#10](https://github.com/7rulnik/source-map-js/pull/10)) [@ai](https://github.com/ai) + +## 1.0.0 + +* Fix package.json#typings field ([#6](https://github.com/7rulnik/source-map-js/pull/6)) [@chalkygames123](https://github.com/chalkygames123) + +* Reduce memory usage of eachMapping w/ loop ([#5](https://github.com/7rulnik/source-map-js/pull/5)) [@noppa](https://github.com/noppa) + +* Reduce npm package size ([#7](https://github.com/7rulnik/source-map-js/pull/7)) [@ai](https://github.com/ai) + +---------- +# It doesn't related to this fork: + +## 0.5.6 + +* Fix for regression when people were using numbers as names in source maps. See + #236. + +## 0.5.5 + +* Fix "regression" of unsupported, implementation behavior that half the world + happens to have come to depend on. See #235. + +* Fix regression involving function hoisting in SpiderMonkey. See #233. + +## 0.5.4 + +* Large performance improvements to source-map serialization. See #228 and #229. + +## 0.5.3 + +* Do not include unnecessary distribution files. See + commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. + +## 0.5.2 + +* Include browser distributions of the library in package.json's `files`. See + issue #212. + +## 0.5.1 + +* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See + ff05274becc9e6e1295ed60f3ea090d31d843379. + +## 0.5.0 + +* Node 0.8 is no longer supported. + +* Use webpack instead of dryice for bundling. + +* Big speedups serializing source maps. See pull request #203. + +* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that + explicitly start with the source root. See issue #199. + +## 0.4.4 + +* Fix an issue where using a `SourceMapGenerator` after having created a + `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See + issue #191. + +* Fix an issue with where `SourceMapGenerator` would mistakenly consider + different mappings as duplicates of each other and avoid generating them. See + issue #192. + +## 0.4.3 + +* A very large number of performance improvements, particularly when parsing + source maps. Collectively about 75% of time shaved off of the source map + parsing benchmark! + +* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy + searching in the presence of a column option. See issue #177. + +* Fix a bug with joining a source and its source root when the source is above + the root. See issue #182. + +* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to + determine when all sources' contents are inlined into the source map. See + issue #190. + +## 0.4.2 + +* Add an `.npmignore` file so that the benchmarks aren't pulled down by + dependent projects. Issue #169. + +* Add an optional `column` argument to + `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines + with no mappings. Issues #172 and #173. + +## 0.4.1 + +* Fix accidentally defining a global variable. #170. + +## 0.4.0 + +* The default direction for fuzzy searching was changed back to its original + direction. See #164. + +* There is now a `bias` option you can supply to `SourceMapConsumer` to control + the fuzzy searching direction. See #167. + +* About an 8% speed up in parsing source maps. See #159. + +* Added a benchmark for parsing and generating source maps. + +## 0.3.0 + +* Change the default direction that searching for positions fuzzes when there is + not an exact match. See #154. + +* Support for environments using json2.js for JSON serialization. See #156. + +## 0.2.0 + +* Support for consuming "indexed" source maps which do not have any remote + sections. See pull request #127. This introduces a minor backwards + incompatibility if you are monkey patching `SourceMapConsumer.prototype` + methods. + +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + +## 0.1.40 + +* Performance improvements for parsing source maps in SourceMapConsumer. + +## 0.1.39 + +* Fix a bug where setting a source's contents to null before any source content + had been set before threw a TypeError. See issue #131. + +## 0.1.38 + +* Fix a bug where finding relative paths from an empty path were creating + absolute paths. See issue #129. + +## 0.1.37 + +* Fix a bug where if the source root was an empty string, relative source paths + would turn into absolute source paths. Issue #124. + +## 0.1.36 + +* Allow the `names` mapping property to be an empty string. Issue #121. + +## 0.1.35 + +* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` + to specify a path that relative sources in the second parameter should be + relative to. Issue #105. + +* If no file property is given to a `SourceMapGenerator`, then the resulting + source map will no longer have a `null` file property. The property will + simply not exist. Issue #104. + +* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. + Issue #116. + +## 0.1.34 + +* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. + +* Fix bug involving source contents and the + `SourceMapGenerator.prototype.applySourceMap`. Issue #100. + +## 0.1.33 + +* Fix some edge cases surrounding path joining and URL resolution. + +* Add a third parameter for relative path to + `SourceMapGenerator.prototype.applySourceMap`. + +* Fix issues with mappings and EOLs. + +## 0.1.32 + +* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns + (issue 92). + +* Fixed test runner to actually report number of failed tests as its process + exit code. + +* Fixed a typo when reporting bad mappings (issue 87). + +## 0.1.31 + +* Delay parsing the mappings in SourceMapConsumer until queried for a source + location. + +* Support Sass source maps (which at the time of writing deviate from the spec + in small ways) in SourceMapConsumer. + +## 0.1.30 + +* Do not join source root with a source, when the source is a data URI. + +* Extend the test runner to allow running single specific test files at a time. + +* Performance improvements in `SourceNode.prototype.walk` and + `SourceMapConsumer.prototype.eachMapping`. + +* Source map browser builds will now work inside Workers. + +* Better error messages when attempting to add an invalid mapping to a + `SourceMapGenerator`. + +## 0.1.29 + +* Allow duplicate entries in the `names` and `sources` arrays of source maps + (usually from TypeScript) we are parsing. Fixes github issue 72. + +## 0.1.28 + +* Skip duplicate mappings when creating source maps from SourceNode; github + issue 75. + +## 0.1.27 + +* Don't throw an error when the `file` property is missing in SourceMapConsumer, + we don't use it anyway. + +## 0.1.26 + +* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. + +## 0.1.25 + +* Make compatible with browserify + +## 0.1.24 + +* Fix issue with absolute paths and `file://` URIs. See + https://bugzilla.mozilla.org/show_bug.cgi?id=885597 + +## 0.1.23 + +* Fix issue with absolute paths and sourcesContent, github issue 64. + +## 0.1.22 + +* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. + +## 0.1.21 + +* Fixed handling of sources that start with a slash so that they are relative to + the source root's host. + +## 0.1.20 + +* Fixed github issue #43: absolute URLs aren't joined with the source root + anymore. + +## 0.1.19 + +* Using Travis CI to run tests. + +## 0.1.18 + +* Fixed a bug in the handling of sourceRoot. + +## 0.1.17 + +* Added SourceNode.fromStringWithSourceMap. + +## 0.1.16 + +* Added missing documentation. + +* Fixed the generating of empty mappings in SourceNode. + +## 0.1.15 + +* Added SourceMapGenerator.applySourceMap. + +## 0.1.14 + +* The sourceRoot is now handled consistently. + +## 0.1.13 + +* Added SourceMapGenerator.fromSourceMap. + +## 0.1.12 + +* SourceNode now generates empty mappings too. + +## 0.1.11 + +* Added name support to SourceNode. + +## 0.1.10 + +* Added sourcesContent support to the customer and generator. diff --git a/node_modules/source-map-js/LICENSE b/node_modules/source-map-js/LICENSE new file mode 100644 index 0000000..ed1b7cf --- /dev/null +++ b/node_modules/source-map-js/LICENSE @@ -0,0 +1,28 @@ + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/source-map-js/README.md b/node_modules/source-map-js/README.md new file mode 100644 index 0000000..ba01846 --- /dev/null +++ b/node_modules/source-map-js/README.md @@ -0,0 +1,758 @@ +# Source Map JS + +[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js) + +Difference between original [source-map](https://github.com/mozilla/source-map): + +> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations. + +This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async. + +It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times. + +![Downloads count](media/downloads.png) + +More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all. + +[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation. + +I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map. + +--------- + +This is a library to generate and consume the source map format +[described here][format]. + +[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit + +## Use with Node + + $ npm install source-map-js + + + +-------------------------------------------------------------------------------- + + + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. Line numbers in + this library are 1-based (note that the underlying source map + specification uses 0-based line numbers -- this library handles the + translation). + +* `column`: The column number in the generated source. Column numbers + in this library are 0-based. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. The line number is 1-based. + +* `column`: The column number in the original source, or null if this + information is not available. The column number is 0-based. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: The column number in the original source. The column + number is 0-based. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: Optional. The column number in the original source. The + column number is 0-based. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. The line number is 1-based. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. The column number + is 0-based. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/node_modules/source-map-js/lib/array-set.js b/node_modules/source-map-js/lib/array-set.js new file mode 100644 index 0000000..fbd5c81 --- /dev/null +++ b/node_modules/source-map-js/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/node_modules/source-map-js/lib/base64-vlq.js b/node_modules/source-map-js/lib/base64-vlq.js new file mode 100644 index 0000000..612b404 --- /dev/null +++ b/node_modules/source-map-js/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/node_modules/source-map-js/lib/base64.js b/node_modules/source-map-js/lib/base64.js new file mode 100644 index 0000000..8aa86b3 --- /dev/null +++ b/node_modules/source-map-js/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/node_modules/source-map-js/lib/binary-search.js b/node_modules/source-map-js/lib/binary-search.js new file mode 100644 index 0000000..010ac94 --- /dev/null +++ b/node_modules/source-map-js/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/node_modules/source-map-js/lib/mapping-list.js b/node_modules/source-map-js/lib/mapping-list.js new file mode 100644 index 0000000..06d1274 --- /dev/null +++ b/node_modules/source-map-js/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/node_modules/source-map-js/lib/quick-sort.js b/node_modules/source-map-js/lib/quick-sort.js new file mode 100644 index 0000000..23f9eda --- /dev/null +++ b/node_modules/source-map-js/lib/quick-sort.js @@ -0,0 +1,132 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +function SortTemplate(comparator) { + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + + return doQuickSort; +} + +function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + +let sortCache = new WeakMap(); +exports.quickSort = function (ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); +}; diff --git a/node_modules/source-map-js/lib/source-map-consumer.js b/node_modules/source-map-js/lib/source-map-consumer.js new file mode 100644 index 0000000..4bd7a4a --- /dev/null +++ b/node_modules/source-map-js/lib/source-map-consumer.js @@ -0,0 +1,1184 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + boundCallback({ + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + +const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; +function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) { + break; + } + array[j - 1] = b; + array[j] = a; + } + } + } else { + quickSort(array, compareGenerated, start); + } +} +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/source-map-js/lib/source-map-generator.js b/node_modules/source-map-js/lib/source-map-generator.js new file mode 100644 index 0000000..508bcfb --- /dev/null +++ b/node_modules/source-map-js/lib/source-map-generator.js @@ -0,0 +1,425 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/source-map-js/lib/source-node.js b/node_modules/source-map-js/lib/source-node.js new file mode 100644 index 0000000..8bcdbe3 --- /dev/null +++ b/node_modules/source-map-js/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/node_modules/source-map-js/lib/util.js b/node_modules/source-map-js/lib/util.js new file mode 100644 index 0000000..430e2d0 --- /dev/null +++ b/node_modules/source-map-js/lib/util.js @@ -0,0 +1,594 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +var MAX_CACHED_INPUTS = 32; + +/** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ +function lruMemoize(f) { + var cache = []; + + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + + var result = f(input); + + cache.unshift({ + input, + result, + }); + + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + + return result; + }; +} + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + // Split the path into parts between `/` characters. This is much faster than + // using `.split(/\/+/g)`. + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +}); +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/source-map-js/package.json b/node_modules/source-map-js/package.json new file mode 100644 index 0000000..501fafe --- /dev/null +++ b/node_modules/source-map-js/package.json @@ -0,0 +1,71 @@ +{ + "name": "source-map-js", + "description": "Generates and consumes source maps", + "version": "1.0.2", + "homepage": "https://github.com/7rulnik/source-map-js", + "author": "Valentin 7rulnik Semirulnik ", + "contributors": [ + "Nick Fitzgerald ", + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": "7rulnik/source-map-js", + "main": "./source-map.js", + "files": [ + "source-map.js", + "source-map.d.ts", + "lib/" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "clean-publish": "^3.1.0", + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "clean-publish": { + "cleanDocs": true + }, + "typings": "source-map.d.ts" +} diff --git a/node_modules/source-map-js/source-map.d.ts b/node_modules/source-map-js/source-map.d.ts new file mode 100644 index 0000000..9f8a4b3 --- /dev/null +++ b/node_modules/source-map-js/source-map.d.ts @@ -0,0 +1,115 @@ +declare module 'source-map-js' { + export interface StartOfSourceMap { + file?: string; + sourceRoot?: string; + } + + export interface RawSourceMap extends StartOfSourceMap { + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; + } + + export interface Position { + line: number; + column: number; + } + + export interface LineRange extends Position { + lastColumn: number; + } + + export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; + } + + export interface SourceFindPosition extends FindPosition { + source: string; + } + + export interface MappedPosition extends Position { + source: string; + name?: string; + } + + export interface MappingItem { + source: string; + generatedLine: number; + generatedColumn: number; + originalLine: number; + originalColumn: number; + name: string; + } + + export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; + } + + export interface Mapping { + generated: Position; + original: Position; + source: string; + name?: string; + } + + export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; + } + + export interface CodeWithSourceMap { + code: string; + map: SourceMapGenerator; + } + + export class SourceNode { + constructor(); + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + walk(fn: (chunk: string, mapping: MappedPosition) => void): void; + walkSourceContents(fn: (file: string, content: string) => void): void; + join(sep: string): SourceNode; + replaceRight(pattern: string, replacement: string): SourceNode; + toString(): string; + toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; + } +} + +declare module 'source-map-js/lib/source-map-generator' { + import { SourceMapGenerator } from 'source-map-js' + export { SourceMapGenerator } +} + +declare module 'source-map-js/lib/source-map-consumer' { + import { SourceMapConsumer } from 'source-map-js' + export { SourceMapConsumer } +} + +declare module 'source-map-js/lib/source-node' { + import { SourceNode } from 'source-map-js' + export { SourceNode } +} diff --git a/node_modules/source-map-js/source-map.js b/node_modules/source-map-js/source-map.js new file mode 100644 index 0000000..bc88fe8 --- /dev/null +++ b/node_modules/source-map-js/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/sucrase/LICENSE b/node_modules/sucrase/LICENSE new file mode 100644 index 0000000..06d77d6 --- /dev/null +++ b/node_modules/sucrase/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012-2018 various contributors (see AUTHORS) + +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/sucrase/README.md b/node_modules/sucrase/README.md new file mode 100644 index 0000000..c45138a --- /dev/null +++ b/node_modules/sucrase/README.md @@ -0,0 +1,295 @@ +# Sucrase + +[![Build Status](https://github.com/alangpierce/sucrase/workflows/All%20tests/badge.svg)](https://github.com/alangpierce/sucrase/actions) +[![npm version](https://img.shields.io/npm/v/sucrase.svg)](https://www.npmjs.com/package/sucrase) +[![Install Size](https://packagephobia.now.sh/badge?p=sucrase)](https://packagephobia.now.sh/result?p=sucrase) +[![MIT License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](LICENSE) +[![Join the chat at https://gitter.im/sucrasejs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sucrasejs/Lobby) + +## [Try it out](https://sucrase.io) + +## Quick usage + +```bash +yarn add --dev sucrase # Or npm install --save-dev sucrase +node -r sucrase/register main.ts +``` + +Using the [ts-node](https://github.com/TypeStrong/ts-node) integration: + +```bash +yarn add --dev sucrase ts-node typescript +./node_modules/.bin/ts-node --transpiler sucrase/ts-node-plugin main.ts +``` + +## Project overview + +Sucrase is an alternative to Babel that allows super-fast development builds. +Instead of compiling a large range of JS features to be able to work in Internet +Explorer, Sucrase assumes that you're developing with a recent browser or recent +Node.js version, so it focuses on compiling non-standard language extensions: +JSX, TypeScript, and Flow. Because of this smaller scope, Sucrase can get away +with an architecture that is much more performant but less extensible and +maintainable. Sucrase's parser is forked from Babel's parser (so Sucrase is +indebted to Babel and wouldn't be possible without it) and trims it down to a +focused subset of what Babel solves. If it fits your use case, hopefully Sucrase +can speed up your development experience! + +**Sucrase has been extensively tested.** It can successfully build +the [Benchling](https://benchling.com/) frontend code, +[Babel](https://github.com/babel/babel), +[React](https://github.com/facebook/react), +[TSLint](https://github.com/palantir/tslint), +[Apollo client](https://github.com/apollographql/apollo-client), and +[decaffeinate](https://github.com/decaffeinate/decaffeinate) +with all tests passing, about 1 million lines of code total. + +**Sucrase is about 20x faster than Babel.** Here's one measurement of how +Sucrase compares with other tools when compiling the Jest codebase 3 times, +about 360k lines of code total: + +```text + Time Speed +Sucrase 0.57 seconds 636975 lines per second +swc 1.19 seconds 304526 lines per second +esbuild 1.45 seconds 248692 lines per second +TypeScript 8.98 seconds 40240 lines per second +Babel 9.18 seconds 39366 lines per second +``` + +Details: Measured on July 2022. Tools run in single-threaded mode without warm-up. See the +[benchmark code](https://github.com/alangpierce/sucrase/blob/main/benchmark/benchmark.ts) +for methodology and caveats. + +## Transforms + +The main configuration option in Sucrase is an array of transform names. These +transforms are available: + +* **jsx**: Enables JSX syntax. By default, JSX is transformed to `React.createClass`, + but may be preserved or transformed to `_jsx()` by setting the `jsxRuntime` option. + Also adds `createReactClass` display names and JSX context information. +* **typescript**: Compiles TypeScript code to JavaScript, removing type + annotations and handling features like enums. Does not check types. Sucrase + transforms each file independently, so you should enable the `isolatedModules` + TypeScript flag so that the typechecker will disallow the few features like + `const enum`s that need cross-file compilation. The Sucrase option `keepUnusedImports` + can be used to disable all automatic removal of imports and exports, analogous to TS + `verbatimModuleSyntax`. +* **flow**: Removes Flow type annotations. Does not check types. +* **imports**: Transforms ES Modules (`import`/`export`) to CommonJS + (`require`/`module.exports`) using the same approach as Babel and TypeScript + with `--esModuleInterop`. If `preserveDynamicImport` is specified in the Sucrase + options, then dynamic `import` expressions are left alone, which is particularly + useful in Node to load ESM-only libraries. If `preserveDynamicImport` is not + specified, `import` expressions are transformed into a promise-wrapped call to + `require`. +* **react-hot-loader**: Performs the equivalent of the `react-hot-loader/babel` + transform in the [react-hot-loader](https://github.com/gaearon/react-hot-loader) + project. This enables advanced hot reloading use cases such as editing of + bound methods. +* **jest**: Hoist desired [jest](https://jestjs.io/) method calls above imports in + the same way as [babel-plugin-jest-hoist](https://github.com/facebook/jest/tree/master/packages/babel-plugin-jest-hoist). + Does not validate the arguments passed to `jest.mock`, but the same rules still apply. + +When the `imports` transform is *not* specified (i.e. when targeting ESM), the +`injectCreateRequireForImportRequire` option can be specified to transform TS +`import foo = require("foo");` in a way that matches the +[TypeScript 4.7 behavior](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#commonjs-interoperability) +with `module: nodenext`. + +These newer JS features are transformed by default: + +* [Optional chaining](https://github.com/tc39/proposal-optional-chaining): `a?.b` +* [Nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing): `a ?? b` +* [Class fields](https://github.com/tc39/proposal-class-fields): `class C { x = 1; }`. + This includes static fields but not the `#x` private field syntax. +* [Numeric separators](https://github.com/tc39/proposal-numeric-separator): + `const n = 1_234;` +* [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding): + `try { doThing(); } catch { }`. + +If your target runtime supports these features, you can specify +`disableESTransforms: true` so that Sucrase preserves the syntax rather than +trying to transform it. Note that transpiled and standard class fields behave +slightly differently; see the +[TypeScript 3.7 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier) +for details. If you use TypeScript, you can enable the TypeScript option +`useDefineForClassFields` to enable error checking related to these differences. + +### Unsupported syntax + +All JS syntax not mentioned above will "pass through" and needs to be supported +by your JS runtime. For example: + +* Decorators, private fields, `throw` expressions, generator arrow functions, + and `do` expressions are all unsupported in browsers and Node (as of this + writing), and Sucrase doesn't make an attempt to transpile them. +* Object rest/spread, async functions, and async iterators are all recent + features that should work fine, but might cause issues if you use older + versions of tools like webpack. BigInt and newer regex features may or may not + work, based on your tooling. + +### JSX Options + +By default, JSX is compiled to React functions in development mode. This can be +configured with a few options: + +* **jsxRuntime**: A string specifying the transform mode, which can be one of three values: + * `"classic"` (default): The original JSX transform that calls `React.createElement` by default. + To configure for non-React use cases, specify: + * **jsxPragma**: Element creation function, defaults to `React.createElement`. + * **jsxFragmentPragma**: Fragment component, defaults to `React.Fragment`. + * `"automatic"`: The [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) + introduced with React 17, which calls `jsx` functions and auto-adds import statements. + To configure for non-React use cases, specify: + * **jsxImportSource**: Package name for auto-generated import statements, defaults to `react`. + * `"preserve"`: Don't transform JSX, and instead emit it as-is in the output code. +* **production**: If `true`, use production version of functions and don't include debugging + information. When using React in production mode with the automatic transform, this *must* be + set to true to avoid an error about `jsxDEV` being missing. + +### Legacy CommonJS interop + +Two legacy modes can be used with the `imports` transform: + +* **enableLegacyTypeScriptModuleInterop**: Use the default TypeScript approach + to CommonJS interop instead of assuming that TypeScript's `--esModuleInterop` + flag is enabled. For example, if a CJS module exports a function, legacy + TypeScript interop requires you to write `import * as add from './add';`, + while Babel, Webpack, Node.js, and TypeScript with `--esModuleInterop` require + you to write `import add from './add';`. As mentioned in the + [docs](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop), + the TypeScript team recommends you always use `--esModuleInterop`. +* **enableLegacyBabel5ModuleInterop**: Use the Babel 5 approach to CommonJS + interop, so that you can run `require('./MyModule')` instead of + `require('./MyModule').default`. Analogous to + [babel-plugin-add-module-exports](https://github.com/59naga/babel-plugin-add-module-exports). + +## Usage + +### Tool integrations + +* [Webpack](https://github.com/alangpierce/sucrase/tree/main/integrations/webpack-loader) +* [Gulp](https://github.com/alangpierce/sucrase/tree/main/integrations/gulp-plugin) +* [Jest](https://github.com/alangpierce/sucrase/tree/main/integrations/jest-plugin) +* [Rollup](https://github.com/rollup/plugins/tree/master/packages/sucrase) +* [Broccoli](https://github.com/stefanpenner/broccoli-sucrase) + +### Usage in Node + +The most robust way is to use the Sucrase plugin for [ts-node](https://github.com/TypeStrong/ts-node), +which has various Node integrations and configures Sucrase via `tsconfig.json`: +```bash +ts-node --transpiler sucrase/ts-node-plugin +``` + +For projects that don't target ESM, Sucrase also has a require hook with some +reasonable defaults that can be accessed in a few ways: + +* From code: `require("sucrase/register");` +* When invoking Node: `node -r sucrase/register main.ts` +* As a separate binary: `sucrase-node main.ts` + +Options can be passed to the require hook via a `SUCRASE_OPTIONS` environment +variable holding a JSON string of options. + +### Compiling a project to JS + +For simple use cases, Sucrase comes with a `sucrase` CLI that mirrors your +directory structure to an output directory: +```bash +sucrase ./srcDir -d ./outDir --transforms typescript,imports +``` + +### Usage from code + +For any advanced use cases, Sucrase can be called from JS directly: + +```js +import {transform} from "sucrase"; +const compiledCode = transform(code, {transforms: ["typescript", "imports"]}).code; +``` + +## What Sucrase is not + +Sucrase is intended to be useful for the most common cases, but it does not aim +to have nearly the scope and versatility of Babel. Some specific examples: + +* Sucrase does not check your code for errors. Sucrase's contract is that if you + give it valid code, it will produce valid JS code. If you give it invalid + code, it might produce invalid code, it might produce valid code, or it might + give an error. Always use Sucrase with a linter or typechecker, which is more + suited for error-checking. +* Sucrase is not pluginizable. With the current architecture, transforms need to + be explicitly written to cooperate with each other, so each additional + transform takes significant extra work. +* Sucrase is not good for prototyping language extensions and upcoming language + features. Its faster architecture makes new transforms more difficult to write + and more fragile. +* Sucrase will never produce code for old browsers like IE. Compiling code down + to ES5 is much more complicated than any transformation that Sucrase needs to + do. +* Sucrase is hesitant to implement upcoming JS features, although some of them + make sense to implement for pragmatic reasons. Its main focus is on language + extensions (JSX, TypeScript, Flow) that will never be supported by JS + runtimes. +* Like Babel, Sucrase is not a typechecker, and must process each file in + isolation. For example, TypeScript `const enum`s are treated as regular + `enum`s rather than inlining across files. +* You should think carefully before using Sucrase in production. Sucrase is + mostly beneficial in development, and in many cases, Babel or tsc will be more + suitable for production builds. + +See the [Project Vision](./docs/PROJECT_VISION.md) document for more details on +the philosophy behind Sucrase. + +## Motivation + +As JavaScript implementations mature, it becomes more and more reasonable to +disable Babel transforms, especially in development when you know that you're +targeting a modern runtime. You might hope that you could simplify and speed up +the build step by eventually disabling Babel entirely, but this isn't possible +if you're using a non-standard language extension like JSX, TypeScript, or Flow. +Unfortunately, disabling most transforms in Babel doesn't speed it up as much as +you might expect. To understand, let's take a look at how Babel works: + +1. Tokenize the input source code into a token stream. +2. Parse the token stream into an AST. +3. Walk the AST to compute the scope information for each variable. +4. Apply all transform plugins in a single traversal, resulting in a new AST. +5. Print the resulting AST. + +Only step 4 gets faster when disabling plugins, so there's always a fixed cost +to running Babel regardless of how many transforms are enabled. + +Sucrase bypasses most of these steps, and works like this: + +1. Tokenize the input source code into a token stream using a trimmed-down fork + of the Babel parser. This fork does not produce a full AST, but still + produces meaningful token metadata specifically designed for the later + transforms. +2. Scan through the tokens, computing preliminary information like all + imported/exported names. +3. Run the transform by doing a pass through the tokens and performing a number + of careful find-and-replace operations, like replacing ` 0 || + importInfo.namedExports.length > 0 + ) { + continue; + } + const names = [ + ...importInfo.defaultNames, + ...importInfo.wildcardNames, + ...importInfo.namedImports.map(({localName}) => localName), + ]; + if (names.every((name) => this.shouldAutomaticallyElideImportedName(name))) { + this.importsToReplace.set(path, ""); + } + } + } + + shouldAutomaticallyElideImportedName(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + !this.nonTypeIdentifiers.has(name) + ); + } + + generateImportReplacements() { + for (const [path, importInfo] of this.importInfoByPath.entries()) { + const { + defaultNames, + wildcardNames, + namedImports, + namedExports, + exportStarNames, + hasStarExport, + } = importInfo; + + if ( + defaultNames.length === 0 && + wildcardNames.length === 0 && + namedImports.length === 0 && + namedExports.length === 0 && + exportStarNames.length === 0 && + !hasStarExport + ) { + // Import is never used, so don't even assign a name. + this.importsToReplace.set(path, `require('${path}');`); + continue; + } + + const primaryImportName = this.getFreeIdentifierForPath(path); + let secondaryImportName; + if (this.enableLegacyTypeScriptModuleInterop) { + secondaryImportName = primaryImportName; + } else { + secondaryImportName = + wildcardNames.length > 0 ? wildcardNames[0] : this.getFreeIdentifierForPath(path); + } + let requireCode = `var ${primaryImportName} = require('${path}');`; + if (wildcardNames.length > 0) { + for (const wildcardName of wildcardNames) { + const moduleExpr = this.enableLegacyTypeScriptModuleInterop + ? primaryImportName + : `${this.helperManager.getHelperName("interopRequireWildcard")}(${primaryImportName})`; + requireCode += ` var ${wildcardName} = ${moduleExpr};`; + } + } else if (exportStarNames.length > 0 && secondaryImportName !== primaryImportName) { + requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( + "interopRequireWildcard", + )}(${primaryImportName});`; + } else if (defaultNames.length > 0 && secondaryImportName !== primaryImportName) { + requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( + "interopRequireDefault", + )}(${primaryImportName});`; + } + + for (const {importedName, localName} of namedExports) { + requireCode += ` ${this.helperManager.getHelperName( + "createNamedExportFrom", + )}(${primaryImportName}, '${localName}', '${importedName}');`; + } + for (const exportStarName of exportStarNames) { + requireCode += ` exports.${exportStarName} = ${secondaryImportName};`; + } + if (hasStarExport) { + requireCode += ` ${this.helperManager.getHelperName( + "createStarExport", + )}(${primaryImportName});`; + } + + this.importsToReplace.set(path, requireCode); + + for (const defaultName of defaultNames) { + this.identifierReplacements.set(defaultName, `${secondaryImportName}.default`); + } + for (const {importedName, localName} of namedImports) { + this.identifierReplacements.set(localName, `${primaryImportName}.${importedName}`); + } + } + } + + getFreeIdentifierForPath(path) { + const components = path.split("/"); + const lastComponent = components[components.length - 1]; + const baseName = lastComponent.replace(/\W/g, ""); + return this.nameManager.claimFreeName(`_${baseName}`); + } + + preprocessImportAtIndex(index) { + const defaultNames = []; + const wildcardNames = []; + const namedImports = []; + + index++; + if ( + (this.tokens.matchesContextualAtIndex(index, _keywords.ContextualKeyword._type) || + this.tokens.matches1AtIndex(index, _types.TokenType._typeof)) && + !this.tokens.matches1AtIndex(index + 1, _types.TokenType.comma) && + !this.tokens.matchesContextualAtIndex(index + 1, _keywords.ContextualKeyword._from) + ) { + // import type declaration, so no need to process anything. + return; + } + + if (this.tokens.matches1AtIndex(index, _types.TokenType.parenL)) { + // Dynamic import, so nothing to do + return; + } + + if (this.tokens.matches1AtIndex(index, _types.TokenType.name)) { + defaultNames.push(this.tokens.identifierNameAtIndex(index)); + index++; + if (this.tokens.matches1AtIndex(index, _types.TokenType.comma)) { + index++; + } + } + + if (this.tokens.matches1AtIndex(index, _types.TokenType.star)) { + // * as + index += 2; + wildcardNames.push(this.tokens.identifierNameAtIndex(index)); + index++; + } + + if (this.tokens.matches1AtIndex(index, _types.TokenType.braceL)) { + const result = this.getNamedImports(index + 1); + index = result.newIndex; + + for (const namedImport of result.namedImports) { + // Treat {default as X} as a default import to ensure usage of require interop helper + if (namedImport.importedName === "default") { + defaultNames.push(namedImport.localName); + } else { + namedImports.push(namedImport); + } + } + } + + if (this.tokens.matchesContextualAtIndex(index, _keywords.ContextualKeyword._from)) { + index++; + } + + if (!this.tokens.matches1AtIndex(index, _types.TokenType.string)) { + throw new Error("Expected string token at the end of import statement."); + } + const path = this.tokens.stringValueAtIndex(index); + const importInfo = this.getImportInfo(path); + importInfo.defaultNames.push(...defaultNames); + importInfo.wildcardNames.push(...wildcardNames); + importInfo.namedImports.push(...namedImports); + if (defaultNames.length === 0 && wildcardNames.length === 0 && namedImports.length === 0) { + importInfo.hasBareImport = true; + } + } + + preprocessExportAtIndex(index) { + if ( + this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._var) || + this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._let) || + this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._const) + ) { + this.preprocessVarExportAtIndex(index); + } else if ( + this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._function) || + this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._class) + ) { + const exportName = this.tokens.identifierNameAtIndex(index + 2); + this.addExportBinding(exportName, exportName); + } else if (this.tokens.matches3AtIndex(index, _types.TokenType._export, _types.TokenType.name, _types.TokenType._function)) { + const exportName = this.tokens.identifierNameAtIndex(index + 3); + this.addExportBinding(exportName, exportName); + } else if (this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType.braceL)) { + this.preprocessNamedExportAtIndex(index); + } else if (this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType.star)) { + this.preprocessExportStarAtIndex(index); + } + } + + preprocessVarExportAtIndex(index) { + let depth = 0; + // Handle cases like `export let {x} = y;`, starting at the open-brace in that case. + for (let i = index + 2; ; i++) { + if ( + this.tokens.matches1AtIndex(i, _types.TokenType.braceL) || + this.tokens.matches1AtIndex(i, _types.TokenType.dollarBraceL) || + this.tokens.matches1AtIndex(i, _types.TokenType.bracketL) + ) { + depth++; + } else if ( + this.tokens.matches1AtIndex(i, _types.TokenType.braceR) || + this.tokens.matches1AtIndex(i, _types.TokenType.bracketR) + ) { + depth--; + } else if (depth === 0 && !this.tokens.matches1AtIndex(i, _types.TokenType.name)) { + break; + } else if (this.tokens.matches1AtIndex(1, _types.TokenType.eq)) { + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + i = endIndex - 1; + } else { + const token = this.tokens.tokens[i]; + if (_tokenizer.isDeclaration.call(void 0, token)) { + const exportName = this.tokens.identifierNameAtIndex(i); + this.identifierReplacements.set(exportName, `exports.${exportName}`); + } + } + } + } + + /** + * Walk this export statement just in case it's an export...from statement. + * If it is, combine it into the import info for that path. Otherwise, just + * bail out; it'll be handled later. + */ + preprocessNamedExportAtIndex(index) { + // export { + index += 2; + const {newIndex, namedImports} = this.getNamedImports(index); + index = newIndex; + + if (this.tokens.matchesContextualAtIndex(index, _keywords.ContextualKeyword._from)) { + index++; + } else { + // Reinterpret "a as b" to be local/exported rather than imported/local. + for (const {importedName: localName, localName: exportedName} of namedImports) { + this.addExportBinding(localName, exportedName); + } + return; + } + + if (!this.tokens.matches1AtIndex(index, _types.TokenType.string)) { + throw new Error("Expected string token at the end of import statement."); + } + const path = this.tokens.stringValueAtIndex(index); + const importInfo = this.getImportInfo(path); + importInfo.namedExports.push(...namedImports); + } + + preprocessExportStarAtIndex(index) { + let exportedName = null; + if (this.tokens.matches3AtIndex(index, _types.TokenType._export, _types.TokenType.star, _types.TokenType._as)) { + // export * as + index += 3; + exportedName = this.tokens.identifierNameAtIndex(index); + // foo from + index += 2; + } else { + // export * from + index += 3; + } + if (!this.tokens.matches1AtIndex(index, _types.TokenType.string)) { + throw new Error("Expected string token at the end of star export statement."); + } + const path = this.tokens.stringValueAtIndex(index); + const importInfo = this.getImportInfo(path); + if (exportedName !== null) { + importInfo.exportStarNames.push(exportedName); + } else { + importInfo.hasStarExport = true; + } + } + + getNamedImports(index) { + const namedImports = []; + while (true) { + if (this.tokens.matches1AtIndex(index, _types.TokenType.braceR)) { + index++; + break; + } + + const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens, index); + index = specifierInfo.endIndex; + if (!specifierInfo.isType) { + namedImports.push({ + importedName: specifierInfo.leftName, + localName: specifierInfo.rightName, + }); + } + + if (this.tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.braceR)) { + index += 2; + break; + } else if (this.tokens.matches1AtIndex(index, _types.TokenType.braceR)) { + index++; + break; + } else if (this.tokens.matches1AtIndex(index, _types.TokenType.comma)) { + index++; + } else { + throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[index])}`); + } + } + return {newIndex: index, namedImports}; + } + + /** + * Get a mutable import info object for this path, creating one if it doesn't + * exist yet. + */ + getImportInfo(path) { + const existingInfo = this.importInfoByPath.get(path); + if (existingInfo) { + return existingInfo; + } + const newInfo = { + defaultNames: [], + wildcardNames: [], + namedImports: [], + namedExports: [], + hasBareImport: false, + exportStarNames: [], + hasStarExport: false, + }; + this.importInfoByPath.set(path, newInfo); + return newInfo; + } + + addExportBinding(localName, exportedName) { + if (!this.exportBindingsByLocalName.has(localName)) { + this.exportBindingsByLocalName.set(localName, []); + } + this.exportBindingsByLocalName.get(localName).push(exportedName); + } + + /** + * Return the code to use for the import for this path, or the empty string if + * the code has already been "claimed" by a previous import. + */ + claimImportCode(importPath) { + const result = this.importsToReplace.get(importPath); + this.importsToReplace.set(importPath, ""); + return result || ""; + } + + getIdentifierReplacement(identifierName) { + return this.identifierReplacements.get(identifierName) || null; + } + + /** + * Return a string like `exports.foo = exports.bar`. + */ + resolveExportBinding(assignedName) { + const exportedNames = this.exportBindingsByLocalName.get(assignedName); + if (!exportedNames || exportedNames.length === 0) { + return null; + } + return exportedNames.map((exportedName) => `exports.${exportedName}`).join(" = "); + } + + /** + * Return all imported/exported names where we might be interested in whether usages of those + * names are shadowed. + */ + getGlobalNames() { + return new Set([ + ...this.identifierReplacements.keys(), + ...this.exportBindingsByLocalName.keys(), + ]); + } +} exports.default = CJSImportProcessor; diff --git a/node_modules/sucrase/dist/HelperManager.js b/node_modules/sucrase/dist/HelperManager.js new file mode 100644 index 0000000..6dcc9c9 --- /dev/null +++ b/node_modules/sucrase/dist/HelperManager.js @@ -0,0 +1,176 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +const HELPERS = { + require: ` + import {createRequire as CREATE_REQUIRE_NAME} from "module"; + const require = CREATE_REQUIRE_NAME(import.meta.url); + `, + interopRequireWildcard: ` + function interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + return newObj; + } + } + `, + interopRequireDefault: ` + function interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + `, + createNamedExportFrom: ` + function createNamedExportFrom(obj, localName, importedName) { + Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]}); + } + `, + // Note that TypeScript and Babel do this differently; TypeScript does a simple existence + // check in the exports object and does a plain assignment, whereas Babel uses + // defineProperty and builds an object of explicitly-exported names so that star exports can + // always take lower precedence. For now, we do the easier TypeScript thing. + createStarExport: ` + function createStarExport(obj) { + Object.keys(obj) + .filter((key) => key !== "default" && key !== "__esModule") + .forEach((key) => { + if (exports.hasOwnProperty(key)) { + return; + } + Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); + }); + } + `, + nullishCoalesce: ` + function nullishCoalesce(lhs, rhsFn) { + if (lhs != null) { + return lhs; + } else { + return rhsFn(); + } + } + `, + asyncNullishCoalesce: ` + async function asyncNullishCoalesce(lhs, rhsFn) { + if (lhs != null) { + return lhs; + } else { + return await rhsFn(); + } + } + `, + optionalChain: ` + function optionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i]; + const fn = ops[i + 1]; + i += 2; + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + return undefined; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = fn((...args) => value.call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; + } + `, + asyncOptionalChain: ` + async function asyncOptionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i]; + const fn = ops[i + 1]; + i += 2; + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + return undefined; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = await fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = await fn((...args) => value.call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; + } + `, + optionalChainDelete: ` + function optionalChainDelete(ops) { + const result = OPTIONAL_CHAIN_NAME(ops); + return result == null ? true : result; + } + `, + asyncOptionalChainDelete: ` + async function asyncOptionalChainDelete(ops) { + const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); + return result == null ? true : result; + } + `, +}; + + class HelperManager { + __init() {this.helperNames = {}} + __init2() {this.createRequireName = null} + constructor( nameManager) {;this.nameManager = nameManager;HelperManager.prototype.__init.call(this);HelperManager.prototype.__init2.call(this);} + + getHelperName(baseName) { + let helperName = this.helperNames[baseName]; + if (helperName) { + return helperName; + } + helperName = this.nameManager.claimFreeName(`_${baseName}`); + this.helperNames[baseName] = helperName; + return helperName; + } + + emitHelpers() { + let resultCode = ""; + if (this.helperNames.optionalChainDelete) { + this.getHelperName("optionalChain"); + } + if (this.helperNames.asyncOptionalChainDelete) { + this.getHelperName("asyncOptionalChain"); + } + for (const [baseName, helperCodeTemplate] of Object.entries(HELPERS)) { + const helperName = this.helperNames[baseName]; + let helperCode = helperCodeTemplate; + if (baseName === "optionalChainDelete") { + helperCode = helperCode.replace("OPTIONAL_CHAIN_NAME", this.helperNames.optionalChain); + } else if (baseName === "asyncOptionalChainDelete") { + helperCode = helperCode.replace( + "ASYNC_OPTIONAL_CHAIN_NAME", + this.helperNames.asyncOptionalChain, + ); + } else if (baseName === "require") { + if (this.createRequireName === null) { + this.createRequireName = this.nameManager.claimFreeName("_createRequire"); + } + helperCode = helperCode.replace(/CREATE_REQUIRE_NAME/g, this.createRequireName); + } + if (helperName) { + resultCode += " "; + resultCode += helperCode.replace(baseName, helperName).replace(/\s+/g, " ").trim(); + } + } + return resultCode; + } +} exports.HelperManager = HelperManager; diff --git a/node_modules/sucrase/dist/NameManager.js b/node_modules/sucrase/dist/NameManager.js new file mode 100644 index 0000000..0ebbe28 --- /dev/null +++ b/node_modules/sucrase/dist/NameManager.js @@ -0,0 +1,27 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _getIdentifierNames = require('./util/getIdentifierNames'); var _getIdentifierNames2 = _interopRequireDefault(_getIdentifierNames); + + class NameManager { + __init() {this.usedNames = new Set()} + + constructor(code, tokens) {;NameManager.prototype.__init.call(this); + this.usedNames = new Set(_getIdentifierNames2.default.call(void 0, code, tokens)); + } + + claimFreeName(name) { + const newName = this.findFreeName(name); + this.usedNames.add(newName); + return newName; + } + + findFreeName(name) { + if (!this.usedNames.has(name)) { + return name; + } + let suffixNum = 2; + while (this.usedNames.has(name + String(suffixNum))) { + suffixNum++; + } + return name + String(suffixNum); + } +} exports.default = NameManager; diff --git a/node_modules/sucrase/dist/Options-gen-types.js b/node_modules/sucrase/dist/Options-gen-types.js new file mode 100644 index 0000000..438d198 --- /dev/null +++ b/node_modules/sucrase/dist/Options-gen-types.js @@ -0,0 +1,42 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }/** + * This module was automatically generated by `ts-interface-builder` + */ +var _tsinterfacechecker = require('ts-interface-checker'); var t = _interopRequireWildcard(_tsinterfacechecker); +// tslint:disable:object-literal-key-quotes + + const Transform = t.union( + t.lit("jsx"), + t.lit("typescript"), + t.lit("flow"), + t.lit("imports"), + t.lit("react-hot-loader"), + t.lit("jest"), +); exports.Transform = Transform; + + const SourceMapOptions = t.iface([], { + compiledFilename: "string", +}); exports.SourceMapOptions = SourceMapOptions; + + const Options = t.iface([], { + transforms: t.array("Transform"), + disableESTransforms: t.opt("boolean"), + jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))), + production: t.opt("boolean"), + jsxImportSource: t.opt("string"), + jsxPragma: t.opt("string"), + jsxFragmentPragma: t.opt("string"), + keepUnusedImports: t.opt("boolean"), + preserveDynamicImport: t.opt("boolean"), + injectCreateRequireForImportRequire: t.opt("boolean"), + enableLegacyTypeScriptModuleInterop: t.opt("boolean"), + enableLegacyBabel5ModuleInterop: t.opt("boolean"), + sourceMapOptions: t.opt("SourceMapOptions"), + filePath: t.opt("string"), +}); exports.Options = Options; + +const exportedTypeSuite = { + Transform: exports.Transform, + SourceMapOptions: exports.SourceMapOptions, + Options: exports.Options, +}; +exports. default = exportedTypeSuite; diff --git a/node_modules/sucrase/dist/Options.js b/node_modules/sucrase/dist/Options.js new file mode 100644 index 0000000..15855c4 --- /dev/null +++ b/node_modules/sucrase/dist/Options.js @@ -0,0 +1,101 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _tsinterfacechecker = require('ts-interface-checker'); + +var _Optionsgentypes = require('./Options-gen-types'); var _Optionsgentypes2 = _interopRequireDefault(_Optionsgentypes); + +const {Options: OptionsChecker} = _tsinterfacechecker.createCheckers.call(void 0, _Optionsgentypes2.default); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function validateOptions(options) { + OptionsChecker.strictCheck(options); +} exports.validateOptions = validateOptions; diff --git a/node_modules/sucrase/dist/TokenProcessor.js b/node_modules/sucrase/dist/TokenProcessor.js new file mode 100644 index 0000000..58fdd98 --- /dev/null +++ b/node_modules/sucrase/dist/TokenProcessor.js @@ -0,0 +1,357 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + +var _types = require('./parser/tokenizer/types'); +var _isAsyncOperation = require('./util/isAsyncOperation'); var _isAsyncOperation2 = _interopRequireDefault(_isAsyncOperation); + + + + + + + + + + + + class TokenProcessor { + __init() {this.resultCode = ""} + // Array mapping input token index to optional string index position in the + // output code. + __init2() {this.resultMappings = new Array(this.tokens.length)} + __init3() {this.tokenIndex = 0} + + constructor( + code, + tokens, + isFlowEnabled, + disableESTransforms, + helperManager, + ) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);} + + /** + * Snapshot the token state in a way that can be restored later, useful for + * things like lookahead. + * + * resultMappings do not need to be copied since in all use cases, they will + * be overwritten anyway after restore. + */ + snapshot() { + return { + resultCode: this.resultCode, + tokenIndex: this.tokenIndex, + }; + } + + restoreToSnapshot(snapshot) { + this.resultCode = snapshot.resultCode; + this.tokenIndex = snapshot.tokenIndex; + } + + /** + * Remove and return the code generated since the snapshot, leaving the + * current token position in-place. Unlike most TokenProcessor operations, + * this operation can result in input/output line number mismatches because + * the removed code may contain newlines, so this operation should be used + * sparingly. + */ + dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) { + const result = this.resultCode.slice(snapshot.resultCode.length); + this.resultCode = snapshot.resultCode; + return result; + } + + reset() { + this.resultCode = ""; + this.resultMappings = new Array(this.tokens.length); + this.tokenIndex = 0; + } + + matchesContextualAtIndex(index, contextualKeyword) { + return ( + this.matches1AtIndex(index, _types.TokenType.name) && + this.tokens[index].contextualKeyword === contextualKeyword + ); + } + + identifierNameAtIndex(index) { + // TODO: We need to process escapes since technically you can have unicode escapes in variable + // names. + return this.identifierNameForToken(this.tokens[index]); + } + + identifierNameAtRelativeIndex(relativeIndex) { + return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex)); + } + + identifierName() { + return this.identifierNameForToken(this.currentToken()); + } + + identifierNameForToken(token) { + return this.code.slice(token.start, token.end); + } + + rawCodeForToken(token) { + return this.code.slice(token.start, token.end); + } + + stringValueAtIndex(index) { + return this.stringValueForToken(this.tokens[index]); + } + + stringValue() { + return this.stringValueForToken(this.currentToken()); + } + + stringValueForToken(token) { + // This is used to identify when two imports are the same and to resolve TypeScript enum keys. + // Ideally we'd process escapes within the strings, but for now we pretty much take the raw + // code. + return this.code.slice(token.start + 1, token.end - 1); + } + + matches1AtIndex(index, t1) { + return this.tokens[index].type === t1; + } + + matches2AtIndex(index, t1, t2) { + return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2; + } + + matches3AtIndex(index, t1, t2, t3) { + return ( + this.tokens[index].type === t1 && + this.tokens[index + 1].type === t2 && + this.tokens[index + 2].type === t3 + ); + } + + matches1(t1) { + return this.tokens[this.tokenIndex].type === t1; + } + + matches2(t1, t2) { + return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2; + } + + matches3(t1, t2, t3) { + return ( + this.tokens[this.tokenIndex].type === t1 && + this.tokens[this.tokenIndex + 1].type === t2 && + this.tokens[this.tokenIndex + 2].type === t3 + ); + } + + matches4(t1, t2, t3, t4) { + return ( + this.tokens[this.tokenIndex].type === t1 && + this.tokens[this.tokenIndex + 1].type === t2 && + this.tokens[this.tokenIndex + 2].type === t3 && + this.tokens[this.tokenIndex + 3].type === t4 + ); + } + + matches5(t1, t2, t3, t4, t5) { + return ( + this.tokens[this.tokenIndex].type === t1 && + this.tokens[this.tokenIndex + 1].type === t2 && + this.tokens[this.tokenIndex + 2].type === t3 && + this.tokens[this.tokenIndex + 3].type === t4 && + this.tokens[this.tokenIndex + 4].type === t5 + ); + } + + matchesContextual(contextualKeyword) { + return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword); + } + + matchesContextIdAndLabel(type, contextId) { + return this.matches1(type) && this.currentToken().contextId === contextId; + } + + previousWhitespaceAndComments() { + let whitespaceAndComments = this.code.slice( + this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0, + this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length, + ); + if (this.isFlowEnabled) { + whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, ""); + } + return whitespaceAndComments; + } + + replaceToken(newCode) { + this.resultCode += this.previousWhitespaceAndComments(); + this.appendTokenPrefix(); + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += newCode; + this.appendTokenSuffix(); + this.tokenIndex++; + } + + replaceTokenTrimmingLeftWhitespace(newCode) { + this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, ""); + this.appendTokenPrefix(); + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += newCode; + this.appendTokenSuffix(); + this.tokenIndex++; + } + + removeInitialToken() { + this.replaceToken(""); + } + + removeToken() { + this.replaceTokenTrimmingLeftWhitespace(""); + } + + /** + * Remove all code until the next }, accounting for balanced braces. + */ + removeBalancedCode() { + let braceDepth = 0; + while (!this.isAtEnd()) { + if (this.matches1(_types.TokenType.braceL)) { + braceDepth++; + } else if (this.matches1(_types.TokenType.braceR)) { + if (braceDepth === 0) { + return; + } + braceDepth--; + } + this.removeToken(); + } + } + + copyExpectedToken(tokenType) { + if (this.tokens[this.tokenIndex].type !== tokenType) { + throw new Error(`Expected token ${tokenType}`); + } + this.copyToken(); + } + + copyToken() { + this.resultCode += this.previousWhitespaceAndComments(); + this.appendTokenPrefix(); + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += this.code.slice( + this.tokens[this.tokenIndex].start, + this.tokens[this.tokenIndex].end, + ); + this.appendTokenSuffix(); + this.tokenIndex++; + } + + copyTokenWithPrefix(prefix) { + this.resultCode += this.previousWhitespaceAndComments(); + this.appendTokenPrefix(); + this.resultCode += prefix; + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += this.code.slice( + this.tokens[this.tokenIndex].start, + this.tokens[this.tokenIndex].end, + ); + this.appendTokenSuffix(); + this.tokenIndex++; + } + + appendTokenPrefix() { + const token = this.currentToken(); + if (token.numNullishCoalesceStarts || token.isOptionalChainStart) { + token.isAsyncOperation = _isAsyncOperation2.default.call(void 0, this); + } + if (this.disableESTransforms) { + return; + } + if (token.numNullishCoalesceStarts) { + for (let i = 0; i < token.numNullishCoalesceStarts; i++) { + if (token.isAsyncOperation) { + this.resultCode += "await "; + this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce"); + } else { + this.resultCode += this.helperManager.getHelperName("nullishCoalesce"); + } + this.resultCode += "("; + } + } + if (token.isOptionalChainStart) { + if (token.isAsyncOperation) { + this.resultCode += "await "; + } + if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === _types.TokenType._delete) { + if (token.isAsyncOperation) { + this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete"); + } else { + this.resultCode += this.helperManager.getHelperName("optionalChainDelete"); + } + } else if (token.isAsyncOperation) { + this.resultCode += this.helperManager.getHelperName("asyncOptionalChain"); + } else { + this.resultCode += this.helperManager.getHelperName("optionalChain"); + } + this.resultCode += "(["; + } + } + + appendTokenSuffix() { + const token = this.currentToken(); + if (token.isOptionalChainEnd && !this.disableESTransforms) { + this.resultCode += "])"; + } + if (token.numNullishCoalesceEnds && !this.disableESTransforms) { + for (let i = 0; i < token.numNullishCoalesceEnds; i++) { + this.resultCode += "))"; + } + } + } + + appendCode(code) { + this.resultCode += code; + } + + currentToken() { + return this.tokens[this.tokenIndex]; + } + + currentTokenCode() { + const token = this.currentToken(); + return this.code.slice(token.start, token.end); + } + + tokenAtRelativeIndex(relativeIndex) { + return this.tokens[this.tokenIndex + relativeIndex]; + } + + currentIndex() { + return this.tokenIndex; + } + + /** + * Move to the next token. Only suitable in preprocessing steps. When + * generating new code, you should use copyToken or removeToken. + */ + nextToken() { + if (this.tokenIndex === this.tokens.length) { + throw new Error("Unexpectedly reached end of input."); + } + this.tokenIndex++; + } + + previousToken() { + this.tokenIndex--; + } + + finish() { + if (this.tokenIndex !== this.tokens.length) { + throw new Error("Tried to finish processing tokens before reaching the end."); + } + this.resultCode += this.previousWhitespaceAndComments(); + return {code: this.resultCode, mappings: this.resultMappings}; + } + + isAtEnd() { + return this.tokenIndex === this.tokens.length; + } +} exports.default = TokenProcessor; diff --git a/node_modules/sucrase/dist/cli.js b/node_modules/sucrase/dist/cli.js new file mode 100644 index 0000000..8eb0e89 --- /dev/null +++ b/node_modules/sucrase/dist/cli.js @@ -0,0 +1,320 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/* eslint-disable no-console */ +var _commander = require('commander'); var _commander2 = _interopRequireDefault(_commander); +var _glob = require('glob'); var _glob2 = _interopRequireDefault(_glob); +var _fs = require('mz/fs'); +var _path = require('path'); +var _util = require('util'); + +var _index = require('./index'); + + + + + + + + + + + +const glob = _util.promisify.call(void 0, _glob2.default); + + function run() { + _commander2.default + .description(`Sucrase: super-fast Babel alternative.`) + .usage("[options] ") + .option( + "-d, --out-dir ", + "Compile an input directory of modules into an output directory.", + ) + .option( + "-p, --project ", + "Compile a TypeScript project, will read from tsconfig.json in ", + ) + .option("--out-extension ", "File extension to use for all output files.", "js") + .option("--exclude-dirs ", "Names of directories that should not be traversed.") + .option("-q, --quiet", "Don't print the names of converted files.") + .option("-t, --transforms ", "Comma-separated list of transforms to run.") + .option("--disable-es-transforms", "Opt out of all ES syntax transforms.") + .option("--jsx-runtime ", "Transformation mode for the JSX transform.") + .option("--production", "Disable debugging information from JSX in output.") + .option( + "--jsx-import-source ", + "Automatic JSX transform import path prefix, defaults to `React.Fragment`.", + ) + .option( + "--jsx-pragma ", + "Classic JSX transform element creation function, defaults to `React.createElement`.", + ) + .option( + "--jsx-fragment-pragma ", + "Classic JSX transform fragment component, defaults to `React.Fragment`.", + ) + .option("--keep-unused-imports", "Disable automatic removal of type-only imports/exports.") + .option("--preserve-dynamic-import", "Don't transpile dynamic import() to require.") + .option( + "--inject-create-require-for-import-require", + "Use `createRequire` when transpiling TS `import = require` to ESM.", + ) + .option( + "--enable-legacy-typescript-module-interop", + "Use default TypeScript ESM/CJS interop strategy.", + ) + .option("--enable-legacy-babel5-module-interop", "Use Babel 5 ESM/CJS interop strategy.") + .parse(process.argv); + + if (_commander2.default.project) { + if ( + _commander2.default.outDir || + _commander2.default.transforms || + _commander2.default.args[0] || + _commander2.default.enableLegacyTypescriptModuleInterop + ) { + console.error( + "If TypeScript project is specified, out directory, transforms, source " + + "directory, and --enable-legacy-typescript-module-interop may not be specified.", + ); + process.exit(1); + } + } else { + if (!_commander2.default.outDir) { + console.error("Out directory is required"); + process.exit(1); + } + + if (!_commander2.default.transforms) { + console.error("Transforms option is required."); + process.exit(1); + } + + if (!_commander2.default.args[0]) { + console.error("Source directory is required."); + process.exit(1); + } + } + + const options = { + outDirPath: _commander2.default.outDir, + srcDirPath: _commander2.default.args[0], + project: _commander2.default.project, + outExtension: _commander2.default.outExtension, + excludeDirs: _commander2.default.excludeDirs ? _commander2.default.excludeDirs.split(",") : [], + quiet: _commander2.default.quiet, + sucraseOptions: { + transforms: _commander2.default.transforms ? _commander2.default.transforms.split(",") : [], + disableESTransforms: _commander2.default.disableEsTransforms, + jsxRuntime: _commander2.default.jsxRuntime, + production: _commander2.default.production, + jsxImportSource: _commander2.default.jsxImportSource, + jsxPragma: _commander2.default.jsxPragma || "React.createElement", + jsxFragmentPragma: _commander2.default.jsxFragmentPragma || "React.Fragment", + keepUnusedImports: _commander2.default.keepUnusedImports, + preserveDynamicImport: _commander2.default.preserveDynamicImport, + injectCreateRequireForImportRequire: _commander2.default.injectCreateRequireForImportRequire, + enableLegacyTypeScriptModuleInterop: _commander2.default.enableLegacyTypescriptModuleInterop, + enableLegacyBabel5ModuleInterop: _commander2.default.enableLegacyBabel5ModuleInterop, + }, + }; + + buildDirectory(options).catch((e) => { + process.exitCode = 1; + console.error(e); + }); +} exports.default = run; + + + + + + +async function findFiles(options) { + const outDirPath = options.outDirPath; + const srcDirPath = options.srcDirPath; + + const extensions = options.sucraseOptions.transforms.includes("typescript") + ? [".ts", ".tsx"] + : [".js", ".jsx"]; + + if (!(await _fs.exists.call(void 0, outDirPath))) { + await _fs.mkdir.call(void 0, outDirPath); + } + + const outArr = []; + for (const child of await _fs.readdir.call(void 0, srcDirPath)) { + if (["node_modules", ".git"].includes(child) || options.excludeDirs.includes(child)) { + continue; + } + const srcChildPath = _path.join.call(void 0, srcDirPath, child); + const outChildPath = _path.join.call(void 0, outDirPath, child); + if ((await _fs.stat.call(void 0, srcChildPath)).isDirectory()) { + const innerOptions = {...options}; + innerOptions.srcDirPath = srcChildPath; + innerOptions.outDirPath = outChildPath; + const innerFiles = await findFiles(innerOptions); + outArr.push(...innerFiles); + } else if (extensions.some((ext) => srcChildPath.endsWith(ext))) { + const outPath = outChildPath.replace(/\.\w+$/, `.${options.outExtension}`); + outArr.push({ + srcPath: srcChildPath, + outPath, + }); + } + } + + return outArr; +} + +async function runGlob(options) { + const tsConfigPath = _path.join.call(void 0, options.project, "tsconfig.json"); + + let str; + try { + str = await _fs.readFile.call(void 0, tsConfigPath, "utf8"); + } catch (err) { + console.error("Could not find project tsconfig.json"); + console.error(` --project=${options.project}`); + console.error(err); + process.exit(1); + } + const json = JSON.parse(str); + + const foundFiles = []; + + const files = json.files; + const include = json.include; + + const absProject = _path.join.call(void 0, process.cwd(), options.project); + const outDirs = []; + + if (!(await _fs.exists.call(void 0, options.outDirPath))) { + await _fs.mkdir.call(void 0, options.outDirPath); + } + + if (files) { + for (const file of files) { + if (file.endsWith(".d.ts")) { + continue; + } + if (!file.endsWith(".ts") && !file.endsWith(".js")) { + continue; + } + + const srcFile = _path.join.call(void 0, absProject, file); + const outFile = _path.join.call(void 0, options.outDirPath, file); + const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); + + const outDir = _path.dirname.call(void 0, outPath); + if (!outDirs.includes(outDir)) { + outDirs.push(outDir); + } + + foundFiles.push({ + srcPath: srcFile, + outPath, + }); + } + } + if (include) { + for (const pattern of include) { + const globFiles = await glob(_path.join.call(void 0, absProject, pattern)); + for (const file of globFiles) { + if (!file.endsWith(".ts") && !file.endsWith(".js")) { + continue; + } + if (file.endsWith(".d.ts")) { + continue; + } + + const relativeFile = _path.relative.call(void 0, absProject, file); + const outFile = _path.join.call(void 0, options.outDirPath, relativeFile); + const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); + + const outDir = _path.dirname.call(void 0, outPath); + if (!outDirs.includes(outDir)) { + outDirs.push(outDir); + } + + foundFiles.push({ + srcPath: file, + outPath, + }); + } + } + } + + for (const outDirPath of outDirs) { + if (!(await _fs.exists.call(void 0, outDirPath))) { + await _fs.mkdir.call(void 0, outDirPath); + } + } + + // TODO: read exclude + + return foundFiles; +} + +async function updateOptionsFromProject(options) { + /** + * Read the project information and assign the following. + * - outDirPath + * - transform: imports + * - transform: typescript + * - enableLegacyTypescriptModuleInterop: true/false. + */ + + const tsConfigPath = _path.join.call(void 0, options.project, "tsconfig.json"); + + let str; + try { + str = await _fs.readFile.call(void 0, tsConfigPath, "utf8"); + } catch (err) { + console.error("Could not find project tsconfig.json"); + console.error(` --project=${options.project}`); + console.error(err); + process.exit(1); + } + const json = JSON.parse(str); + const sucraseOpts = options.sucraseOptions; + if (!sucraseOpts.transforms.includes("typescript")) { + sucraseOpts.transforms.push("typescript"); + } + + const compilerOpts = json.compilerOptions; + if (compilerOpts.outDir) { + options.outDirPath = _path.join.call(void 0, process.cwd(), options.project, compilerOpts.outDir); + } + if (compilerOpts.esModuleInterop !== true) { + sucraseOpts.enableLegacyTypeScriptModuleInterop = true; + } + if (compilerOpts.module === "commonjs") { + if (!sucraseOpts.transforms.includes("imports")) { + sucraseOpts.transforms.push("imports"); + } + } +} + +async function buildDirectory(options) { + let files; + if (options.outDirPath && options.srcDirPath) { + files = await findFiles(options); + } else if (options.project) { + await updateOptionsFromProject(options); + files = await runGlob(options); + } else { + console.error("Project or Source directory required."); + process.exit(1); + } + + for (const file of files) { + await buildFile(file.srcPath, file.outPath, options); + } +} + +async function buildFile(srcPath, outPath, options) { + if (!options.quiet) { + console.log(`${srcPath} -> ${outPath}`); + } + const code = (await _fs.readFile.call(void 0, srcPath)).toString(); + const transformedCode = _index.transform.call(void 0, code, {...options.sucraseOptions, filePath: srcPath}).code; + await _fs.writeFile.call(void 0, outPath, transformedCode); +} diff --git a/node_modules/sucrase/dist/computeSourceMap.js b/node_modules/sucrase/dist/computeSourceMap.js new file mode 100644 index 0000000..567ddbb --- /dev/null +++ b/node_modules/sucrase/dist/computeSourceMap.js @@ -0,0 +1,89 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _genmapping = require('@jridgewell/gen-mapping'); + + + +var _charcodes = require('./parser/util/charcodes'); + + + + + + + + + + + + +/** + * Generate a source map indicating that each line maps directly to the original line, + * with the tokens in their new positions. + */ + function computeSourceMap( + {code: generatedCode, mappings: rawMappings}, + filePath, + options, + source, + tokens, +) { + const sourceColumns = computeSourceColumns(source, tokens); + const map = new (0, _genmapping.GenMapping)({file: options.compiledFilename}); + let tokenIndex = 0; + // currentMapping is the output source index for the current input token being + // considered. + let currentMapping = rawMappings[0]; + while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) { + tokenIndex++; + currentMapping = rawMappings[tokenIndex]; + } + let line = 0; + let lineStart = 0; + if (currentMapping !== lineStart) { + _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0); + } + for (let i = 0; i < generatedCode.length; i++) { + if (i === currentMapping) { + const genColumn = currentMapping - lineStart; + const sourceColumn = sourceColumns[tokenIndex]; + _genmapping.maybeAddSegment.call(void 0, map, line, genColumn, filePath, line, sourceColumn); + while ( + (currentMapping === i || currentMapping === undefined) && + tokenIndex < rawMappings.length - 1 + ) { + tokenIndex++; + currentMapping = rawMappings[tokenIndex]; + } + } + if (generatedCode.charCodeAt(i) === _charcodes.charCodes.lineFeed) { + line++; + lineStart = i + 1; + if (currentMapping !== lineStart) { + _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0); + } + } + } + const {sourceRoot, sourcesContent, ...sourceMap} = _genmapping.toEncodedMap.call(void 0, map); + return sourceMap ; +} exports.default = computeSourceMap; + +/** + * Create an array mapping each token index to the 0-based column of the start + * position of the token. + */ +function computeSourceColumns(code, tokens) { + const sourceColumns = new Array(tokens.length); + let tokenIndex = 0; + let currentMapping = tokens[tokenIndex].start; + let lineStart = 0; + for (let i = 0; i < code.length; i++) { + if (i === currentMapping) { + sourceColumns[tokenIndex] = currentMapping - lineStart; + tokenIndex++; + currentMapping = tokens[tokenIndex].start; + } + if (code.charCodeAt(i) === _charcodes.charCodes.lineFeed) { + lineStart = i + 1; + } + } + return sourceColumns; +} diff --git a/node_modules/sucrase/dist/esm/CJSImportProcessor.js b/node_modules/sucrase/dist/esm/CJSImportProcessor.js new file mode 100644 index 0000000..d8b7803 --- /dev/null +++ b/node_modules/sucrase/dist/esm/CJSImportProcessor.js @@ -0,0 +1,456 @@ + + + +import {isDeclaration} from "./parser/tokenizer"; +import {ContextualKeyword} from "./parser/tokenizer/keywords"; +import {TokenType as tt} from "./parser/tokenizer/types"; + +import getImportExportSpecifierInfo from "./util/getImportExportSpecifierInfo"; +import {getNonTypeIdentifiers} from "./util/getNonTypeIdentifiers"; + + + + + + + + + + + + + + + + +/** + * Class responsible for preprocessing and bookkeeping import and export declarations within the + * file. + * + * TypeScript uses a simpler mechanism that does not use functions like interopRequireDefault and + * interopRequireWildcard, so we also allow that mode for compatibility. + */ +export default class CJSImportProcessor { + __init() {this.nonTypeIdentifiers = new Set()} + __init2() {this.importInfoByPath = new Map()} + __init3() {this.importsToReplace = new Map()} + __init4() {this.identifierReplacements = new Map()} + __init5() {this.exportBindingsByLocalName = new Map()} + + constructor( + nameManager, + tokens, + enableLegacyTypeScriptModuleInterop, + options, + isTypeScriptTransformEnabled, + keepUnusedImports, + helperManager, + ) {;this.nameManager = nameManager;this.tokens = tokens;this.enableLegacyTypeScriptModuleInterop = enableLegacyTypeScriptModuleInterop;this.options = options;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.keepUnusedImports = keepUnusedImports;this.helperManager = helperManager;CJSImportProcessor.prototype.__init.call(this);CJSImportProcessor.prototype.__init2.call(this);CJSImportProcessor.prototype.__init3.call(this);CJSImportProcessor.prototype.__init4.call(this);CJSImportProcessor.prototype.__init5.call(this);} + + preprocessTokens() { + for (let i = 0; i < this.tokens.tokens.length; i++) { + if ( + this.tokens.matches1AtIndex(i, tt._import) && + !this.tokens.matches3AtIndex(i, tt._import, tt.name, tt.eq) + ) { + this.preprocessImportAtIndex(i); + } + if ( + this.tokens.matches1AtIndex(i, tt._export) && + !this.tokens.matches2AtIndex(i, tt._export, tt.eq) + ) { + this.preprocessExportAtIndex(i); + } + } + this.generateImportReplacements(); + } + + /** + * In TypeScript, import statements that only import types should be removed. + * This includes `import {} from 'foo';`, but not `import 'foo';`. + */ + pruneTypeOnlyImports() { + this.nonTypeIdentifiers = getNonTypeIdentifiers(this.tokens, this.options); + for (const [path, importInfo] of this.importInfoByPath.entries()) { + if ( + importInfo.hasBareImport || + importInfo.hasStarExport || + importInfo.exportStarNames.length > 0 || + importInfo.namedExports.length > 0 + ) { + continue; + } + const names = [ + ...importInfo.defaultNames, + ...importInfo.wildcardNames, + ...importInfo.namedImports.map(({localName}) => localName), + ]; + if (names.every((name) => this.shouldAutomaticallyElideImportedName(name))) { + this.importsToReplace.set(path, ""); + } + } + } + + shouldAutomaticallyElideImportedName(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + !this.nonTypeIdentifiers.has(name) + ); + } + + generateImportReplacements() { + for (const [path, importInfo] of this.importInfoByPath.entries()) { + const { + defaultNames, + wildcardNames, + namedImports, + namedExports, + exportStarNames, + hasStarExport, + } = importInfo; + + if ( + defaultNames.length === 0 && + wildcardNames.length === 0 && + namedImports.length === 0 && + namedExports.length === 0 && + exportStarNames.length === 0 && + !hasStarExport + ) { + // Import is never used, so don't even assign a name. + this.importsToReplace.set(path, `require('${path}');`); + continue; + } + + const primaryImportName = this.getFreeIdentifierForPath(path); + let secondaryImportName; + if (this.enableLegacyTypeScriptModuleInterop) { + secondaryImportName = primaryImportName; + } else { + secondaryImportName = + wildcardNames.length > 0 ? wildcardNames[0] : this.getFreeIdentifierForPath(path); + } + let requireCode = `var ${primaryImportName} = require('${path}');`; + if (wildcardNames.length > 0) { + for (const wildcardName of wildcardNames) { + const moduleExpr = this.enableLegacyTypeScriptModuleInterop + ? primaryImportName + : `${this.helperManager.getHelperName("interopRequireWildcard")}(${primaryImportName})`; + requireCode += ` var ${wildcardName} = ${moduleExpr};`; + } + } else if (exportStarNames.length > 0 && secondaryImportName !== primaryImportName) { + requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( + "interopRequireWildcard", + )}(${primaryImportName});`; + } else if (defaultNames.length > 0 && secondaryImportName !== primaryImportName) { + requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( + "interopRequireDefault", + )}(${primaryImportName});`; + } + + for (const {importedName, localName} of namedExports) { + requireCode += ` ${this.helperManager.getHelperName( + "createNamedExportFrom", + )}(${primaryImportName}, '${localName}', '${importedName}');`; + } + for (const exportStarName of exportStarNames) { + requireCode += ` exports.${exportStarName} = ${secondaryImportName};`; + } + if (hasStarExport) { + requireCode += ` ${this.helperManager.getHelperName( + "createStarExport", + )}(${primaryImportName});`; + } + + this.importsToReplace.set(path, requireCode); + + for (const defaultName of defaultNames) { + this.identifierReplacements.set(defaultName, `${secondaryImportName}.default`); + } + for (const {importedName, localName} of namedImports) { + this.identifierReplacements.set(localName, `${primaryImportName}.${importedName}`); + } + } + } + + getFreeIdentifierForPath(path) { + const components = path.split("/"); + const lastComponent = components[components.length - 1]; + const baseName = lastComponent.replace(/\W/g, ""); + return this.nameManager.claimFreeName(`_${baseName}`); + } + + preprocessImportAtIndex(index) { + const defaultNames = []; + const wildcardNames = []; + const namedImports = []; + + index++; + if ( + (this.tokens.matchesContextualAtIndex(index, ContextualKeyword._type) || + this.tokens.matches1AtIndex(index, tt._typeof)) && + !this.tokens.matches1AtIndex(index + 1, tt.comma) && + !this.tokens.matchesContextualAtIndex(index + 1, ContextualKeyword._from) + ) { + // import type declaration, so no need to process anything. + return; + } + + if (this.tokens.matches1AtIndex(index, tt.parenL)) { + // Dynamic import, so nothing to do + return; + } + + if (this.tokens.matches1AtIndex(index, tt.name)) { + defaultNames.push(this.tokens.identifierNameAtIndex(index)); + index++; + if (this.tokens.matches1AtIndex(index, tt.comma)) { + index++; + } + } + + if (this.tokens.matches1AtIndex(index, tt.star)) { + // * as + index += 2; + wildcardNames.push(this.tokens.identifierNameAtIndex(index)); + index++; + } + + if (this.tokens.matches1AtIndex(index, tt.braceL)) { + const result = this.getNamedImports(index + 1); + index = result.newIndex; + + for (const namedImport of result.namedImports) { + // Treat {default as X} as a default import to ensure usage of require interop helper + if (namedImport.importedName === "default") { + defaultNames.push(namedImport.localName); + } else { + namedImports.push(namedImport); + } + } + } + + if (this.tokens.matchesContextualAtIndex(index, ContextualKeyword._from)) { + index++; + } + + if (!this.tokens.matches1AtIndex(index, tt.string)) { + throw new Error("Expected string token at the end of import statement."); + } + const path = this.tokens.stringValueAtIndex(index); + const importInfo = this.getImportInfo(path); + importInfo.defaultNames.push(...defaultNames); + importInfo.wildcardNames.push(...wildcardNames); + importInfo.namedImports.push(...namedImports); + if (defaultNames.length === 0 && wildcardNames.length === 0 && namedImports.length === 0) { + importInfo.hasBareImport = true; + } + } + + preprocessExportAtIndex(index) { + if ( + this.tokens.matches2AtIndex(index, tt._export, tt._var) || + this.tokens.matches2AtIndex(index, tt._export, tt._let) || + this.tokens.matches2AtIndex(index, tt._export, tt._const) + ) { + this.preprocessVarExportAtIndex(index); + } else if ( + this.tokens.matches2AtIndex(index, tt._export, tt._function) || + this.tokens.matches2AtIndex(index, tt._export, tt._class) + ) { + const exportName = this.tokens.identifierNameAtIndex(index + 2); + this.addExportBinding(exportName, exportName); + } else if (this.tokens.matches3AtIndex(index, tt._export, tt.name, tt._function)) { + const exportName = this.tokens.identifierNameAtIndex(index + 3); + this.addExportBinding(exportName, exportName); + } else if (this.tokens.matches2AtIndex(index, tt._export, tt.braceL)) { + this.preprocessNamedExportAtIndex(index); + } else if (this.tokens.matches2AtIndex(index, tt._export, tt.star)) { + this.preprocessExportStarAtIndex(index); + } + } + + preprocessVarExportAtIndex(index) { + let depth = 0; + // Handle cases like `export let {x} = y;`, starting at the open-brace in that case. + for (let i = index + 2; ; i++) { + if ( + this.tokens.matches1AtIndex(i, tt.braceL) || + this.tokens.matches1AtIndex(i, tt.dollarBraceL) || + this.tokens.matches1AtIndex(i, tt.bracketL) + ) { + depth++; + } else if ( + this.tokens.matches1AtIndex(i, tt.braceR) || + this.tokens.matches1AtIndex(i, tt.bracketR) + ) { + depth--; + } else if (depth === 0 && !this.tokens.matches1AtIndex(i, tt.name)) { + break; + } else if (this.tokens.matches1AtIndex(1, tt.eq)) { + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + i = endIndex - 1; + } else { + const token = this.tokens.tokens[i]; + if (isDeclaration(token)) { + const exportName = this.tokens.identifierNameAtIndex(i); + this.identifierReplacements.set(exportName, `exports.${exportName}`); + } + } + } + } + + /** + * Walk this export statement just in case it's an export...from statement. + * If it is, combine it into the import info for that path. Otherwise, just + * bail out; it'll be handled later. + */ + preprocessNamedExportAtIndex(index) { + // export { + index += 2; + const {newIndex, namedImports} = this.getNamedImports(index); + index = newIndex; + + if (this.tokens.matchesContextualAtIndex(index, ContextualKeyword._from)) { + index++; + } else { + // Reinterpret "a as b" to be local/exported rather than imported/local. + for (const {importedName: localName, localName: exportedName} of namedImports) { + this.addExportBinding(localName, exportedName); + } + return; + } + + if (!this.tokens.matches1AtIndex(index, tt.string)) { + throw new Error("Expected string token at the end of import statement."); + } + const path = this.tokens.stringValueAtIndex(index); + const importInfo = this.getImportInfo(path); + importInfo.namedExports.push(...namedImports); + } + + preprocessExportStarAtIndex(index) { + let exportedName = null; + if (this.tokens.matches3AtIndex(index, tt._export, tt.star, tt._as)) { + // export * as + index += 3; + exportedName = this.tokens.identifierNameAtIndex(index); + // foo from + index += 2; + } else { + // export * from + index += 3; + } + if (!this.tokens.matches1AtIndex(index, tt.string)) { + throw new Error("Expected string token at the end of star export statement."); + } + const path = this.tokens.stringValueAtIndex(index); + const importInfo = this.getImportInfo(path); + if (exportedName !== null) { + importInfo.exportStarNames.push(exportedName); + } else { + importInfo.hasStarExport = true; + } + } + + getNamedImports(index) { + const namedImports = []; + while (true) { + if (this.tokens.matches1AtIndex(index, tt.braceR)) { + index++; + break; + } + + const specifierInfo = getImportExportSpecifierInfo(this.tokens, index); + index = specifierInfo.endIndex; + if (!specifierInfo.isType) { + namedImports.push({ + importedName: specifierInfo.leftName, + localName: specifierInfo.rightName, + }); + } + + if (this.tokens.matches2AtIndex(index, tt.comma, tt.braceR)) { + index += 2; + break; + } else if (this.tokens.matches1AtIndex(index, tt.braceR)) { + index++; + break; + } else if (this.tokens.matches1AtIndex(index, tt.comma)) { + index++; + } else { + throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[index])}`); + } + } + return {newIndex: index, namedImports}; + } + + /** + * Get a mutable import info object for this path, creating one if it doesn't + * exist yet. + */ + getImportInfo(path) { + const existingInfo = this.importInfoByPath.get(path); + if (existingInfo) { + return existingInfo; + } + const newInfo = { + defaultNames: [], + wildcardNames: [], + namedImports: [], + namedExports: [], + hasBareImport: false, + exportStarNames: [], + hasStarExport: false, + }; + this.importInfoByPath.set(path, newInfo); + return newInfo; + } + + addExportBinding(localName, exportedName) { + if (!this.exportBindingsByLocalName.has(localName)) { + this.exportBindingsByLocalName.set(localName, []); + } + this.exportBindingsByLocalName.get(localName).push(exportedName); + } + + /** + * Return the code to use for the import for this path, or the empty string if + * the code has already been "claimed" by a previous import. + */ + claimImportCode(importPath) { + const result = this.importsToReplace.get(importPath); + this.importsToReplace.set(importPath, ""); + return result || ""; + } + + getIdentifierReplacement(identifierName) { + return this.identifierReplacements.get(identifierName) || null; + } + + /** + * Return a string like `exports.foo = exports.bar`. + */ + resolveExportBinding(assignedName) { + const exportedNames = this.exportBindingsByLocalName.get(assignedName); + if (!exportedNames || exportedNames.length === 0) { + return null; + } + return exportedNames.map((exportedName) => `exports.${exportedName}`).join(" = "); + } + + /** + * Return all imported/exported names where we might be interested in whether usages of those + * names are shadowed. + */ + getGlobalNames() { + return new Set([ + ...this.identifierReplacements.keys(), + ...this.exportBindingsByLocalName.keys(), + ]); + } +} diff --git a/node_modules/sucrase/dist/esm/HelperManager.js b/node_modules/sucrase/dist/esm/HelperManager.js new file mode 100644 index 0000000..7964db3 --- /dev/null +++ b/node_modules/sucrase/dist/esm/HelperManager.js @@ -0,0 +1,176 @@ + + +const HELPERS = { + require: ` + import {createRequire as CREATE_REQUIRE_NAME} from "module"; + const require = CREATE_REQUIRE_NAME(import.meta.url); + `, + interopRequireWildcard: ` + function interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + return newObj; + } + } + `, + interopRequireDefault: ` + function interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + `, + createNamedExportFrom: ` + function createNamedExportFrom(obj, localName, importedName) { + Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]}); + } + `, + // Note that TypeScript and Babel do this differently; TypeScript does a simple existence + // check in the exports object and does a plain assignment, whereas Babel uses + // defineProperty and builds an object of explicitly-exported names so that star exports can + // always take lower precedence. For now, we do the easier TypeScript thing. + createStarExport: ` + function createStarExport(obj) { + Object.keys(obj) + .filter((key) => key !== "default" && key !== "__esModule") + .forEach((key) => { + if (exports.hasOwnProperty(key)) { + return; + } + Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); + }); + } + `, + nullishCoalesce: ` + function nullishCoalesce(lhs, rhsFn) { + if (lhs != null) { + return lhs; + } else { + return rhsFn(); + } + } + `, + asyncNullishCoalesce: ` + async function asyncNullishCoalesce(lhs, rhsFn) { + if (lhs != null) { + return lhs; + } else { + return await rhsFn(); + } + } + `, + optionalChain: ` + function optionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i]; + const fn = ops[i + 1]; + i += 2; + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + return undefined; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = fn((...args) => value.call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; + } + `, + asyncOptionalChain: ` + async function asyncOptionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i]; + const fn = ops[i + 1]; + i += 2; + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + return undefined; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = await fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = await fn((...args) => value.call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; + } + `, + optionalChainDelete: ` + function optionalChainDelete(ops) { + const result = OPTIONAL_CHAIN_NAME(ops); + return result == null ? true : result; + } + `, + asyncOptionalChainDelete: ` + async function asyncOptionalChainDelete(ops) { + const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); + return result == null ? true : result; + } + `, +}; + +export class HelperManager { + __init() {this.helperNames = {}} + __init2() {this.createRequireName = null} + constructor( nameManager) {;this.nameManager = nameManager;HelperManager.prototype.__init.call(this);HelperManager.prototype.__init2.call(this);} + + getHelperName(baseName) { + let helperName = this.helperNames[baseName]; + if (helperName) { + return helperName; + } + helperName = this.nameManager.claimFreeName(`_${baseName}`); + this.helperNames[baseName] = helperName; + return helperName; + } + + emitHelpers() { + let resultCode = ""; + if (this.helperNames.optionalChainDelete) { + this.getHelperName("optionalChain"); + } + if (this.helperNames.asyncOptionalChainDelete) { + this.getHelperName("asyncOptionalChain"); + } + for (const [baseName, helperCodeTemplate] of Object.entries(HELPERS)) { + const helperName = this.helperNames[baseName]; + let helperCode = helperCodeTemplate; + if (baseName === "optionalChainDelete") { + helperCode = helperCode.replace("OPTIONAL_CHAIN_NAME", this.helperNames.optionalChain); + } else if (baseName === "asyncOptionalChainDelete") { + helperCode = helperCode.replace( + "ASYNC_OPTIONAL_CHAIN_NAME", + this.helperNames.asyncOptionalChain, + ); + } else if (baseName === "require") { + if (this.createRequireName === null) { + this.createRequireName = this.nameManager.claimFreeName("_createRequire"); + } + helperCode = helperCode.replace(/CREATE_REQUIRE_NAME/g, this.createRequireName); + } + if (helperName) { + resultCode += " "; + resultCode += helperCode.replace(baseName, helperName).replace(/\s+/g, " ").trim(); + } + } + return resultCode; + } +} diff --git a/node_modules/sucrase/dist/esm/NameManager.js b/node_modules/sucrase/dist/esm/NameManager.js new file mode 100644 index 0000000..47d2c9f --- /dev/null +++ b/node_modules/sucrase/dist/esm/NameManager.js @@ -0,0 +1,27 @@ + +import getIdentifierNames from "./util/getIdentifierNames"; + +export default class NameManager { + __init() {this.usedNames = new Set()} + + constructor(code, tokens) {;NameManager.prototype.__init.call(this); + this.usedNames = new Set(getIdentifierNames(code, tokens)); + } + + claimFreeName(name) { + const newName = this.findFreeName(name); + this.usedNames.add(newName); + return newName; + } + + findFreeName(name) { + if (!this.usedNames.has(name)) { + return name; + } + let suffixNum = 2; + while (this.usedNames.has(name + String(suffixNum))) { + suffixNum++; + } + return name + String(suffixNum); + } +} diff --git a/node_modules/sucrase/dist/esm/Options-gen-types.js b/node_modules/sucrase/dist/esm/Options-gen-types.js new file mode 100644 index 0000000..5c39c2c --- /dev/null +++ b/node_modules/sucrase/dist/esm/Options-gen-types.js @@ -0,0 +1,42 @@ +/** + * This module was automatically generated by `ts-interface-builder` + */ +import * as t from "ts-interface-checker"; +// tslint:disable:object-literal-key-quotes + +export const Transform = t.union( + t.lit("jsx"), + t.lit("typescript"), + t.lit("flow"), + t.lit("imports"), + t.lit("react-hot-loader"), + t.lit("jest"), +); + +export const SourceMapOptions = t.iface([], { + compiledFilename: "string", +}); + +export const Options = t.iface([], { + transforms: t.array("Transform"), + disableESTransforms: t.opt("boolean"), + jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))), + production: t.opt("boolean"), + jsxImportSource: t.opt("string"), + jsxPragma: t.opt("string"), + jsxFragmentPragma: t.opt("string"), + keepUnusedImports: t.opt("boolean"), + preserveDynamicImport: t.opt("boolean"), + injectCreateRequireForImportRequire: t.opt("boolean"), + enableLegacyTypeScriptModuleInterop: t.opt("boolean"), + enableLegacyBabel5ModuleInterop: t.opt("boolean"), + sourceMapOptions: t.opt("SourceMapOptions"), + filePath: t.opt("string"), +}); + +const exportedTypeSuite = { + Transform, + SourceMapOptions, + Options, +}; +export default exportedTypeSuite; diff --git a/node_modules/sucrase/dist/esm/Options.js b/node_modules/sucrase/dist/esm/Options.js new file mode 100644 index 0000000..83ee83d --- /dev/null +++ b/node_modules/sucrase/dist/esm/Options.js @@ -0,0 +1,101 @@ +import {createCheckers} from "ts-interface-checker"; + +import OptionsGenTypes from "./Options-gen-types"; + +const {Options: OptionsChecker} = createCheckers(OptionsGenTypes); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +export function validateOptions(options) { + OptionsChecker.strictCheck(options); +} diff --git a/node_modules/sucrase/dist/esm/TokenProcessor.js b/node_modules/sucrase/dist/esm/TokenProcessor.js new file mode 100644 index 0000000..5335f23 --- /dev/null +++ b/node_modules/sucrase/dist/esm/TokenProcessor.js @@ -0,0 +1,357 @@ + + + +import { TokenType as tt} from "./parser/tokenizer/types"; +import isAsyncOperation from "./util/isAsyncOperation"; + + + + + + + + + + + +export default class TokenProcessor { + __init() {this.resultCode = ""} + // Array mapping input token index to optional string index position in the + // output code. + __init2() {this.resultMappings = new Array(this.tokens.length)} + __init3() {this.tokenIndex = 0} + + constructor( + code, + tokens, + isFlowEnabled, + disableESTransforms, + helperManager, + ) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);} + + /** + * Snapshot the token state in a way that can be restored later, useful for + * things like lookahead. + * + * resultMappings do not need to be copied since in all use cases, they will + * be overwritten anyway after restore. + */ + snapshot() { + return { + resultCode: this.resultCode, + tokenIndex: this.tokenIndex, + }; + } + + restoreToSnapshot(snapshot) { + this.resultCode = snapshot.resultCode; + this.tokenIndex = snapshot.tokenIndex; + } + + /** + * Remove and return the code generated since the snapshot, leaving the + * current token position in-place. Unlike most TokenProcessor operations, + * this operation can result in input/output line number mismatches because + * the removed code may contain newlines, so this operation should be used + * sparingly. + */ + dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) { + const result = this.resultCode.slice(snapshot.resultCode.length); + this.resultCode = snapshot.resultCode; + return result; + } + + reset() { + this.resultCode = ""; + this.resultMappings = new Array(this.tokens.length); + this.tokenIndex = 0; + } + + matchesContextualAtIndex(index, contextualKeyword) { + return ( + this.matches1AtIndex(index, tt.name) && + this.tokens[index].contextualKeyword === contextualKeyword + ); + } + + identifierNameAtIndex(index) { + // TODO: We need to process escapes since technically you can have unicode escapes in variable + // names. + return this.identifierNameForToken(this.tokens[index]); + } + + identifierNameAtRelativeIndex(relativeIndex) { + return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex)); + } + + identifierName() { + return this.identifierNameForToken(this.currentToken()); + } + + identifierNameForToken(token) { + return this.code.slice(token.start, token.end); + } + + rawCodeForToken(token) { + return this.code.slice(token.start, token.end); + } + + stringValueAtIndex(index) { + return this.stringValueForToken(this.tokens[index]); + } + + stringValue() { + return this.stringValueForToken(this.currentToken()); + } + + stringValueForToken(token) { + // This is used to identify when two imports are the same and to resolve TypeScript enum keys. + // Ideally we'd process escapes within the strings, but for now we pretty much take the raw + // code. + return this.code.slice(token.start + 1, token.end - 1); + } + + matches1AtIndex(index, t1) { + return this.tokens[index].type === t1; + } + + matches2AtIndex(index, t1, t2) { + return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2; + } + + matches3AtIndex(index, t1, t2, t3) { + return ( + this.tokens[index].type === t1 && + this.tokens[index + 1].type === t2 && + this.tokens[index + 2].type === t3 + ); + } + + matches1(t1) { + return this.tokens[this.tokenIndex].type === t1; + } + + matches2(t1, t2) { + return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2; + } + + matches3(t1, t2, t3) { + return ( + this.tokens[this.tokenIndex].type === t1 && + this.tokens[this.tokenIndex + 1].type === t2 && + this.tokens[this.tokenIndex + 2].type === t3 + ); + } + + matches4(t1, t2, t3, t4) { + return ( + this.tokens[this.tokenIndex].type === t1 && + this.tokens[this.tokenIndex + 1].type === t2 && + this.tokens[this.tokenIndex + 2].type === t3 && + this.tokens[this.tokenIndex + 3].type === t4 + ); + } + + matches5(t1, t2, t3, t4, t5) { + return ( + this.tokens[this.tokenIndex].type === t1 && + this.tokens[this.tokenIndex + 1].type === t2 && + this.tokens[this.tokenIndex + 2].type === t3 && + this.tokens[this.tokenIndex + 3].type === t4 && + this.tokens[this.tokenIndex + 4].type === t5 + ); + } + + matchesContextual(contextualKeyword) { + return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword); + } + + matchesContextIdAndLabel(type, contextId) { + return this.matches1(type) && this.currentToken().contextId === contextId; + } + + previousWhitespaceAndComments() { + let whitespaceAndComments = this.code.slice( + this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0, + this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length, + ); + if (this.isFlowEnabled) { + whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, ""); + } + return whitespaceAndComments; + } + + replaceToken(newCode) { + this.resultCode += this.previousWhitespaceAndComments(); + this.appendTokenPrefix(); + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += newCode; + this.appendTokenSuffix(); + this.tokenIndex++; + } + + replaceTokenTrimmingLeftWhitespace(newCode) { + this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, ""); + this.appendTokenPrefix(); + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += newCode; + this.appendTokenSuffix(); + this.tokenIndex++; + } + + removeInitialToken() { + this.replaceToken(""); + } + + removeToken() { + this.replaceTokenTrimmingLeftWhitespace(""); + } + + /** + * Remove all code until the next }, accounting for balanced braces. + */ + removeBalancedCode() { + let braceDepth = 0; + while (!this.isAtEnd()) { + if (this.matches1(tt.braceL)) { + braceDepth++; + } else if (this.matches1(tt.braceR)) { + if (braceDepth === 0) { + return; + } + braceDepth--; + } + this.removeToken(); + } + } + + copyExpectedToken(tokenType) { + if (this.tokens[this.tokenIndex].type !== tokenType) { + throw new Error(`Expected token ${tokenType}`); + } + this.copyToken(); + } + + copyToken() { + this.resultCode += this.previousWhitespaceAndComments(); + this.appendTokenPrefix(); + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += this.code.slice( + this.tokens[this.tokenIndex].start, + this.tokens[this.tokenIndex].end, + ); + this.appendTokenSuffix(); + this.tokenIndex++; + } + + copyTokenWithPrefix(prefix) { + this.resultCode += this.previousWhitespaceAndComments(); + this.appendTokenPrefix(); + this.resultCode += prefix; + this.resultMappings[this.tokenIndex] = this.resultCode.length; + this.resultCode += this.code.slice( + this.tokens[this.tokenIndex].start, + this.tokens[this.tokenIndex].end, + ); + this.appendTokenSuffix(); + this.tokenIndex++; + } + + appendTokenPrefix() { + const token = this.currentToken(); + if (token.numNullishCoalesceStarts || token.isOptionalChainStart) { + token.isAsyncOperation = isAsyncOperation(this); + } + if (this.disableESTransforms) { + return; + } + if (token.numNullishCoalesceStarts) { + for (let i = 0; i < token.numNullishCoalesceStarts; i++) { + if (token.isAsyncOperation) { + this.resultCode += "await "; + this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce"); + } else { + this.resultCode += this.helperManager.getHelperName("nullishCoalesce"); + } + this.resultCode += "("; + } + } + if (token.isOptionalChainStart) { + if (token.isAsyncOperation) { + this.resultCode += "await "; + } + if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === tt._delete) { + if (token.isAsyncOperation) { + this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete"); + } else { + this.resultCode += this.helperManager.getHelperName("optionalChainDelete"); + } + } else if (token.isAsyncOperation) { + this.resultCode += this.helperManager.getHelperName("asyncOptionalChain"); + } else { + this.resultCode += this.helperManager.getHelperName("optionalChain"); + } + this.resultCode += "(["; + } + } + + appendTokenSuffix() { + const token = this.currentToken(); + if (token.isOptionalChainEnd && !this.disableESTransforms) { + this.resultCode += "])"; + } + if (token.numNullishCoalesceEnds && !this.disableESTransforms) { + for (let i = 0; i < token.numNullishCoalesceEnds; i++) { + this.resultCode += "))"; + } + } + } + + appendCode(code) { + this.resultCode += code; + } + + currentToken() { + return this.tokens[this.tokenIndex]; + } + + currentTokenCode() { + const token = this.currentToken(); + return this.code.slice(token.start, token.end); + } + + tokenAtRelativeIndex(relativeIndex) { + return this.tokens[this.tokenIndex + relativeIndex]; + } + + currentIndex() { + return this.tokenIndex; + } + + /** + * Move to the next token. Only suitable in preprocessing steps. When + * generating new code, you should use copyToken or removeToken. + */ + nextToken() { + if (this.tokenIndex === this.tokens.length) { + throw new Error("Unexpectedly reached end of input."); + } + this.tokenIndex++; + } + + previousToken() { + this.tokenIndex--; + } + + finish() { + if (this.tokenIndex !== this.tokens.length) { + throw new Error("Tried to finish processing tokens before reaching the end."); + } + this.resultCode += this.previousWhitespaceAndComments(); + return {code: this.resultCode, mappings: this.resultMappings}; + } + + isAtEnd() { + return this.tokenIndex === this.tokens.length; + } +} diff --git a/node_modules/sucrase/dist/esm/cli.js b/node_modules/sucrase/dist/esm/cli.js new file mode 100644 index 0000000..93fbb6e --- /dev/null +++ b/node_modules/sucrase/dist/esm/cli.js @@ -0,0 +1,320 @@ +/* eslint-disable no-console */ +import commander from "commander"; +import globCb from "glob"; +import {exists, mkdir, readdir, readFile, stat, writeFile} from "mz/fs"; +import {dirname, join, relative} from "path"; +import {promisify} from "util"; + +import { transform} from "./index"; + + + + + + + + + + + +const glob = promisify(globCb); + +export default function run() { + commander + .description(`Sucrase: super-fast Babel alternative.`) + .usage("[options] ") + .option( + "-d, --out-dir ", + "Compile an input directory of modules into an output directory.", + ) + .option( + "-p, --project ", + "Compile a TypeScript project, will read from tsconfig.json in ", + ) + .option("--out-extension ", "File extension to use for all output files.", "js") + .option("--exclude-dirs ", "Names of directories that should not be traversed.") + .option("-q, --quiet", "Don't print the names of converted files.") + .option("-t, --transforms ", "Comma-separated list of transforms to run.") + .option("--disable-es-transforms", "Opt out of all ES syntax transforms.") + .option("--jsx-runtime ", "Transformation mode for the JSX transform.") + .option("--production", "Disable debugging information from JSX in output.") + .option( + "--jsx-import-source ", + "Automatic JSX transform import path prefix, defaults to `React.Fragment`.", + ) + .option( + "--jsx-pragma ", + "Classic JSX transform element creation function, defaults to `React.createElement`.", + ) + .option( + "--jsx-fragment-pragma ", + "Classic JSX transform fragment component, defaults to `React.Fragment`.", + ) + .option("--keep-unused-imports", "Disable automatic removal of type-only imports/exports.") + .option("--preserve-dynamic-import", "Don't transpile dynamic import() to require.") + .option( + "--inject-create-require-for-import-require", + "Use `createRequire` when transpiling TS `import = require` to ESM.", + ) + .option( + "--enable-legacy-typescript-module-interop", + "Use default TypeScript ESM/CJS interop strategy.", + ) + .option("--enable-legacy-babel5-module-interop", "Use Babel 5 ESM/CJS interop strategy.") + .parse(process.argv); + + if (commander.project) { + if ( + commander.outDir || + commander.transforms || + commander.args[0] || + commander.enableLegacyTypescriptModuleInterop + ) { + console.error( + "If TypeScript project is specified, out directory, transforms, source " + + "directory, and --enable-legacy-typescript-module-interop may not be specified.", + ); + process.exit(1); + } + } else { + if (!commander.outDir) { + console.error("Out directory is required"); + process.exit(1); + } + + if (!commander.transforms) { + console.error("Transforms option is required."); + process.exit(1); + } + + if (!commander.args[0]) { + console.error("Source directory is required."); + process.exit(1); + } + } + + const options = { + outDirPath: commander.outDir, + srcDirPath: commander.args[0], + project: commander.project, + outExtension: commander.outExtension, + excludeDirs: commander.excludeDirs ? commander.excludeDirs.split(",") : [], + quiet: commander.quiet, + sucraseOptions: { + transforms: commander.transforms ? commander.transforms.split(",") : [], + disableESTransforms: commander.disableEsTransforms, + jsxRuntime: commander.jsxRuntime, + production: commander.production, + jsxImportSource: commander.jsxImportSource, + jsxPragma: commander.jsxPragma || "React.createElement", + jsxFragmentPragma: commander.jsxFragmentPragma || "React.Fragment", + keepUnusedImports: commander.keepUnusedImports, + preserveDynamicImport: commander.preserveDynamicImport, + injectCreateRequireForImportRequire: commander.injectCreateRequireForImportRequire, + enableLegacyTypeScriptModuleInterop: commander.enableLegacyTypescriptModuleInterop, + enableLegacyBabel5ModuleInterop: commander.enableLegacyBabel5ModuleInterop, + }, + }; + + buildDirectory(options).catch((e) => { + process.exitCode = 1; + console.error(e); + }); +} + + + + + + +async function findFiles(options) { + const outDirPath = options.outDirPath; + const srcDirPath = options.srcDirPath; + + const extensions = options.sucraseOptions.transforms.includes("typescript") + ? [".ts", ".tsx"] + : [".js", ".jsx"]; + + if (!(await exists(outDirPath))) { + await mkdir(outDirPath); + } + + const outArr = []; + for (const child of await readdir(srcDirPath)) { + if (["node_modules", ".git"].includes(child) || options.excludeDirs.includes(child)) { + continue; + } + const srcChildPath = join(srcDirPath, child); + const outChildPath = join(outDirPath, child); + if ((await stat(srcChildPath)).isDirectory()) { + const innerOptions = {...options}; + innerOptions.srcDirPath = srcChildPath; + innerOptions.outDirPath = outChildPath; + const innerFiles = await findFiles(innerOptions); + outArr.push(...innerFiles); + } else if (extensions.some((ext) => srcChildPath.endsWith(ext))) { + const outPath = outChildPath.replace(/\.\w+$/, `.${options.outExtension}`); + outArr.push({ + srcPath: srcChildPath, + outPath, + }); + } + } + + return outArr; +} + +async function runGlob(options) { + const tsConfigPath = join(options.project, "tsconfig.json"); + + let str; + try { + str = await readFile(tsConfigPath, "utf8"); + } catch (err) { + console.error("Could not find project tsconfig.json"); + console.error(` --project=${options.project}`); + console.error(err); + process.exit(1); + } + const json = JSON.parse(str); + + const foundFiles = []; + + const files = json.files; + const include = json.include; + + const absProject = join(process.cwd(), options.project); + const outDirs = []; + + if (!(await exists(options.outDirPath))) { + await mkdir(options.outDirPath); + } + + if (files) { + for (const file of files) { + if (file.endsWith(".d.ts")) { + continue; + } + if (!file.endsWith(".ts") && !file.endsWith(".js")) { + continue; + } + + const srcFile = join(absProject, file); + const outFile = join(options.outDirPath, file); + const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); + + const outDir = dirname(outPath); + if (!outDirs.includes(outDir)) { + outDirs.push(outDir); + } + + foundFiles.push({ + srcPath: srcFile, + outPath, + }); + } + } + if (include) { + for (const pattern of include) { + const globFiles = await glob(join(absProject, pattern)); + for (const file of globFiles) { + if (!file.endsWith(".ts") && !file.endsWith(".js")) { + continue; + } + if (file.endsWith(".d.ts")) { + continue; + } + + const relativeFile = relative(absProject, file); + const outFile = join(options.outDirPath, relativeFile); + const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); + + const outDir = dirname(outPath); + if (!outDirs.includes(outDir)) { + outDirs.push(outDir); + } + + foundFiles.push({ + srcPath: file, + outPath, + }); + } + } + } + + for (const outDirPath of outDirs) { + if (!(await exists(outDirPath))) { + await mkdir(outDirPath); + } + } + + // TODO: read exclude + + return foundFiles; +} + +async function updateOptionsFromProject(options) { + /** + * Read the project information and assign the following. + * - outDirPath + * - transform: imports + * - transform: typescript + * - enableLegacyTypescriptModuleInterop: true/false. + */ + + const tsConfigPath = join(options.project, "tsconfig.json"); + + let str; + try { + str = await readFile(tsConfigPath, "utf8"); + } catch (err) { + console.error("Could not find project tsconfig.json"); + console.error(` --project=${options.project}`); + console.error(err); + process.exit(1); + } + const json = JSON.parse(str); + const sucraseOpts = options.sucraseOptions; + if (!sucraseOpts.transforms.includes("typescript")) { + sucraseOpts.transforms.push("typescript"); + } + + const compilerOpts = json.compilerOptions; + if (compilerOpts.outDir) { + options.outDirPath = join(process.cwd(), options.project, compilerOpts.outDir); + } + if (compilerOpts.esModuleInterop !== true) { + sucraseOpts.enableLegacyTypeScriptModuleInterop = true; + } + if (compilerOpts.module === "commonjs") { + if (!sucraseOpts.transforms.includes("imports")) { + sucraseOpts.transforms.push("imports"); + } + } +} + +async function buildDirectory(options) { + let files; + if (options.outDirPath && options.srcDirPath) { + files = await findFiles(options); + } else if (options.project) { + await updateOptionsFromProject(options); + files = await runGlob(options); + } else { + console.error("Project or Source directory required."); + process.exit(1); + } + + for (const file of files) { + await buildFile(file.srcPath, file.outPath, options); + } +} + +async function buildFile(srcPath, outPath, options) { + if (!options.quiet) { + console.log(`${srcPath} -> ${outPath}`); + } + const code = (await readFile(srcPath)).toString(); + const transformedCode = transform(code, {...options.sucraseOptions, filePath: srcPath}).code; + await writeFile(outPath, transformedCode); +} diff --git a/node_modules/sucrase/dist/esm/computeSourceMap.js b/node_modules/sucrase/dist/esm/computeSourceMap.js new file mode 100644 index 0000000..699ea78 --- /dev/null +++ b/node_modules/sucrase/dist/esm/computeSourceMap.js @@ -0,0 +1,89 @@ +import {GenMapping, maybeAddSegment, toEncodedMap} from "@jridgewell/gen-mapping"; + + + +import {charCodes} from "./parser/util/charcodes"; + + + + + + + + + + + + +/** + * Generate a source map indicating that each line maps directly to the original line, + * with the tokens in their new positions. + */ +export default function computeSourceMap( + {code: generatedCode, mappings: rawMappings}, + filePath, + options, + source, + tokens, +) { + const sourceColumns = computeSourceColumns(source, tokens); + const map = new GenMapping({file: options.compiledFilename}); + let tokenIndex = 0; + // currentMapping is the output source index for the current input token being + // considered. + let currentMapping = rawMappings[0]; + while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) { + tokenIndex++; + currentMapping = rawMappings[tokenIndex]; + } + let line = 0; + let lineStart = 0; + if (currentMapping !== lineStart) { + maybeAddSegment(map, line, 0, filePath, line, 0); + } + for (let i = 0; i < generatedCode.length; i++) { + if (i === currentMapping) { + const genColumn = currentMapping - lineStart; + const sourceColumn = sourceColumns[tokenIndex]; + maybeAddSegment(map, line, genColumn, filePath, line, sourceColumn); + while ( + (currentMapping === i || currentMapping === undefined) && + tokenIndex < rawMappings.length - 1 + ) { + tokenIndex++; + currentMapping = rawMappings[tokenIndex]; + } + } + if (generatedCode.charCodeAt(i) === charCodes.lineFeed) { + line++; + lineStart = i + 1; + if (currentMapping !== lineStart) { + maybeAddSegment(map, line, 0, filePath, line, 0); + } + } + } + const {sourceRoot, sourcesContent, ...sourceMap} = toEncodedMap(map); + return sourceMap ; +} + +/** + * Create an array mapping each token index to the 0-based column of the start + * position of the token. + */ +function computeSourceColumns(code, tokens) { + const sourceColumns = new Array(tokens.length); + let tokenIndex = 0; + let currentMapping = tokens[tokenIndex].start; + let lineStart = 0; + for (let i = 0; i < code.length; i++) { + if (i === currentMapping) { + sourceColumns[tokenIndex] = currentMapping - lineStart; + tokenIndex++; + currentMapping = tokens[tokenIndex].start; + } + if (code.charCodeAt(i) === charCodes.lineFeed) { + lineStart = i + 1; + } + } + return sourceColumns; +} diff --git a/node_modules/sucrase/dist/esm/identifyShadowedGlobals.js b/node_modules/sucrase/dist/esm/identifyShadowedGlobals.js new file mode 100644 index 0000000..f953633 --- /dev/null +++ b/node_modules/sucrase/dist/esm/identifyShadowedGlobals.js @@ -0,0 +1,98 @@ +import { + isBlockScopedDeclaration, + isFunctionScopedDeclaration, + isNonTopLevelDeclaration, +} from "./parser/tokenizer"; + +import {TokenType as tt} from "./parser/tokenizer/types"; + + +/** + * Traverse the given tokens and modify them if necessary to indicate that some names shadow global + * variables. + */ +export default function identifyShadowedGlobals( + tokens, + scopes, + globalNames, +) { + if (!hasShadowedGlobals(tokens, globalNames)) { + return; + } + markShadowedGlobals(tokens, scopes, globalNames); +} + +/** + * We can do a fast up-front check to see if there are any declarations to global names. If not, + * then there's no point in computing scope assignments. + */ +// Exported for testing. +export function hasShadowedGlobals(tokens, globalNames) { + for (const token of tokens.tokens) { + if ( + token.type === tt.name && + !token.isType && + isNonTopLevelDeclaration(token) && + globalNames.has(tokens.identifierNameForToken(token)) + ) { + return true; + } + } + return false; +} + +function markShadowedGlobals( + tokens, + scopes, + globalNames, +) { + const scopeStack = []; + let scopeIndex = scopes.length - 1; + // Scopes were generated at completion time, so they're sorted by end index, so we can maintain a + // good stack by going backwards through them. + for (let i = tokens.tokens.length - 1; ; i--) { + while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i + 1) { + scopeStack.pop(); + } + while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i + 1) { + scopeStack.push(scopes[scopeIndex]); + scopeIndex--; + } + // Process scopes after the last iteration so we can make sure we pop all of them. + if (i < 0) { + break; + } + + const token = tokens.tokens[i]; + const name = tokens.identifierNameForToken(token); + if (scopeStack.length > 1 && !token.isType && token.type === tt.name && globalNames.has(name)) { + if (isBlockScopedDeclaration(token)) { + markShadowedForScope(scopeStack[scopeStack.length - 1], tokens, name); + } else if (isFunctionScopedDeclaration(token)) { + let stackIndex = scopeStack.length - 1; + while (stackIndex > 0 && !scopeStack[stackIndex].isFunctionScope) { + stackIndex--; + } + if (stackIndex < 0) { + throw new Error("Did not find parent function scope."); + } + markShadowedForScope(scopeStack[stackIndex], tokens, name); + } + } + } + if (scopeStack.length > 0) { + throw new Error("Expected empty scope stack after processing file."); + } +} + +function markShadowedForScope(scope, tokens, name) { + for (let i = scope.startTokenIndex; i < scope.endTokenIndex; i++) { + const token = tokens.tokens[i]; + if ( + (token.type === tt.name || token.type === tt.jsxName) && + tokens.identifierNameForToken(token) === name + ) { + token.shadowsGlobal = true; + } + } +} diff --git a/node_modules/sucrase/dist/esm/index.js b/node_modules/sucrase/dist/esm/index.js new file mode 100644 index 0000000..e902716 --- /dev/null +++ b/node_modules/sucrase/dist/esm/index.js @@ -0,0 +1,133 @@ +import CJSImportProcessor from "./CJSImportProcessor"; +import computeSourceMap, {} from "./computeSourceMap"; +import {HelperManager} from "./HelperManager"; +import identifyShadowedGlobals from "./identifyShadowedGlobals"; +import NameManager from "./NameManager"; +import {validateOptions} from "./Options"; + +import {parse} from "./parser"; + +import TokenProcessor from "./TokenProcessor"; +import RootTransformer from "./transformers/RootTransformer"; +import formatTokens from "./util/formatTokens"; +import getTSImportedNames from "./util/getTSImportedNames"; + + + + + + + + + + + + + + +; + +export function getVersion() { + /* istanbul ignore next */ + return "3.34.0"; +} + +export function transform(code, options) { + validateOptions(options); + try { + const sucraseContext = getSucraseContext(code, options); + const transformer = new RootTransformer( + sucraseContext, + options.transforms, + Boolean(options.enableLegacyBabel5ModuleInterop), + options, + ); + const transformerResult = transformer.transform(); + let result = {code: transformerResult.code}; + if (options.sourceMapOptions) { + if (!options.filePath) { + throw new Error("filePath must be specified when generating a source map."); + } + result = { + ...result, + sourceMap: computeSourceMap( + transformerResult, + options.filePath, + options.sourceMapOptions, + code, + sucraseContext.tokenProcessor.tokens, + ), + }; + } + return result; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e) { + if (options.filePath) { + e.message = `Error transforming ${options.filePath}: ${e.message}`; + } + throw e; + } +} + +/** + * Return a string representation of the sucrase tokens, mostly useful for + * diagnostic purposes. + */ +export function getFormattedTokens(code, options) { + const tokens = getSucraseContext(code, options).tokenProcessor.tokens; + return formatTokens(code, tokens); +} + +/** + * Call into the parser/tokenizer and do some further preprocessing: + * - Come up with a set of used names so that we can assign new names. + * - Preprocess all import/export statements so we know which globals we are interested in. + * - Compute situations where any of those globals are shadowed. + * + * In the future, some of these preprocessing steps can be skipped based on what actual work is + * being done. + */ +function getSucraseContext(code, options) { + const isJSXEnabled = options.transforms.includes("jsx"); + const isTypeScriptEnabled = options.transforms.includes("typescript"); + const isFlowEnabled = options.transforms.includes("flow"); + const disableESTransforms = options.disableESTransforms === true; + const file = parse(code, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); + const tokens = file.tokens; + const scopes = file.scopes; + + const nameManager = new NameManager(code, tokens); + const helperManager = new HelperManager(nameManager); + const tokenProcessor = new TokenProcessor( + code, + tokens, + isFlowEnabled, + disableESTransforms, + helperManager, + ); + const enableLegacyTypeScriptModuleInterop = Boolean(options.enableLegacyTypeScriptModuleInterop); + + let importProcessor = null; + if (options.transforms.includes("imports")) { + importProcessor = new CJSImportProcessor( + nameManager, + tokenProcessor, + enableLegacyTypeScriptModuleInterop, + options, + options.transforms.includes("typescript"), + Boolean(options.keepUnusedImports), + helperManager, + ); + importProcessor.preprocessTokens(); + // We need to mark shadowed globals after processing imports so we know that the globals are, + // but before type-only import pruning, since that relies on shadowing information. + identifyShadowedGlobals(tokenProcessor, scopes, importProcessor.getGlobalNames()); + if (options.transforms.includes("typescript") && !options.keepUnusedImports) { + importProcessor.pruneTypeOnlyImports(); + } + } else if (options.transforms.includes("typescript") && !options.keepUnusedImports) { + // Shadowed global detection is needed for TS implicit elision of imported names. + identifyShadowedGlobals(tokenProcessor, scopes, getTSImportedNames(tokenProcessor)); + } + return {tokenProcessor, scopes, nameManager, importProcessor, helperManager}; +} diff --git a/node_modules/sucrase/dist/esm/parser/index.js b/node_modules/sucrase/dist/esm/parser/index.js new file mode 100644 index 0000000..5074ae4 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/index.js @@ -0,0 +1,31 @@ + + +import {augmentError, initParser, state} from "./traverser/base"; +import {parseFile} from "./traverser/index"; + +export class File { + + + + constructor(tokens, scopes) { + this.tokens = tokens; + this.scopes = scopes; + } +} + +export function parse( + input, + isJSXEnabled, + isTypeScriptEnabled, + isFlowEnabled, +) { + if (isFlowEnabled && isTypeScriptEnabled) { + throw new Error("Cannot combine flow and typescript plugins."); + } + initParser(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); + const result = parseFile(); + if (state.error) { + throw augmentError(state.error); + } + return result; +} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/flow.js b/node_modules/sucrase/dist/esm/parser/plugins/flow.js new file mode 100644 index 0000000..66295d1 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/plugins/flow.js @@ -0,0 +1,1105 @@ +/* eslint max-len: 0 */ + +import { + eat, + lookaheadType, + lookaheadTypeAndKeyword, + match, + next, + popTypeContext, + pushTypeContext, + +} from "../tokenizer/index"; +import {ContextualKeyword} from "../tokenizer/keywords"; +import {TokenType, TokenType as tt} from "../tokenizer/types"; +import {input, state} from "../traverser/base"; +import { + baseParseMaybeAssign, + baseParseSubscript, + baseParseSubscripts, + parseArrow, + parseArrowExpression, + parseCallExpressionArguments, + parseExprAtom, + parseExpression, + parseFunctionBody, + parseIdentifier, + parseLiteral, + +} from "../traverser/expression"; +import { + baseParseExportStar, + parseExport, + parseExportFrom, + parseExportSpecifiers, + parseFunctionParams, + parseImport, + parseStatement, +} from "../traverser/statement"; +import { + canInsertSemicolon, + eatContextual, + expect, + expectContextual, + isContextual, + isLookaheadContextual, + semicolon, + unexpected, +} from "../traverser/util"; + +function isMaybeDefaultImport(lookahead) { + return ( + (lookahead.type === tt.name || !!(lookahead.type & TokenType.IS_KEYWORD)) && + lookahead.contextualKeyword !== ContextualKeyword._from + ); +} + +function flowParseTypeInitialiser(tok) { + const oldIsType = pushTypeContext(0); + expect(tok || tt.colon); + flowParseType(); + popTypeContext(oldIsType); +} + +function flowParsePredicate() { + expect(tt.modulo); + expectContextual(ContextualKeyword._checks); + if (eat(tt.parenL)) { + parseExpression(); + expect(tt.parenR); + } +} + +function flowParseTypeAndPredicateInitialiser() { + const oldIsType = pushTypeContext(0); + expect(tt.colon); + if (match(tt.modulo)) { + flowParsePredicate(); + } else { + flowParseType(); + if (match(tt.modulo)) { + flowParsePredicate(); + } + } + popTypeContext(oldIsType); +} + +function flowParseDeclareClass() { + next(); + flowParseInterfaceish(/* isClass */ true); +} + +function flowParseDeclareFunction() { + next(); + parseIdentifier(); + + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + expect(tt.parenL); + flowParseFunctionTypeParams(); + expect(tt.parenR); + + flowParseTypeAndPredicateInitialiser(); + + semicolon(); +} + +function flowParseDeclare() { + if (match(tt._class)) { + flowParseDeclareClass(); + } else if (match(tt._function)) { + flowParseDeclareFunction(); + } else if (match(tt._var)) { + flowParseDeclareVariable(); + } else if (eatContextual(ContextualKeyword._module)) { + if (eat(tt.dot)) { + flowParseDeclareModuleExports(); + } else { + flowParseDeclareModule(); + } + } else if (isContextual(ContextualKeyword._type)) { + flowParseDeclareTypeAlias(); + } else if (isContextual(ContextualKeyword._opaque)) { + flowParseDeclareOpaqueType(); + } else if (isContextual(ContextualKeyword._interface)) { + flowParseDeclareInterface(); + } else if (match(tt._export)) { + flowParseDeclareExportDeclaration(); + } else { + unexpected(); + } +} + +function flowParseDeclareVariable() { + next(); + flowParseTypeAnnotatableIdentifier(); + semicolon(); +} + +function flowParseDeclareModule() { + if (match(tt.string)) { + parseExprAtom(); + } else { + parseIdentifier(); + } + + expect(tt.braceL); + while (!match(tt.braceR) && !state.error) { + if (match(tt._import)) { + next(); + parseImport(); + } else { + unexpected(); + } + } + expect(tt.braceR); +} + +function flowParseDeclareExportDeclaration() { + expect(tt._export); + + if (eat(tt._default)) { + if (match(tt._function) || match(tt._class)) { + // declare export default class ... + // declare export default function ... + flowParseDeclare(); + } else { + // declare export default [type]; + flowParseType(); + semicolon(); + } + } else if ( + match(tt._var) || // declare export var ... + match(tt._function) || // declare export function ... + match(tt._class) || // declare export class ... + isContextual(ContextualKeyword._opaque) // declare export opaque .. + ) { + flowParseDeclare(); + } else if ( + match(tt.star) || // declare export * from '' + match(tt.braceL) || // declare export {} ... + isContextual(ContextualKeyword._interface) || // declare export interface ... + isContextual(ContextualKeyword._type) || // declare export type ... + isContextual(ContextualKeyword._opaque) // declare export opaque type ... + ) { + parseExport(); + } else { + unexpected(); + } +} + +function flowParseDeclareModuleExports() { + expectContextual(ContextualKeyword._exports); + flowParseTypeAnnotation(); + semicolon(); +} + +function flowParseDeclareTypeAlias() { + next(); + flowParseTypeAlias(); +} + +function flowParseDeclareOpaqueType() { + next(); + flowParseOpaqueType(true); +} + +function flowParseDeclareInterface() { + next(); + flowParseInterfaceish(); +} + +// Interfaces + +function flowParseInterfaceish(isClass = false) { + flowParseRestrictedIdentifier(); + + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + if (eat(tt._extends)) { + do { + flowParseInterfaceExtends(); + } while (!isClass && eat(tt.comma)); + } + + if (isContextual(ContextualKeyword._mixins)) { + next(); + do { + flowParseInterfaceExtends(); + } while (eat(tt.comma)); + } + + if (isContextual(ContextualKeyword._implements)) { + next(); + do { + flowParseInterfaceExtends(); + } while (eat(tt.comma)); + } + + flowParseObjectType(isClass, false, isClass); +} + +function flowParseInterfaceExtends() { + flowParseQualifiedTypeIdentifier(false); + if (match(tt.lessThan)) { + flowParseTypeParameterInstantiation(); + } +} + +function flowParseInterface() { + flowParseInterfaceish(); +} + +function flowParseRestrictedIdentifier() { + parseIdentifier(); +} + +function flowParseTypeAlias() { + flowParseRestrictedIdentifier(); + + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + flowParseTypeInitialiser(tt.eq); + semicolon(); +} + +function flowParseOpaqueType(declare) { + expectContextual(ContextualKeyword._type); + flowParseRestrictedIdentifier(); + + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + // Parse the supertype + if (match(tt.colon)) { + flowParseTypeInitialiser(tt.colon); + } + + if (!declare) { + flowParseTypeInitialiser(tt.eq); + } + semicolon(); +} + +function flowParseTypeParameter() { + flowParseVariance(); + flowParseTypeAnnotatableIdentifier(); + + if (eat(tt.eq)) { + flowParseType(); + } +} + +export function flowParseTypeParameterDeclaration() { + const oldIsType = pushTypeContext(0); + // istanbul ignore else: this condition is already checked at all call sites + if (match(tt.lessThan) || match(tt.typeParameterStart)) { + next(); + } else { + unexpected(); + } + + do { + flowParseTypeParameter(); + if (!match(tt.greaterThan)) { + expect(tt.comma); + } + } while (!match(tt.greaterThan) && !state.error); + expect(tt.greaterThan); + popTypeContext(oldIsType); +} + +function flowParseTypeParameterInstantiation() { + const oldIsType = pushTypeContext(0); + expect(tt.lessThan); + while (!match(tt.greaterThan) && !state.error) { + flowParseType(); + if (!match(tt.greaterThan)) { + expect(tt.comma); + } + } + expect(tt.greaterThan); + popTypeContext(oldIsType); +} + +function flowParseInterfaceType() { + expectContextual(ContextualKeyword._interface); + if (eat(tt._extends)) { + do { + flowParseInterfaceExtends(); + } while (eat(tt.comma)); + } + flowParseObjectType(false, false, false); +} + +function flowParseObjectPropertyKey() { + if (match(tt.num) || match(tt.string)) { + parseExprAtom(); + } else { + parseIdentifier(); + } +} + +function flowParseObjectTypeIndexer() { + // Note: bracketL has already been consumed + if (lookaheadType() === tt.colon) { + flowParseObjectPropertyKey(); + flowParseTypeInitialiser(); + } else { + flowParseType(); + } + expect(tt.bracketR); + flowParseTypeInitialiser(); +} + +function flowParseObjectTypeInternalSlot() { + // Note: both bracketL have already been consumed + flowParseObjectPropertyKey(); + expect(tt.bracketR); + expect(tt.bracketR); + if (match(tt.lessThan) || match(tt.parenL)) { + flowParseObjectTypeMethodish(); + } else { + eat(tt.question); + flowParseTypeInitialiser(); + } +} + +function flowParseObjectTypeMethodish() { + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + expect(tt.parenL); + while (!match(tt.parenR) && !match(tt.ellipsis) && !state.error) { + flowParseFunctionTypeParam(); + if (!match(tt.parenR)) { + expect(tt.comma); + } + } + + if (eat(tt.ellipsis)) { + flowParseFunctionTypeParam(); + } + expect(tt.parenR); + flowParseTypeInitialiser(); +} + +function flowParseObjectTypeCallProperty() { + flowParseObjectTypeMethodish(); +} + +function flowParseObjectType(allowStatic, allowExact, allowProto) { + let endDelim; + if (allowExact && match(tt.braceBarL)) { + expect(tt.braceBarL); + endDelim = tt.braceBarR; + } else { + expect(tt.braceL); + endDelim = tt.braceR; + } + + while (!match(endDelim) && !state.error) { + if (allowProto && isContextual(ContextualKeyword._proto)) { + const lookahead = lookaheadType(); + if (lookahead !== tt.colon && lookahead !== tt.question) { + next(); + allowStatic = false; + } + } + if (allowStatic && isContextual(ContextualKeyword._static)) { + const lookahead = lookaheadType(); + if (lookahead !== tt.colon && lookahead !== tt.question) { + next(); + } + } + + flowParseVariance(); + + if (eat(tt.bracketL)) { + if (eat(tt.bracketL)) { + flowParseObjectTypeInternalSlot(); + } else { + flowParseObjectTypeIndexer(); + } + } else if (match(tt.parenL) || match(tt.lessThan)) { + flowParseObjectTypeCallProperty(); + } else { + if (isContextual(ContextualKeyword._get) || isContextual(ContextualKeyword._set)) { + const lookahead = lookaheadType(); + if (lookahead === tt.name || lookahead === tt.string || lookahead === tt.num) { + next(); + } + } + + flowParseObjectTypeProperty(); + } + + flowObjectTypeSemicolon(); + } + + expect(endDelim); +} + +function flowParseObjectTypeProperty() { + if (match(tt.ellipsis)) { + expect(tt.ellipsis); + if (!eat(tt.comma)) { + eat(tt.semi); + } + // Explicit inexact object syntax. + if (match(tt.braceR)) { + return; + } + flowParseType(); + } else { + flowParseObjectPropertyKey(); + if (match(tt.lessThan) || match(tt.parenL)) { + // This is a method property + flowParseObjectTypeMethodish(); + } else { + eat(tt.question); + flowParseTypeInitialiser(); + } + } +} + +function flowObjectTypeSemicolon() { + if (!eat(tt.semi) && !eat(tt.comma) && !match(tt.braceR) && !match(tt.braceBarR)) { + unexpected(); + } +} + +function flowParseQualifiedTypeIdentifier(initialIdAlreadyParsed) { + if (!initialIdAlreadyParsed) { + parseIdentifier(); + } + while (eat(tt.dot)) { + parseIdentifier(); + } +} + +function flowParseGenericType() { + flowParseQualifiedTypeIdentifier(true); + if (match(tt.lessThan)) { + flowParseTypeParameterInstantiation(); + } +} + +function flowParseTypeofType() { + expect(tt._typeof); + flowParsePrimaryType(); +} + +function flowParseTupleType() { + expect(tt.bracketL); + // We allow trailing commas + while (state.pos < input.length && !match(tt.bracketR)) { + flowParseType(); + if (match(tt.bracketR)) { + break; + } + expect(tt.comma); + } + expect(tt.bracketR); +} + +function flowParseFunctionTypeParam() { + const lookahead = lookaheadType(); + if (lookahead === tt.colon || lookahead === tt.question) { + parseIdentifier(); + eat(tt.question); + flowParseTypeInitialiser(); + } else { + flowParseType(); + } +} + +function flowParseFunctionTypeParams() { + while (!match(tt.parenR) && !match(tt.ellipsis) && !state.error) { + flowParseFunctionTypeParam(); + if (!match(tt.parenR)) { + expect(tt.comma); + } + } + if (eat(tt.ellipsis)) { + flowParseFunctionTypeParam(); + } +} + +// The parsing of types roughly parallels the parsing of expressions, and +// primary types are kind of like primary expressions...they're the +// primitives with which other types are constructed. +function flowParsePrimaryType() { + let isGroupedType = false; + const oldNoAnonFunctionType = state.noAnonFunctionType; + + switch (state.type) { + case tt.name: { + if (isContextual(ContextualKeyword._interface)) { + flowParseInterfaceType(); + return; + } + parseIdentifier(); + flowParseGenericType(); + return; + } + + case tt.braceL: + flowParseObjectType(false, false, false); + return; + + case tt.braceBarL: + flowParseObjectType(false, true, false); + return; + + case tt.bracketL: + flowParseTupleType(); + return; + + case tt.lessThan: + flowParseTypeParameterDeclaration(); + expect(tt.parenL); + flowParseFunctionTypeParams(); + expect(tt.parenR); + expect(tt.arrow); + flowParseType(); + return; + + case tt.parenL: + next(); + + // Check to see if this is actually a grouped type + if (!match(tt.parenR) && !match(tt.ellipsis)) { + if (match(tt.name)) { + const token = lookaheadType(); + isGroupedType = token !== tt.question && token !== tt.colon; + } else { + isGroupedType = true; + } + } + + if (isGroupedType) { + state.noAnonFunctionType = false; + flowParseType(); + state.noAnonFunctionType = oldNoAnonFunctionType; + + // A `,` or a `) =>` means this is an anonymous function type + if ( + state.noAnonFunctionType || + !(match(tt.comma) || (match(tt.parenR) && lookaheadType() === tt.arrow)) + ) { + expect(tt.parenR); + return; + } else { + // Eat a comma if there is one + eat(tt.comma); + } + } + + flowParseFunctionTypeParams(); + + expect(tt.parenR); + expect(tt.arrow); + flowParseType(); + return; + + case tt.minus: + next(); + parseLiteral(); + return; + + case tt.string: + case tt.num: + case tt._true: + case tt._false: + case tt._null: + case tt._this: + case tt._void: + case tt.star: + next(); + return; + + default: + if (state.type === tt._typeof) { + flowParseTypeofType(); + return; + } else if (state.type & TokenType.IS_KEYWORD) { + next(); + state.tokens[state.tokens.length - 1].type = tt.name; + return; + } + } + + unexpected(); +} + +function flowParsePostfixType() { + flowParsePrimaryType(); + while (!canInsertSemicolon() && (match(tt.bracketL) || match(tt.questionDot))) { + eat(tt.questionDot); + expect(tt.bracketL); + if (eat(tt.bracketR)) { + // Array type + } else { + // Indexed access type + flowParseType(); + expect(tt.bracketR); + } + } +} + +function flowParsePrefixType() { + if (eat(tt.question)) { + flowParsePrefixType(); + } else { + flowParsePostfixType(); + } +} + +function flowParseAnonFunctionWithoutParens() { + flowParsePrefixType(); + if (!state.noAnonFunctionType && eat(tt.arrow)) { + flowParseType(); + } +} + +function flowParseIntersectionType() { + eat(tt.bitwiseAND); + flowParseAnonFunctionWithoutParens(); + while (eat(tt.bitwiseAND)) { + flowParseAnonFunctionWithoutParens(); + } +} + +function flowParseUnionType() { + eat(tt.bitwiseOR); + flowParseIntersectionType(); + while (eat(tt.bitwiseOR)) { + flowParseIntersectionType(); + } +} + +function flowParseType() { + flowParseUnionType(); +} + +export function flowParseTypeAnnotation() { + flowParseTypeInitialiser(); +} + +function flowParseTypeAnnotatableIdentifier() { + parseIdentifier(); + if (match(tt.colon)) { + flowParseTypeAnnotation(); + } +} + +export function flowParseVariance() { + if (match(tt.plus) || match(tt.minus)) { + next(); + state.tokens[state.tokens.length - 1].isType = true; + } +} + +// ================================== +// Overrides +// ================================== + +export function flowParseFunctionBodyAndFinish(funcContextId) { + // For arrow functions, `parseArrow` handles the return type itself. + if (match(tt.colon)) { + flowParseTypeAndPredicateInitialiser(); + } + + parseFunctionBody(false, funcContextId); +} + +export function flowParseSubscript( + startTokenIndex, + noCalls, + stopState, +) { + if (match(tt.questionDot) && lookaheadType() === tt.lessThan) { + if (noCalls) { + stopState.stop = true; + return; + } + next(); + flowParseTypeParameterInstantiation(); + expect(tt.parenL); + parseCallExpressionArguments(); + return; + } else if (!noCalls && match(tt.lessThan)) { + const snapshot = state.snapshot(); + flowParseTypeParameterInstantiation(); + expect(tt.parenL); + parseCallExpressionArguments(); + if (state.error) { + state.restoreFromSnapshot(snapshot); + } else { + return; + } + } + baseParseSubscript(startTokenIndex, noCalls, stopState); +} + +export function flowStartParseNewArguments() { + if (match(tt.lessThan)) { + const snapshot = state.snapshot(); + flowParseTypeParameterInstantiation(); + if (state.error) { + state.restoreFromSnapshot(snapshot); + } + } +} + +// interfaces +export function flowTryParseStatement() { + if (match(tt.name) && state.contextualKeyword === ContextualKeyword._interface) { + const oldIsType = pushTypeContext(0); + next(); + flowParseInterface(); + popTypeContext(oldIsType); + return true; + } else if (isContextual(ContextualKeyword._enum)) { + flowParseEnumDeclaration(); + return true; + } + return false; +} + +export function flowTryParseExportDefaultExpression() { + if (isContextual(ContextualKeyword._enum)) { + flowParseEnumDeclaration(); + return true; + } + return false; +} + +// declares, interfaces and type aliases +export function flowParseIdentifierStatement(contextualKeyword) { + if (contextualKeyword === ContextualKeyword._declare) { + if ( + match(tt._class) || + match(tt.name) || + match(tt._function) || + match(tt._var) || + match(tt._export) + ) { + const oldIsType = pushTypeContext(1); + flowParseDeclare(); + popTypeContext(oldIsType); + } + } else if (match(tt.name)) { + if (contextualKeyword === ContextualKeyword._interface) { + const oldIsType = pushTypeContext(1); + flowParseInterface(); + popTypeContext(oldIsType); + } else if (contextualKeyword === ContextualKeyword._type) { + const oldIsType = pushTypeContext(1); + flowParseTypeAlias(); + popTypeContext(oldIsType); + } else if (contextualKeyword === ContextualKeyword._opaque) { + const oldIsType = pushTypeContext(1); + flowParseOpaqueType(false); + popTypeContext(oldIsType); + } + } + semicolon(); +} + +// export type +export function flowShouldParseExportDeclaration() { + return ( + isContextual(ContextualKeyword._type) || + isContextual(ContextualKeyword._interface) || + isContextual(ContextualKeyword._opaque) || + isContextual(ContextualKeyword._enum) + ); +} + +export function flowShouldDisallowExportDefaultSpecifier() { + return ( + match(tt.name) && + (state.contextualKeyword === ContextualKeyword._type || + state.contextualKeyword === ContextualKeyword._interface || + state.contextualKeyword === ContextualKeyword._opaque || + state.contextualKeyword === ContextualKeyword._enum) + ); +} + +export function flowParseExportDeclaration() { + if (isContextual(ContextualKeyword._type)) { + const oldIsType = pushTypeContext(1); + next(); + + if (match(tt.braceL)) { + // export type { foo, bar }; + parseExportSpecifiers(); + parseExportFrom(); + } else { + // export type Foo = Bar; + flowParseTypeAlias(); + } + popTypeContext(oldIsType); + } else if (isContextual(ContextualKeyword._opaque)) { + const oldIsType = pushTypeContext(1); + next(); + // export opaque type Foo = Bar; + flowParseOpaqueType(false); + popTypeContext(oldIsType); + } else if (isContextual(ContextualKeyword._interface)) { + const oldIsType = pushTypeContext(1); + next(); + flowParseInterface(); + popTypeContext(oldIsType); + } else { + parseStatement(true); + } +} + +export function flowShouldParseExportStar() { + return match(tt.star) || (isContextual(ContextualKeyword._type) && lookaheadType() === tt.star); +} + +export function flowParseExportStar() { + if (eatContextual(ContextualKeyword._type)) { + const oldIsType = pushTypeContext(2); + baseParseExportStar(); + popTypeContext(oldIsType); + } else { + baseParseExportStar(); + } +} + +// parse a the super class type parameters and implements +export function flowAfterParseClassSuper(hasSuper) { + if (hasSuper && match(tt.lessThan)) { + flowParseTypeParameterInstantiation(); + } + if (isContextual(ContextualKeyword._implements)) { + const oldIsType = pushTypeContext(0); + next(); + state.tokens[state.tokens.length - 1].type = tt._implements; + do { + flowParseRestrictedIdentifier(); + if (match(tt.lessThan)) { + flowParseTypeParameterInstantiation(); + } + } while (eat(tt.comma)); + popTypeContext(oldIsType); + } +} + +// parse type parameters for object method shorthand +export function flowStartParseObjPropValue() { + // method shorthand + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + if (!match(tt.parenL)) unexpected(); + } +} + +export function flowParseAssignableListItemTypes() { + const oldIsType = pushTypeContext(0); + eat(tt.question); + if (match(tt.colon)) { + flowParseTypeAnnotation(); + } + popTypeContext(oldIsType); +} + +// parse typeof and type imports +export function flowStartParseImportSpecifiers() { + if (match(tt._typeof) || isContextual(ContextualKeyword._type)) { + const lh = lookaheadTypeAndKeyword(); + if (isMaybeDefaultImport(lh) || lh.type === tt.braceL || lh.type === tt.star) { + next(); + } + } +} + +// parse import-type/typeof shorthand +export function flowParseImportSpecifier() { + const isTypeKeyword = + state.contextualKeyword === ContextualKeyword._type || state.type === tt._typeof; + if (isTypeKeyword) { + next(); + } else { + parseIdentifier(); + } + + if (isContextual(ContextualKeyword._as) && !isLookaheadContextual(ContextualKeyword._as)) { + parseIdentifier(); + if (isTypeKeyword && !match(tt.name) && !(state.type & TokenType.IS_KEYWORD)) { + // `import {type as ,` or `import {type as }` + } else { + // `import {type as foo` + parseIdentifier(); + } + } else { + if (isTypeKeyword && (match(tt.name) || !!(state.type & TokenType.IS_KEYWORD))) { + // `import {type foo` + parseIdentifier(); + } + if (eatContextual(ContextualKeyword._as)) { + parseIdentifier(); + } + } +} + +// parse function type parameters - function foo() {} +export function flowStartParseFunctionParams() { + // Originally this checked if the method is a getter/setter, but if it was, we'd crash soon + // anyway, so don't try to propagate that information. + if (match(tt.lessThan)) { + const oldIsType = pushTypeContext(0); + flowParseTypeParameterDeclaration(); + popTypeContext(oldIsType); + } +} + +// parse flow type annotations on variable declarator heads - let foo: string = bar +export function flowAfterParseVarHead() { + if (match(tt.colon)) { + flowParseTypeAnnotation(); + } +} + +// parse the return type of an async arrow function - let foo = (async (): number => {}); +export function flowStartParseAsyncArrowFromCallExpression() { + if (match(tt.colon)) { + const oldNoAnonFunctionType = state.noAnonFunctionType; + state.noAnonFunctionType = true; + flowParseTypeAnnotation(); + state.noAnonFunctionType = oldNoAnonFunctionType; + } +} + +// We need to support type parameter declarations for arrow functions. This +// is tricky. There are three situations we need to handle +// +// 1. This is either JSX or an arrow function. We'll try JSX first. If that +// fails, we'll try an arrow function. If that fails, we'll throw the JSX +// error. +// 2. This is an arrow function. We'll parse the type parameter declaration, +// parse the rest, make sure the rest is an arrow function, and go from +// there +// 3. This is neither. Just call the super method +export function flowParseMaybeAssign(noIn, isWithinParens) { + if (match(tt.lessThan)) { + const snapshot = state.snapshot(); + let wasArrow = baseParseMaybeAssign(noIn, isWithinParens); + if (state.error) { + state.restoreFromSnapshot(snapshot); + state.type = tt.typeParameterStart; + } else { + return wasArrow; + } + + const oldIsType = pushTypeContext(0); + flowParseTypeParameterDeclaration(); + popTypeContext(oldIsType); + wasArrow = baseParseMaybeAssign(noIn, isWithinParens); + if (wasArrow) { + return true; + } + unexpected(); + } + + return baseParseMaybeAssign(noIn, isWithinParens); +} + +// handle return types for arrow functions +export function flowParseArrow() { + if (match(tt.colon)) { + const oldIsType = pushTypeContext(0); + const snapshot = state.snapshot(); + + const oldNoAnonFunctionType = state.noAnonFunctionType; + state.noAnonFunctionType = true; + flowParseTypeAndPredicateInitialiser(); + state.noAnonFunctionType = oldNoAnonFunctionType; + + if (canInsertSemicolon()) unexpected(); + if (!match(tt.arrow)) unexpected(); + + if (state.error) { + state.restoreFromSnapshot(snapshot); + } + popTypeContext(oldIsType); + } + return eat(tt.arrow); +} + +export function flowParseSubscripts(startTokenIndex, noCalls = false) { + if ( + state.tokens[state.tokens.length - 1].contextualKeyword === ContextualKeyword._async && + match(tt.lessThan) + ) { + const snapshot = state.snapshot(); + const wasArrow = parseAsyncArrowWithTypeParameters(); + if (wasArrow && !state.error) { + return; + } + state.restoreFromSnapshot(snapshot); + } + + baseParseSubscripts(startTokenIndex, noCalls); +} + +// Returns true if there was an arrow function here. +function parseAsyncArrowWithTypeParameters() { + state.scopeDepth++; + const startTokenIndex = state.tokens.length; + parseFunctionParams(); + if (!parseArrow()) { + return false; + } + parseArrowExpression(startTokenIndex); + return true; +} + +function flowParseEnumDeclaration() { + expectContextual(ContextualKeyword._enum); + state.tokens[state.tokens.length - 1].type = tt._enum; + parseIdentifier(); + flowParseEnumBody(); +} + +function flowParseEnumBody() { + if (eatContextual(ContextualKeyword._of)) { + next(); + } + expect(tt.braceL); + flowParseEnumMembers(); + expect(tt.braceR); +} + +function flowParseEnumMembers() { + while (!match(tt.braceR) && !state.error) { + if (eat(tt.ellipsis)) { + break; + } + flowParseEnumMember(); + if (!match(tt.braceR)) { + expect(tt.comma); + } + } +} + +function flowParseEnumMember() { + parseIdentifier(); + if (eat(tt.eq)) { + // Flow enum values are always just one token (a string, number, or boolean literal). + next(); + } +} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js b/node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js new file mode 100644 index 0000000..83f3983 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js @@ -0,0 +1,367 @@ +import { + eat, + finishToken, + getTokenFromCode, + IdentifierRole, + JSXRole, + match, + next, + skipSpace, + Token, +} from "../../tokenizer/index"; +import {TokenType as tt} from "../../tokenizer/types"; +import {input, isTypeScriptEnabled, state} from "../../traverser/base"; +import {parseExpression, parseMaybeAssign} from "../../traverser/expression"; +import {expect, unexpected} from "../../traverser/util"; +import {charCodes} from "../../util/charcodes"; +import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../../util/identifier"; +import {tsTryParseJSXTypeArgument} from "../typescript"; + +/** + * Read token with JSX contents. + * + * In addition to detecting jsxTagStart and also regular tokens that might be + * part of an expression, this code detects the start and end of text ranges + * within JSX children. In order to properly count the number of children, we + * distinguish jsxText from jsxEmptyText, which is a text range that simplifies + * to the empty string after JSX whitespace trimming. + * + * It turns out that a JSX text range will simplify to the empty string if and + * only if both of these conditions hold: + * - The range consists entirely of whitespace characters (only counting space, + * tab, \r, and \n). + * - The range has at least one newline. + * This can be proven by analyzing any implementation of whitespace trimming, + * e.g. formatJSXTextLiteral in Sucrase or cleanJSXElementLiteralChild in Babel. + */ +function jsxReadToken() { + let sawNewline = false; + let sawNonWhitespace = false; + while (true) { + if (state.pos >= input.length) { + unexpected("Unterminated JSX contents"); + return; + } + + const ch = input.charCodeAt(state.pos); + if (ch === charCodes.lessThan || ch === charCodes.leftCurlyBrace) { + if (state.pos === state.start) { + if (ch === charCodes.lessThan) { + state.pos++; + finishToken(tt.jsxTagStart); + return; + } + getTokenFromCode(ch); + return; + } + if (sawNewline && !sawNonWhitespace) { + finishToken(tt.jsxEmptyText); + } else { + finishToken(tt.jsxText); + } + return; + } + + // This is part of JSX text. + if (ch === charCodes.lineFeed) { + sawNewline = true; + } else if (ch !== charCodes.space && ch !== charCodes.carriageReturn && ch !== charCodes.tab) { + sawNonWhitespace = true; + } + state.pos++; + } +} + +function jsxReadString(quote) { + state.pos++; + for (;;) { + if (state.pos >= input.length) { + unexpected("Unterminated string constant"); + return; + } + + const ch = input.charCodeAt(state.pos); + if (ch === quote) { + state.pos++; + break; + } + state.pos++; + } + finishToken(tt.string); +} + +// Read a JSX identifier (valid tag or attribute name). +// +// Optimized version since JSX identifiers can't contain +// escape characters and so can be read as single slice. +// Also assumes that first character was already checked +// by isIdentifierStart in readToken. + +function jsxReadWord() { + let ch; + do { + if (state.pos > input.length) { + unexpected("Unexpectedly reached the end of input."); + return; + } + ch = input.charCodeAt(++state.pos); + } while (IS_IDENTIFIER_CHAR[ch] || ch === charCodes.dash); + finishToken(tt.jsxName); +} + +// Parse next token as JSX identifier +function jsxParseIdentifier() { + nextJSXTagToken(); +} + +// Parse namespaced identifier. +function jsxParseNamespacedName(identifierRole) { + jsxParseIdentifier(); + if (!eat(tt.colon)) { + // Plain identifier, so this is an access. + state.tokens[state.tokens.length - 1].identifierRole = identifierRole; + return; + } + // Process the second half of the namespaced name. + jsxParseIdentifier(); +} + +// Parses element name in any form - namespaced, member +// or single identifier. +function jsxParseElementName() { + const firstTokenIndex = state.tokens.length; + jsxParseNamespacedName(IdentifierRole.Access); + let hadDot = false; + while (match(tt.dot)) { + hadDot = true; + nextJSXTagToken(); + jsxParseIdentifier(); + } + // For tags like
with a lowercase letter and no dots, the name is + // actually *not* an identifier access, since it's referring to a built-in + // tag name. Remove the identifier role in this case so that it's not + // accidentally transformed by the imports transform when preserving JSX. + if (!hadDot) { + const firstToken = state.tokens[firstTokenIndex]; + const firstChar = input.charCodeAt(firstToken.start); + if (firstChar >= charCodes.lowercaseA && firstChar <= charCodes.lowercaseZ) { + firstToken.identifierRole = null; + } + } +} + +// Parses any type of JSX attribute value. +function jsxParseAttributeValue() { + switch (state.type) { + case tt.braceL: + next(); + parseExpression(); + nextJSXTagToken(); + return; + + case tt.jsxTagStart: + jsxParseElement(); + nextJSXTagToken(); + return; + + case tt.string: + nextJSXTagToken(); + return; + + default: + unexpected("JSX value should be either an expression or a quoted JSX text"); + } +} + +// Parse JSX spread child, after already processing the { +// Does not parse the closing } +function jsxParseSpreadChild() { + expect(tt.ellipsis); + parseExpression(); +} + +// Parses JSX opening tag starting after "<". +// Returns true if the tag was self-closing. +// Does not parse the last token. +function jsxParseOpeningElement(initialTokenIndex) { + if (match(tt.jsxTagEnd)) { + // This is an open-fragment. + return false; + } + jsxParseElementName(); + if (isTypeScriptEnabled) { + tsTryParseJSXTypeArgument(); + } + let hasSeenPropSpread = false; + while (!match(tt.slash) && !match(tt.jsxTagEnd) && !state.error) { + if (eat(tt.braceL)) { + hasSeenPropSpread = true; + expect(tt.ellipsis); + parseMaybeAssign(); + // } + nextJSXTagToken(); + continue; + } + if ( + hasSeenPropSpread && + state.end - state.start === 3 && + input.charCodeAt(state.start) === charCodes.lowercaseK && + input.charCodeAt(state.start + 1) === charCodes.lowercaseE && + input.charCodeAt(state.start + 2) === charCodes.lowercaseY + ) { + state.tokens[initialTokenIndex].jsxRole = JSXRole.KeyAfterPropSpread; + } + jsxParseNamespacedName(IdentifierRole.ObjectKey); + if (match(tt.eq)) { + nextJSXTagToken(); + jsxParseAttributeValue(); + } + } + const isSelfClosing = match(tt.slash); + if (isSelfClosing) { + // / + nextJSXTagToken(); + } + return isSelfClosing; +} + +// Parses JSX closing tag starting after " 1) { + state.tokens[initialTokenIndex].jsxRole = JSXRole.StaticChildren; + } + } + return; + } + numExplicitChildren++; + jsxParseElementAt(); + nextJSXExprToken(); + break; + + case tt.jsxText: + numExplicitChildren++; + nextJSXExprToken(); + break; + + case tt.jsxEmptyText: + nextJSXExprToken(); + break; + + case tt.braceL: + next(); + if (match(tt.ellipsis)) { + jsxParseSpreadChild(); + nextJSXExprToken(); + // Spread children are a mechanism to explicitly mark children as + // static, so count it as 2 children to satisfy the "more than one + // child" condition. + numExplicitChildren += 2; + } else { + // If we see {}, this is an empty pseudo-expression that doesn't + // count as a child. + if (!match(tt.braceR)) { + numExplicitChildren++; + parseExpression(); + } + nextJSXExprToken(); + } + + break; + + // istanbul ignore next - should never happen + default: + unexpected(); + return; + } + } + } +} + +// Parses entire JSX element from current position. +// Does not parse the last token. +export function jsxParseElement() { + nextJSXTagToken(); + jsxParseElementAt(); +} + +// ================================== +// Overrides +// ================================== + +export function nextJSXTagToken() { + state.tokens.push(new Token()); + skipSpace(); + state.start = state.pos; + const code = input.charCodeAt(state.pos); + + if (IS_IDENTIFIER_START[code]) { + jsxReadWord(); + } else if (code === charCodes.quotationMark || code === charCodes.apostrophe) { + jsxReadString(code); + } else { + // The following tokens are just one character each. + ++state.pos; + switch (code) { + case charCodes.greaterThan: + finishToken(tt.jsxTagEnd); + break; + case charCodes.lessThan: + finishToken(tt.jsxTagStart); + break; + case charCodes.slash: + finishToken(tt.slash); + break; + case charCodes.equalsTo: + finishToken(tt.eq); + break; + case charCodes.leftCurlyBrace: + finishToken(tt.braceL); + break; + case charCodes.dot: + finishToken(tt.dot); + break; + case charCodes.colon: + finishToken(tt.colon); + break; + default: + unexpected(); + } + } +} + +function nextJSXExprToken() { + state.tokens.push(new Token()); + state.start = state.pos; + jsxReadToken(); +} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js b/node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js new file mode 100644 index 0000000..c6a0741 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js @@ -0,0 +1,256 @@ +// Use a Map rather than object to avoid unexpected __proto__ access. +export default new Map([ + ["quot", "\u0022"], + ["amp", "&"], + ["apos", "\u0027"], + ["lt", "<"], + ["gt", ">"], + ["nbsp", "\u00A0"], + ["iexcl", "\u00A1"], + ["cent", "\u00A2"], + ["pound", "\u00A3"], + ["curren", "\u00A4"], + ["yen", "\u00A5"], + ["brvbar", "\u00A6"], + ["sect", "\u00A7"], + ["uml", "\u00A8"], + ["copy", "\u00A9"], + ["ordf", "\u00AA"], + ["laquo", "\u00AB"], + ["not", "\u00AC"], + ["shy", "\u00AD"], + ["reg", "\u00AE"], + ["macr", "\u00AF"], + ["deg", "\u00B0"], + ["plusmn", "\u00B1"], + ["sup2", "\u00B2"], + ["sup3", "\u00B3"], + ["acute", "\u00B4"], + ["micro", "\u00B5"], + ["para", "\u00B6"], + ["middot", "\u00B7"], + ["cedil", "\u00B8"], + ["sup1", "\u00B9"], + ["ordm", "\u00BA"], + ["raquo", "\u00BB"], + ["frac14", "\u00BC"], + ["frac12", "\u00BD"], + ["frac34", "\u00BE"], + ["iquest", "\u00BF"], + ["Agrave", "\u00C0"], + ["Aacute", "\u00C1"], + ["Acirc", "\u00C2"], + ["Atilde", "\u00C3"], + ["Auml", "\u00C4"], + ["Aring", "\u00C5"], + ["AElig", "\u00C6"], + ["Ccedil", "\u00C7"], + ["Egrave", "\u00C8"], + ["Eacute", "\u00C9"], + ["Ecirc", "\u00CA"], + ["Euml", "\u00CB"], + ["Igrave", "\u00CC"], + ["Iacute", "\u00CD"], + ["Icirc", "\u00CE"], + ["Iuml", "\u00CF"], + ["ETH", "\u00D0"], + ["Ntilde", "\u00D1"], + ["Ograve", "\u00D2"], + ["Oacute", "\u00D3"], + ["Ocirc", "\u00D4"], + ["Otilde", "\u00D5"], + ["Ouml", "\u00D6"], + ["times", "\u00D7"], + ["Oslash", "\u00D8"], + ["Ugrave", "\u00D9"], + ["Uacute", "\u00DA"], + ["Ucirc", "\u00DB"], + ["Uuml", "\u00DC"], + ["Yacute", "\u00DD"], + ["THORN", "\u00DE"], + ["szlig", "\u00DF"], + ["agrave", "\u00E0"], + ["aacute", "\u00E1"], + ["acirc", "\u00E2"], + ["atilde", "\u00E3"], + ["auml", "\u00E4"], + ["aring", "\u00E5"], + ["aelig", "\u00E6"], + ["ccedil", "\u00E7"], + ["egrave", "\u00E8"], + ["eacute", "\u00E9"], + ["ecirc", "\u00EA"], + ["euml", "\u00EB"], + ["igrave", "\u00EC"], + ["iacute", "\u00ED"], + ["icirc", "\u00EE"], + ["iuml", "\u00EF"], + ["eth", "\u00F0"], + ["ntilde", "\u00F1"], + ["ograve", "\u00F2"], + ["oacute", "\u00F3"], + ["ocirc", "\u00F4"], + ["otilde", "\u00F5"], + ["ouml", "\u00F6"], + ["divide", "\u00F7"], + ["oslash", "\u00F8"], + ["ugrave", "\u00F9"], + ["uacute", "\u00FA"], + ["ucirc", "\u00FB"], + ["uuml", "\u00FC"], + ["yacute", "\u00FD"], + ["thorn", "\u00FE"], + ["yuml", "\u00FF"], + ["OElig", "\u0152"], + ["oelig", "\u0153"], + ["Scaron", "\u0160"], + ["scaron", "\u0161"], + ["Yuml", "\u0178"], + ["fnof", "\u0192"], + ["circ", "\u02C6"], + ["tilde", "\u02DC"], + ["Alpha", "\u0391"], + ["Beta", "\u0392"], + ["Gamma", "\u0393"], + ["Delta", "\u0394"], + ["Epsilon", "\u0395"], + ["Zeta", "\u0396"], + ["Eta", "\u0397"], + ["Theta", "\u0398"], + ["Iota", "\u0399"], + ["Kappa", "\u039A"], + ["Lambda", "\u039B"], + ["Mu", "\u039C"], + ["Nu", "\u039D"], + ["Xi", "\u039E"], + ["Omicron", "\u039F"], + ["Pi", "\u03A0"], + ["Rho", "\u03A1"], + ["Sigma", "\u03A3"], + ["Tau", "\u03A4"], + ["Upsilon", "\u03A5"], + ["Phi", "\u03A6"], + ["Chi", "\u03A7"], + ["Psi", "\u03A8"], + ["Omega", "\u03A9"], + ["alpha", "\u03B1"], + ["beta", "\u03B2"], + ["gamma", "\u03B3"], + ["delta", "\u03B4"], + ["epsilon", "\u03B5"], + ["zeta", "\u03B6"], + ["eta", "\u03B7"], + ["theta", "\u03B8"], + ["iota", "\u03B9"], + ["kappa", "\u03BA"], + ["lambda", "\u03BB"], + ["mu", "\u03BC"], + ["nu", "\u03BD"], + ["xi", "\u03BE"], + ["omicron", "\u03BF"], + ["pi", "\u03C0"], + ["rho", "\u03C1"], + ["sigmaf", "\u03C2"], + ["sigma", "\u03C3"], + ["tau", "\u03C4"], + ["upsilon", "\u03C5"], + ["phi", "\u03C6"], + ["chi", "\u03C7"], + ["psi", "\u03C8"], + ["omega", "\u03C9"], + ["thetasym", "\u03D1"], + ["upsih", "\u03D2"], + ["piv", "\u03D6"], + ["ensp", "\u2002"], + ["emsp", "\u2003"], + ["thinsp", "\u2009"], + ["zwnj", "\u200C"], + ["zwj", "\u200D"], + ["lrm", "\u200E"], + ["rlm", "\u200F"], + ["ndash", "\u2013"], + ["mdash", "\u2014"], + ["lsquo", "\u2018"], + ["rsquo", "\u2019"], + ["sbquo", "\u201A"], + ["ldquo", "\u201C"], + ["rdquo", "\u201D"], + ["bdquo", "\u201E"], + ["dagger", "\u2020"], + ["Dagger", "\u2021"], + ["bull", "\u2022"], + ["hellip", "\u2026"], + ["permil", "\u2030"], + ["prime", "\u2032"], + ["Prime", "\u2033"], + ["lsaquo", "\u2039"], + ["rsaquo", "\u203A"], + ["oline", "\u203E"], + ["frasl", "\u2044"], + ["euro", "\u20AC"], + ["image", "\u2111"], + ["weierp", "\u2118"], + ["real", "\u211C"], + ["trade", "\u2122"], + ["alefsym", "\u2135"], + ["larr", "\u2190"], + ["uarr", "\u2191"], + ["rarr", "\u2192"], + ["darr", "\u2193"], + ["harr", "\u2194"], + ["crarr", "\u21B5"], + ["lArr", "\u21D0"], + ["uArr", "\u21D1"], + ["rArr", "\u21D2"], + ["dArr", "\u21D3"], + ["hArr", "\u21D4"], + ["forall", "\u2200"], + ["part", "\u2202"], + ["exist", "\u2203"], + ["empty", "\u2205"], + ["nabla", "\u2207"], + ["isin", "\u2208"], + ["notin", "\u2209"], + ["ni", "\u220B"], + ["prod", "\u220F"], + ["sum", "\u2211"], + ["minus", "\u2212"], + ["lowast", "\u2217"], + ["radic", "\u221A"], + ["prop", "\u221D"], + ["infin", "\u221E"], + ["ang", "\u2220"], + ["and", "\u2227"], + ["or", "\u2228"], + ["cap", "\u2229"], + ["cup", "\u222A"], + ["int", "\u222B"], + ["there4", "\u2234"], + ["sim", "\u223C"], + ["cong", "\u2245"], + ["asymp", "\u2248"], + ["ne", "\u2260"], + ["equiv", "\u2261"], + ["le", "\u2264"], + ["ge", "\u2265"], + ["sub", "\u2282"], + ["sup", "\u2283"], + ["nsub", "\u2284"], + ["sube", "\u2286"], + ["supe", "\u2287"], + ["oplus", "\u2295"], + ["otimes", "\u2297"], + ["perp", "\u22A5"], + ["sdot", "\u22C5"], + ["lceil", "\u2308"], + ["rceil", "\u2309"], + ["lfloor", "\u230A"], + ["rfloor", "\u230B"], + ["lang", "\u2329"], + ["rang", "\u232A"], + ["loz", "\u25CA"], + ["spades", "\u2660"], + ["clubs", "\u2663"], + ["hearts", "\u2665"], + ["diams", "\u2666"], +]); diff --git a/node_modules/sucrase/dist/esm/parser/plugins/types.js b/node_modules/sucrase/dist/esm/parser/plugins/types.js new file mode 100644 index 0000000..78e4af4 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/plugins/types.js @@ -0,0 +1,37 @@ +import {eatTypeToken, lookaheadType, match} from "../tokenizer/index"; +import {TokenType as tt} from "../tokenizer/types"; +import {isFlowEnabled, isTypeScriptEnabled} from "../traverser/base"; +import {baseParseConditional} from "../traverser/expression"; +import {flowParseTypeAnnotation} from "./flow"; +import {tsParseTypeAnnotation} from "./typescript"; + +/** + * Common parser code for TypeScript and Flow. + */ + +// An apparent conditional expression could actually be an optional parameter in an arrow function. +export function typedParseConditional(noIn) { + // If we see ?:, this can't possibly be a valid conditional. typedParseParenItem will be called + // later to finish off the arrow parameter. We also need to handle bare ? tokens for optional + // parameters without type annotations, i.e. ?, and ?) . + if (match(tt.question)) { + const nextType = lookaheadType(); + if (nextType === tt.colon || nextType === tt.comma || nextType === tt.parenR) { + return; + } + } + baseParseConditional(noIn); +} + +// Note: These "type casts" are *not* valid TS expressions. +// But we parse them here and change them when completing the arrow function. +export function typedParseParenItem() { + eatTypeToken(tt.question); + if (match(tt.colon)) { + if (isTypeScriptEnabled) { + tsParseTypeAnnotation(); + } else if (isFlowEnabled) { + flowParseTypeAnnotation(); + } + } +} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/typescript.js b/node_modules/sucrase/dist/esm/parser/plugins/typescript.js new file mode 100644 index 0000000..f64ca67 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/plugins/typescript.js @@ -0,0 +1,1632 @@ +import { + eat, + finishToken, + IdentifierRole, + lookaheadType, + lookaheadTypeAndKeyword, + match, + next, + nextTemplateToken, + popTypeContext, + pushTypeContext, + rescan_gt, +} from "../tokenizer/index"; +import {ContextualKeyword} from "../tokenizer/keywords"; +import {TokenType, TokenType as tt} from "../tokenizer/types"; +import {isJSXEnabled, state} from "../traverser/base"; +import { + atPossibleAsync, + baseParseMaybeAssign, + baseParseSubscript, + parseCallExpressionArguments, + parseExprAtom, + parseExpression, + parseFunctionBody, + parseIdentifier, + parseLiteral, + parseMaybeAssign, + parseMaybeUnary, + parsePropertyName, + parseTemplate, + +} from "../traverser/expression"; +import {parseBindingIdentifier, parseBindingList, parseImportedIdentifier} from "../traverser/lval"; +import { + baseParseMaybeDecoratorArguments, + parseBlockBody, + parseClass, + parseFunction, + parseFunctionParams, + parseStatement, + parseVarStatement, +} from "../traverser/statement"; +import { + canInsertSemicolon, + eatContextual, + expect, + expectContextual, + hasPrecedingLineBreak, + isContextual, + isLineTerminator, + isLookaheadContextual, + semicolon, + unexpected, +} from "../traverser/util"; +import {nextJSXTagToken} from "./jsx"; + +function tsIsIdentifier() { + // TODO: actually a bit more complex in TypeScript, but shouldn't matter. + // See https://github.com/Microsoft/TypeScript/issues/15008 + return match(tt.name); +} + +function isLiteralPropertyName() { + return ( + match(tt.name) || + Boolean(state.type & TokenType.IS_KEYWORD) || + match(tt.string) || + match(tt.num) || + match(tt.bigint) || + match(tt.decimal) + ); +} + +function tsNextTokenCanFollowModifier() { + // Note: TypeScript's implementation is much more complicated because + // more things are considered modifiers there. + // This implementation only handles modifiers not handled by babylon itself. And "static". + // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method... + const snapshot = state.snapshot(); + + next(); + const canFollowModifier = + (match(tt.bracketL) || + match(tt.braceL) || + match(tt.star) || + match(tt.ellipsis) || + match(tt.hash) || + isLiteralPropertyName()) && + !hasPrecedingLineBreak(); + + if (canFollowModifier) { + return true; + } else { + state.restoreFromSnapshot(snapshot); + return false; + } +} + +export function tsParseModifiers(allowedModifiers) { + while (true) { + const modifier = tsParseModifier(allowedModifiers); + if (modifier === null) { + break; + } + } +} + +/** Parses a modifier matching one the given modifier names. */ +export function tsParseModifier( + allowedModifiers, +) { + if (!match(tt.name)) { + return null; + } + + const modifier = state.contextualKeyword; + if (allowedModifiers.indexOf(modifier) !== -1 && tsNextTokenCanFollowModifier()) { + switch (modifier) { + case ContextualKeyword._readonly: + state.tokens[state.tokens.length - 1].type = tt._readonly; + break; + case ContextualKeyword._abstract: + state.tokens[state.tokens.length - 1].type = tt._abstract; + break; + case ContextualKeyword._static: + state.tokens[state.tokens.length - 1].type = tt._static; + break; + case ContextualKeyword._public: + state.tokens[state.tokens.length - 1].type = tt._public; + break; + case ContextualKeyword._private: + state.tokens[state.tokens.length - 1].type = tt._private; + break; + case ContextualKeyword._protected: + state.tokens[state.tokens.length - 1].type = tt._protected; + break; + case ContextualKeyword._override: + state.tokens[state.tokens.length - 1].type = tt._override; + break; + case ContextualKeyword._declare: + state.tokens[state.tokens.length - 1].type = tt._declare; + break; + default: + break; + } + return modifier; + } + return null; +} + +function tsParseEntityName() { + parseIdentifier(); + while (eat(tt.dot)) { + parseIdentifier(); + } +} + +function tsParseTypeReference() { + tsParseEntityName(); + if (!hasPrecedingLineBreak() && match(tt.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseThisTypePredicate() { + next(); + tsParseTypeAnnotation(); +} + +function tsParseThisTypeNode() { + next(); +} + +function tsParseTypeQuery() { + expect(tt._typeof); + if (match(tt._import)) { + tsParseImportType(); + } else { + tsParseEntityName(); + } + if (!hasPrecedingLineBreak() && match(tt.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseImportType() { + expect(tt._import); + expect(tt.parenL); + expect(tt.string); + expect(tt.parenR); + if (eat(tt.dot)) { + tsParseEntityName(); + } + if (match(tt.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseTypeParameter() { + eat(tt._const); + const hadIn = eat(tt._in); + const hadOut = eatContextual(ContextualKeyword._out); + eat(tt._const); + if ((hadIn || hadOut) && !match(tt.name)) { + // The "in" or "out" keyword must have actually been the type parameter + // name, so set it as the name. + state.tokens[state.tokens.length - 1].type = tt.name; + } else { + parseIdentifier(); + } + + if (eat(tt._extends)) { + tsParseType(); + } + if (eat(tt.eq)) { + tsParseType(); + } +} + +export function tsTryParseTypeParameters() { + if (match(tt.lessThan)) { + tsParseTypeParameters(); + } +} + +function tsParseTypeParameters() { + const oldIsType = pushTypeContext(0); + if (match(tt.lessThan) || match(tt.typeParameterStart)) { + next(); + } else { + unexpected(); + } + + while (!eat(tt.greaterThan) && !state.error) { + tsParseTypeParameter(); + eat(tt.comma); + } + popTypeContext(oldIsType); +} + +// Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, +// but here it's always false, because this is only used for types. +function tsFillSignature(returnToken) { + // Arrow fns *must* have return token (`=>`). Normal functions can omit it. + const returnTokenRequired = returnToken === tt.arrow; + tsTryParseTypeParameters(); + expect(tt.parenL); + // Create a scope even though we're doing type parsing so we don't accidentally + // treat params as top-level bindings. + state.scopeDepth++; + tsParseBindingListForSignature(false /* isBlockScope */); + state.scopeDepth--; + if (returnTokenRequired) { + tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (match(returnToken)) { + tsParseTypeOrTypePredicateAnnotation(returnToken); + } +} + +function tsParseBindingListForSignature(isBlockScope) { + parseBindingList(tt.parenR, isBlockScope); +} + +function tsParseTypeMemberSemicolon() { + if (!eat(tt.comma)) { + semicolon(); + } +} + +function tsParseSignatureMember() { + tsFillSignature(tt.colon); + tsParseTypeMemberSemicolon(); +} + +function tsIsUnambiguouslyIndexSignature() { + const snapshot = state.snapshot(); + next(); // Skip '{' + const isIndexSignature = eat(tt.name) && match(tt.colon); + state.restoreFromSnapshot(snapshot); + return isIndexSignature; +} + +function tsTryParseIndexSignature() { + if (!(match(tt.bracketL) && tsIsUnambiguouslyIndexSignature())) { + return false; + } + + const oldIsType = pushTypeContext(0); + + expect(tt.bracketL); + parseIdentifier(); + tsParseTypeAnnotation(); + expect(tt.bracketR); + + tsTryParseTypeAnnotation(); + tsParseTypeMemberSemicolon(); + + popTypeContext(oldIsType); + return true; +} + +function tsParsePropertyOrMethodSignature(isReadonly) { + eat(tt.question); + + if (!isReadonly && (match(tt.parenL) || match(tt.lessThan))) { + tsFillSignature(tt.colon); + tsParseTypeMemberSemicolon(); + } else { + tsTryParseTypeAnnotation(); + tsParseTypeMemberSemicolon(); + } +} + +function tsParseTypeMember() { + if (match(tt.parenL) || match(tt.lessThan)) { + // call signature + tsParseSignatureMember(); + return; + } + if (match(tt._new)) { + next(); + if (match(tt.parenL) || match(tt.lessThan)) { + // constructor signature + tsParseSignatureMember(); + } else { + tsParsePropertyOrMethodSignature(false); + } + return; + } + const readonly = !!tsParseModifier([ContextualKeyword._readonly]); + + const found = tsTryParseIndexSignature(); + if (found) { + return; + } + if ( + (isContextual(ContextualKeyword._get) || isContextual(ContextualKeyword._set)) && + tsNextTokenCanFollowModifier() + ) { + // This is a getter/setter on a type. The tsNextTokenCanFollowModifier + // function already called next() for us, so continue parsing the name. + } + parsePropertyName(-1 /* Types don't need context IDs. */); + tsParsePropertyOrMethodSignature(readonly); +} + +function tsParseTypeLiteral() { + tsParseObjectTypeMembers(); +} + +function tsParseObjectTypeMembers() { + expect(tt.braceL); + while (!eat(tt.braceR) && !state.error) { + tsParseTypeMember(); + } +} + +function tsLookaheadIsStartOfMappedType() { + const snapshot = state.snapshot(); + const isStartOfMappedType = tsIsStartOfMappedType(); + state.restoreFromSnapshot(snapshot); + return isStartOfMappedType; +} + +function tsIsStartOfMappedType() { + next(); + if (eat(tt.plus) || eat(tt.minus)) { + return isContextual(ContextualKeyword._readonly); + } + if (isContextual(ContextualKeyword._readonly)) { + next(); + } + if (!match(tt.bracketL)) { + return false; + } + next(); + if (!tsIsIdentifier()) { + return false; + } + next(); + return match(tt._in); +} + +function tsParseMappedTypeParameter() { + parseIdentifier(); + expect(tt._in); + tsParseType(); +} + +function tsParseMappedType() { + expect(tt.braceL); + if (match(tt.plus) || match(tt.minus)) { + next(); + expectContextual(ContextualKeyword._readonly); + } else { + eatContextual(ContextualKeyword._readonly); + } + expect(tt.bracketL); + tsParseMappedTypeParameter(); + if (eatContextual(ContextualKeyword._as)) { + tsParseType(); + } + expect(tt.bracketR); + if (match(tt.plus) || match(tt.minus)) { + next(); + expect(tt.question); + } else { + eat(tt.question); + } + tsTryParseType(); + semicolon(); + expect(tt.braceR); +} + +function tsParseTupleType() { + expect(tt.bracketL); + while (!eat(tt.bracketR) && !state.error) { + // Do not validate presence of either none or only labeled elements + tsParseTupleElementType(); + eat(tt.comma); + } +} + +function tsParseTupleElementType() { + // parses `...TsType[]` + if (eat(tt.ellipsis)) { + tsParseType(); + } else { + // parses `TsType?` + tsParseType(); + eat(tt.question); + } + + // The type we parsed above was actually a label + if (eat(tt.colon)) { + // Labeled tuple types must affix the label with `...` or `?`, so no need to handle those here + tsParseType(); + } +} + +function tsParseParenthesizedType() { + expect(tt.parenL); + tsParseType(); + expect(tt.parenR); +} + +function tsParseTemplateLiteralType() { + // Finish `, read quasi + nextTemplateToken(); + // Finish quasi, read ${ + nextTemplateToken(); + while (!match(tt.backQuote) && !state.error) { + expect(tt.dollarBraceL); + tsParseType(); + // Finish }, read quasi + nextTemplateToken(); + // Finish quasi, read either ${ or ` + nextTemplateToken(); + } + next(); +} + +var FunctionType; (function (FunctionType) { + const TSFunctionType = 0; FunctionType[FunctionType["TSFunctionType"] = TSFunctionType] = "TSFunctionType"; + const TSConstructorType = TSFunctionType + 1; FunctionType[FunctionType["TSConstructorType"] = TSConstructorType] = "TSConstructorType"; + const TSAbstractConstructorType = TSConstructorType + 1; FunctionType[FunctionType["TSAbstractConstructorType"] = TSAbstractConstructorType] = "TSAbstractConstructorType"; +})(FunctionType || (FunctionType = {})); + +function tsParseFunctionOrConstructorType(type) { + if (type === FunctionType.TSAbstractConstructorType) { + expectContextual(ContextualKeyword._abstract); + } + if (type === FunctionType.TSConstructorType || type === FunctionType.TSAbstractConstructorType) { + expect(tt._new); + } + const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; + state.inDisallowConditionalTypesContext = false; + tsFillSignature(tt.arrow); + state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; +} + +function tsParseNonArrayType() { + switch (state.type) { + case tt.name: + tsParseTypeReference(); + return; + case tt._void: + case tt._null: + next(); + return; + case tt.string: + case tt.num: + case tt.bigint: + case tt.decimal: + case tt._true: + case tt._false: + parseLiteral(); + return; + case tt.minus: + next(); + parseLiteral(); + return; + case tt._this: { + tsParseThisTypeNode(); + if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) { + tsParseThisTypePredicate(); + } + return; + } + case tt._typeof: + tsParseTypeQuery(); + return; + case tt._import: + tsParseImportType(); + return; + case tt.braceL: + if (tsLookaheadIsStartOfMappedType()) { + tsParseMappedType(); + } else { + tsParseTypeLiteral(); + } + return; + case tt.bracketL: + tsParseTupleType(); + return; + case tt.parenL: + tsParseParenthesizedType(); + return; + case tt.backQuote: + tsParseTemplateLiteralType(); + return; + default: + if (state.type & TokenType.IS_KEYWORD) { + next(); + state.tokens[state.tokens.length - 1].type = tt.name; + return; + } + break; + } + + unexpected(); +} + +function tsParseArrayTypeOrHigher() { + tsParseNonArrayType(); + while (!hasPrecedingLineBreak() && eat(tt.bracketL)) { + if (!eat(tt.bracketR)) { + // If we hit ] immediately, this is an array type, otherwise it's an indexed access type. + tsParseType(); + expect(tt.bracketR); + } + } +} + +function tsParseInferType() { + expectContextual(ContextualKeyword._infer); + parseIdentifier(); + if (match(tt._extends)) { + // Infer type constraints introduce an ambiguity about whether the "extends" + // is a constraint for this infer type or is another conditional type. + const snapshot = state.snapshot(); + expect(tt._extends); + const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; + state.inDisallowConditionalTypesContext = true; + tsParseType(); + state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + if (state.error || (!state.inDisallowConditionalTypesContext && match(tt.question))) { + state.restoreFromSnapshot(snapshot); + } + } +} + +function tsParseTypeOperatorOrHigher() { + if ( + isContextual(ContextualKeyword._keyof) || + isContextual(ContextualKeyword._unique) || + isContextual(ContextualKeyword._readonly) + ) { + next(); + tsParseTypeOperatorOrHigher(); + } else if (isContextual(ContextualKeyword._infer)) { + tsParseInferType(); + } else { + const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; + state.inDisallowConditionalTypesContext = false; + tsParseArrayTypeOrHigher(); + state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } +} + +function tsParseIntersectionTypeOrHigher() { + eat(tt.bitwiseAND); + tsParseTypeOperatorOrHigher(); + if (match(tt.bitwiseAND)) { + while (eat(tt.bitwiseAND)) { + tsParseTypeOperatorOrHigher(); + } + } +} + +function tsParseUnionTypeOrHigher() { + eat(tt.bitwiseOR); + tsParseIntersectionTypeOrHigher(); + if (match(tt.bitwiseOR)) { + while (eat(tt.bitwiseOR)) { + tsParseIntersectionTypeOrHigher(); + } + } +} + +function tsIsStartOfFunctionType() { + if (match(tt.lessThan)) { + return true; + } + return match(tt.parenL) && tsLookaheadIsUnambiguouslyStartOfFunctionType(); +} + +function tsSkipParameterStart() { + if (match(tt.name) || match(tt._this)) { + next(); + return true; + } + // If this is a possible array/object destructure, walk to the matching bracket/brace. + // The next token after will tell us definitively whether this is a function param. + if (match(tt.braceL) || match(tt.bracketL)) { + let depth = 1; + next(); + while (depth > 0 && !state.error) { + if (match(tt.braceL) || match(tt.bracketL)) { + depth++; + } else if (match(tt.braceR) || match(tt.bracketR)) { + depth--; + } + next(); + } + return true; + } + return false; +} + +function tsLookaheadIsUnambiguouslyStartOfFunctionType() { + const snapshot = state.snapshot(); + const isUnambiguouslyStartOfFunctionType = tsIsUnambiguouslyStartOfFunctionType(); + state.restoreFromSnapshot(snapshot); + return isUnambiguouslyStartOfFunctionType; +} + +function tsIsUnambiguouslyStartOfFunctionType() { + next(); + if (match(tt.parenR) || match(tt.ellipsis)) { + // ( ) + // ( ... + return true; + } + if (tsSkipParameterStart()) { + if (match(tt.colon) || match(tt.comma) || match(tt.question) || match(tt.eq)) { + // ( xxx : + // ( xxx , + // ( xxx ? + // ( xxx = + return true; + } + if (match(tt.parenR)) { + next(); + if (match(tt.arrow)) { + // ( xxx ) => + return true; + } + } + } + return false; +} + +function tsParseTypeOrTypePredicateAnnotation(returnToken) { + const oldIsType = pushTypeContext(0); + expect(returnToken); + const finishedReturn = tsParseTypePredicateOrAssertsPrefix(); + if (!finishedReturn) { + tsParseType(); + } + popTypeContext(oldIsType); +} + +function tsTryParseTypeOrTypePredicateAnnotation() { + if (match(tt.colon)) { + tsParseTypeOrTypePredicateAnnotation(tt.colon); + } +} + +export function tsTryParseTypeAnnotation() { + if (match(tt.colon)) { + tsParseTypeAnnotation(); + } +} + +function tsTryParseType() { + if (eat(tt.colon)) { + tsParseType(); + } +} + +/** + * Detect a few special return syntax cases: `x is T`, `asserts x`, `asserts x is T`, + * `asserts this is T`. + * + * Returns true if we parsed the return type, false if there's still a type to be parsed. + */ +function tsParseTypePredicateOrAssertsPrefix() { + const snapshot = state.snapshot(); + if (isContextual(ContextualKeyword._asserts)) { + // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user- + // defined type guard on the `asserts` variable) or just a type called `asserts`. + next(); + if (eatContextual(ContextualKeyword._is)) { + // If we see `asserts is`, then this must be of the form `asserts is T`, since + // `asserts is is T` isn't valid. + tsParseType(); + return true; + } else if (tsIsIdentifier() || match(tt._this)) { + next(); + if (eatContextual(ContextualKeyword._is)) { + // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`. + tsParseType(); + } + return true; + } else { + // Regular type, so bail out and start type parsing from scratch. + state.restoreFromSnapshot(snapshot); + return false; + } + } else if (tsIsIdentifier() || match(tt._this)) { + // This is a regular identifier, which may or may not have "is" after it. + next(); + if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) { + next(); + tsParseType(); + return true; + } else { + // Regular type, so bail out and start type parsing from scratch. + state.restoreFromSnapshot(snapshot); + return false; + } + } + return false; +} + +export function tsParseTypeAnnotation() { + const oldIsType = pushTypeContext(0); + expect(tt.colon); + tsParseType(); + popTypeContext(oldIsType); +} + +export function tsParseType() { + tsParseNonConditionalType(); + if (state.inDisallowConditionalTypesContext || hasPrecedingLineBreak() || !eat(tt._extends)) { + return; + } + // extends type + const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; + state.inDisallowConditionalTypesContext = true; + tsParseNonConditionalType(); + state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + + expect(tt.question); + // true type + tsParseType(); + expect(tt.colon); + // false type + tsParseType(); +} + +function isAbstractConstructorSignature() { + return isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._new; +} + +export function tsParseNonConditionalType() { + if (tsIsStartOfFunctionType()) { + tsParseFunctionOrConstructorType(FunctionType.TSFunctionType); + return; + } + if (match(tt._new)) { + // As in `new () => Date` + tsParseFunctionOrConstructorType(FunctionType.TSConstructorType); + return; + } else if (isAbstractConstructorSignature()) { + // As in `abstract new () => Date` + tsParseFunctionOrConstructorType(FunctionType.TSAbstractConstructorType); + return; + } + tsParseUnionTypeOrHigher(); +} + +export function tsParseTypeAssertion() { + const oldIsType = pushTypeContext(1); + tsParseType(); + expect(tt.greaterThan); + popTypeContext(oldIsType); + parseMaybeUnary(); +} + +export function tsTryParseJSXTypeArgument() { + if (eat(tt.jsxTagStart)) { + state.tokens[state.tokens.length - 1].type = tt.typeParameterStart; + const oldIsType = pushTypeContext(1); + while (!match(tt.greaterThan) && !state.error) { + tsParseType(); + eat(tt.comma); + } + // Process >, but the one after needs to be parsed JSX-style. + nextJSXTagToken(); + popTypeContext(oldIsType); + } +} + +function tsParseHeritageClause() { + while (!match(tt.braceL) && !state.error) { + tsParseExpressionWithTypeArguments(); + eat(tt.comma); + } +} + +function tsParseExpressionWithTypeArguments() { + // Note: TS uses parseLeftHandSideExpressionOrHigher, + // then has grammar errors later if it's not an EntityName. + tsParseEntityName(); + if (match(tt.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseInterfaceDeclaration() { + parseBindingIdentifier(false); + tsTryParseTypeParameters(); + if (eat(tt._extends)) { + tsParseHeritageClause(); + } + tsParseObjectTypeMembers(); +} + +function tsParseTypeAliasDeclaration() { + parseBindingIdentifier(false); + tsTryParseTypeParameters(); + expect(tt.eq); + tsParseType(); + semicolon(); +} + +function tsParseEnumMember() { + // Computed property names are grammar errors in an enum, so accept just string literal or identifier. + if (match(tt.string)) { + parseLiteral(); + } else { + parseIdentifier(); + } + if (eat(tt.eq)) { + const eqIndex = state.tokens.length - 1; + parseMaybeAssign(); + state.tokens[eqIndex].rhsEndIndex = state.tokens.length; + } +} + +function tsParseEnumDeclaration() { + parseBindingIdentifier(false); + expect(tt.braceL); + while (!eat(tt.braceR) && !state.error) { + tsParseEnumMember(); + eat(tt.comma); + } +} + +function tsParseModuleBlock() { + expect(tt.braceL); + parseBlockBody(/* end */ tt.braceR); +} + +function tsParseModuleOrNamespaceDeclaration() { + parseBindingIdentifier(false); + if (eat(tt.dot)) { + tsParseModuleOrNamespaceDeclaration(); + } else { + tsParseModuleBlock(); + } +} + +function tsParseAmbientExternalModuleDeclaration() { + if (isContextual(ContextualKeyword._global)) { + parseIdentifier(); + } else if (match(tt.string)) { + parseExprAtom(); + } else { + unexpected(); + } + + if (match(tt.braceL)) { + tsParseModuleBlock(); + } else { + semicolon(); + } +} + +export function tsParseImportEqualsDeclaration() { + parseImportedIdentifier(); + expect(tt.eq); + tsParseModuleReference(); + semicolon(); +} + +function tsIsExternalModuleReference() { + return isContextual(ContextualKeyword._require) && lookaheadType() === tt.parenL; +} + +function tsParseModuleReference() { + if (tsIsExternalModuleReference()) { + tsParseExternalModuleReference(); + } else { + tsParseEntityName(); + } +} + +function tsParseExternalModuleReference() { + expectContextual(ContextualKeyword._require); + expect(tt.parenL); + if (!match(tt.string)) { + unexpected(); + } + parseLiteral(); + expect(tt.parenR); +} + +// Utilities + +// Returns true if a statement matched. +function tsTryParseDeclare() { + if (isLineTerminator()) { + return false; + } + switch (state.type) { + case tt._function: { + const oldIsType = pushTypeContext(1); + next(); + // We don't need to precisely get the function start here, since it's only used to mark + // the function as a type if it's bodiless, and it's already a type here. + const functionStart = state.start; + parseFunction(functionStart, /* isStatement */ true); + popTypeContext(oldIsType); + return true; + } + case tt._class: { + const oldIsType = pushTypeContext(1); + parseClass(/* isStatement */ true, /* optionalId */ false); + popTypeContext(oldIsType); + return true; + } + case tt._const: { + if (match(tt._const) && isLookaheadContextual(ContextualKeyword._enum)) { + const oldIsType = pushTypeContext(1); + // `const enum = 0;` not allowed because "enum" is a strict mode reserved word. + expect(tt._const); + expectContextual(ContextualKeyword._enum); + state.tokens[state.tokens.length - 1].type = tt._enum; + tsParseEnumDeclaration(); + popTypeContext(oldIsType); + return true; + } + } + // falls through + case tt._var: + case tt._let: { + const oldIsType = pushTypeContext(1); + parseVarStatement(state.type !== tt._var); + popTypeContext(oldIsType); + return true; + } + case tt.name: { + const oldIsType = pushTypeContext(1); + const contextualKeyword = state.contextualKeyword; + let matched = false; + if (contextualKeyword === ContextualKeyword._global) { + tsParseAmbientExternalModuleDeclaration(); + matched = true; + } else { + matched = tsParseDeclaration(contextualKeyword, /* isBeforeToken */ true); + } + popTypeContext(oldIsType); + return matched; + } + default: + return false; + } +} + +// Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`. +// Returns true if it matched a declaration. +function tsTryParseExportDeclaration() { + return tsParseDeclaration(state.contextualKeyword, /* isBeforeToken */ true); +} + +// Returns true if it matched a statement. +function tsParseExpressionStatement(contextualKeyword) { + switch (contextualKeyword) { + case ContextualKeyword._declare: { + const declareTokenIndex = state.tokens.length - 1; + const matched = tsTryParseDeclare(); + if (matched) { + state.tokens[declareTokenIndex].type = tt._declare; + return true; + } + break; + } + case ContextualKeyword._global: + // `global { }` (with no `declare`) may appear inside an ambient module declaration. + // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past "global". + if (match(tt.braceL)) { + tsParseModuleBlock(); + return true; + } + break; + + default: + return tsParseDeclaration(contextualKeyword, /* isBeforeToken */ false); + } + return false; +} + +/** + * Common code for parsing a declaration. + * + * isBeforeToken indicates that the current parser state is at the contextual + * keyword (and that it is not yet emitted) rather than reading the token after + * it. When isBeforeToken is true, we may be preceded by an `export` token and + * should include that token in a type context we create, e.g. to handle + * `export interface` or `export type`. (This is a bit of a hack and should be + * cleaned up at some point.) + * + * Returns true if it matched a declaration. + */ +function tsParseDeclaration(contextualKeyword, isBeforeToken) { + switch (contextualKeyword) { + case ContextualKeyword._abstract: + if (tsCheckLineTerminator(isBeforeToken) && match(tt._class)) { + state.tokens[state.tokens.length - 1].type = tt._abstract; + parseClass(/* isStatement */ true, /* optionalId */ false); + return true; + } + break; + + case ContextualKeyword._enum: + if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { + state.tokens[state.tokens.length - 1].type = tt._enum; + tsParseEnumDeclaration(); + return true; + } + break; + + case ContextualKeyword._interface: + if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { + // `next` is true in "export" and "declare" contexts, so we want to remove that token + // as well. + const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); + tsParseInterfaceDeclaration(); + popTypeContext(oldIsType); + return true; + } + break; + + case ContextualKeyword._module: + if (tsCheckLineTerminator(isBeforeToken)) { + if (match(tt.string)) { + const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); + tsParseAmbientExternalModuleDeclaration(); + popTypeContext(oldIsType); + return true; + } else if (match(tt.name)) { + const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); + tsParseModuleOrNamespaceDeclaration(); + popTypeContext(oldIsType); + return true; + } + } + break; + + case ContextualKeyword._namespace: + if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { + const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); + tsParseModuleOrNamespaceDeclaration(); + popTypeContext(oldIsType); + return true; + } + break; + + case ContextualKeyword._type: + if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { + const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); + tsParseTypeAliasDeclaration(); + popTypeContext(oldIsType); + return true; + } + break; + + default: + break; + } + return false; +} + +function tsCheckLineTerminator(isBeforeToken) { + if (isBeforeToken) { + // Babel checks hasFollowingLineBreak here and returns false, but this + // doesn't actually come up, e.g. `export interface` can never be on its own + // line in valid code. + next(); + return true; + } else { + return !isLineTerminator(); + } +} + +// Returns true if there was a generic async arrow function. +function tsTryParseGenericAsyncArrowFunction() { + const snapshot = state.snapshot(); + + tsParseTypeParameters(); + parseFunctionParams(); + tsTryParseTypeOrTypePredicateAnnotation(); + expect(tt.arrow); + + if (state.error) { + state.restoreFromSnapshot(snapshot); + return false; + } + + parseFunctionBody(true); + return true; +} + +/** + * If necessary, hack the tokenizer state so that this bitshift was actually a + * less-than token, then keep parsing. This should only be used in situations + * where we restore from snapshot on error (which reverts this change) or + * where bitshift would be illegal anyway (e.g. in a class "extends" clause). + * + * This hack is useful to handle situations like foo<() => void>() where + * there can legitimately be two open-angle-brackets in a row in TS. + */ +function tsParseTypeArgumentsWithPossibleBitshift() { + if (state.type === tt.bitShiftL) { + state.pos -= 1; + finishToken(tt.lessThan); + } + tsParseTypeArguments(); +} + +function tsParseTypeArguments() { + const oldIsType = pushTypeContext(0); + expect(tt.lessThan); + while (!match(tt.greaterThan) && !state.error) { + tsParseType(); + eat(tt.comma); + } + if (!oldIsType) { + // If the type arguments are present in an expression context, e.g. + // f(), then the > sign should be tokenized as a non-type token. + // In particular, f(a < b, c >= d) should parse the >= as a single token, + // resulting in a syntax error and fallback to the non-type-args + // interpretation. In the success case, even though the > is tokenized as a + // non-type token, it still must be marked as a type token so that it is + // erased. + popTypeContext(oldIsType); + rescan_gt(); + expect(tt.greaterThan); + state.tokens[state.tokens.length - 1].isType = true; + } else { + expect(tt.greaterThan); + popTypeContext(oldIsType); + } +} + +export function tsIsDeclarationStart() { + if (match(tt.name)) { + switch (state.contextualKeyword) { + case ContextualKeyword._abstract: + case ContextualKeyword._declare: + case ContextualKeyword._enum: + case ContextualKeyword._interface: + case ContextualKeyword._module: + case ContextualKeyword._namespace: + case ContextualKeyword._type: + return true; + default: + break; + } + } + + return false; +} + +// ====================================================== +// OVERRIDES +// ====================================================== + +export function tsParseFunctionBodyAndFinish(functionStart, funcContextId) { + // For arrow functions, `parseArrow` handles the return type itself. + if (match(tt.colon)) { + tsParseTypeOrTypePredicateAnnotation(tt.colon); + } + + // The original code checked the node type to make sure this function type allows a missing + // body, but we skip that to avoid sending around the node type. We instead just use the + // allowExpressionBody boolean to make sure it's not an arrow function. + if (!match(tt.braceL) && isLineTerminator()) { + // Retroactively mark the function declaration as a type. + let i = state.tokens.length - 1; + while ( + i >= 0 && + (state.tokens[i].start >= functionStart || + state.tokens[i].type === tt._default || + state.tokens[i].type === tt._export) + ) { + state.tokens[i].isType = true; + i--; + } + return; + } + + parseFunctionBody(false, funcContextId); +} + +export function tsParseSubscript( + startTokenIndex, + noCalls, + stopState, +) { + if (!hasPrecedingLineBreak() && eat(tt.bang)) { + state.tokens[state.tokens.length - 1].type = tt.nonNullAssertion; + return; + } + + if (match(tt.lessThan) || match(tt.bitShiftL)) { + // There are number of things we are going to "maybe" parse, like type arguments on + // tagged template expressions. If any of them fail, walk it back and continue. + const snapshot = state.snapshot(); + + if (!noCalls && atPossibleAsync()) { + // Almost certainly this is a generic async function `async () => ... + // But it might be a call with a type argument `async();` + const asyncArrowFn = tsTryParseGenericAsyncArrowFunction(); + if (asyncArrowFn) { + return; + } + } + tsParseTypeArgumentsWithPossibleBitshift(); + if (!noCalls && eat(tt.parenL)) { + // With f(), the subscriptStartIndex marker is on the ( token. + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + parseCallExpressionArguments(); + } else if (match(tt.backQuote)) { + // Tagged template with a type argument. + parseTemplate(); + } else if ( + // The remaining possible case is an instantiation expression, e.g. + // Array . Check for a few cases that would disqualify it and + // cause us to bail out. + // a>c is not (a)>c, but a<(b>>c) + state.type === tt.greaterThan || + // ac is (ac + (state.type !== tt.parenL && + Boolean(state.type & TokenType.IS_EXPRESSION_START) && + !hasPrecedingLineBreak()) + ) { + // Bail out. We have something like ac, which is not an expression with + // type arguments but an (a < b) > c comparison. + unexpected(); + } + + if (state.error) { + state.restoreFromSnapshot(snapshot); + } else { + return; + } + } else if (!noCalls && match(tt.questionDot) && lookaheadType() === tt.lessThan) { + // If we see f?.<, then this must be an optional call with a type argument. + next(); + state.tokens[startTokenIndex].isOptionalChainStart = true; + // With f?.(), the subscriptStartIndex marker is on the ?. token. + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + + tsParseTypeArguments(); + expect(tt.parenL); + parseCallExpressionArguments(); + } + baseParseSubscript(startTokenIndex, noCalls, stopState); +} + +export function tsTryParseExport() { + if (eat(tt._import)) { + // One of these cases: + // export import A = B; + // export import type A = require("A"); + if (isContextual(ContextualKeyword._type) && lookaheadType() !== tt.eq) { + // Eat a `type` token, unless it's actually an identifier name. + expectContextual(ContextualKeyword._type); + } + tsParseImportEqualsDeclaration(); + return true; + } else if (eat(tt.eq)) { + // `export = x;` + parseExpression(); + semicolon(); + return true; + } else if (eatContextual(ContextualKeyword._as)) { + // `export as namespace A;` + // See `parseNamespaceExportDeclaration` in TypeScript's own parser + expectContextual(ContextualKeyword._namespace); + parseIdentifier(); + semicolon(); + return true; + } else { + if (isContextual(ContextualKeyword._type)) { + const nextType = lookaheadType(); + // export type {foo} from 'a'; + // export type * from 'a';' + // export type * as ns from 'a';' + if (nextType === tt.braceL || nextType === tt.star) { + next(); + } + } + return false; + } +} + +/** + * Parse a TS import specifier, which may be prefixed with "type" and may be of + * the form `foo as bar`. + * + * The number of identifier-like tokens we see happens to be enough to uniquely + * identify the form, so simply count the number of identifiers rather than + * matching the words `type` or `as`. This is particularly important because + * `type` and `as` could each actually be plain identifiers rather than + * keywords. + */ +export function tsParseImportSpecifier() { + parseIdentifier(); + if (match(tt.comma) || match(tt.braceR)) { + // import {foo} + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; + return; + } + parseIdentifier(); + if (match(tt.comma) || match(tt.braceR)) { + // import {type foo} + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; + state.tokens[state.tokens.length - 2].isType = true; + state.tokens[state.tokens.length - 1].isType = true; + return; + } + parseIdentifier(); + if (match(tt.comma) || match(tt.braceR)) { + // import {foo as bar} + state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess; + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; + return; + } + parseIdentifier(); + // import {type foo as bar} + state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess; + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; + state.tokens[state.tokens.length - 4].isType = true; + state.tokens[state.tokens.length - 3].isType = true; + state.tokens[state.tokens.length - 2].isType = true; + state.tokens[state.tokens.length - 1].isType = true; +} + +/** + * Just like named import specifiers, export specifiers can have from 1 to 4 + * tokens, inclusive, and the number of tokens determines the role of each token. + */ +export function tsParseExportSpecifier() { + parseIdentifier(); + if (match(tt.comma) || match(tt.braceR)) { + // export {foo} + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess; + return; + } + parseIdentifier(); + if (match(tt.comma) || match(tt.braceR)) { + // export {type foo} + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess; + state.tokens[state.tokens.length - 2].isType = true; + state.tokens[state.tokens.length - 1].isType = true; + return; + } + parseIdentifier(); + if (match(tt.comma) || match(tt.braceR)) { + // export {foo as bar} + state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess; + return; + } + parseIdentifier(); + // export {type foo as bar} + state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess; + state.tokens[state.tokens.length - 4].isType = true; + state.tokens[state.tokens.length - 3].isType = true; + state.tokens[state.tokens.length - 2].isType = true; + state.tokens[state.tokens.length - 1].isType = true; +} + +export function tsTryParseExportDefaultExpression() { + if (isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._class) { + state.type = tt._abstract; + next(); // Skip "abstract" + parseClass(true, true); + return true; + } + if (isContextual(ContextualKeyword._interface)) { + // Make sure "export default" are considered type tokens so the whole thing is removed. + const oldIsType = pushTypeContext(2); + tsParseDeclaration(ContextualKeyword._interface, true); + popTypeContext(oldIsType); + return true; + } + return false; +} + +export function tsTryParseStatementContent() { + if (state.type === tt._const) { + const ahead = lookaheadTypeAndKeyword(); + if (ahead.type === tt.name && ahead.contextualKeyword === ContextualKeyword._enum) { + expect(tt._const); + expectContextual(ContextualKeyword._enum); + state.tokens[state.tokens.length - 1].type = tt._enum; + tsParseEnumDeclaration(); + return true; + } + } + return false; +} + +export function tsTryParseClassMemberWithIsStatic(isStatic) { + const memberStartIndexAfterStatic = state.tokens.length; + tsParseModifiers([ + ContextualKeyword._abstract, + ContextualKeyword._readonly, + ContextualKeyword._declare, + ContextualKeyword._static, + ContextualKeyword._override, + ]); + + const modifiersEndIndex = state.tokens.length; + const found = tsTryParseIndexSignature(); + if (found) { + // Index signatures are type declarations, so set the modifier tokens as + // type tokens. Most tokens could be assumed to be type tokens, but `static` + // is ambiguous unless we set it explicitly here. + const memberStartIndex = isStatic + ? memberStartIndexAfterStatic - 1 + : memberStartIndexAfterStatic; + for (let i = memberStartIndex; i < modifiersEndIndex; i++) { + state.tokens[i].isType = true; + } + return true; + } + return false; +} + +// Note: The reason we do this in `parseIdentifierStatement` and not `parseStatement` +// is that e.g. `type()` is valid JS, so we must try parsing that first. +// If it's really a type, we will parse `type` as the statement, and can correct it here +// by parsing the rest. +export function tsParseIdentifierStatement(contextualKeyword) { + const matched = tsParseExpressionStatement(contextualKeyword); + if (!matched) { + semicolon(); + } +} + +export function tsParseExportDeclaration() { + // "export declare" is equivalent to just "export". + const isDeclare = eatContextual(ContextualKeyword._declare); + if (isDeclare) { + state.tokens[state.tokens.length - 1].type = tt._declare; + } + + let matchedDeclaration = false; + if (match(tt.name)) { + if (isDeclare) { + const oldIsType = pushTypeContext(2); + matchedDeclaration = tsTryParseExportDeclaration(); + popTypeContext(oldIsType); + } else { + matchedDeclaration = tsTryParseExportDeclaration(); + } + } + if (!matchedDeclaration) { + if (isDeclare) { + const oldIsType = pushTypeContext(2); + parseStatement(true); + popTypeContext(oldIsType); + } else { + parseStatement(true); + } + } +} + +export function tsAfterParseClassSuper(hasSuper) { + if (hasSuper && (match(tt.lessThan) || match(tt.bitShiftL))) { + tsParseTypeArgumentsWithPossibleBitshift(); + } + if (eatContextual(ContextualKeyword._implements)) { + state.tokens[state.tokens.length - 1].type = tt._implements; + const oldIsType = pushTypeContext(1); + tsParseHeritageClause(); + popTypeContext(oldIsType); + } +} + +export function tsStartParseObjPropValue() { + tsTryParseTypeParameters(); +} + +export function tsStartParseFunctionParams() { + tsTryParseTypeParameters(); +} + +// `let x: number;` +export function tsAfterParseVarHead() { + const oldIsType = pushTypeContext(0); + if (!hasPrecedingLineBreak()) { + eat(tt.bang); + } + tsTryParseTypeAnnotation(); + popTypeContext(oldIsType); +} + +// parse the return type of an async arrow function - let foo = (async (): number => {}); +export function tsStartParseAsyncArrowFromCallExpression() { + if (match(tt.colon)) { + tsParseTypeAnnotation(); + } +} + +// Returns true if the expression was an arrow function. +export function tsParseMaybeAssign(noIn, isWithinParens) { + // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax. + if (isJSXEnabled) { + return tsParseMaybeAssignWithJSX(noIn, isWithinParens); + } else { + return tsParseMaybeAssignWithoutJSX(noIn, isWithinParens); + } +} + +export function tsParseMaybeAssignWithJSX(noIn, isWithinParens) { + if (!match(tt.lessThan)) { + return baseParseMaybeAssign(noIn, isWithinParens); + } + + // Prefer to parse JSX if possible. But may be an arrow fn. + const snapshot = state.snapshot(); + let wasArrow = baseParseMaybeAssign(noIn, isWithinParens); + if (state.error) { + state.restoreFromSnapshot(snapshot); + } else { + return wasArrow; + } + + // Otherwise, try as type-parameterized arrow function. + state.type = tt.typeParameterStart; + // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. + tsParseTypeParameters(); + wasArrow = baseParseMaybeAssign(noIn, isWithinParens); + if (!wasArrow) { + unexpected(); + } + + return wasArrow; +} + +export function tsParseMaybeAssignWithoutJSX(noIn, isWithinParens) { + if (!match(tt.lessThan)) { + return baseParseMaybeAssign(noIn, isWithinParens); + } + + const snapshot = state.snapshot(); + // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. + tsParseTypeParameters(); + const wasArrow = baseParseMaybeAssign(noIn, isWithinParens); + if (!wasArrow) { + unexpected(); + } + if (state.error) { + state.restoreFromSnapshot(snapshot); + } else { + return wasArrow; + } + + // Try parsing a type cast instead of an arrow function. + // This will start with a type assertion (via parseMaybeUnary). + // But don't directly call `tsParseTypeAssertion` because we want to handle any binary after it. + return baseParseMaybeAssign(noIn, isWithinParens); +} + +export function tsParseArrow() { + if (match(tt.colon)) { + // This is different from how the TS parser does it. + // TS uses lookahead. Babylon parses it as a parenthesized expression and converts. + const snapshot = state.snapshot(); + + tsParseTypeOrTypePredicateAnnotation(tt.colon); + if (canInsertSemicolon()) unexpected(); + if (!match(tt.arrow)) unexpected(); + + if (state.error) { + state.restoreFromSnapshot(snapshot); + } + } + return eat(tt.arrow); +} + +// Allow type annotations inside of a parameter list. +export function tsParseAssignableListItemTypes() { + const oldIsType = pushTypeContext(0); + eat(tt.question); + tsTryParseTypeAnnotation(); + popTypeContext(oldIsType); +} + +export function tsParseMaybeDecoratorArguments() { + if (match(tt.lessThan) || match(tt.bitShiftL)) { + tsParseTypeArgumentsWithPossibleBitshift(); + } + baseParseMaybeDecoratorArguments(); +} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/index.js b/node_modules/sucrase/dist/esm/parser/tokenizer/index.js new file mode 100644 index 0000000..69f286a --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/tokenizer/index.js @@ -0,0 +1,1004 @@ +/* eslint max-len: 0 */ + +import {input, isFlowEnabled, state} from "../traverser/base"; +import {unexpected} from "../traverser/util"; +import {charCodes} from "../util/charcodes"; +import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../util/identifier"; +import {IS_WHITESPACE, skipWhiteSpace} from "../util/whitespace"; +import {ContextualKeyword} from "./keywords"; +import readWord from "./readWord"; +import { TokenType as tt} from "./types"; + +export var IdentifierRole; (function (IdentifierRole) { + const Access = 0; IdentifierRole[IdentifierRole["Access"] = Access] = "Access"; + const ExportAccess = Access + 1; IdentifierRole[IdentifierRole["ExportAccess"] = ExportAccess] = "ExportAccess"; + const TopLevelDeclaration = ExportAccess + 1; IdentifierRole[IdentifierRole["TopLevelDeclaration"] = TopLevelDeclaration] = "TopLevelDeclaration"; + const FunctionScopedDeclaration = TopLevelDeclaration + 1; IdentifierRole[IdentifierRole["FunctionScopedDeclaration"] = FunctionScopedDeclaration] = "FunctionScopedDeclaration"; + const BlockScopedDeclaration = FunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["BlockScopedDeclaration"] = BlockScopedDeclaration] = "BlockScopedDeclaration"; + const ObjectShorthandTopLevelDeclaration = BlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandTopLevelDeclaration"] = ObjectShorthandTopLevelDeclaration] = "ObjectShorthandTopLevelDeclaration"; + const ObjectShorthandFunctionScopedDeclaration = ObjectShorthandTopLevelDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandFunctionScopedDeclaration"] = ObjectShorthandFunctionScopedDeclaration] = "ObjectShorthandFunctionScopedDeclaration"; + const ObjectShorthandBlockScopedDeclaration = ObjectShorthandFunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandBlockScopedDeclaration"] = ObjectShorthandBlockScopedDeclaration] = "ObjectShorthandBlockScopedDeclaration"; + const ObjectShorthand = ObjectShorthandBlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthand"] = ObjectShorthand] = "ObjectShorthand"; + // Any identifier bound in an import statement, e.g. both A and b from + // `import A, * as b from 'A';` + const ImportDeclaration = ObjectShorthand + 1; IdentifierRole[IdentifierRole["ImportDeclaration"] = ImportDeclaration] = "ImportDeclaration"; + const ObjectKey = ImportDeclaration + 1; IdentifierRole[IdentifierRole["ObjectKey"] = ObjectKey] = "ObjectKey"; + // The `foo` in `import {foo as bar} from "./abc";`. + const ImportAccess = ObjectKey + 1; IdentifierRole[IdentifierRole["ImportAccess"] = ImportAccess] = "ImportAccess"; +})(IdentifierRole || (IdentifierRole = {})); + +/** + * Extra information on jsxTagStart tokens, used to determine which of the three + * jsx functions are called in the automatic transform. + */ +export var JSXRole; (function (JSXRole) { + // The element is self-closing or has a body that resolves to empty. We + // shouldn't emit children at all in this case. + const NoChildren = 0; JSXRole[JSXRole["NoChildren"] = NoChildren] = "NoChildren"; + // The element has a single explicit child, which might still be an arbitrary + // expression like an array. We should emit that expression as the children. + const OneChild = NoChildren + 1; JSXRole[JSXRole["OneChild"] = OneChild] = "OneChild"; + // The element has at least two explicitly-specified children or has spread + // children, so child positions are assumed to be "static". We should wrap + // these children in an array. + const StaticChildren = OneChild + 1; JSXRole[JSXRole["StaticChildren"] = StaticChildren] = "StaticChildren"; + // The element has a prop named "key" after a prop spread, so we should fall + // back to the createElement function. + const KeyAfterPropSpread = StaticChildren + 1; JSXRole[JSXRole["KeyAfterPropSpread"] = KeyAfterPropSpread] = "KeyAfterPropSpread"; +})(JSXRole || (JSXRole = {})); + +export function isDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.TopLevelDeclaration || + role === IdentifierRole.FunctionScopedDeclaration || + role === IdentifierRole.BlockScopedDeclaration || + role === IdentifierRole.ObjectShorthandTopLevelDeclaration || + role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || + role === IdentifierRole.ObjectShorthandBlockScopedDeclaration + ); +} + +export function isNonTopLevelDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.FunctionScopedDeclaration || + role === IdentifierRole.BlockScopedDeclaration || + role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || + role === IdentifierRole.ObjectShorthandBlockScopedDeclaration + ); +} + +export function isTopLevelDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.TopLevelDeclaration || + role === IdentifierRole.ObjectShorthandTopLevelDeclaration || + role === IdentifierRole.ImportDeclaration + ); +} + +export function isBlockScopedDeclaration(token) { + const role = token.identifierRole; + // Treat top-level declarations as block scope since the distinction doesn't matter here. + return ( + role === IdentifierRole.TopLevelDeclaration || + role === IdentifierRole.BlockScopedDeclaration || + role === IdentifierRole.ObjectShorthandTopLevelDeclaration || + role === IdentifierRole.ObjectShorthandBlockScopedDeclaration + ); +} + +export function isFunctionScopedDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.FunctionScopedDeclaration || + role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration + ); +} + +export function isObjectShorthandDeclaration(token) { + return ( + token.identifierRole === IdentifierRole.ObjectShorthandTopLevelDeclaration || + token.identifierRole === IdentifierRole.ObjectShorthandBlockScopedDeclaration || + token.identifierRole === IdentifierRole.ObjectShorthandFunctionScopedDeclaration + ); +} + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. +export class Token { + constructor() { + this.type = state.type; + this.contextualKeyword = state.contextualKeyword; + this.start = state.start; + this.end = state.end; + this.scopeDepth = state.scopeDepth; + this.isType = state.isType; + this.identifierRole = null; + this.jsxRole = null; + this.shadowsGlobal = false; + this.isAsyncOperation = false; + this.contextId = null; + this.rhsEndIndex = null; + this.isExpression = false; + this.numNullishCoalesceStarts = 0; + this.numNullishCoalesceEnds = 0; + this.isOptionalChainStart = false; + this.isOptionalChainEnd = false; + this.subscriptStartIndex = null; + this.nullishStartIndex = null; + } + + + + + + + + + + // Initially false for all tokens, then may be computed in a follow-up step that does scope + // analysis. + + // Initially false for all tokens, but may be set during transform to mark it as containing an + // await operation. + + + // For assignments, the index of the RHS. For export tokens, the end of the export. + + // For class tokens, records if the class is a class expression or a class statement. + + // Number of times to insert a `nullishCoalesce(` snippet before this token. + + // Number of times to insert a `)` snippet after this token. + + // If true, insert an `optionalChain([` snippet before this token. + + // If true, insert a `])` snippet after this token. + + // Tag for `.`, `?.`, `[`, `?.[`, `(`, and `?.(` to denote the "root" token for this + // subscript chain. This can be used to determine if this chain is an optional chain. + + // Tag for `??` operators to denote the root token for this nullish coalescing call. + +} + +// ## Tokenizer + +// Move to the next token +export function next() { + state.tokens.push(new Token()); + nextToken(); +} + +// Call instead of next when inside a template, since that needs to be handled differently. +export function nextTemplateToken() { + state.tokens.push(new Token()); + state.start = state.pos; + readTmplToken(); +} + +// The tokenizer never parses regexes by default. Instead, the parser is responsible for +// instructing it to parse a regex when we see a slash at the start of an expression. +export function retokenizeSlashAsRegex() { + if (state.type === tt.assign) { + --state.pos; + } + readRegexp(); +} + +export function pushTypeContext(existingTokensInType) { + for (let i = state.tokens.length - existingTokensInType; i < state.tokens.length; i++) { + state.tokens[i].isType = true; + } + const oldIsType = state.isType; + state.isType = true; + return oldIsType; +} + +export function popTypeContext(oldIsType) { + state.isType = oldIsType; +} + +export function eat(type) { + if (match(type)) { + next(); + return true; + } else { + return false; + } +} + +export function eatTypeToken(tokenType) { + const oldIsType = state.isType; + state.isType = true; + eat(tokenType); + state.isType = oldIsType; +} + +export function match(type) { + return state.type === type; +} + +export function lookaheadType() { + const snapshot = state.snapshot(); + next(); + const type = state.type; + state.restoreFromSnapshot(snapshot); + return type; +} + +export class TypeAndKeyword { + + + constructor(type, contextualKeyword) { + this.type = type; + this.contextualKeyword = contextualKeyword; + } +} + +export function lookaheadTypeAndKeyword() { + const snapshot = state.snapshot(); + next(); + const type = state.type; + const contextualKeyword = state.contextualKeyword; + state.restoreFromSnapshot(snapshot); + return new TypeAndKeyword(type, contextualKeyword); +} + +export function nextTokenStart() { + return nextTokenStartSince(state.pos); +} + +export function nextTokenStartSince(pos) { + skipWhiteSpace.lastIndex = pos; + const skip = skipWhiteSpace.exec(input); + return pos + skip[0].length; +} + +export function lookaheadCharCode() { + return input.charCodeAt(nextTokenStart()); +} + +// Read a single token, updating the parser object's token-related +// properties. +export function nextToken() { + skipSpace(); + state.start = state.pos; + if (state.pos >= input.length) { + const tokens = state.tokens; + // We normally run past the end a bit, but if we're way past the end, avoid an infinite loop. + // Also check the token positions rather than the types since sometimes we rewrite the token + // type to something else. + if ( + tokens.length >= 2 && + tokens[tokens.length - 1].start >= input.length && + tokens[tokens.length - 2].start >= input.length + ) { + unexpected("Unexpectedly reached the end of input."); + } + finishToken(tt.eof); + return; + } + readToken(input.charCodeAt(state.pos)); +} + +function readToken(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if ( + IS_IDENTIFIER_START[code] || + code === charCodes.backslash || + (code === charCodes.atSign && input.charCodeAt(state.pos + 1) === charCodes.atSign) + ) { + readWord(); + } else { + getTokenFromCode(code); + } +} + +function skipBlockComment() { + while ( + input.charCodeAt(state.pos) !== charCodes.asterisk || + input.charCodeAt(state.pos + 1) !== charCodes.slash + ) { + state.pos++; + if (state.pos > input.length) { + unexpected("Unterminated comment", state.pos - 2); + return; + } + } + state.pos += 2; +} + +export function skipLineComment(startSkip) { + let ch = input.charCodeAt((state.pos += startSkip)); + if (state.pos < input.length) { + while ( + ch !== charCodes.lineFeed && + ch !== charCodes.carriageReturn && + ch !== charCodes.lineSeparator && + ch !== charCodes.paragraphSeparator && + ++state.pos < input.length + ) { + ch = input.charCodeAt(state.pos); + } + } +} + +// Called at the start of the parse and after every token. Skips +// whitespace and comments. +export function skipSpace() { + while (state.pos < input.length) { + const ch = input.charCodeAt(state.pos); + switch (ch) { + case charCodes.carriageReturn: + if (input.charCodeAt(state.pos + 1) === charCodes.lineFeed) { + ++state.pos; + } + + case charCodes.lineFeed: + case charCodes.lineSeparator: + case charCodes.paragraphSeparator: + ++state.pos; + break; + + case charCodes.slash: + switch (input.charCodeAt(state.pos + 1)) { + case charCodes.asterisk: + state.pos += 2; + skipBlockComment(); + break; + + case charCodes.slash: + skipLineComment(2); + break; + + default: + return; + } + break; + + default: + if (IS_WHITESPACE[ch]) { + ++state.pos; + } else { + return; + } + } + } +} + +// Called at the end of every token. Sets various fields, and skips the space after the token, so +// that the next one's `start` will point at the right position. +export function finishToken( + type, + contextualKeyword = ContextualKeyword.NONE, +) { + state.end = state.pos; + state.type = type; + state.contextualKeyword = contextualKeyword; +} + +// ### Token reading + +// This is the function that is called to fetch the next token. It +// is somewhat obscure, because it works in character codes rather +// than characters, and because operator parsing has been inlined +// into it. +// +// All in the name of speed. +function readToken_dot() { + const nextChar = input.charCodeAt(state.pos + 1); + if (nextChar >= charCodes.digit0 && nextChar <= charCodes.digit9) { + readNumber(true); + return; + } + + if (nextChar === charCodes.dot && input.charCodeAt(state.pos + 2) === charCodes.dot) { + state.pos += 3; + finishToken(tt.ellipsis); + } else { + ++state.pos; + finishToken(tt.dot); + } +} + +function readToken_slash() { + const nextChar = input.charCodeAt(state.pos + 1); + if (nextChar === charCodes.equalsTo) { + finishOp(tt.assign, 2); + } else { + finishOp(tt.slash, 1); + } +} + +function readToken_mult_modulo(code) { + // '%*' + let tokenType = code === charCodes.asterisk ? tt.star : tt.modulo; + let width = 1; + let nextChar = input.charCodeAt(state.pos + 1); + + // Exponentiation operator ** + if (code === charCodes.asterisk && nextChar === charCodes.asterisk) { + width++; + nextChar = input.charCodeAt(state.pos + 2); + tokenType = tt.exponent; + } + + // Match *= or %=, disallowing *=> which can be valid in flow. + if ( + nextChar === charCodes.equalsTo && + input.charCodeAt(state.pos + 2) !== charCodes.greaterThan + ) { + width++; + tokenType = tt.assign; + } + + finishOp(tokenType, width); +} + +function readToken_pipe_amp(code) { + // '|&' + const nextChar = input.charCodeAt(state.pos + 1); + + if (nextChar === code) { + if (input.charCodeAt(state.pos + 2) === charCodes.equalsTo) { + // ||= or &&= + finishOp(tt.assign, 3); + } else { + // || or && + finishOp(code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND, 2); + } + return; + } + + if (code === charCodes.verticalBar) { + // '|>' + if (nextChar === charCodes.greaterThan) { + finishOp(tt.pipeline, 2); + return; + } else if (nextChar === charCodes.rightCurlyBrace && isFlowEnabled) { + // '|}' + finishOp(tt.braceBarR, 2); + return; + } + } + + if (nextChar === charCodes.equalsTo) { + finishOp(tt.assign, 2); + return; + } + + finishOp(code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND, 1); +} + +function readToken_caret() { + // '^' + const nextChar = input.charCodeAt(state.pos + 1); + if (nextChar === charCodes.equalsTo) { + finishOp(tt.assign, 2); + } else { + finishOp(tt.bitwiseXOR, 1); + } +} + +function readToken_plus_min(code) { + // '+-' + const nextChar = input.charCodeAt(state.pos + 1); + + if (nextChar === code) { + // Tentatively call this a prefix operator, but it might be changed to postfix later. + finishOp(tt.preIncDec, 2); + return; + } + + if (nextChar === charCodes.equalsTo) { + finishOp(tt.assign, 2); + } else if (code === charCodes.plusSign) { + finishOp(tt.plus, 1); + } else { + finishOp(tt.minus, 1); + } +} + +function readToken_lt() { + const nextChar = input.charCodeAt(state.pos + 1); + + if (nextChar === charCodes.lessThan) { + if (input.charCodeAt(state.pos + 2) === charCodes.equalsTo) { + finishOp(tt.assign, 3); + return; + } + // We see <<, but need to be really careful about whether to treat it as a + // true left-shift or as two < tokens. + if (state.isType) { + // Within a type, << might come up in a snippet like `Array<() => void>`, + // so treat it as two < tokens. Importantly, this should only override << + // rather than other tokens like <= . If we treated <= as < in a type + // context, then the snippet `a as T <= 1` would incorrectly start parsing + // a type argument on T. We don't need to worry about `a as T << 1` + // because TypeScript disallows that syntax. + finishOp(tt.lessThan, 1); + } else { + // Outside a type, this might be a true left-shift operator, or it might + // still be two open-type-arg tokens, such as in `f<() => void>()`. We + // look at the token while considering the `f`, so we don't yet know that + // we're in a type context. In this case, we initially tokenize as a + // left-shift and correct after-the-fact as necessary in + // tsParseTypeArgumentsWithPossibleBitshift . + finishOp(tt.bitShiftL, 2); + } + return; + } + + if (nextChar === charCodes.equalsTo) { + // <= + finishOp(tt.relationalOrEqual, 2); + } else { + finishOp(tt.lessThan, 1); + } +} + +function readToken_gt() { + if (state.isType) { + // Avoid right-shift for things like `Array>` and + // greater-than-or-equal for things like `const a: Array=[];`. + finishOp(tt.greaterThan, 1); + return; + } + + const nextChar = input.charCodeAt(state.pos + 1); + + if (nextChar === charCodes.greaterThan) { + const size = input.charCodeAt(state.pos + 2) === charCodes.greaterThan ? 3 : 2; + if (input.charCodeAt(state.pos + size) === charCodes.equalsTo) { + finishOp(tt.assign, size + 1); + return; + } + finishOp(tt.bitShiftR, size); + return; + } + + if (nextChar === charCodes.equalsTo) { + // >= + finishOp(tt.relationalOrEqual, 2); + } else { + finishOp(tt.greaterThan, 1); + } +} + +/** + * Reinterpret a possible > token when transitioning from a type to a non-type + * context. + * + * This comes up in two situations where >= needs to be treated as one token: + * - After an `as` expression, like in the code `a as T >= 1`. + * - In a type argument in an expression context, e.g. `f(a < b, c >= d)`, we + * need to see the token as >= so that we get an error and backtrack to + * normal expression parsing. + * + * Other situations require >= to be seen as two tokens, e.g. + * `const x: Array=[];`, so it's important to treat > as its own token in + * typical type parsing situations. + */ +export function rescan_gt() { + if (state.type === tt.greaterThan) { + state.pos -= 1; + readToken_gt(); + } +} + +function readToken_eq_excl(code) { + // '=!' + const nextChar = input.charCodeAt(state.pos + 1); + if (nextChar === charCodes.equalsTo) { + finishOp(tt.equality, input.charCodeAt(state.pos + 2) === charCodes.equalsTo ? 3 : 2); + return; + } + if (code === charCodes.equalsTo && nextChar === charCodes.greaterThan) { + // '=>' + state.pos += 2; + finishToken(tt.arrow); + return; + } + finishOp(code === charCodes.equalsTo ? tt.eq : tt.bang, 1); +} + +function readToken_question() { + // '?' + const nextChar = input.charCodeAt(state.pos + 1); + const nextChar2 = input.charCodeAt(state.pos + 2); + if ( + nextChar === charCodes.questionMark && + // In Flow (but not TypeScript), ??string is a valid type that should be + // tokenized as two individual ? tokens. + !(isFlowEnabled && state.isType) + ) { + if (nextChar2 === charCodes.equalsTo) { + // '??=' + finishOp(tt.assign, 3); + } else { + // '??' + finishOp(tt.nullishCoalescing, 2); + } + } else if ( + nextChar === charCodes.dot && + !(nextChar2 >= charCodes.digit0 && nextChar2 <= charCodes.digit9) + ) { + // '.' not followed by a number + state.pos += 2; + finishToken(tt.questionDot); + } else { + ++state.pos; + finishToken(tt.question); + } +} + +export function getTokenFromCode(code) { + switch (code) { + case charCodes.numberSign: + ++state.pos; + finishToken(tt.hash); + return; + + // The interpretation of a dot depends on whether it is followed + // by a digit or another two dots. + + case charCodes.dot: + readToken_dot(); + return; + + // Punctuation tokens. + case charCodes.leftParenthesis: + ++state.pos; + finishToken(tt.parenL); + return; + case charCodes.rightParenthesis: + ++state.pos; + finishToken(tt.parenR); + return; + case charCodes.semicolon: + ++state.pos; + finishToken(tt.semi); + return; + case charCodes.comma: + ++state.pos; + finishToken(tt.comma); + return; + case charCodes.leftSquareBracket: + ++state.pos; + finishToken(tt.bracketL); + return; + case charCodes.rightSquareBracket: + ++state.pos; + finishToken(tt.bracketR); + return; + + case charCodes.leftCurlyBrace: + if (isFlowEnabled && input.charCodeAt(state.pos + 1) === charCodes.verticalBar) { + finishOp(tt.braceBarL, 2); + } else { + ++state.pos; + finishToken(tt.braceL); + } + return; + + case charCodes.rightCurlyBrace: + ++state.pos; + finishToken(tt.braceR); + return; + + case charCodes.colon: + if (input.charCodeAt(state.pos + 1) === charCodes.colon) { + finishOp(tt.doubleColon, 2); + } else { + ++state.pos; + finishToken(tt.colon); + } + return; + + case charCodes.questionMark: + readToken_question(); + return; + case charCodes.atSign: + ++state.pos; + finishToken(tt.at); + return; + + case charCodes.graveAccent: + ++state.pos; + finishToken(tt.backQuote); + return; + + case charCodes.digit0: { + const nextChar = input.charCodeAt(state.pos + 1); + // '0x', '0X', '0o', '0O', '0b', '0B' + if ( + nextChar === charCodes.lowercaseX || + nextChar === charCodes.uppercaseX || + nextChar === charCodes.lowercaseO || + nextChar === charCodes.uppercaseO || + nextChar === charCodes.lowercaseB || + nextChar === charCodes.uppercaseB + ) { + readRadixNumber(); + return; + } + } + // Anything else beginning with a digit is an integer, octal + // number, or float. + case charCodes.digit1: + case charCodes.digit2: + case charCodes.digit3: + case charCodes.digit4: + case charCodes.digit5: + case charCodes.digit6: + case charCodes.digit7: + case charCodes.digit8: + case charCodes.digit9: + readNumber(false); + return; + + // Quotes produce strings. + case charCodes.quotationMark: + case charCodes.apostrophe: + readString(code); + return; + + // Operators are parsed inline in tiny state machines. '=' (charCodes.equalsTo) is + // often referred to. `finishOp` simply skips the amount of + // characters it is given as second argument, and returns a token + // of the type given by its first argument. + + case charCodes.slash: + readToken_slash(); + return; + + case charCodes.percentSign: + case charCodes.asterisk: + readToken_mult_modulo(code); + return; + + case charCodes.verticalBar: + case charCodes.ampersand: + readToken_pipe_amp(code); + return; + + case charCodes.caret: + readToken_caret(); + return; + + case charCodes.plusSign: + case charCodes.dash: + readToken_plus_min(code); + return; + + case charCodes.lessThan: + readToken_lt(); + return; + + case charCodes.greaterThan: + readToken_gt(); + return; + + case charCodes.equalsTo: + case charCodes.exclamationMark: + readToken_eq_excl(code); + return; + + case charCodes.tilde: + finishOp(tt.tilde, 1); + return; + + default: + break; + } + + unexpected(`Unexpected character '${String.fromCharCode(code)}'`, state.pos); +} + +function finishOp(type, size) { + state.pos += size; + finishToken(type); +} + +function readRegexp() { + const start = state.pos; + let escaped = false; + let inClass = false; + for (;;) { + if (state.pos >= input.length) { + unexpected("Unterminated regular expression", start); + return; + } + const code = input.charCodeAt(state.pos); + if (escaped) { + escaped = false; + } else { + if (code === charCodes.leftSquareBracket) { + inClass = true; + } else if (code === charCodes.rightSquareBracket && inClass) { + inClass = false; + } else if (code === charCodes.slash && !inClass) { + break; + } + escaped = code === charCodes.backslash; + } + ++state.pos; + } + ++state.pos; + // Need to use `skipWord` because '\uXXXX' sequences are allowed here (don't ask). + skipWord(); + + finishToken(tt.regexp); +} + +/** + * Read a decimal integer. Note that this can't be unified with the similar code + * in readRadixNumber (which also handles hex digits) because "e" needs to be + * the end of the integer so that we can properly handle scientific notation. + */ +function readInt() { + while (true) { + const code = input.charCodeAt(state.pos); + if ((code >= charCodes.digit0 && code <= charCodes.digit9) || code === charCodes.underscore) { + state.pos++; + } else { + break; + } + } +} + +function readRadixNumber() { + state.pos += 2; // 0x + + // Walk to the end of the number, allowing hex digits. + while (true) { + const code = input.charCodeAt(state.pos); + if ( + (code >= charCodes.digit0 && code <= charCodes.digit9) || + (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || + (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) || + code === charCodes.underscore + ) { + state.pos++; + } else { + break; + } + } + + const nextChar = input.charCodeAt(state.pos); + if (nextChar === charCodes.lowercaseN) { + ++state.pos; + finishToken(tt.bigint); + } else { + finishToken(tt.num); + } +} + +// Read an integer, octal integer, or floating-point number. +function readNumber(startsWithDot) { + let isBigInt = false; + let isDecimal = false; + + if (!startsWithDot) { + readInt(); + } + + let nextChar = input.charCodeAt(state.pos); + if (nextChar === charCodes.dot) { + ++state.pos; + readInt(); + nextChar = input.charCodeAt(state.pos); + } + + if (nextChar === charCodes.uppercaseE || nextChar === charCodes.lowercaseE) { + nextChar = input.charCodeAt(++state.pos); + if (nextChar === charCodes.plusSign || nextChar === charCodes.dash) { + ++state.pos; + } + readInt(); + nextChar = input.charCodeAt(state.pos); + } + + if (nextChar === charCodes.lowercaseN) { + ++state.pos; + isBigInt = true; + } else if (nextChar === charCodes.lowercaseM) { + ++state.pos; + isDecimal = true; + } + + if (isBigInt) { + finishToken(tt.bigint); + return; + } + + if (isDecimal) { + finishToken(tt.decimal); + return; + } + + finishToken(tt.num); +} + +function readString(quote) { + state.pos++; + for (;;) { + if (state.pos >= input.length) { + unexpected("Unterminated string constant"); + return; + } + const ch = input.charCodeAt(state.pos); + if (ch === charCodes.backslash) { + state.pos++; + } else if (ch === quote) { + break; + } + state.pos++; + } + state.pos++; + finishToken(tt.string); +} + +// Reads template string tokens. +function readTmplToken() { + for (;;) { + if (state.pos >= input.length) { + unexpected("Unterminated template"); + return; + } + const ch = input.charCodeAt(state.pos); + if ( + ch === charCodes.graveAccent || + (ch === charCodes.dollarSign && input.charCodeAt(state.pos + 1) === charCodes.leftCurlyBrace) + ) { + if (state.pos === state.start && match(tt.template)) { + if (ch === charCodes.dollarSign) { + state.pos += 2; + finishToken(tt.dollarBraceL); + return; + } else { + ++state.pos; + finishToken(tt.backQuote); + return; + } + } + finishToken(tt.template); + return; + } + if (ch === charCodes.backslash) { + state.pos++; + } + state.pos++; + } +} + +// Skip to the end of the current word. Note that this is the same as the snippet at the end of +// readWord, but calling skipWord from readWord seems to slightly hurt performance from some rough +// measurements. +export function skipWord() { + while (state.pos < input.length) { + const ch = input.charCodeAt(state.pos); + if (IS_IDENTIFIER_CHAR[ch]) { + state.pos++; + } else if (ch === charCodes.backslash) { + // \u + state.pos += 2; + if (input.charCodeAt(state.pos) === charCodes.leftCurlyBrace) { + while ( + state.pos < input.length && + input.charCodeAt(state.pos) !== charCodes.rightCurlyBrace + ) { + state.pos++; + } + state.pos++; + } + } else { + break; + } + } +} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js b/node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js new file mode 100644 index 0000000..0dcf1b0 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js @@ -0,0 +1,43 @@ +export var ContextualKeyword; (function (ContextualKeyword) { + const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE"; + const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract"; + const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor"; + const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as"; + const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert"; + const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts"; + const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async"; + const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await"; + const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks"; + const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor"; + const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare"; + const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum"; + const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports"; + const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from"; + const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get"; + const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global"; + const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements"; + const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer"; + const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface"; + const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is"; + const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof"; + const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins"; + const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module"; + const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace"; + const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of"; + const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque"; + const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out"; + const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override"; + const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private"; + const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected"; + const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto"; + const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public"; + const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly"; + const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require"; + const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies"; + const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set"; + const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static"; + const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol"; + const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type"; + const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique"; + const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using"; +})(ContextualKeyword || (ContextualKeyword = {})); diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js b/node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js new file mode 100644 index 0000000..cf3df89 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js @@ -0,0 +1,64 @@ +import {input, state} from "../traverser/base"; +import {charCodes} from "../util/charcodes"; +import {IS_IDENTIFIER_CHAR} from "../util/identifier"; +import {finishToken} from "./index"; +import {READ_WORD_TREE} from "./readWordTree"; +import {TokenType as tt} from "./types"; + +/** + * Read an identifier, producing either a name token or matching on one of the existing keywords. + * For performance, we pre-generate big decision tree that we traverse. Each node represents a + * prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if + * not), and the other 26 values are the transitions to other nodes, or -1 to stop. + */ +export default function readWord() { + let treePos = 0; + let code = 0; + let pos = state.pos; + while (pos < input.length) { + code = input.charCodeAt(pos); + if (code < charCodes.lowercaseA || code > charCodes.lowercaseZ) { + break; + } + const next = READ_WORD_TREE[treePos + (code - charCodes.lowercaseA) + 1]; + if (next === -1) { + break; + } else { + treePos = next; + pos++; + } + } + + const keywordValue = READ_WORD_TREE[treePos]; + if (keywordValue > -1 && !IS_IDENTIFIER_CHAR[code]) { + state.pos = pos; + if (keywordValue & 1) { + finishToken(keywordValue >>> 1); + } else { + finishToken(tt.name, keywordValue >>> 1); + } + return; + } + + while (pos < input.length) { + const ch = input.charCodeAt(pos); + if (IS_IDENTIFIER_CHAR[ch]) { + pos++; + } else if (ch === charCodes.backslash) { + // \u + pos += 2; + if (input.charCodeAt(pos) === charCodes.leftCurlyBrace) { + while (pos < input.length && input.charCodeAt(pos) !== charCodes.rightCurlyBrace) { + pos++; + } + pos++; + } + } else if (ch === charCodes.atSign && input.charCodeAt(pos + 1) === charCodes.atSign) { + pos += 2; + } else { + break; + } + } + state.pos = pos; + finishToken(tt.name); +} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js b/node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js new file mode 100644 index 0000000..ffb8cac --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js @@ -0,0 +1,671 @@ +// Generated file, do not edit! Run "yarn generate" to re-generate this file. +import {ContextualKeyword} from "./keywords"; +import {TokenType as tt} from "./types"; + +// prettier-ignore +export const READ_WORD_TREE = new Int32Array([ + // "" + -1, 27, 783, 918, 1755, 2376, 2862, 3483, -1, 3699, -1, 4617, 4752, 4833, 5130, 5508, 5940, -1, 6480, 6939, 7749, 8181, 8451, 8613, -1, 8829, -1, + // "a" + -1, -1, 54, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, -1, -1, -1, 675, -1, -1, -1, + // "ab" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, + // "abs" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, + // "abst" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, -1, -1, + // "abstr" + -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "abstra" + -1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "abstrac" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1, + // "abstract" + ContextualKeyword._abstract << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ac" + -1, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "acc" + -1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "acce" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, + // "acces" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1, + // "access" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "accesso" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1, + // "accessor" + ContextualKeyword._accessor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "as" + ContextualKeyword._as << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, 594, -1, + // "ass" + -1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "asse" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, + // "asser" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, -1, + // "assert" + ContextualKeyword._assert << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, -1, -1, -1, -1, -1, -1, -1, + // "asserts" + ContextualKeyword._asserts << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "asy" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "asyn" + -1, -1, -1, 648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "async" + ContextualKeyword._async << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "aw" + -1, 702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "awa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "awai" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1, + // "await" + ContextualKeyword._await << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "b" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, -1, -1, + // "br" + -1, -1, -1, -1, -1, 837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "bre" + -1, 864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "brea" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "break" + (tt._break << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "c" + -1, 945, -1, -1, -1, -1, -1, -1, 1107, -1, -1, -1, 1242, -1, -1, 1350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ca" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 972, 1026, -1, -1, -1, -1, -1, -1, + // "cas" + -1, -1, -1, -1, -1, 999, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "case" + (tt._case << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cat" + -1, -1, -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "catc" + -1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "catch" + (tt._catch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ch" + -1, -1, -1, -1, -1, 1134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "che" + -1, -1, -1, 1161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "chec" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "check" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1215, -1, -1, -1, -1, -1, -1, -1, + // "checks" + ContextualKeyword._checks << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cl" + -1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cla" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1296, -1, -1, -1, -1, -1, -1, -1, + // "clas" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1323, -1, -1, -1, -1, -1, -1, -1, + // "class" + (tt._class << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "co" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "con" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, 1620, -1, -1, -1, -1, -1, -1, + // "cons" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1431, -1, -1, -1, -1, -1, -1, + // "const" + (tt._const << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1458, -1, -1, -1, -1, -1, -1, -1, -1, + // "constr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, -1, -1, -1, -1, + // "constru" + -1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "construc" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1539, -1, -1, -1, -1, -1, -1, + // "construct" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "constructo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, -1, -1, -1, -1, -1, -1, -1, -1, + // "constructor" + ContextualKeyword._constructor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cont" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "conti" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1674, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "contin" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1701, -1, -1, -1, -1, -1, + // "continu" + -1, -1, -1, -1, -1, 1728, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "continue" + (tt._continue << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "d" + -1, -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "de" + -1, -1, 1809, 1971, -1, -1, 2106, -1, -1, -1, -1, -1, 2241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "deb" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, -1, -1, + // "debu" + -1, -1, -1, -1, -1, -1, -1, 1863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "debug" + -1, -1, -1, -1, -1, -1, -1, 1890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "debugg" + -1, -1, -1, -1, -1, 1917, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "debugge" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, -1, -1, + // "debugger" + (tt._debugger << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "dec" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "decl" + -1, 2025, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "decla" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2052, -1, -1, -1, -1, -1, -1, -1, -1, + // "declar" + -1, -1, -1, -1, -1, 2079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "declare" + ContextualKeyword._declare << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "def" + -1, 2133, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "defa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2160, -1, -1, -1, -1, -1, + // "defau" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "defaul" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, -1, -1, -1, -1, + // "default" + (tt._default << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "del" + -1, -1, -1, -1, -1, 2268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "dele" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1, + // "delet" + -1, -1, -1, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "delete" + (tt._delete << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "do" + (tt._do << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "e" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2403, -1, 2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2565, -1, -1, + // "el" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2430, -1, -1, -1, -1, -1, -1, -1, + // "els" + -1, -1, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "else" + (tt._else << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "en" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2511, -1, -1, -1, -1, -1, + // "enu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "enum" + ContextualKeyword._enum << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ex" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, 2727, -1, -1, -1, -1, -1, -1, + // "exp" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2619, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "expo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2646, -1, -1, -1, -1, -1, -1, -1, -1, + // "expor" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2673, -1, -1, -1, -1, -1, -1, + // "export" + (tt._export << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2700, -1, -1, -1, -1, -1, -1, -1, + // "exports" + ContextualKeyword._exports << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ext" + -1, -1, -1, -1, -1, 2754, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "exte" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "exten" + -1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "extend" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2835, -1, -1, -1, -1, -1, -1, -1, + // "extends" + (tt._extends << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "f" + -1, 2889, -1, -1, -1, -1, -1, -1, -1, 2997, -1, -1, -1, -1, -1, 3159, -1, -1, 3213, -1, -1, 3294, -1, -1, -1, -1, -1, + // "fa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fal" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2943, -1, -1, -1, -1, -1, -1, -1, + // "fals" + -1, -1, -1, -1, -1, 2970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "false" + (tt._false << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fin" + -1, 3051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fina" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "final" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "finall" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1, + // "finally" + (tt._finally << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3186, -1, -1, -1, -1, -1, -1, -1, -1, + // "for" + (tt._for << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fro" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "from" + ContextualKeyword._from << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fun" + -1, -1, -1, 3348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "func" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3375, -1, -1, -1, -1, -1, -1, + // "funct" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "functi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "functio" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "function" + (tt._function << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "g" + -1, -1, -1, -1, -1, 3510, -1, -1, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ge" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3537, -1, -1, -1, -1, -1, -1, + // "get" + ContextualKeyword._get << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "gl" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "glo" + -1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "glob" + -1, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "globa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "global" + ContextualKeyword._global << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "i" + -1, -1, -1, -1, -1, -1, 3726, -1, -1, -1, -1, -1, -1, 3753, 4077, -1, -1, -1, -1, 4590, -1, -1, -1, -1, -1, -1, -1, + // "if" + (tt._if << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "im" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "imp" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3807, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "impl" + -1, -1, -1, -1, -1, 3834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "imple" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "implem" + -1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "impleme" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "implemen" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, -1, -1, + // "implement" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3969, -1, -1, -1, -1, -1, -1, -1, + // "implements" + ContextualKeyword._implements << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "impo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, -1, -1, -1, -1, -1, + // "impor" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4050, -1, -1, -1, -1, -1, -1, + // "import" + (tt._import << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "in" + (tt._in << 1) + 1, -1, -1, -1, -1, -1, 4104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, 4401, -1, -1, -1, -1, -1, -1, + // "inf" + -1, -1, -1, -1, -1, 4131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "infe" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, + // "infer" + ContextualKeyword._infer << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ins" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, -1, + // "inst" + -1, 4239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "insta" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instan" + -1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instanc" + -1, -1, -1, -1, -1, 4320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instance" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instanceo" + -1, -1, -1, -1, -1, -1, 4374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instanceof" + (tt._instanceof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "int" + -1, -1, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "inte" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4455, -1, -1, -1, -1, -1, -1, -1, -1, + // "inter" + -1, -1, -1, -1, -1, -1, 4482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interf" + -1, 4509, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interfa" + -1, -1, -1, 4536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interfac" + -1, -1, -1, -1, -1, 4563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interface" + ContextualKeyword._interface << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "is" + ContextualKeyword._is << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "k" + -1, -1, -1, -1, -1, 4644, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ke" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4671, -1, + // "key" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "keyo" + -1, -1, -1, -1, -1, -1, 4725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "keyof" + ContextualKeyword._keyof << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "l" + -1, -1, -1, -1, -1, 4779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "le" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4806, -1, -1, -1, -1, -1, -1, + // "let" + (tt._let << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "m" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4860, -1, -1, -1, -1, -1, 4995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4887, -1, -1, + // "mix" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mixi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mixin" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, + // "mixins" + ContextualKeyword._mixins << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mo" + -1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mod" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, -1, -1, -1, + // "modu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "modul" + -1, -1, -1, -1, -1, 5103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "module" + ContextualKeyword._module << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "n" + -1, 5157, -1, -1, -1, 5373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1, + // "na" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "nam" + -1, -1, -1, -1, -1, 5211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "name" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1, + // "names" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namesp" + -1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namespa" + -1, -1, -1, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namespac" + -1, -1, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namespace" + ContextualKeyword._namespace << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ne" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5400, -1, -1, -1, + // "new" + (tt._new << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "nu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "nul" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "null" + (tt._null << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "o" + -1, -1, -1, -1, -1, -1, 5535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5562, -1, -1, -1, -1, 5697, 5751, -1, -1, -1, -1, + // "of" + ContextualKeyword._of << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "op" + -1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "opa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5616, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "opaq" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5643, -1, -1, -1, -1, -1, + // "opaqu" + -1, -1, -1, -1, -1, 5670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "opaque" + ContextualKeyword._opaque << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ou" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5724, -1, -1, -1, -1, -1, -1, + // "out" + ContextualKeyword._out << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ov" + -1, -1, -1, -1, -1, 5778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ove" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5805, -1, -1, -1, -1, -1, -1, -1, -1, + // "over" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1, + // "overr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "overri" + -1, -1, -1, -1, 5886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "overrid" + -1, -1, -1, -1, -1, 5913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "override" + ContextualKeyword._override << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "p" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5967, -1, -1, 6345, -1, -1, -1, -1, -1, + // "pr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, -1, -1, -1, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pri" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6021, -1, -1, -1, -1, + // "priv" + -1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "priva" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, -1, -1, -1, -1, -1, -1, + // "privat" + -1, -1, -1, -1, -1, 6102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "private" + ContextualKeyword._private << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pro" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6156, -1, -1, -1, -1, -1, -1, + // "prot" + -1, -1, -1, -1, -1, 6183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "prote" + -1, -1, -1, 6210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "protec" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, -1, -1, -1, -1, + // "protect" + -1, -1, -1, -1, -1, 6264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "protecte" + -1, -1, -1, -1, 6291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "protected" + ContextualKeyword._protected << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "proto" + ContextualKeyword._proto << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pu" + -1, -1, 6372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pub" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "publ" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 6426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "publi" + -1, -1, -1, 6453, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "public" + ContextualKeyword._public << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "r" + -1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "re" + -1, 6534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6696, -1, -1, 6831, -1, -1, -1, -1, -1, -1, + // "rea" + -1, -1, -1, -1, 6561, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "read" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "reado" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "readon" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "readonl" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6669, -1, + // "readonly" + ContextualKeyword._readonly << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "req" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6723, -1, -1, -1, -1, -1, + // "requ" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 6750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "requi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6777, -1, -1, -1, -1, -1, -1, -1, -1, + // "requir" + -1, -1, -1, -1, -1, 6804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "require" + ContextualKeyword._require << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ret" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6858, -1, -1, -1, -1, -1, + // "retu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6885, -1, -1, -1, -1, -1, -1, -1, -1, + // "retur" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "return" + (tt._return << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "s" + -1, 6966, -1, -1, -1, 7182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7236, 7371, -1, 7479, -1, 7614, -1, + // "sa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6993, -1, -1, -1, -1, -1, -1, + // "sat" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sati" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7047, -1, -1, -1, -1, -1, -1, -1, + // "satis" + -1, -1, -1, -1, -1, -1, 7074, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "satisf" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "satisfi" + -1, -1, -1, -1, -1, 7128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "satisfie" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7155, -1, -1, -1, -1, -1, -1, -1, + // "satisfies" + ContextualKeyword._satisfies << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "se" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7209, -1, -1, -1, -1, -1, -1, + // "set" + ContextualKeyword._set << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "st" + -1, 7263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sta" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7290, -1, -1, -1, -1, -1, -1, + // "stat" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "stati" + -1, -1, -1, 7344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "static" + ContextualKeyword._static << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "su" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7398, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sup" + -1, -1, -1, -1, -1, 7425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "supe" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7452, -1, -1, -1, -1, -1, -1, -1, -1, + // "super" + (tt._super << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sw" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7506, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "swi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7533, -1, -1, -1, -1, -1, -1, + // "swit" + -1, -1, -1, 7560, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "switc" + -1, -1, -1, -1, -1, -1, -1, -1, 7587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "switch" + (tt._switch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sy" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sym" + -1, -1, 7668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "symb" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "symbo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "symbol" + ContextualKeyword._symbol << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "t" + -1, -1, -1, -1, -1, -1, -1, -1, 7776, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7938, -1, -1, -1, -1, -1, -1, 8046, -1, + // "th" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7803, -1, -1, -1, -1, -1, -1, -1, -1, 7857, -1, -1, -1, -1, -1, -1, -1, -1, + // "thi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7830, -1, -1, -1, -1, -1, -1, -1, + // "this" + (tt._this << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "thr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "thro" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7911, -1, -1, -1, + // "throw" + (tt._throw << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "tr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7965, -1, -1, -1, 8019, -1, + // "tru" + -1, -1, -1, -1, -1, 7992, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "true" + (tt._true << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "try" + (tt._try << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ty" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "typ" + -1, -1, -1, -1, -1, 8100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "type" + ContextualKeyword._type << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "typeo" + -1, -1, -1, -1, -1, -1, 8154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "typeof" + (tt._typeof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "u" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8208, -1, -1, -1, -1, 8343, -1, -1, -1, -1, -1, -1, -1, + // "un" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "uni" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8262, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "uniq" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8289, -1, -1, -1, -1, -1, + // "uniqu" + -1, -1, -1, -1, -1, 8316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "unique" + ContextualKeyword._unique << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "us" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "usi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "usin" + -1, -1, -1, -1, -1, -1, -1, 8424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "using" + ContextualKeyword._using << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "v" + -1, 8478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "va" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8505, -1, -1, -1, -1, -1, -1, -1, -1, + // "var" + (tt._var << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "vo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "voi" + -1, -1, -1, -1, 8586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "void" + (tt._void << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "w" + -1, -1, -1, -1, -1, -1, -1, -1, 8640, 8748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "wh" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "whi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "whil" + -1, -1, -1, -1, -1, 8721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "while" + (tt._while << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "wi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8775, -1, -1, -1, -1, -1, -1, + // "wit" + -1, -1, -1, -1, -1, -1, -1, -1, 8802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "with" + (tt._with << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "y" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yi" + -1, -1, -1, -1, -1, 8883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yie" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yiel" + -1, -1, -1, -1, 8937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yield" + (tt._yield << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +]); diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/state.js b/node_modules/sucrase/dist/esm/parser/tokenizer/state.js new file mode 100644 index 0000000..940cde0 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/tokenizer/state.js @@ -0,0 +1,106 @@ + +import {ContextualKeyword} from "./keywords"; +import { TokenType as tt} from "./types"; + +export class Scope { + + + + + constructor(startTokenIndex, endTokenIndex, isFunctionScope) { + this.startTokenIndex = startTokenIndex; + this.endTokenIndex = endTokenIndex; + this.isFunctionScope = isFunctionScope; + } +} + +export class StateSnapshot { + constructor( + potentialArrowAt, + noAnonFunctionType, + inDisallowConditionalTypesContext, + tokensLength, + scopesLength, + pos, + type, + contextualKeyword, + start, + end, + isType, + scopeDepth, + error, + ) {;this.potentialArrowAt = potentialArrowAt;this.noAnonFunctionType = noAnonFunctionType;this.inDisallowConditionalTypesContext = inDisallowConditionalTypesContext;this.tokensLength = tokensLength;this.scopesLength = scopesLength;this.pos = pos;this.type = type;this.contextualKeyword = contextualKeyword;this.start = start;this.end = end;this.isType = isType;this.scopeDepth = scopeDepth;this.error = error;} +} + +export default class State {constructor() { State.prototype.__init.call(this);State.prototype.__init2.call(this);State.prototype.__init3.call(this);State.prototype.__init4.call(this);State.prototype.__init5.call(this);State.prototype.__init6.call(this);State.prototype.__init7.call(this);State.prototype.__init8.call(this);State.prototype.__init9.call(this);State.prototype.__init10.call(this);State.prototype.__init11.call(this);State.prototype.__init12.call(this);State.prototype.__init13.call(this); } + // Used to signify the start of a potential arrow function + __init() {this.potentialArrowAt = -1} + + // Used by Flow to handle an edge case involving function type parsing. + __init2() {this.noAnonFunctionType = false} + + // Used by TypeScript to handle ambiguities when parsing conditional types. + __init3() {this.inDisallowConditionalTypesContext = false} + + // Token store. + __init4() {this.tokens = []} + + // Array of all observed scopes, ordered by their ending position. + __init5() {this.scopes = []} + + // The current position of the tokenizer in the input. + __init6() {this.pos = 0} + + // Information about the current token. + __init7() {this.type = tt.eof} + __init8() {this.contextualKeyword = ContextualKeyword.NONE} + __init9() {this.start = 0} + __init10() {this.end = 0} + + __init11() {this.isType = false} + __init12() {this.scopeDepth = 0} + + /** + * If the parser is in an error state, then the token is always tt.eof and all functions can + * keep executing but should be written so they don't get into an infinite loop in this situation. + * + * This approach, combined with the ability to snapshot and restore state, allows us to implement + * backtracking without exceptions and without needing to explicitly propagate error states + * everywhere. + */ + __init13() {this.error = null} + + snapshot() { + return new StateSnapshot( + this.potentialArrowAt, + this.noAnonFunctionType, + this.inDisallowConditionalTypesContext, + this.tokens.length, + this.scopes.length, + this.pos, + this.type, + this.contextualKeyword, + this.start, + this.end, + this.isType, + this.scopeDepth, + this.error, + ); + } + + restoreFromSnapshot(snapshot) { + this.potentialArrowAt = snapshot.potentialArrowAt; + this.noAnonFunctionType = snapshot.noAnonFunctionType; + this.inDisallowConditionalTypesContext = snapshot.inDisallowConditionalTypesContext; + this.tokens.length = snapshot.tokensLength; + this.scopes.length = snapshot.scopesLength; + this.pos = snapshot.pos; + this.type = snapshot.type; + this.contextualKeyword = snapshot.contextualKeyword; + this.start = snapshot.start; + this.end = snapshot.end; + this.isType = snapshot.isType; + this.scopeDepth = snapshot.scopeDepth; + this.error = snapshot.error; + } +} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/types.js b/node_modules/sucrase/dist/esm/parser/tokenizer/types.js new file mode 100644 index 0000000..9746ad6 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/tokenizer/types.js @@ -0,0 +1,361 @@ +// Generated file, do not edit! Run "yarn generate" to re-generate this file. +/* istanbul ignore file */ +/** + * Enum of all token types, with bit fields to signify meaningful properties. + */ +export var TokenType; (function (TokenType) { + // Precedence 0 means not an operator; otherwise it is a positive number up to 12. + const PRECEDENCE_MASK = 0xf; TokenType[TokenType["PRECEDENCE_MASK"] = PRECEDENCE_MASK] = "PRECEDENCE_MASK"; + const IS_KEYWORD = 1 << 4; TokenType[TokenType["IS_KEYWORD"] = IS_KEYWORD] = "IS_KEYWORD"; + const IS_ASSIGN = 1 << 5; TokenType[TokenType["IS_ASSIGN"] = IS_ASSIGN] = "IS_ASSIGN"; + const IS_RIGHT_ASSOCIATIVE = 1 << 6; TokenType[TokenType["IS_RIGHT_ASSOCIATIVE"] = IS_RIGHT_ASSOCIATIVE] = "IS_RIGHT_ASSOCIATIVE"; + const IS_PREFIX = 1 << 7; TokenType[TokenType["IS_PREFIX"] = IS_PREFIX] = "IS_PREFIX"; + const IS_POSTFIX = 1 << 8; TokenType[TokenType["IS_POSTFIX"] = IS_POSTFIX] = "IS_POSTFIX"; + const IS_EXPRESSION_START = 1 << 9; TokenType[TokenType["IS_EXPRESSION_START"] = IS_EXPRESSION_START] = "IS_EXPRESSION_START"; + + const num = 512; TokenType[TokenType["num"] = num] = "num"; // num startsExpr + const bigint = 1536; TokenType[TokenType["bigint"] = bigint] = "bigint"; // bigint startsExpr + const decimal = 2560; TokenType[TokenType["decimal"] = decimal] = "decimal"; // decimal startsExpr + const regexp = 3584; TokenType[TokenType["regexp"] = regexp] = "regexp"; // regexp startsExpr + const string = 4608; TokenType[TokenType["string"] = string] = "string"; // string startsExpr + const name = 5632; TokenType[TokenType["name"] = name] = "name"; // name startsExpr + const eof = 6144; TokenType[TokenType["eof"] = eof] = "eof"; // eof + const bracketL = 7680; TokenType[TokenType["bracketL"] = bracketL] = "bracketL"; // [ startsExpr + const bracketR = 8192; TokenType[TokenType["bracketR"] = bracketR] = "bracketR"; // ] + const braceL = 9728; TokenType[TokenType["braceL"] = braceL] = "braceL"; // { startsExpr + const braceBarL = 10752; TokenType[TokenType["braceBarL"] = braceBarL] = "braceBarL"; // {| startsExpr + const braceR = 11264; TokenType[TokenType["braceR"] = braceR] = "braceR"; // } + const braceBarR = 12288; TokenType[TokenType["braceBarR"] = braceBarR] = "braceBarR"; // |} + const parenL = 13824; TokenType[TokenType["parenL"] = parenL] = "parenL"; // ( startsExpr + const parenR = 14336; TokenType[TokenType["parenR"] = parenR] = "parenR"; // ) + const comma = 15360; TokenType[TokenType["comma"] = comma] = "comma"; // , + const semi = 16384; TokenType[TokenType["semi"] = semi] = "semi"; // ; + const colon = 17408; TokenType[TokenType["colon"] = colon] = "colon"; // : + const doubleColon = 18432; TokenType[TokenType["doubleColon"] = doubleColon] = "doubleColon"; // :: + const dot = 19456; TokenType[TokenType["dot"] = dot] = "dot"; // . + const question = 20480; TokenType[TokenType["question"] = question] = "question"; // ? + const questionDot = 21504; TokenType[TokenType["questionDot"] = questionDot] = "questionDot"; // ?. + const arrow = 22528; TokenType[TokenType["arrow"] = arrow] = "arrow"; // => + const template = 23552; TokenType[TokenType["template"] = template] = "template"; // template + const ellipsis = 24576; TokenType[TokenType["ellipsis"] = ellipsis] = "ellipsis"; // ... + const backQuote = 25600; TokenType[TokenType["backQuote"] = backQuote] = "backQuote"; // ` + const dollarBraceL = 27136; TokenType[TokenType["dollarBraceL"] = dollarBraceL] = "dollarBraceL"; // ${ startsExpr + const at = 27648; TokenType[TokenType["at"] = at] = "at"; // @ + const hash = 29184; TokenType[TokenType["hash"] = hash] = "hash"; // # startsExpr + const eq = 29728; TokenType[TokenType["eq"] = eq] = "eq"; // = isAssign + const assign = 30752; TokenType[TokenType["assign"] = assign] = "assign"; // _= isAssign + const preIncDec = 32640; TokenType[TokenType["preIncDec"] = preIncDec] = "preIncDec"; // ++/-- prefix postfix startsExpr + const postIncDec = 33664; TokenType[TokenType["postIncDec"] = postIncDec] = "postIncDec"; // ++/-- prefix postfix startsExpr + const bang = 34432; TokenType[TokenType["bang"] = bang] = "bang"; // ! prefix startsExpr + const tilde = 35456; TokenType[TokenType["tilde"] = tilde] = "tilde"; // ~ prefix startsExpr + const pipeline = 35841; TokenType[TokenType["pipeline"] = pipeline] = "pipeline"; // |> prec:1 + const nullishCoalescing = 36866; TokenType[TokenType["nullishCoalescing"] = nullishCoalescing] = "nullishCoalescing"; // ?? prec:2 + const logicalOR = 37890; TokenType[TokenType["logicalOR"] = logicalOR] = "logicalOR"; // || prec:2 + const logicalAND = 38915; TokenType[TokenType["logicalAND"] = logicalAND] = "logicalAND"; // && prec:3 + const bitwiseOR = 39940; TokenType[TokenType["bitwiseOR"] = bitwiseOR] = "bitwiseOR"; // | prec:4 + const bitwiseXOR = 40965; TokenType[TokenType["bitwiseXOR"] = bitwiseXOR] = "bitwiseXOR"; // ^ prec:5 + const bitwiseAND = 41990; TokenType[TokenType["bitwiseAND"] = bitwiseAND] = "bitwiseAND"; // & prec:6 + const equality = 43015; TokenType[TokenType["equality"] = equality] = "equality"; // ==/!= prec:7 + const lessThan = 44040; TokenType[TokenType["lessThan"] = lessThan] = "lessThan"; // < prec:8 + const greaterThan = 45064; TokenType[TokenType["greaterThan"] = greaterThan] = "greaterThan"; // > prec:8 + const relationalOrEqual = 46088; TokenType[TokenType["relationalOrEqual"] = relationalOrEqual] = "relationalOrEqual"; // <=/>= prec:8 + const bitShiftL = 47113; TokenType[TokenType["bitShiftL"] = bitShiftL] = "bitShiftL"; // << prec:9 + const bitShiftR = 48137; TokenType[TokenType["bitShiftR"] = bitShiftR] = "bitShiftR"; // >>/>>> prec:9 + const plus = 49802; TokenType[TokenType["plus"] = plus] = "plus"; // + prec:10 prefix startsExpr + const minus = 50826; TokenType[TokenType["minus"] = minus] = "minus"; // - prec:10 prefix startsExpr + const modulo = 51723; TokenType[TokenType["modulo"] = modulo] = "modulo"; // % prec:11 startsExpr + const star = 52235; TokenType[TokenType["star"] = star] = "star"; // * prec:11 + const slash = 53259; TokenType[TokenType["slash"] = slash] = "slash"; // / prec:11 + const exponent = 54348; TokenType[TokenType["exponent"] = exponent] = "exponent"; // ** prec:12 rightAssociative + const jsxName = 55296; TokenType[TokenType["jsxName"] = jsxName] = "jsxName"; // jsxName + const jsxText = 56320; TokenType[TokenType["jsxText"] = jsxText] = "jsxText"; // jsxText + const jsxEmptyText = 57344; TokenType[TokenType["jsxEmptyText"] = jsxEmptyText] = "jsxEmptyText"; // jsxEmptyText + const jsxTagStart = 58880; TokenType[TokenType["jsxTagStart"] = jsxTagStart] = "jsxTagStart"; // jsxTagStart startsExpr + const jsxTagEnd = 59392; TokenType[TokenType["jsxTagEnd"] = jsxTagEnd] = "jsxTagEnd"; // jsxTagEnd + const typeParameterStart = 60928; TokenType[TokenType["typeParameterStart"] = typeParameterStart] = "typeParameterStart"; // typeParameterStart startsExpr + const nonNullAssertion = 61440; TokenType[TokenType["nonNullAssertion"] = nonNullAssertion] = "nonNullAssertion"; // nonNullAssertion + const _break = 62480; TokenType[TokenType["_break"] = _break] = "_break"; // break keyword + const _case = 63504; TokenType[TokenType["_case"] = _case] = "_case"; // case keyword + const _catch = 64528; TokenType[TokenType["_catch"] = _catch] = "_catch"; // catch keyword + const _continue = 65552; TokenType[TokenType["_continue"] = _continue] = "_continue"; // continue keyword + const _debugger = 66576; TokenType[TokenType["_debugger"] = _debugger] = "_debugger"; // debugger keyword + const _default = 67600; TokenType[TokenType["_default"] = _default] = "_default"; // default keyword + const _do = 68624; TokenType[TokenType["_do"] = _do] = "_do"; // do keyword + const _else = 69648; TokenType[TokenType["_else"] = _else] = "_else"; // else keyword + const _finally = 70672; TokenType[TokenType["_finally"] = _finally] = "_finally"; // finally keyword + const _for = 71696; TokenType[TokenType["_for"] = _for] = "_for"; // for keyword + const _function = 73232; TokenType[TokenType["_function"] = _function] = "_function"; // function keyword startsExpr + const _if = 73744; TokenType[TokenType["_if"] = _if] = "_if"; // if keyword + const _return = 74768; TokenType[TokenType["_return"] = _return] = "_return"; // return keyword + const _switch = 75792; TokenType[TokenType["_switch"] = _switch] = "_switch"; // switch keyword + const _throw = 77456; TokenType[TokenType["_throw"] = _throw] = "_throw"; // throw keyword prefix startsExpr + const _try = 77840; TokenType[TokenType["_try"] = _try] = "_try"; // try keyword + const _var = 78864; TokenType[TokenType["_var"] = _var] = "_var"; // var keyword + const _let = 79888; TokenType[TokenType["_let"] = _let] = "_let"; // let keyword + const _const = 80912; TokenType[TokenType["_const"] = _const] = "_const"; // const keyword + const _while = 81936; TokenType[TokenType["_while"] = _while] = "_while"; // while keyword + const _with = 82960; TokenType[TokenType["_with"] = _with] = "_with"; // with keyword + const _new = 84496; TokenType[TokenType["_new"] = _new] = "_new"; // new keyword startsExpr + const _this = 85520; TokenType[TokenType["_this"] = _this] = "_this"; // this keyword startsExpr + const _super = 86544; TokenType[TokenType["_super"] = _super] = "_super"; // super keyword startsExpr + const _class = 87568; TokenType[TokenType["_class"] = _class] = "_class"; // class keyword startsExpr + const _extends = 88080; TokenType[TokenType["_extends"] = _extends] = "_extends"; // extends keyword + const _export = 89104; TokenType[TokenType["_export"] = _export] = "_export"; // export keyword + const _import = 90640; TokenType[TokenType["_import"] = _import] = "_import"; // import keyword startsExpr + const _yield = 91664; TokenType[TokenType["_yield"] = _yield] = "_yield"; // yield keyword startsExpr + const _null = 92688; TokenType[TokenType["_null"] = _null] = "_null"; // null keyword startsExpr + const _true = 93712; TokenType[TokenType["_true"] = _true] = "_true"; // true keyword startsExpr + const _false = 94736; TokenType[TokenType["_false"] = _false] = "_false"; // false keyword startsExpr + const _in = 95256; TokenType[TokenType["_in"] = _in] = "_in"; // in prec:8 keyword + const _instanceof = 96280; TokenType[TokenType["_instanceof"] = _instanceof] = "_instanceof"; // instanceof prec:8 keyword + const _typeof = 97936; TokenType[TokenType["_typeof"] = _typeof] = "_typeof"; // typeof keyword prefix startsExpr + const _void = 98960; TokenType[TokenType["_void"] = _void] = "_void"; // void keyword prefix startsExpr + const _delete = 99984; TokenType[TokenType["_delete"] = _delete] = "_delete"; // delete keyword prefix startsExpr + const _async = 100880; TokenType[TokenType["_async"] = _async] = "_async"; // async keyword startsExpr + const _get = 101904; TokenType[TokenType["_get"] = _get] = "_get"; // get keyword startsExpr + const _set = 102928; TokenType[TokenType["_set"] = _set] = "_set"; // set keyword startsExpr + const _declare = 103952; TokenType[TokenType["_declare"] = _declare] = "_declare"; // declare keyword startsExpr + const _readonly = 104976; TokenType[TokenType["_readonly"] = _readonly] = "_readonly"; // readonly keyword startsExpr + const _abstract = 106000; TokenType[TokenType["_abstract"] = _abstract] = "_abstract"; // abstract keyword startsExpr + const _static = 107024; TokenType[TokenType["_static"] = _static] = "_static"; // static keyword startsExpr + const _public = 107536; TokenType[TokenType["_public"] = _public] = "_public"; // public keyword + const _private = 108560; TokenType[TokenType["_private"] = _private] = "_private"; // private keyword + const _protected = 109584; TokenType[TokenType["_protected"] = _protected] = "_protected"; // protected keyword + const _override = 110608; TokenType[TokenType["_override"] = _override] = "_override"; // override keyword + const _as = 112144; TokenType[TokenType["_as"] = _as] = "_as"; // as keyword startsExpr + const _enum = 113168; TokenType[TokenType["_enum"] = _enum] = "_enum"; // enum keyword startsExpr + const _type = 114192; TokenType[TokenType["_type"] = _type] = "_type"; // type keyword startsExpr + const _implements = 115216; TokenType[TokenType["_implements"] = _implements] = "_implements"; // implements keyword startsExpr +})(TokenType || (TokenType = {})); +export function formatTokenType(tokenType) { + switch (tokenType) { + case TokenType.num: + return "num"; + case TokenType.bigint: + return "bigint"; + case TokenType.decimal: + return "decimal"; + case TokenType.regexp: + return "regexp"; + case TokenType.string: + return "string"; + case TokenType.name: + return "name"; + case TokenType.eof: + return "eof"; + case TokenType.bracketL: + return "["; + case TokenType.bracketR: + return "]"; + case TokenType.braceL: + return "{"; + case TokenType.braceBarL: + return "{|"; + case TokenType.braceR: + return "}"; + case TokenType.braceBarR: + return "|}"; + case TokenType.parenL: + return "("; + case TokenType.parenR: + return ")"; + case TokenType.comma: + return ","; + case TokenType.semi: + return ";"; + case TokenType.colon: + return ":"; + case TokenType.doubleColon: + return "::"; + case TokenType.dot: + return "."; + case TokenType.question: + return "?"; + case TokenType.questionDot: + return "?."; + case TokenType.arrow: + return "=>"; + case TokenType.template: + return "template"; + case TokenType.ellipsis: + return "..."; + case TokenType.backQuote: + return "`"; + case TokenType.dollarBraceL: + return "${"; + case TokenType.at: + return "@"; + case TokenType.hash: + return "#"; + case TokenType.eq: + return "="; + case TokenType.assign: + return "_="; + case TokenType.preIncDec: + return "++/--"; + case TokenType.postIncDec: + return "++/--"; + case TokenType.bang: + return "!"; + case TokenType.tilde: + return "~"; + case TokenType.pipeline: + return "|>"; + case TokenType.nullishCoalescing: + return "??"; + case TokenType.logicalOR: + return "||"; + case TokenType.logicalAND: + return "&&"; + case TokenType.bitwiseOR: + return "|"; + case TokenType.bitwiseXOR: + return "^"; + case TokenType.bitwiseAND: + return "&"; + case TokenType.equality: + return "==/!="; + case TokenType.lessThan: + return "<"; + case TokenType.greaterThan: + return ">"; + case TokenType.relationalOrEqual: + return "<=/>="; + case TokenType.bitShiftL: + return "<<"; + case TokenType.bitShiftR: + return ">>/>>>"; + case TokenType.plus: + return "+"; + case TokenType.minus: + return "-"; + case TokenType.modulo: + return "%"; + case TokenType.star: + return "*"; + case TokenType.slash: + return "/"; + case TokenType.exponent: + return "**"; + case TokenType.jsxName: + return "jsxName"; + case TokenType.jsxText: + return "jsxText"; + case TokenType.jsxEmptyText: + return "jsxEmptyText"; + case TokenType.jsxTagStart: + return "jsxTagStart"; + case TokenType.jsxTagEnd: + return "jsxTagEnd"; + case TokenType.typeParameterStart: + return "typeParameterStart"; + case TokenType.nonNullAssertion: + return "nonNullAssertion"; + case TokenType._break: + return "break"; + case TokenType._case: + return "case"; + case TokenType._catch: + return "catch"; + case TokenType._continue: + return "continue"; + case TokenType._debugger: + return "debugger"; + case TokenType._default: + return "default"; + case TokenType._do: + return "do"; + case TokenType._else: + return "else"; + case TokenType._finally: + return "finally"; + case TokenType._for: + return "for"; + case TokenType._function: + return "function"; + case TokenType._if: + return "if"; + case TokenType._return: + return "return"; + case TokenType._switch: + return "switch"; + case TokenType._throw: + return "throw"; + case TokenType._try: + return "try"; + case TokenType._var: + return "var"; + case TokenType._let: + return "let"; + case TokenType._const: + return "const"; + case TokenType._while: + return "while"; + case TokenType._with: + return "with"; + case TokenType._new: + return "new"; + case TokenType._this: + return "this"; + case TokenType._super: + return "super"; + case TokenType._class: + return "class"; + case TokenType._extends: + return "extends"; + case TokenType._export: + return "export"; + case TokenType._import: + return "import"; + case TokenType._yield: + return "yield"; + case TokenType._null: + return "null"; + case TokenType._true: + return "true"; + case TokenType._false: + return "false"; + case TokenType._in: + return "in"; + case TokenType._instanceof: + return "instanceof"; + case TokenType._typeof: + return "typeof"; + case TokenType._void: + return "void"; + case TokenType._delete: + return "delete"; + case TokenType._async: + return "async"; + case TokenType._get: + return "get"; + case TokenType._set: + return "set"; + case TokenType._declare: + return "declare"; + case TokenType._readonly: + return "readonly"; + case TokenType._abstract: + return "abstract"; + case TokenType._static: + return "static"; + case TokenType._public: + return "public"; + case TokenType._private: + return "private"; + case TokenType._protected: + return "protected"; + case TokenType._override: + return "override"; + case TokenType._as: + return "as"; + case TokenType._enum: + return "enum"; + case TokenType._type: + return "type"; + case TokenType._implements: + return "implements"; + default: + return ""; + } +} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/base.js b/node_modules/sucrase/dist/esm/parser/traverser/base.js new file mode 100644 index 0000000..df24ff7 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/traverser/base.js @@ -0,0 +1,60 @@ +import State from "../tokenizer/state"; +import {charCodes} from "../util/charcodes"; + +export let isJSXEnabled; +export let isTypeScriptEnabled; +export let isFlowEnabled; +export let state; +export let input; +export let nextContextId; + +export function getNextContextId() { + return nextContextId++; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function augmentError(error) { + if ("pos" in error) { + const loc = locationForIndex(error.pos); + error.message += ` (${loc.line}:${loc.column})`; + error.loc = loc; + } + return error; +} + +export class Loc { + + + constructor(line, column) { + this.line = line; + this.column = column; + } +} + +export function locationForIndex(pos) { + let line = 1; + let column = 1; + for (let i = 0; i < pos; i++) { + if (input.charCodeAt(i) === charCodes.lineFeed) { + line++; + column = 1; + } else { + column++; + } + } + return new Loc(line, column); +} + +export function initParser( + inputCode, + isJSXEnabledArg, + isTypeScriptEnabledArg, + isFlowEnabledArg, +) { + input = inputCode; + state = new State(); + nextContextId = 1; + isJSXEnabled = isJSXEnabledArg; + isTypeScriptEnabled = isTypeScriptEnabledArg; + isFlowEnabled = isFlowEnabledArg; +} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/expression.js b/node_modules/sucrase/dist/esm/parser/traverser/expression.js new file mode 100644 index 0000000..aa6717f --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/traverser/expression.js @@ -0,0 +1,1022 @@ +/* eslint max-len: 0 */ + +// A recursive descent parser operates by defining functions for all +// syntactic elements, and recursively calling those, each function +// advancing the input stream and returning an AST node. Precedence +// of constructs (for example, the fact that `!x[1]` means `!(x[1])` +// instead of `(!x)[1]` is handled by the fact that the parser +// function that parses unary prefix operators is called first, and +// in turn calls the function that parses `[]` subscripts — that +// way, it'll receive the node for `x[1]` already parsed, and wraps +// *that* in the unary operator node. +// +// Acorn uses an [operator precedence parser][opp] to handle binary +// operator precedence, because it is much more compact than using +// the technique outlined above, which uses different, nesting +// functions to specify precedence, for all of the ten binary +// precedence levels that JavaScript defines. +// +// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + +import { + flowParseArrow, + flowParseFunctionBodyAndFinish, + flowParseMaybeAssign, + flowParseSubscript, + flowParseSubscripts, + flowParseVariance, + flowStartParseAsyncArrowFromCallExpression, + flowStartParseNewArguments, + flowStartParseObjPropValue, +} from "../plugins/flow"; +import {jsxParseElement} from "../plugins/jsx/index"; +import {typedParseConditional, typedParseParenItem} from "../plugins/types"; +import { + tsParseArrow, + tsParseFunctionBodyAndFinish, + tsParseMaybeAssign, + tsParseSubscript, + tsParseType, + tsParseTypeAssertion, + tsStartParseAsyncArrowFromCallExpression, + tsStartParseObjPropValue, +} from "../plugins/typescript"; +import { + eat, + IdentifierRole, + lookaheadCharCode, + lookaheadType, + match, + next, + nextTemplateToken, + popTypeContext, + pushTypeContext, + rescan_gt, + retokenizeSlashAsRegex, +} from "../tokenizer/index"; +import {ContextualKeyword} from "../tokenizer/keywords"; +import {Scope} from "../tokenizer/state"; +import {TokenType, TokenType as tt} from "../tokenizer/types"; +import {charCodes} from "../util/charcodes"; +import {IS_IDENTIFIER_START} from "../util/identifier"; +import {getNextContextId, isFlowEnabled, isJSXEnabled, isTypeScriptEnabled, state} from "./base"; +import { + markPriorBindingIdentifier, + parseBindingIdentifier, + parseMaybeDefault, + parseRest, + parseSpread, +} from "./lval"; +import { + parseBlock, + parseBlockBody, + parseClass, + parseDecorators, + parseFunction, + parseFunctionParams, +} from "./statement"; +import { + canInsertSemicolon, + eatContextual, + expect, + expectContextual, + hasFollowingLineBreak, + hasPrecedingLineBreak, + isContextual, + unexpected, +} from "./util"; + +export class StopState { + + constructor(stop) { + this.stop = stop; + } +} + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function (s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. +export function parseExpression(noIn = false) { + parseMaybeAssign(noIn); + if (match(tt.comma)) { + while (eat(tt.comma)) { + parseMaybeAssign(noIn); + } + } +} + +/** + * noIn is used when parsing a for loop so that we don't interpret a following "in" as the binary + * operatior. + * isWithinParens is used to indicate that we're parsing something that might be a comma expression + * or might be an arrow function or might be a Flow type assertion (which requires explicit parens). + * In these cases, we should allow : and ?: after the initial "left" part. + */ +export function parseMaybeAssign(noIn = false, isWithinParens = false) { + if (isTypeScriptEnabled) { + return tsParseMaybeAssign(noIn, isWithinParens); + } else if (isFlowEnabled) { + return flowParseMaybeAssign(noIn, isWithinParens); + } else { + return baseParseMaybeAssign(noIn, isWithinParens); + } +} + +// Parse an assignment expression. This includes applications of +// operators like `+=`. +// Returns true if the expression was an arrow function. +export function baseParseMaybeAssign(noIn, isWithinParens) { + if (match(tt._yield)) { + parseYield(); + return false; + } + + if (match(tt.parenL) || match(tt.name) || match(tt._yield)) { + state.potentialArrowAt = state.start; + } + + const wasArrow = parseMaybeConditional(noIn); + if (isWithinParens) { + parseParenItem(); + } + if (state.type & TokenType.IS_ASSIGN) { + next(); + parseMaybeAssign(noIn); + return false; + } + return wasArrow; +} + +// Parse a ternary conditional (`?:`) operator. +// Returns true if the expression was an arrow function. +function parseMaybeConditional(noIn) { + const wasArrow = parseExprOps(noIn); + if (wasArrow) { + return true; + } + parseConditional(noIn); + return false; +} + +function parseConditional(noIn) { + if (isTypeScriptEnabled || isFlowEnabled) { + typedParseConditional(noIn); + } else { + baseParseConditional(noIn); + } +} + +export function baseParseConditional(noIn) { + if (eat(tt.question)) { + parseMaybeAssign(); + expect(tt.colon); + parseMaybeAssign(noIn); + } +} + +// Start the precedence parser. +// Returns true if this was an arrow function +function parseExprOps(noIn) { + const startTokenIndex = state.tokens.length; + const wasArrow = parseMaybeUnary(); + if (wasArrow) { + return true; + } + parseExprOp(startTokenIndex, -1, noIn); + return false; +} + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. +function parseExprOp(startTokenIndex, minPrec, noIn) { + if ( + isTypeScriptEnabled && + (tt._in & TokenType.PRECEDENCE_MASK) > minPrec && + !hasPrecedingLineBreak() && + (eatContextual(ContextualKeyword._as) || eatContextual(ContextualKeyword._satisfies)) + ) { + const oldIsType = pushTypeContext(1); + tsParseType(); + popTypeContext(oldIsType); + rescan_gt(); + parseExprOp(startTokenIndex, minPrec, noIn); + return; + } + + const prec = state.type & TokenType.PRECEDENCE_MASK; + if (prec > 0 && (!noIn || !match(tt._in))) { + if (prec > minPrec) { + const op = state.type; + next(); + if (op === tt.nullishCoalescing) { + state.tokens[state.tokens.length - 1].nullishStartIndex = startTokenIndex; + } + + const rhsStartTokenIndex = state.tokens.length; + parseMaybeUnary(); + // Extend the right operand of this operator if possible. + parseExprOp(rhsStartTokenIndex, op & TokenType.IS_RIGHT_ASSOCIATIVE ? prec - 1 : prec, noIn); + if (op === tt.nullishCoalescing) { + state.tokens[startTokenIndex].numNullishCoalesceStarts++; + state.tokens[state.tokens.length - 1].numNullishCoalesceEnds++; + } + // Continue with any future operator holding this expression as the left operand. + parseExprOp(startTokenIndex, minPrec, noIn); + } + } +} + +// Parse unary operators, both prefix and postfix. +// Returns true if this was an arrow function. +export function parseMaybeUnary() { + if (isTypeScriptEnabled && !isJSXEnabled && eat(tt.lessThan)) { + tsParseTypeAssertion(); + return false; + } + if ( + isContextual(ContextualKeyword._module) && + lookaheadCharCode() === charCodes.leftCurlyBrace && + !hasFollowingLineBreak() + ) { + parseModuleExpression(); + return false; + } + if (state.type & TokenType.IS_PREFIX) { + next(); + parseMaybeUnary(); + return false; + } + + const wasArrow = parseExprSubscripts(); + if (wasArrow) { + return true; + } + while (state.type & TokenType.IS_POSTFIX && !canInsertSemicolon()) { + // The tokenizer calls everything a preincrement, so make it a postincrement when + // we see it in that context. + if (state.type === tt.preIncDec) { + state.type = tt.postIncDec; + } + next(); + } + return false; +} + +// Parse call, dot, and `[]`-subscript expressions. +// Returns true if this was an arrow function. +export function parseExprSubscripts() { + const startTokenIndex = state.tokens.length; + const wasArrow = parseExprAtom(); + if (wasArrow) { + return true; + } + parseSubscripts(startTokenIndex); + // If there was any optional chain operation, the start token would be marked + // as such, so also mark the end now. + if (state.tokens.length > startTokenIndex && state.tokens[startTokenIndex].isOptionalChainStart) { + state.tokens[state.tokens.length - 1].isOptionalChainEnd = true; + } + return false; +} + +function parseSubscripts(startTokenIndex, noCalls = false) { + if (isFlowEnabled) { + flowParseSubscripts(startTokenIndex, noCalls); + } else { + baseParseSubscripts(startTokenIndex, noCalls); + } +} + +export function baseParseSubscripts(startTokenIndex, noCalls = false) { + const stopState = new StopState(false); + do { + parseSubscript(startTokenIndex, noCalls, stopState); + } while (!stopState.stop && !state.error); +} + +function parseSubscript(startTokenIndex, noCalls, stopState) { + if (isTypeScriptEnabled) { + tsParseSubscript(startTokenIndex, noCalls, stopState); + } else if (isFlowEnabled) { + flowParseSubscript(startTokenIndex, noCalls, stopState); + } else { + baseParseSubscript(startTokenIndex, noCalls, stopState); + } +} + +/** Set 'state.stop = true' to indicate that we should stop parsing subscripts. */ +export function baseParseSubscript( + startTokenIndex, + noCalls, + stopState, +) { + if (!noCalls && eat(tt.doubleColon)) { + parseNoCallExpr(); + stopState.stop = true; + // Propagate startTokenIndex so that `a::b?.()` will keep `a` as the first token. We may want + // to revisit this in the future when fully supporting bind syntax. + parseSubscripts(startTokenIndex, noCalls); + } else if (match(tt.questionDot)) { + state.tokens[startTokenIndex].isOptionalChainStart = true; + if (noCalls && lookaheadType() === tt.parenL) { + stopState.stop = true; + return; + } + next(); + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + + if (eat(tt.bracketL)) { + parseExpression(); + expect(tt.bracketR); + } else if (eat(tt.parenL)) { + parseCallExpressionArguments(); + } else { + parseMaybePrivateName(); + } + } else if (eat(tt.dot)) { + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + parseMaybePrivateName(); + } else if (eat(tt.bracketL)) { + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + parseExpression(); + expect(tt.bracketR); + } else if (!noCalls && match(tt.parenL)) { + if (atPossibleAsync()) { + // We see "async", but it's possible it's a usage of the name "async". Parse as if it's a + // function call, and if we see an arrow later, backtrack and re-parse as a parameter list. + const snapshot = state.snapshot(); + const asyncStartTokenIndex = state.tokens.length; + next(); + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + + const callContextId = getNextContextId(); + + state.tokens[state.tokens.length - 1].contextId = callContextId; + parseCallExpressionArguments(); + state.tokens[state.tokens.length - 1].contextId = callContextId; + + if (shouldParseAsyncArrow()) { + // We hit an arrow, so backtrack and start again parsing function parameters. + state.restoreFromSnapshot(snapshot); + stopState.stop = true; + state.scopeDepth++; + + parseFunctionParams(); + parseAsyncArrowFromCallExpression(asyncStartTokenIndex); + } + } else { + next(); + state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + const callContextId = getNextContextId(); + state.tokens[state.tokens.length - 1].contextId = callContextId; + parseCallExpressionArguments(); + state.tokens[state.tokens.length - 1].contextId = callContextId; + } + } else if (match(tt.backQuote)) { + // Tagged template expression. + parseTemplate(); + } else { + stopState.stop = true; + } +} + +export function atPossibleAsync() { + // This was made less strict than the original version to avoid passing around nodes, but it + // should be safe to have rare false positives here. + return ( + state.tokens[state.tokens.length - 1].contextualKeyword === ContextualKeyword._async && + !canInsertSemicolon() + ); +} + +export function parseCallExpressionArguments() { + let first = true; + while (!eat(tt.parenR) && !state.error) { + if (first) { + first = false; + } else { + expect(tt.comma); + if (eat(tt.parenR)) { + break; + } + } + + parseExprListItem(false); + } +} + +function shouldParseAsyncArrow() { + return match(tt.colon) || match(tt.arrow); +} + +function parseAsyncArrowFromCallExpression(startTokenIndex) { + if (isTypeScriptEnabled) { + tsStartParseAsyncArrowFromCallExpression(); + } else if (isFlowEnabled) { + flowStartParseAsyncArrowFromCallExpression(); + } + expect(tt.arrow); + parseArrowExpression(startTokenIndex); +} + +// Parse a no-call expression (like argument of `new` or `::` operators). + +function parseNoCallExpr() { + const startTokenIndex = state.tokens.length; + parseExprAtom(); + parseSubscripts(startTokenIndex, true); +} + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. +// Returns true if the parsed expression was an arrow function. +export function parseExprAtom() { + if (eat(tt.modulo)) { + // V8 intrinsic expression. Just parse the identifier, and the function invocation is parsed + // naturally. + parseIdentifier(); + return false; + } + + if (match(tt.jsxText) || match(tt.jsxEmptyText)) { + parseLiteral(); + return false; + } else if (match(tt.lessThan) && isJSXEnabled) { + state.type = tt.jsxTagStart; + jsxParseElement(); + next(); + return false; + } + + const canBeArrow = state.potentialArrowAt === state.start; + switch (state.type) { + case tt.slash: + case tt.assign: + retokenizeSlashAsRegex(); + // Fall through. + + case tt._super: + case tt._this: + case tt.regexp: + case tt.num: + case tt.bigint: + case tt.decimal: + case tt.string: + case tt._null: + case tt._true: + case tt._false: + next(); + return false; + + case tt._import: + next(); + if (match(tt.dot)) { + // import.meta + state.tokens[state.tokens.length - 1].type = tt.name; + next(); + parseIdentifier(); + } + return false; + + case tt.name: { + const startTokenIndex = state.tokens.length; + const functionStart = state.start; + const contextualKeyword = state.contextualKeyword; + parseIdentifier(); + if (contextualKeyword === ContextualKeyword._await) { + parseAwait(); + return false; + } else if ( + contextualKeyword === ContextualKeyword._async && + match(tt._function) && + !canInsertSemicolon() + ) { + next(); + parseFunction(functionStart, false); + return false; + } else if ( + canBeArrow && + contextualKeyword === ContextualKeyword._async && + !canInsertSemicolon() && + match(tt.name) + ) { + state.scopeDepth++; + parseBindingIdentifier(false); + expect(tt.arrow); + // let foo = async bar => {}; + parseArrowExpression(startTokenIndex); + return true; + } else if (match(tt._do) && !canInsertSemicolon()) { + next(); + parseBlock(); + return false; + } + + if (canBeArrow && !canInsertSemicolon() && match(tt.arrow)) { + state.scopeDepth++; + markPriorBindingIdentifier(false); + expect(tt.arrow); + parseArrowExpression(startTokenIndex); + return true; + } + + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.Access; + return false; + } + + case tt._do: { + next(); + parseBlock(); + return false; + } + + case tt.parenL: { + const wasArrow = parseParenAndDistinguishExpression(canBeArrow); + return wasArrow; + } + + case tt.bracketL: + next(); + parseExprList(tt.bracketR, true); + return false; + + case tt.braceL: + parseObj(false, false); + return false; + + case tt._function: + parseFunctionExpression(); + return false; + + case tt.at: + parseDecorators(); + // Fall through. + + case tt._class: + parseClass(false); + return false; + + case tt._new: + parseNew(); + return false; + + case tt.backQuote: + parseTemplate(); + return false; + + case tt.doubleColon: { + next(); + parseNoCallExpr(); + return false; + } + + case tt.hash: { + const code = lookaheadCharCode(); + if (IS_IDENTIFIER_START[code] || code === charCodes.backslash) { + parseMaybePrivateName(); + } else { + next(); + } + // Smart pipeline topic reference. + return false; + } + + default: + unexpected(); + return false; + } +} + +function parseMaybePrivateName() { + eat(tt.hash); + parseIdentifier(); +} + +function parseFunctionExpression() { + const functionStart = state.start; + parseIdentifier(); + if (eat(tt.dot)) { + // function.sent + parseIdentifier(); + } + parseFunction(functionStart, false); +} + +export function parseLiteral() { + next(); +} + +export function parseParenExpression() { + expect(tt.parenL); + parseExpression(); + expect(tt.parenR); +} + +// Returns true if this was an arrow expression. +function parseParenAndDistinguishExpression(canBeArrow) { + // Assume this is a normal parenthesized expression, but if we see an arrow, we'll bail and + // start over as a parameter list. + const snapshot = state.snapshot(); + + const startTokenIndex = state.tokens.length; + expect(tt.parenL); + + let first = true; + + while (!match(tt.parenR) && !state.error) { + if (first) { + first = false; + } else { + expect(tt.comma); + if (match(tt.parenR)) { + break; + } + } + + if (match(tt.ellipsis)) { + parseRest(false /* isBlockScope */); + parseParenItem(); + break; + } else { + parseMaybeAssign(false, true); + } + } + + expect(tt.parenR); + + if (canBeArrow && shouldParseArrow()) { + const wasArrow = parseArrow(); + if (wasArrow) { + // It was an arrow function this whole time, so start over and parse it as params so that we + // get proper token annotations. + state.restoreFromSnapshot(snapshot); + state.scopeDepth++; + // Don't specify a context ID because arrow functions don't need a context ID. + parseFunctionParams(); + parseArrow(); + parseArrowExpression(startTokenIndex); + if (state.error) { + // Nevermind! This must have been something that looks very much like an + // arrow function but where its "parameter list" isn't actually a valid + // parameter list. Force non-arrow parsing. + // See https://github.com/alangpierce/sucrase/issues/666 for an example. + state.restoreFromSnapshot(snapshot); + parseParenAndDistinguishExpression(false); + return false; + } + return true; + } + } + + return false; +} + +function shouldParseArrow() { + return match(tt.colon) || !canInsertSemicolon(); +} + +// Returns whether there was an arrow token. +export function parseArrow() { + if (isTypeScriptEnabled) { + return tsParseArrow(); + } else if (isFlowEnabled) { + return flowParseArrow(); + } else { + return eat(tt.arrow); + } +} + +function parseParenItem() { + if (isTypeScriptEnabled || isFlowEnabled) { + typedParseParenItem(); + } +} + +// New's precedence is slightly tricky. It must allow its argument to +// be a `[]` or dot subscript expression, but not a call — at least, +// not without wrapping it in parentheses. Thus, it uses the noCalls +// argument to parseSubscripts to prevent it from consuming the +// argument list. +function parseNew() { + expect(tt._new); + if (eat(tt.dot)) { + // new.target + parseIdentifier(); + return; + } + parseNewCallee(); + if (isFlowEnabled) { + flowStartParseNewArguments(); + } + if (eat(tt.parenL)) { + parseExprList(tt.parenR); + } +} + +function parseNewCallee() { + parseNoCallExpr(); + eat(tt.questionDot); +} + +export function parseTemplate() { + // Finish `, read quasi + nextTemplateToken(); + // Finish quasi, read ${ + nextTemplateToken(); + while (!match(tt.backQuote) && !state.error) { + expect(tt.dollarBraceL); + parseExpression(); + // Finish }, read quasi + nextTemplateToken(); + // Finish quasi, read either ${ or ` + nextTemplateToken(); + } + next(); +} + +// Parse an object literal or binding pattern. +export function parseObj(isPattern, isBlockScope) { + // Attach a context ID to the object open and close brace and each object key. + const contextId = getNextContextId(); + let first = true; + + next(); + state.tokens[state.tokens.length - 1].contextId = contextId; + + while (!eat(tt.braceR) && !state.error) { + if (first) { + first = false; + } else { + expect(tt.comma); + if (eat(tt.braceR)) { + break; + } + } + + let isGenerator = false; + if (match(tt.ellipsis)) { + const previousIndex = state.tokens.length; + parseSpread(); + if (isPattern) { + // Mark role when the only thing being spread over is an identifier. + if (state.tokens.length === previousIndex + 2) { + markPriorBindingIdentifier(isBlockScope); + } + if (eat(tt.braceR)) { + break; + } + } + continue; + } + + if (!isPattern) { + isGenerator = eat(tt.star); + } + + if (!isPattern && isContextual(ContextualKeyword._async)) { + if (isGenerator) unexpected(); + + parseIdentifier(); + if ( + match(tt.colon) || + match(tt.parenL) || + match(tt.braceR) || + match(tt.eq) || + match(tt.comma) + ) { + // This is a key called "async" rather than an async function. + } else { + if (match(tt.star)) { + next(); + isGenerator = true; + } + parsePropertyName(contextId); + } + } else { + parsePropertyName(contextId); + } + + parseObjPropValue(isPattern, isBlockScope, contextId); + } + + state.tokens[state.tokens.length - 1].contextId = contextId; +} + +function isGetterOrSetterMethod(isPattern) { + // We go off of the next and don't bother checking if the node key is actually "get" or "set". + // This lets us avoid generating a node, and should only make the validation worse. + return ( + !isPattern && + (match(tt.string) || // get "string"() {} + match(tt.num) || // get 1() {} + match(tt.bracketL) || // get ["string"]() {} + match(tt.name) || // get foo() {} + !!(state.type & TokenType.IS_KEYWORD)) // get debugger() {} + ); +} + +// Returns true if this was a method. +function parseObjectMethod(isPattern, objectContextId) { + // We don't need to worry about modifiers because object methods can't have optional bodies, so + // the start will never be used. + const functionStart = state.start; + if (match(tt.parenL)) { + if (isPattern) unexpected(); + parseMethod(functionStart, /* isConstructor */ false); + return true; + } + + if (isGetterOrSetterMethod(isPattern)) { + parsePropertyName(objectContextId); + parseMethod(functionStart, /* isConstructor */ false); + return true; + } + return false; +} + +function parseObjectProperty(isPattern, isBlockScope) { + if (eat(tt.colon)) { + if (isPattern) { + parseMaybeDefault(isBlockScope); + } else { + parseMaybeAssign(false); + } + return; + } + + // Since there's no colon, we assume this is an object shorthand. + + // If we're in a destructuring, we've now discovered that the key was actually an assignee, so + // we need to tag it as a declaration with the appropriate scope. Otherwise, we might need to + // transform it on access, so mark it as a normal object shorthand. + let identifierRole; + if (isPattern) { + if (state.scopeDepth === 0) { + identifierRole = IdentifierRole.ObjectShorthandTopLevelDeclaration; + } else if (isBlockScope) { + identifierRole = IdentifierRole.ObjectShorthandBlockScopedDeclaration; + } else { + identifierRole = IdentifierRole.ObjectShorthandFunctionScopedDeclaration; + } + } else { + identifierRole = IdentifierRole.ObjectShorthand; + } + state.tokens[state.tokens.length - 1].identifierRole = identifierRole; + + // Regardless of whether we know this to be a pattern or if we're in an ambiguous context, allow + // parsing as if there's a default value. + parseMaybeDefault(isBlockScope, true); +} + +function parseObjPropValue( + isPattern, + isBlockScope, + objectContextId, +) { + if (isTypeScriptEnabled) { + tsStartParseObjPropValue(); + } else if (isFlowEnabled) { + flowStartParseObjPropValue(); + } + const wasMethod = parseObjectMethod(isPattern, objectContextId); + if (!wasMethod) { + parseObjectProperty(isPattern, isBlockScope); + } +} + +export function parsePropertyName(objectContextId) { + if (isFlowEnabled) { + flowParseVariance(); + } + if (eat(tt.bracketL)) { + state.tokens[state.tokens.length - 1].contextId = objectContextId; + parseMaybeAssign(); + expect(tt.bracketR); + state.tokens[state.tokens.length - 1].contextId = objectContextId; + } else { + if (match(tt.num) || match(tt.string) || match(tt.bigint) || match(tt.decimal)) { + parseExprAtom(); + } else { + parseMaybePrivateName(); + } + + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ObjectKey; + state.tokens[state.tokens.length - 1].contextId = objectContextId; + } +} + +// Parse object or class method. +export function parseMethod(functionStart, isConstructor) { + const funcContextId = getNextContextId(); + + state.scopeDepth++; + const startTokenIndex = state.tokens.length; + const allowModifiers = isConstructor; // For TypeScript parameter properties + parseFunctionParams(allowModifiers, funcContextId); + parseFunctionBodyAndFinish(functionStart, funcContextId); + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true)); + state.scopeDepth--; +} + +// Parse arrow function expression. +// If the parameters are provided, they will be converted to an +// assignable list. +export function parseArrowExpression(startTokenIndex) { + parseFunctionBody(true); + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true)); + state.scopeDepth--; +} + +export function parseFunctionBodyAndFinish(functionStart, funcContextId = 0) { + if (isTypeScriptEnabled) { + tsParseFunctionBodyAndFinish(functionStart, funcContextId); + } else if (isFlowEnabled) { + flowParseFunctionBodyAndFinish(funcContextId); + } else { + parseFunctionBody(false, funcContextId); + } +} + +export function parseFunctionBody(allowExpression, funcContextId = 0) { + const isExpression = allowExpression && !match(tt.braceL); + + if (isExpression) { + parseMaybeAssign(); + } else { + parseBlock(true /* isFunctionScope */, funcContextId); + } +} + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +function parseExprList(close, allowEmpty = false) { + let first = true; + while (!eat(close) && !state.error) { + if (first) { + first = false; + } else { + expect(tt.comma); + if (eat(close)) break; + } + parseExprListItem(allowEmpty); + } +} + +function parseExprListItem(allowEmpty) { + if (allowEmpty && match(tt.comma)) { + // Empty item; nothing more to parse for this item. + } else if (match(tt.ellipsis)) { + parseSpread(); + parseParenItem(); + } else if (match(tt.question)) { + // Partial function application proposal. + next(); + } else { + parseMaybeAssign(false, true); + } +} + +// Parse the next token as an identifier. +export function parseIdentifier() { + next(); + state.tokens[state.tokens.length - 1].type = tt.name; +} + +// Parses await expression inside async function. +function parseAwait() { + parseMaybeUnary(); +} + +// Parses yield expression inside generator. +function parseYield() { + next(); + if (!match(tt.semi) && !canInsertSemicolon()) { + eat(tt.star); + parseMaybeAssign(); + } +} + +// https://github.com/tc39/proposal-js-module-blocks +function parseModuleExpression() { + expectContextual(ContextualKeyword._module); + expect(tt.braceL); + // For now, just call parseBlockBody to parse the block. In the future when we + // implement full support, we'll want to emit scopes and possibly other + // information. + parseBlockBody(tt.braceR); +} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/index.js b/node_modules/sucrase/dist/esm/parser/traverser/index.js new file mode 100644 index 0000000..eb8c990 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/traverser/index.js @@ -0,0 +1,18 @@ + +import {nextToken, skipLineComment} from "../tokenizer/index"; +import {charCodes} from "../util/charcodes"; +import {input, state} from "./base"; +import {parseTopLevel} from "./statement"; + +export function parseFile() { + // If enabled, skip leading hashbang line. + if ( + state.pos === 0 && + input.charCodeAt(0) === charCodes.numberSign && + input.charCodeAt(1) === charCodes.exclamationMark + ) { + skipLineComment(2); + } + nextToken(); + return parseTopLevel(); +} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/lval.js b/node_modules/sucrase/dist/esm/parser/traverser/lval.js new file mode 100644 index 0000000..f5c4855 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/traverser/lval.js @@ -0,0 +1,159 @@ +import {flowParseAssignableListItemTypes} from "../plugins/flow"; +import {tsParseAssignableListItemTypes, tsParseModifiers} from "../plugins/typescript"; +import { + eat, + IdentifierRole, + match, + next, + popTypeContext, + pushTypeContext, +} from "../tokenizer/index"; +import {ContextualKeyword} from "../tokenizer/keywords"; +import {TokenType, TokenType as tt} from "../tokenizer/types"; +import {isFlowEnabled, isTypeScriptEnabled, state} from "./base"; +import {parseIdentifier, parseMaybeAssign, parseObj} from "./expression"; +import {expect, unexpected} from "./util"; + +export function parseSpread() { + next(); + parseMaybeAssign(false); +} + +export function parseRest(isBlockScope) { + next(); + parseBindingAtom(isBlockScope); +} + +export function parseBindingIdentifier(isBlockScope) { + parseIdentifier(); + markPriorBindingIdentifier(isBlockScope); +} + +export function parseImportedIdentifier() { + parseIdentifier(); + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; +} + +export function markPriorBindingIdentifier(isBlockScope) { + let identifierRole; + if (state.scopeDepth === 0) { + identifierRole = IdentifierRole.TopLevelDeclaration; + } else if (isBlockScope) { + identifierRole = IdentifierRole.BlockScopedDeclaration; + } else { + identifierRole = IdentifierRole.FunctionScopedDeclaration; + } + state.tokens[state.tokens.length - 1].identifierRole = identifierRole; +} + +// Parses lvalue (assignable) atom. +export function parseBindingAtom(isBlockScope) { + switch (state.type) { + case tt._this: { + // In TypeScript, "this" may be the name of a parameter, so allow it. + const oldIsType = pushTypeContext(0); + next(); + popTypeContext(oldIsType); + return; + } + + case tt._yield: + case tt.name: { + state.type = tt.name; + parseBindingIdentifier(isBlockScope); + return; + } + + case tt.bracketL: { + next(); + parseBindingList(tt.bracketR, isBlockScope, true /* allowEmpty */); + return; + } + + case tt.braceL: + parseObj(true, isBlockScope); + return; + + default: + unexpected(); + } +} + +export function parseBindingList( + close, + isBlockScope, + allowEmpty = false, + allowModifiers = false, + contextId = 0, +) { + let first = true; + + let hasRemovedComma = false; + const firstItemTokenIndex = state.tokens.length; + + while (!eat(close) && !state.error) { + if (first) { + first = false; + } else { + expect(tt.comma); + state.tokens[state.tokens.length - 1].contextId = contextId; + // After a "this" type in TypeScript, we need to set the following comma (if any) to also be + // a type token so that it will be removed. + if (!hasRemovedComma && state.tokens[firstItemTokenIndex].isType) { + state.tokens[state.tokens.length - 1].isType = true; + hasRemovedComma = true; + } + } + if (allowEmpty && match(tt.comma)) { + // Empty item; nothing further to parse for this item. + } else if (eat(close)) { + break; + } else if (match(tt.ellipsis)) { + parseRest(isBlockScope); + parseAssignableListItemTypes(); + // Support rest element trailing commas allowed by TypeScript <2.9. + eat(TokenType.comma); + expect(close); + break; + } else { + parseAssignableListItem(allowModifiers, isBlockScope); + } + } +} + +function parseAssignableListItem(allowModifiers, isBlockScope) { + if (allowModifiers) { + tsParseModifiers([ + ContextualKeyword._public, + ContextualKeyword._protected, + ContextualKeyword._private, + ContextualKeyword._readonly, + ContextualKeyword._override, + ]); + } + + parseMaybeDefault(isBlockScope); + parseAssignableListItemTypes(); + parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */); +} + +function parseAssignableListItemTypes() { + if (isFlowEnabled) { + flowParseAssignableListItemTypes(); + } else if (isTypeScriptEnabled) { + tsParseAssignableListItemTypes(); + } +} + +// Parses assignment pattern around given atom if possible. +export function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) { + if (!leftAlreadyParsed) { + parseBindingAtom(isBlockScope); + } + if (!eat(tt.eq)) { + return; + } + const eqIndex = state.tokens.length - 1; + parseMaybeAssign(); + state.tokens[eqIndex].rhsEndIndex = state.tokens.length; +} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/statement.js b/node_modules/sucrase/dist/esm/parser/traverser/statement.js new file mode 100644 index 0000000..34a6511 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/traverser/statement.js @@ -0,0 +1,1332 @@ +/* eslint max-len: 0 */ + +import {File} from "../index"; +import { + flowAfterParseClassSuper, + flowAfterParseVarHead, + flowParseExportDeclaration, + flowParseExportStar, + flowParseIdentifierStatement, + flowParseImportSpecifier, + flowParseTypeAnnotation, + flowParseTypeParameterDeclaration, + flowShouldDisallowExportDefaultSpecifier, + flowShouldParseExportDeclaration, + flowShouldParseExportStar, + flowStartParseFunctionParams, + flowStartParseImportSpecifiers, + flowTryParseExportDefaultExpression, + flowTryParseStatement, +} from "../plugins/flow"; +import { + tsAfterParseClassSuper, + tsAfterParseVarHead, + tsIsDeclarationStart, + tsParseExportDeclaration, + tsParseExportSpecifier, + tsParseIdentifierStatement, + tsParseImportEqualsDeclaration, + tsParseImportSpecifier, + tsParseMaybeDecoratorArguments, + tsParseModifiers, + tsStartParseFunctionParams, + tsTryParseClassMemberWithIsStatic, + tsTryParseExport, + tsTryParseExportDefaultExpression, + tsTryParseStatementContent, + tsTryParseTypeAnnotation, + tsTryParseTypeParameters, +} from "../plugins/typescript"; +import { + eat, + eatTypeToken, + IdentifierRole, + lookaheadType, + lookaheadTypeAndKeyword, + match, + next, + nextTokenStart, + nextTokenStartSince, + popTypeContext, + pushTypeContext, +} from "../tokenizer"; +import {ContextualKeyword} from "../tokenizer/keywords"; +import {Scope} from "../tokenizer/state"; +import { TokenType as tt} from "../tokenizer/types"; +import {charCodes} from "../util/charcodes"; +import {getNextContextId, input, isFlowEnabled, isTypeScriptEnabled, state} from "./base"; +import { + parseCallExpressionArguments, + parseExprAtom, + parseExpression, + parseExprSubscripts, + parseFunctionBodyAndFinish, + parseIdentifier, + parseMaybeAssign, + parseMethod, + parseObj, + parseParenExpression, + parsePropertyName, +} from "./expression"; +import { + parseBindingAtom, + parseBindingIdentifier, + parseBindingList, + parseImportedIdentifier, +} from "./lval"; +import { + canInsertSemicolon, + eatContextual, + expect, + expectContextual, + hasFollowingLineBreak, + hasPrecedingLineBreak, + isContextual, + isLineTerminator, + isLookaheadContextual, + semicolon, + unexpected, +} from "./util"; + +export function parseTopLevel() { + parseBlockBody(tt.eof); + state.scopes.push(new Scope(0, state.tokens.length, true)); + if (state.scopeDepth !== 0) { + throw new Error(`Invalid scope depth at end of file: ${state.scopeDepth}`); + } + return new File(state.tokens, state.scopes); +} + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + +export function parseStatement(declaration) { + if (isFlowEnabled) { + if (flowTryParseStatement()) { + return; + } + } + if (match(tt.at)) { + parseDecorators(); + } + parseStatementContent(declaration); +} + +function parseStatementContent(declaration) { + if (isTypeScriptEnabled) { + if (tsTryParseStatementContent()) { + return; + } + } + + const starttype = state.type; + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case tt._break: + case tt._continue: + parseBreakContinueStatement(); + return; + case tt._debugger: + parseDebuggerStatement(); + return; + case tt._do: + parseDoStatement(); + return; + case tt._for: + parseForStatement(); + return; + case tt._function: + if (lookaheadType() === tt.dot) break; + if (!declaration) unexpected(); + parseFunctionStatement(); + return; + + case tt._class: + if (!declaration) unexpected(); + parseClass(true); + return; + + case tt._if: + parseIfStatement(); + return; + case tt._return: + parseReturnStatement(); + return; + case tt._switch: + parseSwitchStatement(); + return; + case tt._throw: + parseThrowStatement(); + return; + case tt._try: + parseTryStatement(); + return; + + case tt._let: + case tt._const: + if (!declaration) unexpected(); // NOTE: falls through to _var + + case tt._var: + parseVarStatement(starttype !== tt._var); + return; + + case tt._while: + parseWhileStatement(); + return; + case tt.braceL: + parseBlock(); + return; + case tt.semi: + parseEmptyStatement(); + return; + case tt._export: + case tt._import: { + const nextType = lookaheadType(); + if (nextType === tt.parenL || nextType === tt.dot) { + break; + } + next(); + if (starttype === tt._import) { + parseImport(); + } else { + parseExport(); + } + return; + } + case tt.name: + if (state.contextualKeyword === ContextualKeyword._async) { + const functionStart = state.start; + // peek ahead and see if next token is a function + const snapshot = state.snapshot(); + next(); + if (match(tt._function) && !canInsertSemicolon()) { + expect(tt._function); + parseFunction(functionStart, true); + return; + } else { + state.restoreFromSnapshot(snapshot); + } + } else if ( + state.contextualKeyword === ContextualKeyword._using && + !hasFollowingLineBreak() && + // Statements like `using[0]` and `using in foo` aren't actual using + // declarations. + lookaheadType() === tt.name + ) { + parseVarStatement(true); + return; + } else if (startsAwaitUsing()) { + expectContextual(ContextualKeyword._await); + parseVarStatement(true); + return; + } + default: + // Do nothing. + break; + } + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + const initialTokensLength = state.tokens.length; + parseExpression(); + let simpleName = null; + if (state.tokens.length === initialTokensLength + 1) { + const token = state.tokens[state.tokens.length - 1]; + if (token.type === tt.name) { + simpleName = token.contextualKeyword; + } + } + if (simpleName == null) { + semicolon(); + return; + } + if (eat(tt.colon)) { + parseLabeledStatement(); + } else { + // This was an identifier, so we might want to handle flow/typescript-specific cases. + parseIdentifierStatement(simpleName); + } +} + +/** + * Determine if we're positioned at an `await using` declaration. + * + * Note that this can happen either in place of a regular variable declaration + * or in a loop body, and in both places, there are similar-looking cases where + * we need to return false. + * + * Examples returning true: + * await using foo = bar(); + * for (await using a of b) {} + * + * Examples returning false: + * await using + * await using + 1 + * await using instanceof T + * for (await using;;) {} + * + * For now, we early return if we don't see `await`, then do a simple + * backtracking-based lookahead for the `using` and identifier tokens. In the + * future, this could be optimized with a character-based approach. + */ +function startsAwaitUsing() { + if (!isContextual(ContextualKeyword._await)) { + return false; + } + const snapshot = state.snapshot(); + // await + next(); + if (!isContextual(ContextualKeyword._using) || hasPrecedingLineBreak()) { + state.restoreFromSnapshot(snapshot); + return false; + } + // using + next(); + if (!match(tt.name) || hasPrecedingLineBreak()) { + state.restoreFromSnapshot(snapshot); + return false; + } + state.restoreFromSnapshot(snapshot); + return true; +} + +export function parseDecorators() { + while (match(tt.at)) { + parseDecorator(); + } +} + +function parseDecorator() { + next(); + if (eat(tt.parenL)) { + parseExpression(); + expect(tt.parenR); + } else { + parseIdentifier(); + while (eat(tt.dot)) { + parseIdentifier(); + } + parseMaybeDecoratorArguments(); + } +} + +function parseMaybeDecoratorArguments() { + if (isTypeScriptEnabled) { + tsParseMaybeDecoratorArguments(); + } else { + baseParseMaybeDecoratorArguments(); + } +} + +export function baseParseMaybeDecoratorArguments() { + if (eat(tt.parenL)) { + parseCallExpressionArguments(); + } +} + +function parseBreakContinueStatement() { + next(); + if (!isLineTerminator()) { + parseIdentifier(); + semicolon(); + } +} + +function parseDebuggerStatement() { + next(); + semicolon(); +} + +function parseDoStatement() { + next(); + parseStatement(false); + expect(tt._while); + parseParenExpression(); + eat(tt.semi); +} + +function parseForStatement() { + state.scopeDepth++; + const startTokenIndex = state.tokens.length; + parseAmbiguousForStatement(); + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(startTokenIndex, endTokenIndex, false)); + state.scopeDepth--; +} + +/** + * Determine if this token is a `using` declaration (explicit resource + * management) as part of a loop. + * https://github.com/tc39/proposal-explicit-resource-management + */ +function isUsingInLoop() { + if (!isContextual(ContextualKeyword._using)) { + return false; + } + // This must be `for (using of`, where `using` is the name of the loop + // variable. + if (isLookaheadContextual(ContextualKeyword._of)) { + return false; + } + return true; +} + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. +function parseAmbiguousForStatement() { + next(); + + let forAwait = false; + if (isContextual(ContextualKeyword._await)) { + forAwait = true; + next(); + } + expect(tt.parenL); + + if (match(tt.semi)) { + if (forAwait) { + unexpected(); + } + parseFor(); + return; + } + + const isAwaitUsing = startsAwaitUsing(); + if (isAwaitUsing || match(tt._var) || match(tt._let) || match(tt._const) || isUsingInLoop()) { + if (isAwaitUsing) { + expectContextual(ContextualKeyword._await); + } + next(); + parseVar(true, state.type !== tt._var); + if (match(tt._in) || isContextual(ContextualKeyword._of)) { + parseForIn(forAwait); + return; + } + parseFor(); + return; + } + + parseExpression(true); + if (match(tt._in) || isContextual(ContextualKeyword._of)) { + parseForIn(forAwait); + return; + } + if (forAwait) { + unexpected(); + } + parseFor(); +} + +function parseFunctionStatement() { + const functionStart = state.start; + next(); + parseFunction(functionStart, true); +} + +function parseIfStatement() { + next(); + parseParenExpression(); + parseStatement(false); + if (eat(tt._else)) { + parseStatement(false); + } +} + +function parseReturnStatement() { + next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (!isLineTerminator()) { + parseExpression(); + semicolon(); + } +} + +function parseSwitchStatement() { + next(); + parseParenExpression(); + state.scopeDepth++; + const startTokenIndex = state.tokens.length; + expect(tt.braceL); + + // Don't bother validation; just go through any sequence of cases, defaults, and statements. + while (!match(tt.braceR) && !state.error) { + if (match(tt._case) || match(tt._default)) { + const isCase = match(tt._case); + next(); + if (isCase) { + parseExpression(); + } + expect(tt.colon); + } else { + parseStatement(true); + } + } + next(); // Closing brace + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(startTokenIndex, endTokenIndex, false)); + state.scopeDepth--; +} + +function parseThrowStatement() { + next(); + parseExpression(); + semicolon(); +} + +function parseCatchClauseParam() { + parseBindingAtom(true /* isBlockScope */); + + if (isTypeScriptEnabled) { + tsTryParseTypeAnnotation(); + } +} + +function parseTryStatement() { + next(); + + parseBlock(); + + if (match(tt._catch)) { + next(); + let catchBindingStartTokenIndex = null; + if (match(tt.parenL)) { + state.scopeDepth++; + catchBindingStartTokenIndex = state.tokens.length; + expect(tt.parenL); + parseCatchClauseParam(); + expect(tt.parenR); + } + parseBlock(); + if (catchBindingStartTokenIndex != null) { + // We need a special scope for the catch binding which includes the binding itself and the + // catch block. + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(catchBindingStartTokenIndex, endTokenIndex, false)); + state.scopeDepth--; + } + } + if (eat(tt._finally)) { + parseBlock(); + } +} + +export function parseVarStatement(isBlockScope) { + next(); + parseVar(false, isBlockScope); + semicolon(); +} + +function parseWhileStatement() { + next(); + parseParenExpression(); + parseStatement(false); +} + +function parseEmptyStatement() { + next(); +} + +function parseLabeledStatement() { + parseStatement(true); +} + +/** + * Parse a statement starting with an identifier of the given name. Subclasses match on the name + * to handle statements like "declare". + */ +function parseIdentifierStatement(contextualKeyword) { + if (isTypeScriptEnabled) { + tsParseIdentifierStatement(contextualKeyword); + } else if (isFlowEnabled) { + flowParseIdentifierStatement(contextualKeyword); + } else { + semicolon(); + } +} + +// Parse a semicolon-enclosed block of statements. +export function parseBlock(isFunctionScope = false, contextId = 0) { + const startTokenIndex = state.tokens.length; + state.scopeDepth++; + expect(tt.braceL); + if (contextId) { + state.tokens[state.tokens.length - 1].contextId = contextId; + } + parseBlockBody(tt.braceR); + if (contextId) { + state.tokens[state.tokens.length - 1].contextId = contextId; + } + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(startTokenIndex, endTokenIndex, isFunctionScope)); + state.scopeDepth--; +} + +export function parseBlockBody(end) { + while (!eat(end) && !state.error) { + parseStatement(true); + } +} + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +function parseFor() { + expect(tt.semi); + if (!match(tt.semi)) { + parseExpression(); + } + expect(tt.semi); + if (!match(tt.parenR)) { + parseExpression(); + } + expect(tt.parenR); + parseStatement(false); +} + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +function parseForIn(forAwait) { + if (forAwait) { + eatContextual(ContextualKeyword._of); + } else { + next(); + } + parseExpression(); + expect(tt.parenR); + parseStatement(false); +} + +// Parse a list of variable declarations. + +function parseVar(isFor, isBlockScope) { + while (true) { + parseVarHead(isBlockScope); + if (eat(tt.eq)) { + const eqIndex = state.tokens.length - 1; + parseMaybeAssign(isFor); + state.tokens[eqIndex].rhsEndIndex = state.tokens.length; + } + if (!eat(tt.comma)) { + break; + } + } +} + +function parseVarHead(isBlockScope) { + parseBindingAtom(isBlockScope); + if (isTypeScriptEnabled) { + tsAfterParseVarHead(); + } else if (isFlowEnabled) { + flowAfterParseVarHead(); + } +} + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + +export function parseFunction( + functionStart, + isStatement, + optionalId = false, +) { + if (match(tt.star)) { + next(); + } + + if (isStatement && !optionalId && !match(tt.name) && !match(tt._yield)) { + unexpected(); + } + + let nameScopeStartTokenIndex = null; + + if (match(tt.name)) { + // Expression-style functions should limit their name's scope to the function body, so we make + // a new function scope to enforce that. + if (!isStatement) { + nameScopeStartTokenIndex = state.tokens.length; + state.scopeDepth++; + } + parseBindingIdentifier(false); + } + + const startTokenIndex = state.tokens.length; + state.scopeDepth++; + parseFunctionParams(); + parseFunctionBodyAndFinish(functionStart); + const endTokenIndex = state.tokens.length; + // In addition to the block scope of the function body, we need a separate function-style scope + // that includes the params. + state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true)); + state.scopeDepth--; + if (nameScopeStartTokenIndex !== null) { + state.scopes.push(new Scope(nameScopeStartTokenIndex, endTokenIndex, true)); + state.scopeDepth--; + } +} + +export function parseFunctionParams( + allowModifiers = false, + funcContextId = 0, +) { + if (isTypeScriptEnabled) { + tsStartParseFunctionParams(); + } else if (isFlowEnabled) { + flowStartParseFunctionParams(); + } + + expect(tt.parenL); + if (funcContextId) { + state.tokens[state.tokens.length - 1].contextId = funcContextId; + } + parseBindingList( + tt.parenR, + false /* isBlockScope */, + false /* allowEmpty */, + allowModifiers, + funcContextId, + ); + if (funcContextId) { + state.tokens[state.tokens.length - 1].contextId = funcContextId; + } +} + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + +export function parseClass(isStatement, optionalId = false) { + // Put a context ID on the class keyword, the open-brace, and the close-brace, so that later + // code can easily navigate to meaningful points on the class. + const contextId = getNextContextId(); + + next(); + state.tokens[state.tokens.length - 1].contextId = contextId; + state.tokens[state.tokens.length - 1].isExpression = !isStatement; + // Like with functions, we declare a special "name scope" from the start of the name to the end + // of the class, but only with expression-style classes, to represent the fact that the name is + // available to the body of the class but not an outer declaration. + let nameScopeStartTokenIndex = null; + if (!isStatement) { + nameScopeStartTokenIndex = state.tokens.length; + state.scopeDepth++; + } + parseClassId(isStatement, optionalId); + parseClassSuper(); + const openBraceIndex = state.tokens.length; + parseClassBody(contextId); + if (state.error) { + return; + } + state.tokens[openBraceIndex].contextId = contextId; + state.tokens[state.tokens.length - 1].contextId = contextId; + if (nameScopeStartTokenIndex !== null) { + const endTokenIndex = state.tokens.length; + state.scopes.push(new Scope(nameScopeStartTokenIndex, endTokenIndex, false)); + state.scopeDepth--; + } +} + +function isClassProperty() { + return match(tt.eq) || match(tt.semi) || match(tt.braceR) || match(tt.bang) || match(tt.colon); +} + +function isClassMethod() { + return match(tt.parenL) || match(tt.lessThan); +} + +function parseClassBody(classContextId) { + expect(tt.braceL); + + while (!eat(tt.braceR) && !state.error) { + if (eat(tt.semi)) { + continue; + } + + if (match(tt.at)) { + parseDecorator(); + continue; + } + const memberStart = state.start; + parseClassMember(memberStart, classContextId); + } +} + +function parseClassMember(memberStart, classContextId) { + if (isTypeScriptEnabled) { + tsParseModifiers([ + ContextualKeyword._declare, + ContextualKeyword._public, + ContextualKeyword._protected, + ContextualKeyword._private, + ContextualKeyword._override, + ]); + } + let isStatic = false; + if (match(tt.name) && state.contextualKeyword === ContextualKeyword._static) { + parseIdentifier(); // eats 'static' + if (isClassMethod()) { + parseClassMethod(memberStart, /* isConstructor */ false); + return; + } else if (isClassProperty()) { + parseClassProperty(); + return; + } + // otherwise something static + state.tokens[state.tokens.length - 1].type = tt._static; + isStatic = true; + + if (match(tt.braceL)) { + // This is a static block. Mark the word "static" with the class context ID for class element + // detection and parse as a regular block. + state.tokens[state.tokens.length - 1].contextId = classContextId; + parseBlock(); + return; + } + } + + parseClassMemberWithIsStatic(memberStart, isStatic, classContextId); +} + +function parseClassMemberWithIsStatic( + memberStart, + isStatic, + classContextId, +) { + if (isTypeScriptEnabled) { + if (tsTryParseClassMemberWithIsStatic(isStatic)) { + return; + } + } + if (eat(tt.star)) { + // a generator + parseClassPropertyName(classContextId); + parseClassMethod(memberStart, /* isConstructor */ false); + return; + } + + // Get the identifier name so we can tell if it's actually a keyword like "async", "get", or + // "set". + parseClassPropertyName(classContextId); + let isConstructor = false; + const token = state.tokens[state.tokens.length - 1]; + // We allow "constructor" as either an identifier or a string. + if (token.contextualKeyword === ContextualKeyword._constructor) { + isConstructor = true; + } + parsePostMemberNameModifiers(); + + if (isClassMethod()) { + parseClassMethod(memberStart, isConstructor); + } else if (isClassProperty()) { + parseClassProperty(); + } else if (token.contextualKeyword === ContextualKeyword._async && !isLineTerminator()) { + state.tokens[state.tokens.length - 1].type = tt._async; + // an async method + const isGenerator = match(tt.star); + if (isGenerator) { + next(); + } + + // The so-called parsed name would have been "async": get the real name. + parseClassPropertyName(classContextId); + parsePostMemberNameModifiers(); + parseClassMethod(memberStart, false /* isConstructor */); + } else if ( + (token.contextualKeyword === ContextualKeyword._get || + token.contextualKeyword === ContextualKeyword._set) && + !(isLineTerminator() && match(tt.star)) + ) { + if (token.contextualKeyword === ContextualKeyword._get) { + state.tokens[state.tokens.length - 1].type = tt._get; + } else { + state.tokens[state.tokens.length - 1].type = tt._set; + } + // `get\n*` is an uninitialized property named 'get' followed by a generator. + // a getter or setter + // The so-called parsed name would have been "get/set": get the real name. + parseClassPropertyName(classContextId); + parseClassMethod(memberStart, /* isConstructor */ false); + } else if (token.contextualKeyword === ContextualKeyword._accessor && !isLineTerminator()) { + parseClassPropertyName(classContextId); + parseClassProperty(); + } else if (isLineTerminator()) { + // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) + parseClassProperty(); + } else { + unexpected(); + } +} + +function parseClassMethod(functionStart, isConstructor) { + if (isTypeScriptEnabled) { + tsTryParseTypeParameters(); + } else if (isFlowEnabled) { + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + } + parseMethod(functionStart, isConstructor); +} + +// Return the name of the class property, if it is a simple identifier. +export function parseClassPropertyName(classContextId) { + parsePropertyName(classContextId); +} + +export function parsePostMemberNameModifiers() { + if (isTypeScriptEnabled) { + const oldIsType = pushTypeContext(0); + eat(tt.question); + popTypeContext(oldIsType); + } +} + +export function parseClassProperty() { + if (isTypeScriptEnabled) { + eatTypeToken(tt.bang); + tsTryParseTypeAnnotation(); + } else if (isFlowEnabled) { + if (match(tt.colon)) { + flowParseTypeAnnotation(); + } + } + + if (match(tt.eq)) { + const equalsTokenIndex = state.tokens.length; + next(); + parseMaybeAssign(); + state.tokens[equalsTokenIndex].rhsEndIndex = state.tokens.length; + } + semicolon(); +} + +function parseClassId(isStatement, optionalId = false) { + if ( + isTypeScriptEnabled && + (!isStatement || optionalId) && + isContextual(ContextualKeyword._implements) + ) { + return; + } + + if (match(tt.name)) { + parseBindingIdentifier(true); + } + + if (isTypeScriptEnabled) { + tsTryParseTypeParameters(); + } else if (isFlowEnabled) { + if (match(tt.lessThan)) { + flowParseTypeParameterDeclaration(); + } + } +} + +// Returns true if there was a superclass. +function parseClassSuper() { + let hasSuper = false; + if (eat(tt._extends)) { + parseExprSubscripts(); + hasSuper = true; + } else { + hasSuper = false; + } + if (isTypeScriptEnabled) { + tsAfterParseClassSuper(hasSuper); + } else if (isFlowEnabled) { + flowAfterParseClassSuper(hasSuper); + } +} + +// Parses module export declaration. + +export function parseExport() { + const exportIndex = state.tokens.length - 1; + if (isTypeScriptEnabled) { + if (tsTryParseExport()) { + return; + } + } + // export * from '...' + if (shouldParseExportStar()) { + parseExportStar(); + } else if (isExportDefaultSpecifier()) { + // export default from + parseIdentifier(); + if (match(tt.comma) && lookaheadType() === tt.star) { + expect(tt.comma); + expect(tt.star); + expectContextual(ContextualKeyword._as); + parseIdentifier(); + } else { + parseExportSpecifiersMaybe(); + } + parseExportFrom(); + } else if (eat(tt._default)) { + // export default ... + parseExportDefaultExpression(); + } else if (shouldParseExportDeclaration()) { + parseExportDeclaration(); + } else { + // export { x, y as z } [from '...'] + parseExportSpecifiers(); + parseExportFrom(); + } + state.tokens[exportIndex].rhsEndIndex = state.tokens.length; +} + +function parseExportDefaultExpression() { + if (isTypeScriptEnabled) { + if (tsTryParseExportDefaultExpression()) { + return; + } + } + if (isFlowEnabled) { + if (flowTryParseExportDefaultExpression()) { + return; + } + } + const functionStart = state.start; + if (eat(tt._function)) { + parseFunction(functionStart, true, true); + } else if (isContextual(ContextualKeyword._async) && lookaheadType() === tt._function) { + // async function declaration + eatContextual(ContextualKeyword._async); + eat(tt._function); + parseFunction(functionStart, true, true); + } else if (match(tt._class)) { + parseClass(true, true); + } else if (match(tt.at)) { + parseDecorators(); + parseClass(true, true); + } else { + parseMaybeAssign(); + semicolon(); + } +} + +function parseExportDeclaration() { + if (isTypeScriptEnabled) { + tsParseExportDeclaration(); + } else if (isFlowEnabled) { + flowParseExportDeclaration(); + } else { + parseStatement(true); + } +} + +function isExportDefaultSpecifier() { + if (isTypeScriptEnabled && tsIsDeclarationStart()) { + return false; + } else if (isFlowEnabled && flowShouldDisallowExportDefaultSpecifier()) { + return false; + } + if (match(tt.name)) { + return state.contextualKeyword !== ContextualKeyword._async; + } + + if (!match(tt._default)) { + return false; + } + + const _next = nextTokenStart(); + const lookahead = lookaheadTypeAndKeyword(); + const hasFrom = + lookahead.type === tt.name && lookahead.contextualKeyword === ContextualKeyword._from; + if (lookahead.type === tt.comma) { + return true; + } + // lookahead again when `export default from` is seen + if (hasFrom) { + const nextAfterFrom = input.charCodeAt(nextTokenStartSince(_next + 4)); + return nextAfterFrom === charCodes.quotationMark || nextAfterFrom === charCodes.apostrophe; + } + return false; +} + +function parseExportSpecifiersMaybe() { + if (eat(tt.comma)) { + parseExportSpecifiers(); + } +} + +export function parseExportFrom() { + if (eatContextual(ContextualKeyword._from)) { + parseExprAtom(); + maybeParseImportAttributes(); + } + semicolon(); +} + +function shouldParseExportStar() { + if (isFlowEnabled) { + return flowShouldParseExportStar(); + } else { + return match(tt.star); + } +} + +function parseExportStar() { + if (isFlowEnabled) { + flowParseExportStar(); + } else { + baseParseExportStar(); + } +} + +export function baseParseExportStar() { + expect(tt.star); + + if (isContextual(ContextualKeyword._as)) { + parseExportNamespace(); + } else { + parseExportFrom(); + } +} + +function parseExportNamespace() { + next(); + state.tokens[state.tokens.length - 1].type = tt._as; + parseIdentifier(); + parseExportSpecifiersMaybe(); + parseExportFrom(); +} + +function shouldParseExportDeclaration() { + return ( + (isTypeScriptEnabled && tsIsDeclarationStart()) || + (isFlowEnabled && flowShouldParseExportDeclaration()) || + state.type === tt._var || + state.type === tt._const || + state.type === tt._let || + state.type === tt._function || + state.type === tt._class || + isContextual(ContextualKeyword._async) || + match(tt.at) + ); +} + +// Parses a comma-separated list of module exports. +export function parseExportSpecifiers() { + let first = true; + + // export { x, y as z } [from '...'] + expect(tt.braceL); + + while (!eat(tt.braceR) && !state.error) { + if (first) { + first = false; + } else { + expect(tt.comma); + if (eat(tt.braceR)) { + break; + } + } + parseExportSpecifier(); + } +} + +function parseExportSpecifier() { + if (isTypeScriptEnabled) { + tsParseExportSpecifier(); + return; + } + parseIdentifier(); + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess; + if (eatContextual(ContextualKeyword._as)) { + parseIdentifier(); + } +} + +/** + * Starting at the `module` token in an import, determine if it was truly an + * import reflection token or just looks like one. + * + * Returns true for: + * import module foo from "foo"; + * import module from from "foo"; + * + * Returns false for: + * import module from "foo"; + * import module, {bar} from "foo"; + */ +function isImportReflection() { + const snapshot = state.snapshot(); + expectContextual(ContextualKeyword._module); + if (eatContextual(ContextualKeyword._from)) { + if (isContextual(ContextualKeyword._from)) { + state.restoreFromSnapshot(snapshot); + return true; + } else { + state.restoreFromSnapshot(snapshot); + return false; + } + } else if (match(tt.comma)) { + state.restoreFromSnapshot(snapshot); + return false; + } else { + state.restoreFromSnapshot(snapshot); + return true; + } +} + +/** + * Eat the "module" token from the import reflection proposal. + * https://github.com/tc39/proposal-import-reflection + */ +function parseMaybeImportReflection() { + // isImportReflection does snapshot/restore, so only run it if we see the word + // "module". + if (isContextual(ContextualKeyword._module) && isImportReflection()) { + next(); + } +} + +// Parses import declaration. + +export function parseImport() { + if (isTypeScriptEnabled && match(tt.name) && lookaheadType() === tt.eq) { + tsParseImportEqualsDeclaration(); + return; + } + if (isTypeScriptEnabled && isContextual(ContextualKeyword._type)) { + const lookahead = lookaheadTypeAndKeyword(); + if (lookahead.type === tt.name && lookahead.contextualKeyword !== ContextualKeyword._from) { + // One of these `import type` cases: + // import type T = require('T'); + // import type A from 'A'; + expectContextual(ContextualKeyword._type); + if (lookaheadType() === tt.eq) { + tsParseImportEqualsDeclaration(); + return; + } + // If this is an `import type...from` statement, then we already ate the + // type token, so proceed to the regular import parser. + } else if (lookahead.type === tt.star || lookahead.type === tt.braceL) { + // One of these `import type` cases, in which case we can eat the type token + // and proceed as normal: + // import type * as A from 'A'; + // import type {a} from 'A'; + expectContextual(ContextualKeyword._type); + } + // Otherwise, we are importing the name "type". + } + + // import '...' + if (match(tt.string)) { + parseExprAtom(); + } else { + parseMaybeImportReflection(); + parseImportSpecifiers(); + expectContextual(ContextualKeyword._from); + parseExprAtom(); + } + maybeParseImportAttributes(); + semicolon(); +} + +// eslint-disable-next-line no-unused-vars +function shouldParseDefaultImport() { + return match(tt.name); +} + +function parseImportSpecifierLocal() { + parseImportedIdentifier(); +} + +// Parses a comma-separated list of module imports. +function parseImportSpecifiers() { + if (isFlowEnabled) { + flowStartParseImportSpecifiers(); + } + + let first = true; + if (shouldParseDefaultImport()) { + // import defaultObj, { x, y as z } from '...' + parseImportSpecifierLocal(); + + if (!eat(tt.comma)) return; + } + + if (match(tt.star)) { + next(); + expectContextual(ContextualKeyword._as); + + parseImportSpecifierLocal(); + + return; + } + + expect(tt.braceL); + while (!eat(tt.braceR) && !state.error) { + if (first) { + first = false; + } else { + // Detect an attempt to deep destructure + if (eat(tt.colon)) { + unexpected( + "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", + ); + } + + expect(tt.comma); + if (eat(tt.braceR)) { + break; + } + } + + parseImportSpecifier(); + } +} + +function parseImportSpecifier() { + if (isTypeScriptEnabled) { + tsParseImportSpecifier(); + return; + } + if (isFlowEnabled) { + flowParseImportSpecifier(); + return; + } + parseImportedIdentifier(); + if (isContextual(ContextualKeyword._as)) { + state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportAccess; + next(); + parseImportedIdentifier(); + } +} + +/** + * Parse import attributes like `with {type: "json"}`, or the legacy form + * `assert {type: "json"}`. + * + * Import attributes technically have their own syntax, but are always parseable + * as a plain JS object, so just do that for simplicity. + */ +function maybeParseImportAttributes() { + if (match(tt._with) || (isContextual(ContextualKeyword._assert) && !hasPrecedingLineBreak())) { + next(); + parseObj(false, false); + } +} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/util.js b/node_modules/sucrase/dist/esm/parser/traverser/util.js new file mode 100644 index 0000000..6a2b2d9 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/traverser/util.js @@ -0,0 +1,104 @@ +import {eat, finishToken, lookaheadTypeAndKeyword, match, nextTokenStart} from "../tokenizer/index"; + +import {formatTokenType, TokenType as tt} from "../tokenizer/types"; +import {charCodes} from "../util/charcodes"; +import {input, state} from "./base"; + +// ## Parser utilities + +// Tests whether parsed token is a contextual keyword. +export function isContextual(contextualKeyword) { + return state.contextualKeyword === contextualKeyword; +} + +export function isLookaheadContextual(contextualKeyword) { + const l = lookaheadTypeAndKeyword(); + return l.type === tt.name && l.contextualKeyword === contextualKeyword; +} + +// Consumes contextual keyword if possible. +export function eatContextual(contextualKeyword) { + return state.contextualKeyword === contextualKeyword && eat(tt.name); +} + +// Asserts that following token is given contextual keyword. +export function expectContextual(contextualKeyword) { + if (!eatContextual(contextualKeyword)) { + unexpected(); + } +} + +// Test whether a semicolon can be inserted at the current position. +export function canInsertSemicolon() { + return match(tt.eof) || match(tt.braceR) || hasPrecedingLineBreak(); +} + +export function hasPrecedingLineBreak() { + const prevToken = state.tokens[state.tokens.length - 1]; + const lastTokEnd = prevToken ? prevToken.end : 0; + for (let i = lastTokEnd; i < state.start; i++) { + const code = input.charCodeAt(i); + if ( + code === charCodes.lineFeed || + code === charCodes.carriageReturn || + code === 0x2028 || + code === 0x2029 + ) { + return true; + } + } + return false; +} + +export function hasFollowingLineBreak() { + const nextStart = nextTokenStart(); + for (let i = state.end; i < nextStart; i++) { + const code = input.charCodeAt(i); + if ( + code === charCodes.lineFeed || + code === charCodes.carriageReturn || + code === 0x2028 || + code === 0x2029 + ) { + return true; + } + } + return false; +} + +export function isLineTerminator() { + return eat(tt.semi) || canInsertSemicolon(); +} + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. +export function semicolon() { + if (!isLineTerminator()) { + unexpected('Unexpected token, expected ";"'); + } +} + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error at given pos. +export function expect(type) { + const matched = eat(type); + if (!matched) { + unexpected(`Unexpected token, expected "${formatTokenType(type)}"`); + } +} + +/** + * Transition the parser to an error state. All code needs to be written to naturally unwind in this + * state, which allows us to backtrack without exceptions and without error plumbing everywhere. + */ +export function unexpected(message = "Unexpected token", pos = state.start) { + if (state.error) { + return; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const err = new SyntaxError(message); + err.pos = pos; + state.error = err; + state.pos = input.length; + finishToken(tt.eof); +} diff --git a/node_modules/sucrase/dist/esm/parser/util/charcodes.js b/node_modules/sucrase/dist/esm/parser/util/charcodes.js new file mode 100644 index 0000000..36ea667 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/util/charcodes.js @@ -0,0 +1,115 @@ +export var charCodes; (function (charCodes) { + const backSpace = 8; charCodes[charCodes["backSpace"] = backSpace] = "backSpace"; + const lineFeed = 10; charCodes[charCodes["lineFeed"] = lineFeed] = "lineFeed"; // '\n' + const tab = 9; charCodes[charCodes["tab"] = tab] = "tab"; // '\t' + const carriageReturn = 13; charCodes[charCodes["carriageReturn"] = carriageReturn] = "carriageReturn"; // '\r' + const shiftOut = 14; charCodes[charCodes["shiftOut"] = shiftOut] = "shiftOut"; + const space = 32; charCodes[charCodes["space"] = space] = "space"; + const exclamationMark = 33; charCodes[charCodes["exclamationMark"] = exclamationMark] = "exclamationMark"; // '!' + const quotationMark = 34; charCodes[charCodes["quotationMark"] = quotationMark] = "quotationMark"; // '"' + const numberSign = 35; charCodes[charCodes["numberSign"] = numberSign] = "numberSign"; // '#' + const dollarSign = 36; charCodes[charCodes["dollarSign"] = dollarSign] = "dollarSign"; // '$' + const percentSign = 37; charCodes[charCodes["percentSign"] = percentSign] = "percentSign"; // '%' + const ampersand = 38; charCodes[charCodes["ampersand"] = ampersand] = "ampersand"; // '&' + const apostrophe = 39; charCodes[charCodes["apostrophe"] = apostrophe] = "apostrophe"; // ''' + const leftParenthesis = 40; charCodes[charCodes["leftParenthesis"] = leftParenthesis] = "leftParenthesis"; // '(' + const rightParenthesis = 41; charCodes[charCodes["rightParenthesis"] = rightParenthesis] = "rightParenthesis"; // ')' + const asterisk = 42; charCodes[charCodes["asterisk"] = asterisk] = "asterisk"; // '*' + const plusSign = 43; charCodes[charCodes["plusSign"] = plusSign] = "plusSign"; // '+' + const comma = 44; charCodes[charCodes["comma"] = comma] = "comma"; // ',' + const dash = 45; charCodes[charCodes["dash"] = dash] = "dash"; // '-' + const dot = 46; charCodes[charCodes["dot"] = dot] = "dot"; // '.' + const slash = 47; charCodes[charCodes["slash"] = slash] = "slash"; // '/' + const digit0 = 48; charCodes[charCodes["digit0"] = digit0] = "digit0"; // '0' + const digit1 = 49; charCodes[charCodes["digit1"] = digit1] = "digit1"; // '1' + const digit2 = 50; charCodes[charCodes["digit2"] = digit2] = "digit2"; // '2' + const digit3 = 51; charCodes[charCodes["digit3"] = digit3] = "digit3"; // '3' + const digit4 = 52; charCodes[charCodes["digit4"] = digit4] = "digit4"; // '4' + const digit5 = 53; charCodes[charCodes["digit5"] = digit5] = "digit5"; // '5' + const digit6 = 54; charCodes[charCodes["digit6"] = digit6] = "digit6"; // '6' + const digit7 = 55; charCodes[charCodes["digit7"] = digit7] = "digit7"; // '7' + const digit8 = 56; charCodes[charCodes["digit8"] = digit8] = "digit8"; // '8' + const digit9 = 57; charCodes[charCodes["digit9"] = digit9] = "digit9"; // '9' + const colon = 58; charCodes[charCodes["colon"] = colon] = "colon"; // ':' + const semicolon = 59; charCodes[charCodes["semicolon"] = semicolon] = "semicolon"; // ';' + const lessThan = 60; charCodes[charCodes["lessThan"] = lessThan] = "lessThan"; // '<' + const equalsTo = 61; charCodes[charCodes["equalsTo"] = equalsTo] = "equalsTo"; // '=' + const greaterThan = 62; charCodes[charCodes["greaterThan"] = greaterThan] = "greaterThan"; // '>' + const questionMark = 63; charCodes[charCodes["questionMark"] = questionMark] = "questionMark"; // '?' + const atSign = 64; charCodes[charCodes["atSign"] = atSign] = "atSign"; // '@' + const uppercaseA = 65; charCodes[charCodes["uppercaseA"] = uppercaseA] = "uppercaseA"; // 'A' + const uppercaseB = 66; charCodes[charCodes["uppercaseB"] = uppercaseB] = "uppercaseB"; // 'B' + const uppercaseC = 67; charCodes[charCodes["uppercaseC"] = uppercaseC] = "uppercaseC"; // 'C' + const uppercaseD = 68; charCodes[charCodes["uppercaseD"] = uppercaseD] = "uppercaseD"; // 'D' + const uppercaseE = 69; charCodes[charCodes["uppercaseE"] = uppercaseE] = "uppercaseE"; // 'E' + const uppercaseF = 70; charCodes[charCodes["uppercaseF"] = uppercaseF] = "uppercaseF"; // 'F' + const uppercaseG = 71; charCodes[charCodes["uppercaseG"] = uppercaseG] = "uppercaseG"; // 'G' + const uppercaseH = 72; charCodes[charCodes["uppercaseH"] = uppercaseH] = "uppercaseH"; // 'H' + const uppercaseI = 73; charCodes[charCodes["uppercaseI"] = uppercaseI] = "uppercaseI"; // 'I' + const uppercaseJ = 74; charCodes[charCodes["uppercaseJ"] = uppercaseJ] = "uppercaseJ"; // 'J' + const uppercaseK = 75; charCodes[charCodes["uppercaseK"] = uppercaseK] = "uppercaseK"; // 'K' + const uppercaseL = 76; charCodes[charCodes["uppercaseL"] = uppercaseL] = "uppercaseL"; // 'L' + const uppercaseM = 77; charCodes[charCodes["uppercaseM"] = uppercaseM] = "uppercaseM"; // 'M' + const uppercaseN = 78; charCodes[charCodes["uppercaseN"] = uppercaseN] = "uppercaseN"; // 'N' + const uppercaseO = 79; charCodes[charCodes["uppercaseO"] = uppercaseO] = "uppercaseO"; // 'O' + const uppercaseP = 80; charCodes[charCodes["uppercaseP"] = uppercaseP] = "uppercaseP"; // 'P' + const uppercaseQ = 81; charCodes[charCodes["uppercaseQ"] = uppercaseQ] = "uppercaseQ"; // 'Q' + const uppercaseR = 82; charCodes[charCodes["uppercaseR"] = uppercaseR] = "uppercaseR"; // 'R' + const uppercaseS = 83; charCodes[charCodes["uppercaseS"] = uppercaseS] = "uppercaseS"; // 'S' + const uppercaseT = 84; charCodes[charCodes["uppercaseT"] = uppercaseT] = "uppercaseT"; // 'T' + const uppercaseU = 85; charCodes[charCodes["uppercaseU"] = uppercaseU] = "uppercaseU"; // 'U' + const uppercaseV = 86; charCodes[charCodes["uppercaseV"] = uppercaseV] = "uppercaseV"; // 'V' + const uppercaseW = 87; charCodes[charCodes["uppercaseW"] = uppercaseW] = "uppercaseW"; // 'W' + const uppercaseX = 88; charCodes[charCodes["uppercaseX"] = uppercaseX] = "uppercaseX"; // 'X' + const uppercaseY = 89; charCodes[charCodes["uppercaseY"] = uppercaseY] = "uppercaseY"; // 'Y' + const uppercaseZ = 90; charCodes[charCodes["uppercaseZ"] = uppercaseZ] = "uppercaseZ"; // 'Z' + const leftSquareBracket = 91; charCodes[charCodes["leftSquareBracket"] = leftSquareBracket] = "leftSquareBracket"; // '[' + const backslash = 92; charCodes[charCodes["backslash"] = backslash] = "backslash"; // '\ ' + const rightSquareBracket = 93; charCodes[charCodes["rightSquareBracket"] = rightSquareBracket] = "rightSquareBracket"; // ']' + const caret = 94; charCodes[charCodes["caret"] = caret] = "caret"; // '^' + const underscore = 95; charCodes[charCodes["underscore"] = underscore] = "underscore"; // '_' + const graveAccent = 96; charCodes[charCodes["graveAccent"] = graveAccent] = "graveAccent"; // '`' + const lowercaseA = 97; charCodes[charCodes["lowercaseA"] = lowercaseA] = "lowercaseA"; // 'a' + const lowercaseB = 98; charCodes[charCodes["lowercaseB"] = lowercaseB] = "lowercaseB"; // 'b' + const lowercaseC = 99; charCodes[charCodes["lowercaseC"] = lowercaseC] = "lowercaseC"; // 'c' + const lowercaseD = 100; charCodes[charCodes["lowercaseD"] = lowercaseD] = "lowercaseD"; // 'd' + const lowercaseE = 101; charCodes[charCodes["lowercaseE"] = lowercaseE] = "lowercaseE"; // 'e' + const lowercaseF = 102; charCodes[charCodes["lowercaseF"] = lowercaseF] = "lowercaseF"; // 'f' + const lowercaseG = 103; charCodes[charCodes["lowercaseG"] = lowercaseG] = "lowercaseG"; // 'g' + const lowercaseH = 104; charCodes[charCodes["lowercaseH"] = lowercaseH] = "lowercaseH"; // 'h' + const lowercaseI = 105; charCodes[charCodes["lowercaseI"] = lowercaseI] = "lowercaseI"; // 'i' + const lowercaseJ = 106; charCodes[charCodes["lowercaseJ"] = lowercaseJ] = "lowercaseJ"; // 'j' + const lowercaseK = 107; charCodes[charCodes["lowercaseK"] = lowercaseK] = "lowercaseK"; // 'k' + const lowercaseL = 108; charCodes[charCodes["lowercaseL"] = lowercaseL] = "lowercaseL"; // 'l' + const lowercaseM = 109; charCodes[charCodes["lowercaseM"] = lowercaseM] = "lowercaseM"; // 'm' + const lowercaseN = 110; charCodes[charCodes["lowercaseN"] = lowercaseN] = "lowercaseN"; // 'n' + const lowercaseO = 111; charCodes[charCodes["lowercaseO"] = lowercaseO] = "lowercaseO"; // 'o' + const lowercaseP = 112; charCodes[charCodes["lowercaseP"] = lowercaseP] = "lowercaseP"; // 'p' + const lowercaseQ = 113; charCodes[charCodes["lowercaseQ"] = lowercaseQ] = "lowercaseQ"; // 'q' + const lowercaseR = 114; charCodes[charCodes["lowercaseR"] = lowercaseR] = "lowercaseR"; // 'r' + const lowercaseS = 115; charCodes[charCodes["lowercaseS"] = lowercaseS] = "lowercaseS"; // 's' + const lowercaseT = 116; charCodes[charCodes["lowercaseT"] = lowercaseT] = "lowercaseT"; // 't' + const lowercaseU = 117; charCodes[charCodes["lowercaseU"] = lowercaseU] = "lowercaseU"; // 'u' + const lowercaseV = 118; charCodes[charCodes["lowercaseV"] = lowercaseV] = "lowercaseV"; // 'v' + const lowercaseW = 119; charCodes[charCodes["lowercaseW"] = lowercaseW] = "lowercaseW"; // 'w' + const lowercaseX = 120; charCodes[charCodes["lowercaseX"] = lowercaseX] = "lowercaseX"; // 'x' + const lowercaseY = 121; charCodes[charCodes["lowercaseY"] = lowercaseY] = "lowercaseY"; // 'y' + const lowercaseZ = 122; charCodes[charCodes["lowercaseZ"] = lowercaseZ] = "lowercaseZ"; // 'z' + const leftCurlyBrace = 123; charCodes[charCodes["leftCurlyBrace"] = leftCurlyBrace] = "leftCurlyBrace"; // '{' + const verticalBar = 124; charCodes[charCodes["verticalBar"] = verticalBar] = "verticalBar"; // '|' + const rightCurlyBrace = 125; charCodes[charCodes["rightCurlyBrace"] = rightCurlyBrace] = "rightCurlyBrace"; // '}' + const tilde = 126; charCodes[charCodes["tilde"] = tilde] = "tilde"; // '~' + const nonBreakingSpace = 160; charCodes[charCodes["nonBreakingSpace"] = nonBreakingSpace] = "nonBreakingSpace"; + // eslint-disable-next-line no-irregular-whitespace + const oghamSpaceMark = 5760; charCodes[charCodes["oghamSpaceMark"] = oghamSpaceMark] = "oghamSpaceMark"; // ' ' + const lineSeparator = 8232; charCodes[charCodes["lineSeparator"] = lineSeparator] = "lineSeparator"; + const paragraphSeparator = 8233; charCodes[charCodes["paragraphSeparator"] = paragraphSeparator] = "paragraphSeparator"; +})(charCodes || (charCodes = {})); + +export function isDigit(code) { + return ( + (code >= charCodes.digit0 && code <= charCodes.digit9) || + (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || + (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) + ); +} diff --git a/node_modules/sucrase/dist/esm/parser/util/identifier.js b/node_modules/sucrase/dist/esm/parser/util/identifier.js new file mode 100644 index 0000000..33a6bb1 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/util/identifier.js @@ -0,0 +1,34 @@ +import {charCodes} from "./charcodes"; +import {WHITESPACE_CHARS} from "./whitespace"; + +function computeIsIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code < 128) return false; + throw new Error("Should not be called with non-ASCII char code."); +} + +export const IS_IDENTIFIER_CHAR = new Uint8Array(65536); +for (let i = 0; i < 128; i++) { + IS_IDENTIFIER_CHAR[i] = computeIsIdentifierChar(i) ? 1 : 0; +} +for (let i = 128; i < 65536; i++) { + IS_IDENTIFIER_CHAR[i] = 1; +} +// Aside from whitespace and newlines, all characters outside the ASCII space are either +// identifier characters or invalid. Since we're not performing code validation, we can just +// treat all invalid characters as identifier characters. +for (const whitespaceChar of WHITESPACE_CHARS) { + IS_IDENTIFIER_CHAR[whitespaceChar] = 0; +} +IS_IDENTIFIER_CHAR[0x2028] = 0; +IS_IDENTIFIER_CHAR[0x2029] = 0; + +export const IS_IDENTIFIER_START = IS_IDENTIFIER_CHAR.slice(); +for (let numChar = charCodes.digit0; numChar <= charCodes.digit9; numChar++) { + IS_IDENTIFIER_START[numChar] = 0; +} diff --git a/node_modules/sucrase/dist/esm/parser/util/whitespace.js b/node_modules/sucrase/dist/esm/parser/util/whitespace.js new file mode 100644 index 0000000..303b8a6 --- /dev/null +++ b/node_modules/sucrase/dist/esm/parser/util/whitespace.js @@ -0,0 +1,33 @@ +import {charCodes} from "./charcodes"; + +// https://tc39.github.io/ecma262/#sec-white-space +export const WHITESPACE_CHARS = [ + 0x0009, + 0x000b, + 0x000c, + charCodes.space, + charCodes.nonBreakingSpace, + charCodes.oghamSpaceMark, + 0x2000, // EN QUAD + 0x2001, // EM QUAD + 0x2002, // EN SPACE + 0x2003, // EM SPACE + 0x2004, // THREE-PER-EM SPACE + 0x2005, // FOUR-PER-EM SPACE + 0x2006, // SIX-PER-EM SPACE + 0x2007, // FIGURE SPACE + 0x2008, // PUNCTUATION SPACE + 0x2009, // THIN SPACE + 0x200a, // HAIR SPACE + 0x202f, // NARROW NO-BREAK SPACE + 0x205f, // MEDIUM MATHEMATICAL SPACE + 0x3000, // IDEOGRAPHIC SPACE + 0xfeff, // ZERO WIDTH NO-BREAK SPACE +]; + +export const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + +export const IS_WHITESPACE = new Uint8Array(65536); +for (const char of WHITESPACE_CHARS) { + IS_WHITESPACE[char] = 1; +} diff --git a/node_modules/sucrase/dist/esm/register.js b/node_modules/sucrase/dist/esm/register.js new file mode 100644 index 0000000..ca30cab --- /dev/null +++ b/node_modules/sucrase/dist/esm/register.js @@ -0,0 +1,88 @@ +import * as pirates from "pirates"; + +import { transform} from "./index"; + + + + + + + + +export function addHook( + extension, + sucraseOptions, + hookOptions, +) { + let mergedSucraseOptions = sucraseOptions; + const sucraseOptionsEnvJSON = process.env.SUCRASE_OPTIONS; + if (sucraseOptionsEnvJSON) { + mergedSucraseOptions = {...mergedSucraseOptions, ...JSON.parse(sucraseOptionsEnvJSON)}; + } + return pirates.addHook( + (code, filePath) => { + const {code: transformedCode, sourceMap} = transform(code, { + ...mergedSucraseOptions, + sourceMapOptions: {compiledFilename: filePath}, + filePath, + }); + const mapBase64 = Buffer.from(JSON.stringify(sourceMap)).toString("base64"); + const suffix = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${mapBase64}`; + return `${transformedCode}\n${suffix}`; + }, + {...hookOptions, exts: [extension]}, + ); +} + +export function registerJS(hookOptions) { + return addHook(".js", {transforms: ["imports", "flow", "jsx"]}, hookOptions); +} + +export function registerJSX(hookOptions) { + return addHook(".jsx", {transforms: ["imports", "flow", "jsx"]}, hookOptions); +} + +export function registerTS(hookOptions) { + return addHook(".ts", {transforms: ["imports", "typescript"]}, hookOptions); +} + +export function registerTSX(hookOptions) { + return addHook(".tsx", {transforms: ["imports", "typescript", "jsx"]}, hookOptions); +} + +export function registerTSLegacyModuleInterop(hookOptions) { + return addHook( + ".ts", + { + transforms: ["imports", "typescript"], + enableLegacyTypeScriptModuleInterop: true, + }, + hookOptions, + ); +} + +export function registerTSXLegacyModuleInterop(hookOptions) { + return addHook( + ".tsx", + { + transforms: ["imports", "typescript", "jsx"], + enableLegacyTypeScriptModuleInterop: true, + }, + hookOptions, + ); +} + +export function registerAll(hookOptions) { + const reverts = [ + registerJS(hookOptions), + registerJSX(hookOptions), + registerTS(hookOptions), + registerTSX(hookOptions), + ]; + + return () => { + for (const fn of reverts) { + fn(); + } + }; +} diff --git a/node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js b/node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js new file mode 100644 index 0000000..78cf896 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js @@ -0,0 +1,916 @@ + + + +import {IdentifierRole, isDeclaration, isObjectShorthandDeclaration} from "../parser/tokenizer"; +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + +import elideImportEquals from "../util/elideImportEquals"; +import getDeclarationInfo, { + + EMPTY_DECLARATION_INFO, +} from "../util/getDeclarationInfo"; +import getImportExportSpecifierInfo from "../util/getImportExportSpecifierInfo"; +import isExportFrom from "../util/isExportFrom"; +import {removeMaybeImportAttributes} from "../util/removeMaybeImportAttributes"; +import shouldElideDefaultExport from "../util/shouldElideDefaultExport"; + + +import Transformer from "./Transformer"; + +/** + * Class for editing import statements when we are transforming to commonjs. + */ +export default class CJSImportTransformer extends Transformer { + __init() {this.hadExport = false} + __init2() {this.hadNamedExport = false} + __init3() {this.hadDefaultExport = false} + + + constructor( + rootTransformer, + tokens, + importProcessor, + nameManager, + helperManager, + reactHotLoaderTransformer, + enableLegacyBabel5ModuleInterop, + enableLegacyTypeScriptModuleInterop, + isTypeScriptTransformEnabled, + isFlowTransformEnabled, + preserveDynamicImport, + keepUnusedImports, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.enableLegacyBabel5ModuleInterop = enableLegacyBabel5ModuleInterop;this.enableLegacyTypeScriptModuleInterop = enableLegacyTypeScriptModuleInterop;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.preserveDynamicImport = preserveDynamicImport;this.keepUnusedImports = keepUnusedImports;CJSImportTransformer.prototype.__init.call(this);CJSImportTransformer.prototype.__init2.call(this);CJSImportTransformer.prototype.__init3.call(this);; + this.declarationInfo = isTypeScriptTransformEnabled + ? getDeclarationInfo(tokens) + : EMPTY_DECLARATION_INFO; + } + + getPrefixCode() { + let prefix = ""; + if (this.hadExport) { + prefix += 'Object.defineProperty(exports, "__esModule", {value: true});'; + } + return prefix; + } + + getSuffixCode() { + if (this.enableLegacyBabel5ModuleInterop && this.hadDefaultExport && !this.hadNamedExport) { + return "\nmodule.exports = exports.default;\n"; + } + return ""; + } + + process() { + // TypeScript `import foo = require('foo');` should always just be translated to plain require. + if (this.tokens.matches3(tt._import, tt.name, tt.eq)) { + return this.processImportEquals(); + } + if (this.tokens.matches1(tt._import)) { + this.processImport(); + return true; + } + if (this.tokens.matches2(tt._export, tt.eq)) { + this.tokens.replaceToken("module.exports"); + return true; + } + if (this.tokens.matches1(tt._export) && !this.tokens.currentToken().isType) { + this.hadExport = true; + return this.processExport(); + } + if (this.tokens.matches2(tt.name, tt.postIncDec)) { + // Fall through to normal identifier matching if this doesn't apply. + if (this.processPostIncDec()) { + return true; + } + } + if (this.tokens.matches1(tt.name) || this.tokens.matches1(tt.jsxName)) { + return this.processIdentifier(); + } + if (this.tokens.matches1(tt.eq)) { + return this.processAssignment(); + } + if (this.tokens.matches1(tt.assign)) { + return this.processComplexAssignment(); + } + if (this.tokens.matches1(tt.preIncDec)) { + return this.processPreIncDec(); + } + return false; + } + + processImportEquals() { + const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + if (this.importProcessor.shouldAutomaticallyElideImportedName(importName)) { + // If this name is only used as a type, elide the whole import. + elideImportEquals(this.tokens); + } else { + // Otherwise, switch `import` to `const`. + this.tokens.replaceToken("const"); + } + return true; + } + + /** + * Transform this: + * import foo, {bar} from 'baz'; + * into + * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); + * + * The import code was already generated in the import preprocessing step, so + * we just need to look it up. + */ + processImport() { + if (this.tokens.matches2(tt._import, tt.parenL)) { + if (this.preserveDynamicImport) { + // Bail out, only making progress for this one token. + this.tokens.copyToken(); + return; + } + const requireWrapper = this.enableLegacyTypeScriptModuleInterop + ? "" + : `${this.helperManager.getHelperName("interopRequireWildcard")}(`; + this.tokens.replaceToken(`Promise.resolve().then(() => ${requireWrapper}require`); + const contextId = this.tokens.currentToken().contextId; + if (contextId == null) { + throw new Error("Expected context ID on dynamic import invocation."); + } + this.tokens.copyToken(); + while (!this.tokens.matchesContextIdAndLabel(tt.parenR, contextId)) { + this.rootTransformer.processToken(); + } + this.tokens.replaceToken(requireWrapper ? ")))" : "))"); + return; + } + + const shouldElideImport = this.removeImportAndDetectIfShouldElide(); + if (shouldElideImport) { + this.tokens.removeToken(); + } else { + const path = this.tokens.stringValue(); + this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); + this.tokens.appendCode(this.importProcessor.claimImportCode(path)); + } + removeMaybeImportAttributes(this.tokens); + if (this.tokens.matches1(tt.semi)) { + this.tokens.removeToken(); + } + } + + /** + * Erase this import (since any CJS output would be completely different), and + * return true if this import is should be elided due to being a type-only + * import. Such imports will not be emitted at all to avoid side effects. + * + * Import elision only happens with the TypeScript or Flow transforms enabled. + * + * TODO: This function has some awkward overlap with + * CJSImportProcessor.pruneTypeOnlyImports , and the two should be unified. + * That function handles TypeScript implicit import name elision, and removes + * an import if all typical imported names (without `type`) are removed due + * to being type-only imports. This function handles Flow import removal and + * properly distinguishes `import 'foo'` from `import {} from 'foo'` for TS + * purposes. + * + * The position should end at the import string. + */ + removeImportAndDetectIfShouldElide() { + this.tokens.removeInitialToken(); + if ( + this.tokens.matchesContextual(ContextualKeyword._type) && + !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.comma) && + !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._from) + ) { + // This is an "import type" statement, so exit early. + this.removeRemainingImport(); + return true; + } + + if (this.tokens.matches1(tt.name) || this.tokens.matches1(tt.star)) { + // We have a default import or namespace import, so there must be some + // non-type import. + this.removeRemainingImport(); + return false; + } + + if (this.tokens.matches1(tt.string)) { + // This is a bare import, so we should proceed with the import. + return false; + } + + let foundNonTypeImport = false; + let foundAnyNamedImport = false; + while (!this.tokens.matches1(tt.string)) { + // Check if any named imports are of the form "foo" or "foo as bar", with + // no leading "type". + if ( + (!foundNonTypeImport && this.tokens.matches1(tt.braceL)) || + this.tokens.matches1(tt.comma) + ) { + this.tokens.removeToken(); + if (!this.tokens.matches1(tt.braceR)) { + foundAnyNamedImport = true; + } + if ( + this.tokens.matches2(tt.name, tt.comma) || + this.tokens.matches2(tt.name, tt.braceR) || + this.tokens.matches4(tt.name, tt.name, tt.name, tt.comma) || + this.tokens.matches4(tt.name, tt.name, tt.name, tt.braceR) + ) { + foundNonTypeImport = true; + } + } + this.tokens.removeToken(); + } + if (this.keepUnusedImports) { + return false; + } + if (this.isTypeScriptTransformEnabled) { + return !foundNonTypeImport; + } else if (this.isFlowTransformEnabled) { + // In Flow, unlike TS, `import {} from 'foo';` preserves the import. + return foundAnyNamedImport && !foundNonTypeImport; + } else { + return false; + } + } + + removeRemainingImport() { + while (!this.tokens.matches1(tt.string)) { + this.tokens.removeToken(); + } + } + + processIdentifier() { + const token = this.tokens.currentToken(); + if (token.shadowsGlobal) { + return false; + } + + if (token.identifierRole === IdentifierRole.ObjectShorthand) { + return this.processObjectShorthand(); + } + + if (token.identifierRole !== IdentifierRole.Access) { + return false; + } + const replacement = this.importProcessor.getIdentifierReplacement( + this.tokens.identifierNameForToken(token), + ); + if (!replacement) { + return false; + } + // Tolerate any number of closing parens while looking for an opening paren + // that indicates a function call. + let possibleOpenParenIndex = this.tokens.currentIndex() + 1; + while ( + possibleOpenParenIndex < this.tokens.tokens.length && + this.tokens.tokens[possibleOpenParenIndex].type === tt.parenR + ) { + possibleOpenParenIndex++; + } + // Avoid treating imported functions as methods of their `exports` object + // by using `(0, f)` when the identifier is in a paren expression. Else + // use `Function.prototype.call` when the identifier is a guaranteed + // function call. When using `call`, pass undefined as the context. + if (this.tokens.tokens[possibleOpenParenIndex].type === tt.parenL) { + if ( + this.tokens.tokenAtRelativeIndex(1).type === tt.parenL && + this.tokens.tokenAtRelativeIndex(-1).type !== tt._new + ) { + this.tokens.replaceToken(`${replacement}.call(void 0, `); + // Remove the old paren. + this.tokens.removeToken(); + // Balance out the new paren. + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.parenR); + } else { + // See here: http://2ality.com/2015/12/references.html + this.tokens.replaceToken(`(0, ${replacement})`); + } + } else { + this.tokens.replaceToken(replacement); + } + return true; + } + + processObjectShorthand() { + const identifier = this.tokens.identifierName(); + const replacement = this.importProcessor.getIdentifierReplacement(identifier); + if (!replacement) { + return false; + } + this.tokens.replaceToken(`${identifier}: ${replacement}`); + return true; + } + + processExport() { + if ( + this.tokens.matches2(tt._export, tt._enum) || + this.tokens.matches3(tt._export, tt._const, tt._enum) + ) { + this.hadNamedExport = true; + // Let the TypeScript transform handle it. + return false; + } + if (this.tokens.matches2(tt._export, tt._default)) { + if (this.tokens.matches3(tt._export, tt._default, tt._enum)) { + this.hadDefaultExport = true; + // Flow export default enums need some special handling, so handle them + // in that tranform rather than this one. + return false; + } + this.processExportDefault(); + return true; + } else if (this.tokens.matches2(tt._export, tt.braceL)) { + this.processExportBindings(); + return true; + } else if ( + this.tokens.matches2(tt._export, tt.name) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type) + ) { + // export type {a}; + // export type {a as b}; + // export type {a} from './b'; + // export type * from './b'; + // export type * as ns from './b'; + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + if (this.tokens.matches1(tt.braceL)) { + while (!this.tokens.matches1(tt.braceR)) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + } else { + // * + this.tokens.removeToken(); + if (this.tokens.matches1(tt._as)) { + // as + this.tokens.removeToken(); + // ns + this.tokens.removeToken(); + } + } + // Remove type re-export `... } from './T'` + if ( + this.tokens.matchesContextual(ContextualKeyword._from) && + this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.string) + ) { + this.tokens.removeToken(); + this.tokens.removeToken(); + removeMaybeImportAttributes(this.tokens); + } + return true; + } + this.hadNamedExport = true; + if ( + this.tokens.matches2(tt._export, tt._var) || + this.tokens.matches2(tt._export, tt._let) || + this.tokens.matches2(tt._export, tt._const) + ) { + this.processExportVar(); + return true; + } else if ( + this.tokens.matches2(tt._export, tt._function) || + // export async function + this.tokens.matches3(tt._export, tt.name, tt._function) + ) { + this.processExportFunction(); + return true; + } else if ( + this.tokens.matches2(tt._export, tt._class) || + this.tokens.matches3(tt._export, tt._abstract, tt._class) || + this.tokens.matches2(tt._export, tt.at) + ) { + this.processExportClass(); + return true; + } else if (this.tokens.matches2(tt._export, tt.star)) { + this.processExportStar(); + return true; + } else { + throw new Error("Unrecognized export syntax."); + } + } + + processAssignment() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index - 1]; + // If the LHS is a type identifier, this must be a declaration like `let a: b = c;`, + // with `b` as the identifier, so nothing needs to be done in that case. + if (identifierToken.isType || identifierToken.type !== tt.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + if (index >= 2 && this.tokens.matches1AtIndex(index - 2, tt.dot)) { + return false; + } + if (index >= 2 && [tt._var, tt._let, tt._const].includes(this.tokens.tokens[index - 2].type)) { + // Declarations don't need an extra assignment. This doesn't avoid the + // assignment for comma-separated declarations, but it's still correct + // since the assignment is just redundant. + return false; + } + const assignmentSnippet = this.importProcessor.resolveExportBinding( + this.tokens.identifierNameForToken(identifierToken), + ); + if (!assignmentSnippet) { + return false; + } + this.tokens.copyToken(); + this.tokens.appendCode(` ${assignmentSnippet} =`); + return true; + } + + /** + * Process something like `a += 3`, where `a` might be an exported value. + */ + processComplexAssignment() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index - 1]; + if (identifierToken.type !== tt.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + if (index >= 2 && this.tokens.matches1AtIndex(index - 2, tt.dot)) { + return false; + } + const assignmentSnippet = this.importProcessor.resolveExportBinding( + this.tokens.identifierNameForToken(identifierToken), + ); + if (!assignmentSnippet) { + return false; + } + this.tokens.appendCode(` = ${assignmentSnippet}`); + this.tokens.copyToken(); + return true; + } + + /** + * Process something like `++a`, where `a` might be an exported value. + */ + processPreIncDec() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index + 1]; + if (identifierToken.type !== tt.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + // Ignore things like ++a.b and ++a[b] and ++a().b. + if ( + index + 2 < this.tokens.tokens.length && + (this.tokens.matches1AtIndex(index + 2, tt.dot) || + this.tokens.matches1AtIndex(index + 2, tt.bracketL) || + this.tokens.matches1AtIndex(index + 2, tt.parenL)) + ) { + return false; + } + const identifierName = this.tokens.identifierNameForToken(identifierToken); + const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); + if (!assignmentSnippet) { + return false; + } + this.tokens.appendCode(`${assignmentSnippet} = `); + this.tokens.copyToken(); + return true; + } + + /** + * Process something like `a++`, where `a` might be an exported value. + * This starts at the `a`, not at the `++`. + */ + processPostIncDec() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index]; + const operatorToken = this.tokens.tokens[index + 1]; + if (identifierToken.type !== tt.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + if (index >= 1 && this.tokens.matches1AtIndex(index - 1, tt.dot)) { + return false; + } + const identifierName = this.tokens.identifierNameForToken(identifierToken); + const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); + if (!assignmentSnippet) { + return false; + } + const operatorCode = this.tokens.rawCodeForToken(operatorToken); + // We might also replace the identifier with something like exports.x, so + // do that replacement here as well. + const base = this.importProcessor.getIdentifierReplacement(identifierName) || identifierName; + if (operatorCode === "++") { + this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} + 1, ${base} - 1)`); + } else if (operatorCode === "--") { + this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} - 1, ${base} + 1)`); + } else { + throw new Error(`Unexpected operator: ${operatorCode}`); + } + this.tokens.removeToken(); + return true; + } + + processExportDefault() { + let exportedRuntimeValue = true; + if ( + this.tokens.matches4(tt._export, tt._default, tt._function, tt.name) || + // export default async function + (this.tokens.matches5(tt._export, tt._default, tt.name, tt._function, tt.name) && + this.tokens.matchesContextualAtIndex( + this.tokens.currentIndex() + 2, + ContextualKeyword._async, + )) + ) { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + // Named function export case: change it to a top-level function + // declaration followed by exports statement. + const name = this.processNamedFunction(); + this.tokens.appendCode(` exports.default = ${name};`); + } else if ( + this.tokens.matches4(tt._export, tt._default, tt._class, tt.name) || + this.tokens.matches5(tt._export, tt._default, tt._abstract, tt._class, tt.name) || + this.tokens.matches3(tt._export, tt._default, tt.at) + ) { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + this.copyDecorators(); + if (this.tokens.matches1(tt._abstract)) { + this.tokens.removeToken(); + } + const name = this.rootTransformer.processNamedClass(); + this.tokens.appendCode(` exports.default = ${name};`); + // After this point, this is a plain "export default E" statement. + } else if ( + shouldElideDefaultExport( + this.isTypeScriptTransformEnabled, + this.keepUnusedImports, + this.tokens, + this.declarationInfo, + ) + ) { + // If the exported value is just an identifier and should be elided by TypeScript + // rules, then remove it entirely. It will always have the form `export default e`, + // where `e` is an identifier. + exportedRuntimeValue = false; + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + this.tokens.removeToken(); + } else if (this.reactHotLoaderTransformer) { + // We need to assign E to a variable. Change "export default E" to + // "let _default; exports.default = _default = E" + const defaultVarName = this.nameManager.claimFreeName("_default"); + this.tokens.replaceToken(`let ${defaultVarName}; exports.`); + this.tokens.copyToken(); + this.tokens.appendCode(` = ${defaultVarName} =`); + this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); + } else { + // Change "export default E" to "exports.default = E" + this.tokens.replaceToken("exports."); + this.tokens.copyToken(); + this.tokens.appendCode(" ="); + } + if (exportedRuntimeValue) { + this.hadDefaultExport = true; + } + } + + copyDecorators() { + while (this.tokens.matches1(tt.at)) { + this.tokens.copyToken(); + if (this.tokens.matches1(tt.parenL)) { + this.tokens.copyExpectedToken(tt.parenL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.parenR); + } else { + this.tokens.copyExpectedToken(tt.name); + while (this.tokens.matches1(tt.dot)) { + this.tokens.copyExpectedToken(tt.dot); + this.tokens.copyExpectedToken(tt.name); + } + if (this.tokens.matches1(tt.parenL)) { + this.tokens.copyExpectedToken(tt.parenL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.parenR); + } + } + } + } + + /** + * Transform a declaration like `export var`, `export let`, or `export const`. + */ + processExportVar() { + if (this.isSimpleExportVar()) { + this.processSimpleExportVar(); + } else { + this.processComplexExportVar(); + } + } + + /** + * Determine if the export is of the form: + * export var/let/const [varName] = [expr]; + * In other words, determine if function name inference might apply. + */ + isSimpleExportVar() { + let tokenIndex = this.tokens.currentIndex(); + // export + tokenIndex++; + // var/let/const + tokenIndex++; + if (!this.tokens.matches1AtIndex(tokenIndex, tt.name)) { + return false; + } + tokenIndex++; + while (tokenIndex < this.tokens.tokens.length && this.tokens.tokens[tokenIndex].isType) { + tokenIndex++; + } + if (!this.tokens.matches1AtIndex(tokenIndex, tt.eq)) { + return false; + } + return true; + } + + /** + * Transform an `export var` declaration initializing a single variable. + * + * For example, this: + * export const f = () => {}; + * becomes this: + * const f = () => {}; exports.f = f; + * + * The variable is unused (e.g. exports.f has the true value of the export). + * We need to produce an assignment of this form so that the function will + * have an inferred name of "f", which wouldn't happen in the more general + * case below. + */ + processSimpleExportVar() { + // export + this.tokens.removeInitialToken(); + // var/let/const + this.tokens.copyToken(); + const varName = this.tokens.identifierName(); + // x: number -> x + while (!this.tokens.matches1(tt.eq)) { + this.rootTransformer.processToken(); + } + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + while (this.tokens.currentIndex() < endIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode(`; exports.${varName} = ${varName}`); + } + + /** + * Transform normal declaration exports, including handling destructuring. + * For example, this: + * export const {x: [a = 2, b], c} = d; + * becomes this: + * ({x: [exports.a = 2, exports.b], c: exports.c} = d;) + */ + processComplexExportVar() { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + const needsParens = this.tokens.matches1(tt.braceL); + if (needsParens) { + this.tokens.appendCode("("); + } + + let depth = 0; + while (true) { + if ( + this.tokens.matches1(tt.braceL) || + this.tokens.matches1(tt.dollarBraceL) || + this.tokens.matches1(tt.bracketL) + ) { + depth++; + this.tokens.copyToken(); + } else if (this.tokens.matches1(tt.braceR) || this.tokens.matches1(tt.bracketR)) { + depth--; + this.tokens.copyToken(); + } else if ( + depth === 0 && + !this.tokens.matches1(tt.name) && + !this.tokens.currentToken().isType + ) { + break; + } else if (this.tokens.matches1(tt.eq)) { + // Default values might have assignments in the RHS that we want to ignore, so skip past + // them. + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + while (this.tokens.currentIndex() < endIndex) { + this.rootTransformer.processToken(); + } + } else { + const token = this.tokens.currentToken(); + if (isDeclaration(token)) { + const name = this.tokens.identifierName(); + let replacement = this.importProcessor.getIdentifierReplacement(name); + if (replacement === null) { + throw new Error(`Expected a replacement for ${name} in \`export var\` syntax.`); + } + if (isObjectShorthandDeclaration(token)) { + replacement = `${name}: ${replacement}`; + } + this.tokens.replaceToken(replacement); + } else { + this.rootTransformer.processToken(); + } + } + } + + if (needsParens) { + // Seek to the end of the RHS. + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + while (this.tokens.currentIndex() < endIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode(")"); + } + } + + /** + * Transform this: + * export function foo() {} + * into this: + * function foo() {} exports.foo = foo; + */ + processExportFunction() { + this.tokens.replaceToken(""); + const name = this.processNamedFunction(); + this.tokens.appendCode(` exports.${name} = ${name};`); + } + + /** + * Skip past a function with a name and return that name. + */ + processNamedFunction() { + if (this.tokens.matches1(tt._function)) { + this.tokens.copyToken(); + } else if (this.tokens.matches2(tt.name, tt._function)) { + if (!this.tokens.matchesContextual(ContextualKeyword._async)) { + throw new Error("Expected async keyword in function export."); + } + this.tokens.copyToken(); + this.tokens.copyToken(); + } + if (this.tokens.matches1(tt.star)) { + this.tokens.copyToken(); + } + if (!this.tokens.matches1(tt.name)) { + throw new Error("Expected identifier for exported function name."); + } + const name = this.tokens.identifierName(); + this.tokens.copyToken(); + if (this.tokens.currentToken().isType) { + this.tokens.removeInitialToken(); + while (this.tokens.currentToken().isType) { + this.tokens.removeToken(); + } + } + this.tokens.copyExpectedToken(tt.parenL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.parenR); + this.rootTransformer.processPossibleTypeRange(); + this.tokens.copyExpectedToken(tt.braceL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.braceR); + return name; + } + + /** + * Transform this: + * export class A {} + * into this: + * class A {} exports.A = A; + */ + processExportClass() { + this.tokens.removeInitialToken(); + this.copyDecorators(); + if (this.tokens.matches1(tt._abstract)) { + this.tokens.removeToken(); + } + const name = this.rootTransformer.processNamedClass(); + this.tokens.appendCode(` exports.${name} = ${name};`); + } + + /** + * Transform this: + * export {a, b as c}; + * into this: + * exports.a = a; exports.c = b; + * + * OR + * + * Transform this: + * export {a, b as c} from './foo'; + * into the pre-generated Object.defineProperty code from the ImportProcessor. + * + * For the first case, if the TypeScript transform is enabled, we need to skip + * exports that are only defined as types. + */ + processExportBindings() { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + + const isReExport = isExportFrom(this.tokens); + + const exportStatements = []; + while (true) { + if (this.tokens.matches1(tt.braceR)) { + this.tokens.removeToken(); + break; + } + + const specifierInfo = getImportExportSpecifierInfo(this.tokens); + + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.removeToken(); + } + + const shouldRemoveExport = + specifierInfo.isType || + (!isReExport && this.shouldElideExportedIdentifier(specifierInfo.leftName)); + if (!shouldRemoveExport) { + const exportedName = specifierInfo.rightName; + if (exportedName === "default") { + this.hadDefaultExport = true; + } else { + this.hadNamedExport = true; + } + const localName = specifierInfo.leftName; + const newLocalName = this.importProcessor.getIdentifierReplacement(localName); + exportStatements.push(`exports.${exportedName} = ${newLocalName || localName};`); + } + + if (this.tokens.matches1(tt.braceR)) { + this.tokens.removeToken(); + break; + } + if (this.tokens.matches2(tt.comma, tt.braceR)) { + this.tokens.removeToken(); + this.tokens.removeToken(); + break; + } else if (this.tokens.matches1(tt.comma)) { + this.tokens.removeToken(); + } else { + throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`); + } + } + + if (this.tokens.matchesContextual(ContextualKeyword._from)) { + // This is an export...from, so throw away the normal named export code + // and use the Object.defineProperty code from ImportProcessor. + this.tokens.removeToken(); + const path = this.tokens.stringValue(); + this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); + removeMaybeImportAttributes(this.tokens); + } else { + // This is a normal named export, so use that. + this.tokens.appendCode(exportStatements.join(" ")); + } + + if (this.tokens.matches1(tt.semi)) { + this.tokens.removeToken(); + } + } + + processExportStar() { + this.tokens.removeInitialToken(); + while (!this.tokens.matches1(tt.string)) { + this.tokens.removeToken(); + } + const path = this.tokens.stringValue(); + this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); + removeMaybeImportAttributes(this.tokens); + if (this.tokens.matches1(tt.semi)) { + this.tokens.removeToken(); + } + } + + shouldElideExportedIdentifier(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + !this.declarationInfo.valueDeclarations.has(name) + ); + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js b/node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js new file mode 100644 index 0000000..b45cd3e --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js @@ -0,0 +1,415 @@ + + + +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + +import elideImportEquals from "../util/elideImportEquals"; +import getDeclarationInfo, { + + EMPTY_DECLARATION_INFO, +} from "../util/getDeclarationInfo"; +import getImportExportSpecifierInfo from "../util/getImportExportSpecifierInfo"; +import {getNonTypeIdentifiers} from "../util/getNonTypeIdentifiers"; +import isExportFrom from "../util/isExportFrom"; +import {removeMaybeImportAttributes} from "../util/removeMaybeImportAttributes"; +import shouldElideDefaultExport from "../util/shouldElideDefaultExport"; + +import Transformer from "./Transformer"; + +/** + * Class for editing import statements when we are keeping the code as ESM. We still need to remove + * type-only imports in TypeScript and Flow. + */ +export default class ESMImportTransformer extends Transformer { + + + + + constructor( + tokens, + nameManager, + helperManager, + reactHotLoaderTransformer, + isTypeScriptTransformEnabled, + isFlowTransformEnabled, + keepUnusedImports, + options, + ) { + super();this.tokens = tokens;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.keepUnusedImports = keepUnusedImports;; + this.nonTypeIdentifiers = + isTypeScriptTransformEnabled && !keepUnusedImports + ? getNonTypeIdentifiers(tokens, options) + : new Set(); + this.declarationInfo = + isTypeScriptTransformEnabled && !keepUnusedImports + ? getDeclarationInfo(tokens) + : EMPTY_DECLARATION_INFO; + this.injectCreateRequireForImportRequire = Boolean(options.injectCreateRequireForImportRequire); + } + + process() { + // TypeScript `import foo = require('foo');` should always just be translated to plain require. + if (this.tokens.matches3(tt._import, tt.name, tt.eq)) { + return this.processImportEquals(); + } + if ( + this.tokens.matches4(tt._import, tt.name, tt.name, tt.eq) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type) + ) { + // import type T = require('T') + this.tokens.removeInitialToken(); + // This construct is always exactly 8 tokens long, so remove the 7 remaining tokens. + for (let i = 0; i < 7; i++) { + this.tokens.removeToken(); + } + return true; + } + if (this.tokens.matches2(tt._export, tt.eq)) { + this.tokens.replaceToken("module.exports"); + return true; + } + if ( + this.tokens.matches5(tt._export, tt._import, tt.name, tt.name, tt.eq) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._type) + ) { + // export import type T = require('T') + this.tokens.removeInitialToken(); + // This construct is always exactly 9 tokens long, so remove the 8 remaining tokens. + for (let i = 0; i < 8; i++) { + this.tokens.removeToken(); + } + return true; + } + if (this.tokens.matches1(tt._import)) { + return this.processImport(); + } + if (this.tokens.matches2(tt._export, tt._default)) { + return this.processExportDefault(); + } + if (this.tokens.matches2(tt._export, tt.braceL)) { + return this.processNamedExports(); + } + if ( + this.tokens.matches2(tt._export, tt.name) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type) + ) { + // export type {a}; + // export type {a as b}; + // export type {a} from './b'; + // export type * from './b'; + // export type * as ns from './b'; + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + if (this.tokens.matches1(tt.braceL)) { + while (!this.tokens.matches1(tt.braceR)) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + } else { + // * + this.tokens.removeToken(); + if (this.tokens.matches1(tt._as)) { + // as + this.tokens.removeToken(); + // ns + this.tokens.removeToken(); + } + } + // Remove type re-export `... } from './T'` + if ( + this.tokens.matchesContextual(ContextualKeyword._from) && + this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.string) + ) { + this.tokens.removeToken(); + this.tokens.removeToken(); + removeMaybeImportAttributes(this.tokens); + } + return true; + } + return false; + } + + processImportEquals() { + const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + if (this.shouldAutomaticallyElideImportedName(importName)) { + // If this name is only used as a type, elide the whole import. + elideImportEquals(this.tokens); + } else if (this.injectCreateRequireForImportRequire) { + // We're using require in an environment (Node ESM) that doesn't provide + // it as a global, so generate a helper to import it. + // import -> const + this.tokens.replaceToken("const"); + // Foo + this.tokens.copyToken(); + // = + this.tokens.copyToken(); + // require + this.tokens.replaceToken(this.helperManager.getHelperName("require")); + } else { + // Otherwise, just switch `import` to `const`. + this.tokens.replaceToken("const"); + } + return true; + } + + processImport() { + if (this.tokens.matches2(tt._import, tt.parenL)) { + // Dynamic imports don't need to be transformed. + return false; + } + + const snapshot = this.tokens.snapshot(); + const allImportsRemoved = this.removeImportTypeBindings(); + if (allImportsRemoved) { + this.tokens.restoreToSnapshot(snapshot); + while (!this.tokens.matches1(tt.string)) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + removeMaybeImportAttributes(this.tokens); + if (this.tokens.matches1(tt.semi)) { + this.tokens.removeToken(); + } + } + return true; + } + + /** + * Remove type bindings from this import, leaving the rest of the import intact. + * + * Return true if this import was ONLY types, and thus is eligible for removal. This will bail out + * of the replacement operation, so we can return early here. + */ + removeImportTypeBindings() { + this.tokens.copyExpectedToken(tt._import); + if ( + this.tokens.matchesContextual(ContextualKeyword._type) && + !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.comma) && + !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._from) + ) { + // This is an "import type" statement, so exit early. + return true; + } + + if (this.tokens.matches1(tt.string)) { + // This is a bare import, so we should proceed with the import. + this.tokens.copyToken(); + return false; + } + + // Skip the "module" token in import reflection. + if ( + this.tokens.matchesContextual(ContextualKeyword._module) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._from) + ) { + this.tokens.copyToken(); + } + + let foundNonTypeImport = false; + let foundAnyNamedImport = false; + let needsComma = false; + + // Handle default import. + if (this.tokens.matches1(tt.name)) { + if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())) { + this.tokens.removeToken(); + if (this.tokens.matches1(tt.comma)) { + this.tokens.removeToken(); + } + } else { + foundNonTypeImport = true; + this.tokens.copyToken(); + if (this.tokens.matches1(tt.comma)) { + // We're in a statement like: + // import A, * as B from './A'; + // or + // import A, {foo} from './A'; + // where the `A` is being kept. The comma should be removed if an only + // if the next part of the import statement is elided, but that's hard + // to determine at this point in the code. Instead, always remove it + // and set a flag to add it back if necessary. + needsComma = true; + this.tokens.removeToken(); + } + } + } + + if (this.tokens.matches1(tt.star)) { + if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))) { + this.tokens.removeToken(); + this.tokens.removeToken(); + this.tokens.removeToken(); + } else { + if (needsComma) { + this.tokens.appendCode(","); + } + foundNonTypeImport = true; + this.tokens.copyExpectedToken(tt.star); + this.tokens.copyExpectedToken(tt.name); + this.tokens.copyExpectedToken(tt.name); + } + } else if (this.tokens.matches1(tt.braceL)) { + if (needsComma) { + this.tokens.appendCode(","); + } + this.tokens.copyToken(); + while (!this.tokens.matches1(tt.braceR)) { + foundAnyNamedImport = true; + const specifierInfo = getImportExportSpecifierInfo(this.tokens); + if ( + specifierInfo.isType || + this.shouldAutomaticallyElideImportedName(specifierInfo.rightName) + ) { + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.removeToken(); + } + if (this.tokens.matches1(tt.comma)) { + this.tokens.removeToken(); + } + } else { + foundNonTypeImport = true; + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.copyToken(); + } + if (this.tokens.matches1(tt.comma)) { + this.tokens.copyToken(); + } + } + } + this.tokens.copyExpectedToken(tt.braceR); + } + + if (this.keepUnusedImports) { + return false; + } + if (this.isTypeScriptTransformEnabled) { + return !foundNonTypeImport; + } else if (this.isFlowTransformEnabled) { + // In Flow, unlike TS, `import {} from 'foo';` preserves the import. + return foundAnyNamedImport && !foundNonTypeImport; + } else { + return false; + } + } + + shouldAutomaticallyElideImportedName(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + !this.nonTypeIdentifiers.has(name) + ); + } + + processExportDefault() { + if ( + shouldElideDefaultExport( + this.isTypeScriptTransformEnabled, + this.keepUnusedImports, + this.tokens, + this.declarationInfo, + ) + ) { + // If the exported value is just an identifier and should be elided by TypeScript + // rules, then remove it entirely. It will always have the form `export default e`, + // where `e` is an identifier. + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + this.tokens.removeToken(); + return true; + } + + const alreadyHasName = + this.tokens.matches4(tt._export, tt._default, tt._function, tt.name) || + // export default async function + (this.tokens.matches5(tt._export, tt._default, tt.name, tt._function, tt.name) && + this.tokens.matchesContextualAtIndex( + this.tokens.currentIndex() + 2, + ContextualKeyword._async, + )) || + this.tokens.matches4(tt._export, tt._default, tt._class, tt.name) || + this.tokens.matches5(tt._export, tt._default, tt._abstract, tt._class, tt.name); + + if (!alreadyHasName && this.reactHotLoaderTransformer) { + // This is a plain "export default E" statement and we need to assign E to a variable. + // Change "export default E" to "let _default; export default _default = E" + const defaultVarName = this.nameManager.claimFreeName("_default"); + this.tokens.replaceToken(`let ${defaultVarName}; export`); + this.tokens.copyToken(); + this.tokens.appendCode(` ${defaultVarName} =`); + this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); + return true; + } + return false; + } + + /** + * Handle a statement with one of these forms: + * export {a, type b}; + * export {c, type d} from 'foo'; + * + * In both cases, any explicit type exports should be removed. In the first + * case, we also need to handle implicit export elision for names declared as + * types. In the second case, we must NOT do implicit named export elision, + * but we must remove the runtime import if all exports are type exports. + */ + processNamedExports() { + if (!this.isTypeScriptTransformEnabled) { + return false; + } + this.tokens.copyExpectedToken(tt._export); + this.tokens.copyExpectedToken(tt.braceL); + + const isReExport = isExportFrom(this.tokens); + let foundNonTypeExport = false; + while (!this.tokens.matches1(tt.braceR)) { + const specifierInfo = getImportExportSpecifierInfo(this.tokens); + if ( + specifierInfo.isType || + (!isReExport && this.shouldElideExportedName(specifierInfo.leftName)) + ) { + // Type export, so remove all tokens, including any comma. + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.removeToken(); + } + if (this.tokens.matches1(tt.comma)) { + this.tokens.removeToken(); + } + } else { + // Non-type export, so copy all tokens, including any comma. + foundNonTypeExport = true; + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.copyToken(); + } + if (this.tokens.matches1(tt.comma)) { + this.tokens.copyToken(); + } + } + } + this.tokens.copyExpectedToken(tt.braceR); + + if (!this.keepUnusedImports && isReExport && !foundNonTypeExport) { + // This is a type-only re-export, so skip evaluating the other module. Technically this + // leaves the statement as `export {}`, but that's ok since that's a no-op. + this.tokens.removeToken(); + this.tokens.removeToken(); + removeMaybeImportAttributes(this.tokens); + } + + return true; + } + + /** + * ESM elides all imports with the rule that we only elide if we see that it's + * a type and never see it as a value. This is in contrast to CJS, which + * elides imports that are completely unknown. + */ + shouldElideExportedName(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + this.declarationInfo.typeDeclarations.has(name) && + !this.declarationInfo.valueDeclarations.has(name) + ); + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/FlowTransformer.js b/node_modules/sucrase/dist/esm/transformers/FlowTransformer.js new file mode 100644 index 0000000..7df0aca --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/FlowTransformer.js @@ -0,0 +1,182 @@ +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + + +import Transformer from "./Transformer"; + +export default class FlowTransformer extends Transformer { + constructor( + rootTransformer, + tokens, + isImportsTransformEnabled, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; + } + + process() { + if ( + this.rootTransformer.processPossibleArrowParamEnd() || + this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || + this.rootTransformer.processPossibleTypeRange() + ) { + return true; + } + if (this.tokens.matches1(tt._enum)) { + this.processEnum(); + return true; + } + if (this.tokens.matches2(tt._export, tt._enum)) { + this.processNamedExportEnum(); + return true; + } + if (this.tokens.matches3(tt._export, tt._default, tt._enum)) { + this.processDefaultExportEnum(); + return true; + } + return false; + } + + /** + * Handle a declaration like: + * export enum E ... + * + * With this imports transform, this becomes: + * const E = [[enum]]; exports.E = E; + * + * otherwise, it becomes: + * export const E = [[enum]]; + */ + processNamedExportEnum() { + if (this.isImportsTransformEnabled) { + // export + this.tokens.removeInitialToken(); + const enumName = this.tokens.identifierNameAtRelativeIndex(1); + this.processEnum(); + this.tokens.appendCode(` exports.${enumName} = ${enumName};`); + } else { + this.tokens.copyToken(); + this.processEnum(); + } + } + + /** + * Handle a declaration like: + * export default enum E + * + * With the imports transform, this becomes: + * const E = [[enum]]; exports.default = E; + * + * otherwise, it becomes: + * const E = [[enum]]; export default E; + */ + processDefaultExportEnum() { + // export + this.tokens.removeInitialToken(); + // default + this.tokens.removeToken(); + const enumName = this.tokens.identifierNameAtRelativeIndex(1); + this.processEnum(); + if (this.isImportsTransformEnabled) { + this.tokens.appendCode(` exports.default = ${enumName};`); + } else { + this.tokens.appendCode(` export default ${enumName};`); + } + } + + /** + * Transpile flow enums to invoke the "flow-enums-runtime" library. + * + * Currently, the transpiled code always uses `require("flow-enums-runtime")`, + * but if future flexibility is needed, we could expose a config option for + * this string (similar to configurable JSX). Even when targeting ESM, the + * default behavior of babel-plugin-transform-flow-enums is to use require + * rather than injecting an import. + * + * Flow enums are quite a bit simpler than TS enums and have some convenient + * constraints: + * - Element initializers must be either always present or always absent. That + * means that we can use fixed lookahead on the first element (if any) and + * assume that all elements are like that. + * - The right-hand side of an element initializer must be a literal value, + * not a complex expression and not referencing other elements. That means + * we can simply copy a single token. + * + * Enums can be broken up into three basic cases: + * + * Mirrored enums: + * enum E {A, B} + * -> + * const E = require("flow-enums-runtime").Mirrored(["A", "B"]); + * + * Initializer enums: + * enum E {A = 1, B = 2} + * -> + * const E = require("flow-enums-runtime")({A: 1, B: 2}); + * + * Symbol enums: + * enum E of symbol {A, B} + * -> + * const E = require("flow-enums-runtime")({A: Symbol("A"), B: Symbol("B")}); + * + * We can statically detect which of the three cases this is by looking at the + * "of" declaration (if any) and seeing if the first element has an initializer. + * Since the other transform details are so similar between the three cases, we + * use a single implementation and vary the transform within processEnumElement + * based on case. + */ + processEnum() { + // enum E -> const E + this.tokens.replaceToken("const"); + this.tokens.copyExpectedToken(tt.name); + + let isSymbolEnum = false; + if (this.tokens.matchesContextual(ContextualKeyword._of)) { + this.tokens.removeToken(); + isSymbolEnum = this.tokens.matchesContextual(ContextualKeyword._symbol); + this.tokens.removeToken(); + } + const hasInitializers = this.tokens.matches3(tt.braceL, tt.name, tt.eq); + this.tokens.appendCode(' = require("flow-enums-runtime")'); + + const isMirrored = !isSymbolEnum && !hasInitializers; + this.tokens.replaceTokenTrimmingLeftWhitespace(isMirrored ? ".Mirrored([" : "({"); + + while (!this.tokens.matches1(tt.braceR)) { + // ... is allowed at the end and has no runtime behavior. + if (this.tokens.matches1(tt.ellipsis)) { + this.tokens.removeToken(); + break; + } + this.processEnumElement(isSymbolEnum, hasInitializers); + if (this.tokens.matches1(tt.comma)) { + this.tokens.copyToken(); + } + } + + this.tokens.replaceToken(isMirrored ? "]);" : "});"); + } + + /** + * Process an individual enum element, producing either an array element or an + * object element based on what type of enum this is. + */ + processEnumElement(isSymbolEnum, hasInitializers) { + if (isSymbolEnum) { + // Symbol enums never have initializers and are expanded to object elements. + // A, -> A: Symbol("A"), + const elementName = this.tokens.identifierName(); + this.tokens.copyToken(); + this.tokens.appendCode(`: Symbol("${elementName}")`); + } else if (hasInitializers) { + // Initializers are expanded to object elements. + // A = 1, -> A: 1, + this.tokens.copyToken(); + this.tokens.replaceTokenTrimmingLeftWhitespace(":"); + this.tokens.copyToken(); + } else { + // Enum elements without initializers become string literal array elements. + // A, -> "A", + this.tokens.replaceToken(`"${this.tokens.identifierName()}"`); + } + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/JSXTransformer.js b/node_modules/sucrase/dist/esm/transformers/JSXTransformer.js new file mode 100644 index 0000000..e5f5ae5 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/JSXTransformer.js @@ -0,0 +1,733 @@ + + + +import XHTMLEntities from "../parser/plugins/jsx/xhtml"; +import {JSXRole} from "../parser/tokenizer"; +import {TokenType as tt} from "../parser/tokenizer/types"; +import {charCodes} from "../parser/util/charcodes"; + +import getJSXPragmaInfo, {} from "../util/getJSXPragmaInfo"; + +import Transformer from "./Transformer"; + +export default class JSXTransformer extends Transformer { + + + + + // State for calculating the line number of each JSX tag in development. + __init() {this.lastLineNumber = 1} + __init2() {this.lastIndex = 0} + + // In development, variable name holding the name of the current file. + __init3() {this.filenameVarName = null} + // Mapping of claimed names for imports in the automatic transform, e,g. + // {jsx: "_jsx"}. This determines which imports to generate in the prefix. + __init4() {this.esmAutomaticImportNameResolutions = {}} + // When automatically adding imports in CJS mode, we store the variable name + // holding the imported CJS module so we can require it in the prefix. + __init5() {this.cjsAutomaticModuleNameResolutions = {}} + + constructor( + rootTransformer, + tokens, + importProcessor, + nameManager, + options, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.options = options;JSXTransformer.prototype.__init.call(this);JSXTransformer.prototype.__init2.call(this);JSXTransformer.prototype.__init3.call(this);JSXTransformer.prototype.__init4.call(this);JSXTransformer.prototype.__init5.call(this);; + this.jsxPragmaInfo = getJSXPragmaInfo(options); + this.isAutomaticRuntime = options.jsxRuntime === "automatic"; + this.jsxImportSource = options.jsxImportSource || "react"; + } + + process() { + if (this.tokens.matches1(tt.jsxTagStart)) { + this.processJSXTag(); + return true; + } + return false; + } + + getPrefixCode() { + let prefix = ""; + if (this.filenameVarName) { + prefix += `const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath || "")};`; + } + if (this.isAutomaticRuntime) { + if (this.importProcessor) { + // CJS mode: emit require statements for all modules that were referenced. + for (const [path, resolvedName] of Object.entries(this.cjsAutomaticModuleNameResolutions)) { + prefix += `var ${resolvedName} = require("${path}");`; + } + } else { + // ESM mode: consolidate and emit import statements for referenced names. + const {createElement: createElementResolution, ...otherResolutions} = + this.esmAutomaticImportNameResolutions; + if (createElementResolution) { + prefix += `import {createElement as ${createElementResolution}} from "${this.jsxImportSource}";`; + } + const importSpecifiers = Object.entries(otherResolutions) + .map(([name, resolvedName]) => `${name} as ${resolvedName}`) + .join(", "); + if (importSpecifiers) { + const importPath = + this.jsxImportSource + (this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime"); + prefix += `import {${importSpecifiers}} from "${importPath}";`; + } + } + } + return prefix; + } + + processJSXTag() { + const {jsxRole, start} = this.tokens.currentToken(); + // Calculate line number information at the very start (if in development + // mode) so that the information is guaranteed to be queried in token order. + const elementLocationCode = this.options.production ? null : this.getElementLocationCode(start); + if (this.isAutomaticRuntime && jsxRole !== JSXRole.KeyAfterPropSpread) { + this.transformTagToJSXFunc(elementLocationCode, jsxRole); + } else { + this.transformTagToCreateElement(elementLocationCode); + } + } + + getElementLocationCode(firstTokenStart) { + const lineNumber = this.getLineNumberForIndex(firstTokenStart); + return `lineNumber: ${lineNumber}`; + } + + /** + * Get the line number for this source position. This is calculated lazily and + * must be called in increasing order by index. + */ + getLineNumberForIndex(index) { + const code = this.tokens.code; + while (this.lastIndex < index && this.lastIndex < code.length) { + if (code[this.lastIndex] === "\n") { + this.lastLineNumber++; + } + this.lastIndex++; + } + return this.lastLineNumber; + } + + /** + * Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is + * the primary transformation for the automatic transform. + * + * Example: + *
Hello{x}
+ * becomes + * jsxs('div', {a: 1, children: ["Hello", x]}, 2) + */ + transformTagToJSXFunc(elementLocationCode, jsxRole) { + const isStatic = jsxRole === JSXRole.StaticChildren; + // First tag is always jsxTagStart. + this.tokens.replaceToken(this.getJSXFuncInvocationCode(isStatic)); + + let keyCode = null; + if (this.tokens.matches1(tt.jsxTagEnd)) { + // Fragment syntax. + this.tokens.replaceToken(`${this.getFragmentCode()}, {`); + this.processAutomaticChildrenAndEndProps(jsxRole); + } else { + // Normal open tag or self-closing tag. + this.processTagIntro(); + this.tokens.appendCode(", {"); + keyCode = this.processProps(true); + + if (this.tokens.matches2(tt.slash, tt.jsxTagEnd)) { + // Self-closing tag, no children to add, so close the props. + this.tokens.appendCode("}"); + } else if (this.tokens.matches1(tt.jsxTagEnd)) { + // Tag with children. + this.tokens.removeToken(); + this.processAutomaticChildrenAndEndProps(jsxRole); + } else { + throw new Error("Expected either /> or > at the end of the tag."); + } + // If a key was present, move it to its own arg. Note that moving code + // like this will cause line numbers to get out of sync within the JSX + // element if the key expression has a newline in it. This is unfortunate, + // but hopefully should be rare. + if (keyCode) { + this.tokens.appendCode(`, ${keyCode}`); + } + } + if (!this.options.production) { + // If the key wasn't already added, add it now so we can correctly set + // positional args for jsxDEV. + if (keyCode === null) { + this.tokens.appendCode(", void 0"); + } + this.tokens.appendCode(`, ${isStatic}, ${this.getDevSource(elementLocationCode)}, this`); + } + // We're at the close-tag or the end of a self-closing tag, so remove + // everything else and close the function call. + this.tokens.removeInitialToken(); + while (!this.tokens.matches1(tt.jsxTagEnd)) { + this.tokens.removeToken(); + } + this.tokens.replaceToken(")"); + } + + /** + * Convert the current JSX element to a createElement call. In the classic + * runtime, this is the only case. In the automatic runtime, this is called + * as a fallback in some situations. + * + * Example: + *
Hello{x}
+ * becomes + * React.createElement('div', {a: 1, key: 2}, "Hello", x) + */ + transformTagToCreateElement(elementLocationCode) { + // First tag is always jsxTagStart. + this.tokens.replaceToken(this.getCreateElementInvocationCode()); + + if (this.tokens.matches1(tt.jsxTagEnd)) { + // Fragment syntax. + this.tokens.replaceToken(`${this.getFragmentCode()}, null`); + this.processChildren(true); + } else { + // Normal open tag or self-closing tag. + this.processTagIntro(); + this.processPropsObjectWithDevInfo(elementLocationCode); + + if (this.tokens.matches2(tt.slash, tt.jsxTagEnd)) { + // Self-closing tag; no children to process. + } else if (this.tokens.matches1(tt.jsxTagEnd)) { + // Tag with children and a close-tag; process the children as args. + this.tokens.removeToken(); + this.processChildren(true); + } else { + throw new Error("Expected either /> or > at the end of the tag."); + } + } + // We're at the close-tag or the end of a self-closing tag, so remove + // everything else and close the function call. + this.tokens.removeInitialToken(); + while (!this.tokens.matches1(tt.jsxTagEnd)) { + this.tokens.removeToken(); + } + this.tokens.replaceToken(")"); + } + + /** + * Get the code for the relevant function for this context: jsx, jsxs, + * or jsxDEV. The following open-paren is included as well. + * + * These functions are only used for the automatic runtime, so they are always + * auto-imported, but the auto-import will be either CJS or ESM based on the + * target module format. + */ + getJSXFuncInvocationCode(isStatic) { + if (this.options.production) { + if (isStatic) { + return this.claimAutoImportedFuncInvocation("jsxs", "/jsx-runtime"); + } else { + return this.claimAutoImportedFuncInvocation("jsx", "/jsx-runtime"); + } + } else { + return this.claimAutoImportedFuncInvocation("jsxDEV", "/jsx-dev-runtime"); + } + } + + /** + * Return the code to use for the createElement function, e.g. + * `React.createElement`, including the following open-paren. + * + * This is the main function to use for the classic runtime. For the + * automatic runtime, this function is used as a fallback function to + * preserve behavior when there is a prop spread followed by an explicit + * key. In that automatic runtime case, the function should be automatically + * imported. + */ + getCreateElementInvocationCode() { + if (this.isAutomaticRuntime) { + return this.claimAutoImportedFuncInvocation("createElement", ""); + } else { + const {jsxPragmaInfo} = this; + const resolvedPragmaBaseName = this.importProcessor + ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.base) || jsxPragmaInfo.base + : jsxPragmaInfo.base; + return `${resolvedPragmaBaseName}${jsxPragmaInfo.suffix}(`; + } + } + + /** + * Return the code to use as the component when compiling a shorthand + * fragment, e.g. `React.Fragment`. + * + * This may be called from either the classic or automatic runtime, and + * the value should be auto-imported for the automatic runtime. + */ + getFragmentCode() { + if (this.isAutomaticRuntime) { + return this.claimAutoImportedName( + "Fragment", + this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime", + ); + } else { + const {jsxPragmaInfo} = this; + const resolvedFragmentPragmaBaseName = this.importProcessor + ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.fragmentBase) || + jsxPragmaInfo.fragmentBase + : jsxPragmaInfo.fragmentBase; + return resolvedFragmentPragmaBaseName + jsxPragmaInfo.fragmentSuffix; + } + } + + /** + * Return code that invokes the given function. + * + * When the imports transform is enabled, use the CJSImportTransformer + * strategy of using `.call(void 0, ...` to avoid passing a `this` value in a + * situation that would otherwise look like a method call. + */ + claimAutoImportedFuncInvocation(funcName, importPathSuffix) { + const funcCode = this.claimAutoImportedName(funcName, importPathSuffix); + if (this.importProcessor) { + return `${funcCode}.call(void 0, `; + } else { + return `${funcCode}(`; + } + } + + claimAutoImportedName(funcName, importPathSuffix) { + if (this.importProcessor) { + // CJS mode: claim a name for the module and mark it for import. + const path = this.jsxImportSource + importPathSuffix; + if (!this.cjsAutomaticModuleNameResolutions[path]) { + this.cjsAutomaticModuleNameResolutions[path] = + this.importProcessor.getFreeIdentifierForPath(path); + } + return `${this.cjsAutomaticModuleNameResolutions[path]}.${funcName}`; + } else { + // ESM mode: claim a name for this function and add it to the names that + // should be auto-imported when the prefix is generated. + if (!this.esmAutomaticImportNameResolutions[funcName]) { + this.esmAutomaticImportNameResolutions[funcName] = this.nameManager.claimFreeName( + `_${funcName}`, + ); + } + return this.esmAutomaticImportNameResolutions[funcName]; + } + } + + /** + * Process the first part of a tag, before any props. + */ + processTagIntro() { + // Walk forward until we see one of these patterns: + // jsxName to start the first prop, preceded by another jsxName to end the tag name. + // jsxName to start the first prop, preceded by greaterThan to end the type argument. + // [open brace] to start the first prop. + // [jsxTagEnd] to end the open-tag. + // [slash, jsxTagEnd] to end the self-closing tag. + let introEnd = this.tokens.currentIndex() + 1; + while ( + this.tokens.tokens[introEnd].isType || + (!this.tokens.matches2AtIndex(introEnd - 1, tt.jsxName, tt.jsxName) && + !this.tokens.matches2AtIndex(introEnd - 1, tt.greaterThan, tt.jsxName) && + !this.tokens.matches1AtIndex(introEnd, tt.braceL) && + !this.tokens.matches1AtIndex(introEnd, tt.jsxTagEnd) && + !this.tokens.matches2AtIndex(introEnd, tt.slash, tt.jsxTagEnd)) + ) { + introEnd++; + } + if (introEnd === this.tokens.currentIndex() + 1) { + const tagName = this.tokens.identifierName(); + if (startsWithLowerCase(tagName)) { + this.tokens.replaceToken(`'${tagName}'`); + } + } + while (this.tokens.currentIndex() < introEnd) { + this.rootTransformer.processToken(); + } + } + + /** + * Starting at the beginning of the props, add the props argument to + * React.createElement, including the comma before it. + */ + processPropsObjectWithDevInfo(elementLocationCode) { + const devProps = this.options.production + ? "" + : `__self: this, __source: ${this.getDevSource(elementLocationCode)}`; + if (!this.tokens.matches1(tt.jsxName) && !this.tokens.matches1(tt.braceL)) { + if (devProps) { + this.tokens.appendCode(`, {${devProps}}`); + } else { + this.tokens.appendCode(`, null`); + } + return; + } + this.tokens.appendCode(`, {`); + this.processProps(false); + if (devProps) { + this.tokens.appendCode(` ${devProps}}`); + } else { + this.tokens.appendCode("}"); + } + } + + /** + * Transform the core part of the props, assuming that a { has already been + * inserted before us and that a } will be inserted after us. + * + * If extractKeyCode is true (i.e. when using any jsx... function), any prop + * named "key" has its code captured and returned rather than being emitted to + * the output code. This shifts line numbers, and emitting the code later will + * correct line numbers again. If no key is found or if extractKeyCode is + * false, this function returns null. + */ + processProps(extractKeyCode) { + let keyCode = null; + while (true) { + if (this.tokens.matches2(tt.jsxName, tt.eq)) { + // This is a regular key={value} or key="value" prop. + const propName = this.tokens.identifierName(); + if (extractKeyCode && propName === "key") { + if (keyCode !== null) { + // The props list has multiple keys. Different implementations are + // inconsistent about what to do here: as of this writing, Babel and + // swc keep the *last* key and completely remove the rest, while + // TypeScript uses the *first* key and leaves the others as regular + // props. The React team collaborated with Babel on the + // implementation of this behavior, so presumably the Babel behavior + // is the one to use. + // Since we won't ever be emitting the previous key code, we need to + // at least emit its newlines here so that the line numbers match up + // in the long run. + this.tokens.appendCode(keyCode.replace(/[^\n]/g, "")); + } + // key + this.tokens.removeToken(); + // = + this.tokens.removeToken(); + const snapshot = this.tokens.snapshot(); + this.processPropValue(); + keyCode = this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot); + // Don't add a comma + continue; + } else { + this.processPropName(propName); + this.tokens.replaceToken(": "); + this.processPropValue(); + } + } else if (this.tokens.matches1(tt.jsxName)) { + // This is a shorthand prop like . + const propName = this.tokens.identifierName(); + this.processPropName(propName); + this.tokens.appendCode(": true"); + } else if (this.tokens.matches1(tt.braceL)) { + // This is prop spread, like
, which we can pass + // through fairly directly as an object spread. + this.tokens.replaceToken(""); + this.rootTransformer.processBalancedCode(); + this.tokens.replaceToken(""); + } else { + break; + } + this.tokens.appendCode(","); + } + return keyCode; + } + + processPropName(propName) { + if (propName.includes("-")) { + this.tokens.replaceToken(`'${propName}'`); + } else { + this.tokens.copyToken(); + } + } + + processPropValue() { + if (this.tokens.matches1(tt.braceL)) { + this.tokens.replaceToken(""); + this.rootTransformer.processBalancedCode(); + this.tokens.replaceToken(""); + } else if (this.tokens.matches1(tt.jsxTagStart)) { + this.processJSXTag(); + } else { + this.processStringPropValue(); + } + } + + processStringPropValue() { + const token = this.tokens.currentToken(); + const valueCode = this.tokens.code.slice(token.start + 1, token.end - 1); + const replacementCode = formatJSXTextReplacement(valueCode); + const literalCode = formatJSXStringValueLiteral(valueCode); + this.tokens.replaceToken(literalCode + replacementCode); + } + + /** + * Starting in the middle of the props object literal, produce an additional + * prop for the children and close the object literal. + */ + processAutomaticChildrenAndEndProps(jsxRole) { + if (jsxRole === JSXRole.StaticChildren) { + this.tokens.appendCode(" children: ["); + this.processChildren(false); + this.tokens.appendCode("]}"); + } else { + // The parser information tells us whether we will see a real child or if + // all remaining children (if any) will resolve to empty. If there are no + // non-empty children, don't emit a children prop at all, but still + // process children so that we properly transform the code into nothing. + if (jsxRole === JSXRole.OneChild) { + this.tokens.appendCode(" children: "); + } + this.processChildren(false); + this.tokens.appendCode("}"); + } + } + + /** + * Transform children into a comma-separated list, which will be either + * arguments to createElement or array elements of a children prop. + */ + processChildren(needsInitialComma) { + let needsComma = needsInitialComma; + while (true) { + if (this.tokens.matches2(tt.jsxTagStart, tt.slash)) { + // Closing tag, so no more children. + return; + } + let didEmitElement = false; + if (this.tokens.matches1(tt.braceL)) { + if (this.tokens.matches2(tt.braceL, tt.braceR)) { + // Empty interpolations and comment-only interpolations are allowed + // and don't create an extra child arg. + this.tokens.replaceToken(""); + this.tokens.replaceToken(""); + } else { + // Interpolated expression. + this.tokens.replaceToken(needsComma ? ", " : ""); + this.rootTransformer.processBalancedCode(); + this.tokens.replaceToken(""); + didEmitElement = true; + } + } else if (this.tokens.matches1(tt.jsxTagStart)) { + // Child JSX element + this.tokens.appendCode(needsComma ? ", " : ""); + this.processJSXTag(); + didEmitElement = true; + } else if (this.tokens.matches1(tt.jsxText) || this.tokens.matches1(tt.jsxEmptyText)) { + didEmitElement = this.processChildTextElement(needsComma); + } else { + throw new Error("Unexpected token when processing JSX children."); + } + if (didEmitElement) { + needsComma = true; + } + } + } + + /** + * Turn a JSX text element into a string literal, or nothing at all if the JSX + * text resolves to the empty string. + * + * Returns true if a string literal is emitted, false otherwise. + */ + processChildTextElement(needsComma) { + const token = this.tokens.currentToken(); + const valueCode = this.tokens.code.slice(token.start, token.end); + const replacementCode = formatJSXTextReplacement(valueCode); + const literalCode = formatJSXTextLiteral(valueCode); + if (literalCode === '""') { + this.tokens.replaceToken(replacementCode); + return false; + } else { + this.tokens.replaceToken(`${needsComma ? ", " : ""}${literalCode}${replacementCode}`); + return true; + } + } + + getDevSource(elementLocationCode) { + return `{fileName: ${this.getFilenameVarName()}, ${elementLocationCode}}`; + } + + getFilenameVarName() { + if (!this.filenameVarName) { + this.filenameVarName = this.nameManager.claimFreeName("_jsxFileName"); + } + return this.filenameVarName; + } +} + +/** + * Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart. + * + * Really only treat anything starting with a-z as tag names. `_`, `$`, `é` + * should be treated as component names + */ +export function startsWithLowerCase(s) { + const firstChar = s.charCodeAt(0); + return firstChar >= charCodes.lowercaseA && firstChar <= charCodes.lowercaseZ; +} + +/** + * Turn the given jsxText string into a JS string literal. Leading and trailing + * whitespace on lines is removed, except immediately after the open-tag and + * before the close-tag. Empty lines are completely removed, and spaces are + * added between lines after that. + * + * We use JSON.stringify to introduce escape characters as necessary, and trim + * the start and end of each line and remove blank lines. + */ +function formatJSXTextLiteral(text) { + let result = ""; + let whitespace = ""; + + let isInInitialLineWhitespace = false; + let seenNonWhitespace = false; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === " " || c === "\t" || c === "\r") { + if (!isInInitialLineWhitespace) { + whitespace += c; + } + } else if (c === "\n") { + whitespace = ""; + isInInitialLineWhitespace = true; + } else { + if (seenNonWhitespace && isInInitialLineWhitespace) { + result += " "; + } + result += whitespace; + whitespace = ""; + if (c === "&") { + const {entity, newI} = processEntity(text, i + 1); + i = newI - 1; + result += entity; + } else { + result += c; + } + seenNonWhitespace = true; + isInInitialLineWhitespace = false; + } + } + if (!isInInitialLineWhitespace) { + result += whitespace; + } + return JSON.stringify(result); +} + +/** + * Produce the code that should be printed after the JSX text string literal, + * with most content removed, but all newlines preserved and all spacing at the + * end preserved. + */ +function formatJSXTextReplacement(text) { + let numNewlines = 0; + let numSpaces = 0; + for (const c of text) { + if (c === "\n") { + numNewlines++; + numSpaces = 0; + } else if (c === " ") { + numSpaces++; + } + } + return "\n".repeat(numNewlines) + " ".repeat(numSpaces); +} + +/** + * Format a string in the value position of a JSX prop. + * + * Use the same implementation as convertAttribute from + * babel-helper-builder-react-jsx. + */ +function formatJSXStringValueLiteral(text) { + let result = ""; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === "\n") { + if (/\s/.test(text[i + 1])) { + result += " "; + while (i < text.length && /\s/.test(text[i + 1])) { + i++; + } + } else { + result += "\n"; + } + } else if (c === "&") { + const {entity, newI} = processEntity(text, i + 1); + result += entity; + i = newI - 1; + } else { + result += c; + } + } + return JSON.stringify(result); +} + +/** + * Starting at a &, see if there's an HTML entity (specified by name, decimal + * char code, or hex char code) and return it if so. + * + * Modified from jsxReadString in babel-parser. + */ +function processEntity(text, indexAfterAmpersand) { + let str = ""; + let count = 0; + let entity; + let i = indexAfterAmpersand; + + if (text[i] === "#") { + let radix = 10; + i++; + let numStart; + if (text[i] === "x") { + radix = 16; + i++; + numStart = i; + while (i < text.length && isHexDigit(text.charCodeAt(i))) { + i++; + } + } else { + numStart = i; + while (i < text.length && isDecimalDigit(text.charCodeAt(i))) { + i++; + } + } + if (text[i] === ";") { + const numStr = text.slice(numStart, i); + if (numStr) { + i++; + entity = String.fromCodePoint(parseInt(numStr, radix)); + } + } + } else { + while (i < text.length && count++ < 10) { + const ch = text[i]; + i++; + if (ch === ";") { + entity = XHTMLEntities.get(str); + break; + } + str += ch; + } + } + + if (!entity) { + return {entity: "&", newI: indexAfterAmpersand}; + } + return {entity, newI: i}; +} + +function isDecimalDigit(code) { + return code >= charCodes.digit0 && code <= charCodes.digit9; +} + +function isHexDigit(code) { + return ( + (code >= charCodes.digit0 && code <= charCodes.digit9) || + (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || + (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) + ); +} diff --git a/node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js b/node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js new file mode 100644 index 0000000..8f45d06 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js @@ -0,0 +1,111 @@ + function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +import {TokenType as tt} from "../parser/tokenizer/types"; + + +import Transformer from "./Transformer"; + +const JEST_GLOBAL_NAME = "jest"; +const HOISTED_METHODS = ["mock", "unmock", "enableAutomock", "disableAutomock"]; + +/** + * Implementation of babel-plugin-jest-hoist, which hoists up some jest method + * calls above the imports to allow them to override other imports. + * + * To preserve line numbers, rather than directly moving the jest.mock code, we + * wrap each invocation in a function statement and then call the function from + * the top of the file. + */ +export default class JestHoistTransformer extends Transformer { + __init() {this.hoistedFunctionNames = []} + + constructor( + rootTransformer, + tokens, + nameManager, + importProcessor, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.nameManager = nameManager;this.importProcessor = importProcessor;JestHoistTransformer.prototype.__init.call(this);; + } + + process() { + if ( + this.tokens.currentToken().scopeDepth === 0 && + this.tokens.matches4(tt.name, tt.dot, tt.name, tt.parenL) && + this.tokens.identifierName() === JEST_GLOBAL_NAME + ) { + // TODO: This only works if imports transform is active, which it will be for jest. + // But if jest adds module support and we no longer need the import transform, this needs fixing. + if (_optionalChain([this, 'access', _ => _.importProcessor, 'optionalAccess', _2 => _2.getGlobalNames, 'call', _3 => _3(), 'optionalAccess', _4 => _4.has, 'call', _5 => _5(JEST_GLOBAL_NAME)])) { + return false; + } + return this.extractHoistedCalls(); + } + + return false; + } + + getHoistedCode() { + if (this.hoistedFunctionNames.length > 0) { + // This will be placed before module interop code, but that's fine since + // imports aren't allowed in module mock factories. + return this.hoistedFunctionNames.map((name) => `${name}();`).join(""); + } + return ""; + } + + /** + * Extracts any methods calls on the jest-object that should be hoisted. + * + * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options, + * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted. + * + * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does. + */ + extractHoistedCalls() { + // We're handling a chain of calls where `jest` may or may not need to be inserted for each call + // in the chain, so remove the initial `jest` to make the loop implementation cleaner. + this.tokens.removeToken(); + // Track some state so that multiple non-hoisted chained calls in a row keep their chaining + // syntax. + let followsNonHoistedJestCall = false; + + // Iterate through all chained calls on the jest object. + while (this.tokens.matches3(tt.dot, tt.name, tt.parenL)) { + const methodName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + const shouldHoist = HOISTED_METHODS.includes(methodName); + if (shouldHoist) { + // We've matched e.g. `.mock(...)` or similar call. + // Replace the initial `.` with `function __jestHoist(){jest.` + const hoistedFunctionName = this.nameManager.claimFreeName("__jestHoist"); + this.hoistedFunctionNames.push(hoistedFunctionName); + this.tokens.replaceToken(`function ${hoistedFunctionName}(){${JEST_GLOBAL_NAME}.`); + this.tokens.copyToken(); + this.tokens.copyToken(); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.parenR); + this.tokens.appendCode(";}"); + followsNonHoistedJestCall = false; + } else { + // This is a non-hoisted method, so just transform the code as usual. + if (followsNonHoistedJestCall) { + // If we didn't hoist the previous call, we can leave the code as-is to chain off of the + // previous method call. It's important to preserve the code here because we don't know + // for sure that the method actually returned the jest object for chaining. + this.tokens.copyToken(); + } else { + // If we hoisted the previous call, we know it returns the jest object back, so we insert + // the identifier `jest` to continue the chain. + this.tokens.replaceToken(`${JEST_GLOBAL_NAME}.`); + } + this.tokens.copyToken(); + this.tokens.copyToken(); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.parenR); + followsNonHoistedJestCall = true; + } + } + + return true; + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js b/node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js new file mode 100644 index 0000000..0cb01a1 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js @@ -0,0 +1,20 @@ +import {TokenType as tt} from "../parser/tokenizer/types"; + +import Transformer from "./Transformer"; + +export default class NumericSeparatorTransformer extends Transformer { + constructor( tokens) { + super();this.tokens = tokens;; + } + + process() { + if (this.tokens.matches1(tt.num)) { + const code = this.tokens.currentTokenCode(); + if (code.includes("_")) { + this.tokens.replaceToken(code.replace(/_/g, "")); + return true; + } + } + return false; + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js b/node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js new file mode 100644 index 0000000..547273b --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js @@ -0,0 +1,19 @@ + +import {TokenType as tt} from "../parser/tokenizer/types"; + +import Transformer from "./Transformer"; + +export default class OptionalCatchBindingTransformer extends Transformer { + constructor( tokens, nameManager) { + super();this.tokens = tokens;this.nameManager = nameManager;; + } + + process() { + if (this.tokens.matches2(tt._catch, tt.braceL)) { + this.tokens.copyToken(); + this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`); + return true; + } + return false; + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js b/node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js new file mode 100644 index 0000000..571d97f --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js @@ -0,0 +1,155 @@ + +import {TokenType as tt} from "../parser/tokenizer/types"; + +import Transformer from "./Transformer"; + +/** + * Transformer supporting the optional chaining and nullish coalescing operators. + * + * Tech plan here: + * https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan + * + * The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles + * the operators themselves. + */ +export default class OptionalChainingNullishTransformer extends Transformer { + constructor( tokens, nameManager) { + super();this.tokens = tokens;this.nameManager = nameManager;; + } + + process() { + if (this.tokens.matches1(tt.nullishCoalescing)) { + const token = this.tokens.currentToken(); + if (this.tokens.tokens[token.nullishStartIndex].isAsyncOperation) { + this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("); + } else { + this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("); + } + return true; + } + if (this.tokens.matches1(tt._delete)) { + const nextToken = this.tokens.tokenAtRelativeIndex(1); + if (nextToken.isOptionalChainStart) { + this.tokens.removeInitialToken(); + return true; + } + } + const token = this.tokens.currentToken(); + const chainStart = token.subscriptStartIndex; + if ( + chainStart != null && + this.tokens.tokens[chainStart].isOptionalChainStart && + // Super subscripts can't be optional (since super is never null/undefined), and the syntax + // relies on the subscript being intact, so leave this token alone. + this.tokens.tokenAtRelativeIndex(-1).type !== tt._super + ) { + const param = this.nameManager.claimFreeName("_"); + let arrowStartSnippet; + if ( + chainStart > 0 && + this.tokens.matches1AtIndex(chainStart - 1, tt._delete) && + this.isLastSubscriptInChain() + ) { + // Delete operations are special: we already removed the delete keyword, and to still + // perform a delete, we need to insert a delete in the very last part of the chain, which + // in correct code will always be a property access. + arrowStartSnippet = `${param} => delete ${param}`; + } else { + arrowStartSnippet = `${param} => ${param}`; + } + if (this.tokens.tokens[chainStart].isAsyncOperation) { + arrowStartSnippet = `async ${arrowStartSnippet}`; + } + if ( + this.tokens.matches2(tt.questionDot, tt.parenL) || + this.tokens.matches2(tt.questionDot, tt.lessThan) + ) { + if (this.justSkippedSuper()) { + this.tokens.appendCode(".bind(this)"); + } + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${arrowStartSnippet}`); + } else if (this.tokens.matches2(tt.questionDot, tt.bracketL)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}`); + } else if (this.tokens.matches1(tt.questionDot)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}.`); + } else if (this.tokens.matches1(tt.dot)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}.`); + } else if (this.tokens.matches1(tt.bracketL)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}[`); + } else if (this.tokens.matches1(tt.parenL)) { + if (this.justSkippedSuper()) { + this.tokens.appendCode(".bind(this)"); + } + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${arrowStartSnippet}(`); + } else { + throw new Error("Unexpected subscript operator in optional chain."); + } + return true; + } + return false; + } + + /** + * Determine if the current token is the last of its chain, so that we know whether it's eligible + * to have a delete op inserted. + * + * We can do this by walking forward until we determine one way or another. Each + * isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in + * a nesting way, so we can track depth and walk to the end of the chain (the point where the + * depth goes negative) and see if any other subscript token is after us in the chain. + */ + isLastSubscriptInChain() { + let depth = 0; + for (let i = this.tokens.currentIndex() + 1; ; i++) { + if (i >= this.tokens.tokens.length) { + throw new Error("Reached the end of the code while finding the end of the access chain."); + } + if (this.tokens.tokens[i].isOptionalChainStart) { + depth++; + } else if (this.tokens.tokens[i].isOptionalChainEnd) { + depth--; + } + if (depth < 0) { + return true; + } + + // This subscript token is a later one in the same chain. + if (depth === 0 && this.tokens.tokens[i].subscriptStartIndex != null) { + return false; + } + } + } + + /** + * Determine if we are the open-paren in an expression like super.a()?.b. + * + * We can do this by walking backward to find the previous subscript. If that subscript was + * preceded by a super, then we must be the subscript after it, so if this is a call expression, + * we'll need to attach the right context. + */ + justSkippedSuper() { + let depth = 0; + let index = this.tokens.currentIndex() - 1; + while (true) { + if (index < 0) { + throw new Error( + "Reached the start of the code while finding the start of the access chain.", + ); + } + if (this.tokens.tokens[index].isOptionalChainStart) { + depth--; + } else if (this.tokens.tokens[index].isOptionalChainEnd) { + depth++; + } + if (depth < 0) { + return false; + } + + // This subscript token is a later one in the same chain. + if (depth === 0 && this.tokens.tokens[index].subscriptStartIndex != null) { + return this.tokens.tokens[index - 1].type === tt._super; + } + index--; + } + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js b/node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js new file mode 100644 index 0000000..0c44c81 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js @@ -0,0 +1,160 @@ + + +import {IdentifierRole} from "../parser/tokenizer"; +import {TokenType as tt} from "../parser/tokenizer/types"; + + +import Transformer from "./Transformer"; + +/** + * Implementation of babel-plugin-transform-react-display-name, which adds a + * display name to usages of React.createClass and createReactClass. + */ +export default class ReactDisplayNameTransformer extends Transformer { + constructor( + rootTransformer, + tokens, + importProcessor, + options, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.options = options;; + } + + process() { + const startIndex = this.tokens.currentIndex(); + if (this.tokens.identifierName() === "createReactClass") { + const newName = + this.importProcessor && this.importProcessor.getIdentifierReplacement("createReactClass"); + if (newName) { + this.tokens.replaceToken(`(0, ${newName})`); + } else { + this.tokens.copyToken(); + } + this.tryProcessCreateClassCall(startIndex); + return true; + } + if ( + this.tokens.matches3(tt.name, tt.dot, tt.name) && + this.tokens.identifierName() === "React" && + this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 2) === "createClass" + ) { + const newName = this.importProcessor + ? this.importProcessor.getIdentifierReplacement("React") || "React" + : "React"; + if (newName) { + this.tokens.replaceToken(newName); + this.tokens.copyToken(); + this.tokens.copyToken(); + } else { + this.tokens.copyToken(); + this.tokens.copyToken(); + this.tokens.copyToken(); + } + this.tryProcessCreateClassCall(startIndex); + return true; + } + return false; + } + + /** + * This is called with the token position at the open-paren. + */ + tryProcessCreateClassCall(startIndex) { + const displayName = this.findDisplayName(startIndex); + if (!displayName) { + return; + } + + if (this.classNeedsDisplayName()) { + this.tokens.copyExpectedToken(tt.parenL); + this.tokens.copyExpectedToken(tt.braceL); + this.tokens.appendCode(`displayName: '${displayName}',`); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(tt.braceR); + this.tokens.copyExpectedToken(tt.parenR); + } + } + + findDisplayName(startIndex) { + if (startIndex < 2) { + return null; + } + if (this.tokens.matches2AtIndex(startIndex - 2, tt.name, tt.eq)) { + // This is an assignment (or declaration) and the LHS is either an identifier or a member + // expression ending in an identifier, so use that identifier name. + return this.tokens.identifierNameAtIndex(startIndex - 2); + } + if ( + startIndex >= 2 && + this.tokens.tokens[startIndex - 2].identifierRole === IdentifierRole.ObjectKey + ) { + // This is an object literal value. + return this.tokens.identifierNameAtIndex(startIndex - 2); + } + if (this.tokens.matches2AtIndex(startIndex - 2, tt._export, tt._default)) { + return this.getDisplayNameFromFilename(); + } + return null; + } + + getDisplayNameFromFilename() { + const filePath = this.options.filePath || "unknown"; + const pathSegments = filePath.split("/"); + const filename = pathSegments[pathSegments.length - 1]; + const dotIndex = filename.lastIndexOf("."); + const baseFilename = dotIndex === -1 ? filename : filename.slice(0, dotIndex); + if (baseFilename === "index" && pathSegments[pathSegments.length - 2]) { + return pathSegments[pathSegments.length - 2]; + } else { + return baseFilename; + } + } + + /** + * We only want to add a display name when this is a function call containing + * one argument, which is an object literal without `displayName` as an + * existing key. + */ + classNeedsDisplayName() { + let index = this.tokens.currentIndex(); + if (!this.tokens.matches2(tt.parenL, tt.braceL)) { + return false; + } + // The block starts on the {, and we expect any displayName key to be in + // that context. We need to ignore other other contexts to avoid matching + // nested displayName keys. + const objectStartIndex = index + 1; + const objectContextId = this.tokens.tokens[objectStartIndex].contextId; + if (objectContextId == null) { + throw new Error("Expected non-null context ID on object open-brace."); + } + + for (; index < this.tokens.tokens.length; index++) { + const token = this.tokens.tokens[index]; + if (token.type === tt.braceR && token.contextId === objectContextId) { + index++; + break; + } + + if ( + this.tokens.identifierNameAtIndex(index) === "displayName" && + this.tokens.tokens[index].identifierRole === IdentifierRole.ObjectKey && + token.contextId === objectContextId + ) { + // We found a displayName key, so bail out. + return false; + } + } + + if (index === this.tokens.tokens.length) { + throw new Error("Unexpected end of input when processing React class."); + } + + // If we got this far, we know we have createClass with an object with no + // display name, so we want to proceed as long as that was the only argument. + return ( + this.tokens.matches1AtIndex(index, tt.parenR) || + this.tokens.matches2AtIndex(index, tt.comma, tt.parenR) + ); + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js b/node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js new file mode 100644 index 0000000..873902e --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js @@ -0,0 +1,69 @@ +import {IdentifierRole, isTopLevelDeclaration} from "../parser/tokenizer"; + +import Transformer from "./Transformer"; + +export default class ReactHotLoaderTransformer extends Transformer { + __init() {this.extractedDefaultExportName = null} + + constructor( tokens, filePath) { + super();this.tokens = tokens;this.filePath = filePath;ReactHotLoaderTransformer.prototype.__init.call(this);; + } + + setExtractedDefaultExportName(extractedDefaultExportName) { + this.extractedDefaultExportName = extractedDefaultExportName; + } + + getPrefixCode() { + return ` + (function () { + var enterModule = require('react-hot-loader').enterModule; + enterModule && enterModule(module); + })();` + .replace(/\s+/g, " ") + .trim(); + } + + getSuffixCode() { + const topLevelNames = new Set(); + for (const token of this.tokens.tokens) { + if ( + !token.isType && + isTopLevelDeclaration(token) && + token.identifierRole !== IdentifierRole.ImportDeclaration + ) { + topLevelNames.add(this.tokens.identifierNameForToken(token)); + } + } + const namesToRegister = Array.from(topLevelNames).map((name) => ({ + variableName: name, + uniqueLocalName: name, + })); + if (this.extractedDefaultExportName) { + namesToRegister.push({ + variableName: this.extractedDefaultExportName, + uniqueLocalName: "default", + }); + } + return ` +;(function () { + var reactHotLoader = require('react-hot-loader').default; + var leaveModule = require('react-hot-loader').leaveModule; + if (!reactHotLoader) { + return; + } +${namesToRegister + .map( + ({variableName, uniqueLocalName}) => + ` reactHotLoader.register(${variableName}, "${uniqueLocalName}", ${JSON.stringify( + this.filePath || "", + )});`, + ) + .join("\n")} + leaveModule(module); +})();`; + } + + process() { + return false; + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/RootTransformer.js b/node_modules/sucrase/dist/esm/transformers/RootTransformer.js new file mode 100644 index 0000000..c7a83fe --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/RootTransformer.js @@ -0,0 +1,462 @@ + + + +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + +import getClassInfo, {} from "../util/getClassInfo"; +import CJSImportTransformer from "./CJSImportTransformer"; +import ESMImportTransformer from "./ESMImportTransformer"; +import FlowTransformer from "./FlowTransformer"; +import JestHoistTransformer from "./JestHoistTransformer"; +import JSXTransformer from "./JSXTransformer"; +import NumericSeparatorTransformer from "./NumericSeparatorTransformer"; +import OptionalCatchBindingTransformer from "./OptionalCatchBindingTransformer"; +import OptionalChainingNullishTransformer from "./OptionalChainingNullishTransformer"; +import ReactDisplayNameTransformer from "./ReactDisplayNameTransformer"; +import ReactHotLoaderTransformer from "./ReactHotLoaderTransformer"; + +import TypeScriptTransformer from "./TypeScriptTransformer"; + + + + + + + + +export default class RootTransformer { + __init() {this.transformers = []} + + + __init2() {this.generatedVariables = []} + + + + + + constructor( + sucraseContext, + transforms, + enableLegacyBabel5ModuleInterop, + options, + ) {;RootTransformer.prototype.__init.call(this);RootTransformer.prototype.__init2.call(this); + this.nameManager = sucraseContext.nameManager; + this.helperManager = sucraseContext.helperManager; + const {tokenProcessor, importProcessor} = sucraseContext; + this.tokens = tokenProcessor; + this.isImportsTransformEnabled = transforms.includes("imports"); + this.isReactHotLoaderTransformEnabled = transforms.includes("react-hot-loader"); + this.disableESTransforms = Boolean(options.disableESTransforms); + + if (!options.disableESTransforms) { + this.transformers.push( + new OptionalChainingNullishTransformer(tokenProcessor, this.nameManager), + ); + this.transformers.push(new NumericSeparatorTransformer(tokenProcessor)); + this.transformers.push(new OptionalCatchBindingTransformer(tokenProcessor, this.nameManager)); + } + + if (transforms.includes("jsx")) { + if (options.jsxRuntime !== "preserve") { + this.transformers.push( + new JSXTransformer(this, tokenProcessor, importProcessor, this.nameManager, options), + ); + } + this.transformers.push( + new ReactDisplayNameTransformer(this, tokenProcessor, importProcessor, options), + ); + } + + let reactHotLoaderTransformer = null; + if (transforms.includes("react-hot-loader")) { + if (!options.filePath) { + throw new Error("filePath is required when using the react-hot-loader transform."); + } + reactHotLoaderTransformer = new ReactHotLoaderTransformer(tokenProcessor, options.filePath); + this.transformers.push(reactHotLoaderTransformer); + } + + // Note that we always want to enable the imports transformer, even when the import transform + // itself isn't enabled, since we need to do type-only import pruning for both Flow and + // TypeScript. + if (transforms.includes("imports")) { + if (importProcessor === null) { + throw new Error("Expected non-null importProcessor with imports transform enabled."); + } + this.transformers.push( + new CJSImportTransformer( + this, + tokenProcessor, + importProcessor, + this.nameManager, + this.helperManager, + reactHotLoaderTransformer, + enableLegacyBabel5ModuleInterop, + Boolean(options.enableLegacyTypeScriptModuleInterop), + transforms.includes("typescript"), + transforms.includes("flow"), + Boolean(options.preserveDynamicImport), + Boolean(options.keepUnusedImports), + ), + ); + } else { + this.transformers.push( + new ESMImportTransformer( + tokenProcessor, + this.nameManager, + this.helperManager, + reactHotLoaderTransformer, + transforms.includes("typescript"), + transforms.includes("flow"), + Boolean(options.keepUnusedImports), + options, + ), + ); + } + + if (transforms.includes("flow")) { + this.transformers.push( + new FlowTransformer(this, tokenProcessor, transforms.includes("imports")), + ); + } + if (transforms.includes("typescript")) { + this.transformers.push( + new TypeScriptTransformer(this, tokenProcessor, transforms.includes("imports")), + ); + } + if (transforms.includes("jest")) { + this.transformers.push( + new JestHoistTransformer(this, tokenProcessor, this.nameManager, importProcessor), + ); + } + } + + transform() { + this.tokens.reset(); + this.processBalancedCode(); + const shouldAddUseStrict = this.isImportsTransformEnabled; + // "use strict" always needs to be first, so override the normal transformer order. + let prefix = shouldAddUseStrict ? '"use strict";' : ""; + for (const transformer of this.transformers) { + prefix += transformer.getPrefixCode(); + } + prefix += this.helperManager.emitHelpers(); + prefix += this.generatedVariables.map((v) => ` var ${v};`).join(""); + for (const transformer of this.transformers) { + prefix += transformer.getHoistedCode(); + } + let suffix = ""; + for (const transformer of this.transformers) { + suffix += transformer.getSuffixCode(); + } + const result = this.tokens.finish(); + let {code} = result; + if (code.startsWith("#!")) { + let newlineIndex = code.indexOf("\n"); + if (newlineIndex === -1) { + newlineIndex = code.length; + code += "\n"; + } + return { + code: code.slice(0, newlineIndex + 1) + prefix + code.slice(newlineIndex + 1) + suffix, + // The hashbang line has no tokens, so shifting the tokens to account + // for prefix can happen normally. + mappings: this.shiftMappings(result.mappings, prefix.length), + }; + } else { + return { + code: prefix + code + suffix, + mappings: this.shiftMappings(result.mappings, prefix.length), + }; + } + } + + processBalancedCode() { + let braceDepth = 0; + let parenDepth = 0; + while (!this.tokens.isAtEnd()) { + if (this.tokens.matches1(tt.braceL) || this.tokens.matches1(tt.dollarBraceL)) { + braceDepth++; + } else if (this.tokens.matches1(tt.braceR)) { + if (braceDepth === 0) { + return; + } + braceDepth--; + } + if (this.tokens.matches1(tt.parenL)) { + parenDepth++; + } else if (this.tokens.matches1(tt.parenR)) { + if (parenDepth === 0) { + return; + } + parenDepth--; + } + this.processToken(); + } + } + + processToken() { + if (this.tokens.matches1(tt._class)) { + this.processClass(); + return; + } + for (const transformer of this.transformers) { + const wasProcessed = transformer.process(); + if (wasProcessed) { + return; + } + } + this.tokens.copyToken(); + } + + /** + * Skip past a class with a name and return that name. + */ + processNamedClass() { + if (!this.tokens.matches2(tt._class, tt.name)) { + throw new Error("Expected identifier for exported class name."); + } + const name = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + this.processClass(); + return name; + } + + processClass() { + const classInfo = getClassInfo(this, this.tokens, this.nameManager, this.disableESTransforms); + + // Both static and instance initializers need a class name to use to invoke the initializer, so + // assign to one if necessary. + const needsCommaExpression = + (classInfo.headerInfo.isExpression || !classInfo.headerInfo.className) && + classInfo.staticInitializerNames.length + classInfo.instanceInitializerNames.length > 0; + + let className = classInfo.headerInfo.className; + if (needsCommaExpression) { + className = this.nameManager.claimFreeName("_class"); + this.generatedVariables.push(className); + this.tokens.appendCode(` (${className} =`); + } + + const classToken = this.tokens.currentToken(); + const contextId = classToken.contextId; + if (contextId == null) { + throw new Error("Expected class to have a context ID."); + } + this.tokens.copyExpectedToken(tt._class); + while (!this.tokens.matchesContextIdAndLabel(tt.braceL, contextId)) { + this.processToken(); + } + + this.processClassBody(classInfo, className); + + const staticInitializerStatements = classInfo.staticInitializerNames.map( + (name) => `${className}.${name}()`, + ); + if (needsCommaExpression) { + this.tokens.appendCode( + `, ${staticInitializerStatements.map((s) => `${s}, `).join("")}${className})`, + ); + } else if (classInfo.staticInitializerNames.length > 0) { + this.tokens.appendCode(` ${staticInitializerStatements.map((s) => `${s};`).join(" ")}`); + } + } + + /** + * We want to just handle class fields in all contexts, since TypeScript supports them. Later, + * when some JS implementations support class fields, this should be made optional. + */ + processClassBody(classInfo, className) { + const { + headerInfo, + constructorInsertPos, + constructorInitializerStatements, + fields, + instanceInitializerNames, + rangesToRemove, + } = classInfo; + let fieldIndex = 0; + let rangeToRemoveIndex = 0; + const classContextId = this.tokens.currentToken().contextId; + if (classContextId == null) { + throw new Error("Expected non-null context ID on class."); + } + this.tokens.copyExpectedToken(tt.braceL); + if (this.isReactHotLoaderTransformEnabled) { + this.tokens.appendCode( + "__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}", + ); + } + + const needsConstructorInit = + constructorInitializerStatements.length + instanceInitializerNames.length > 0; + + if (constructorInsertPos === null && needsConstructorInit) { + const constructorInitializersCode = this.makeConstructorInitCode( + constructorInitializerStatements, + instanceInitializerNames, + className, + ); + if (headerInfo.hasSuperclass) { + const argsName = this.nameManager.claimFreeName("args"); + this.tokens.appendCode( + `constructor(...${argsName}) { super(...${argsName}); ${constructorInitializersCode}; }`, + ); + } else { + this.tokens.appendCode(`constructor() { ${constructorInitializersCode}; }`); + } + } + + while (!this.tokens.matchesContextIdAndLabel(tt.braceR, classContextId)) { + if (fieldIndex < fields.length && this.tokens.currentIndex() === fields[fieldIndex].start) { + let needsCloseBrace = false; + if (this.tokens.matches1(tt.bracketL)) { + this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this`); + } else if (this.tokens.matches1(tt.string) || this.tokens.matches1(tt.num)) { + this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this[`); + needsCloseBrace = true; + } else { + this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this.`); + } + while (this.tokens.currentIndex() < fields[fieldIndex].end) { + if (needsCloseBrace && this.tokens.currentIndex() === fields[fieldIndex].equalsIndex) { + this.tokens.appendCode("]"); + } + this.processToken(); + } + this.tokens.appendCode("}"); + fieldIndex++; + } else if ( + rangeToRemoveIndex < rangesToRemove.length && + this.tokens.currentIndex() >= rangesToRemove[rangeToRemoveIndex].start + ) { + if (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { + this.tokens.removeInitialToken(); + } + while (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { + this.tokens.removeToken(); + } + rangeToRemoveIndex++; + } else if (this.tokens.currentIndex() === constructorInsertPos) { + this.tokens.copyToken(); + if (needsConstructorInit) { + this.tokens.appendCode( + `;${this.makeConstructorInitCode( + constructorInitializerStatements, + instanceInitializerNames, + className, + )};`, + ); + } + this.processToken(); + } else { + this.processToken(); + } + } + this.tokens.copyExpectedToken(tt.braceR); + } + + makeConstructorInitCode( + constructorInitializerStatements, + instanceInitializerNames, + className, + ) { + return [ + ...constructorInitializerStatements, + ...instanceInitializerNames.map((name) => `${className}.prototype.${name}.call(this)`), + ].join(";"); + } + + /** + * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with + * arrow function return types since they can confuse the parser. In that case, we want to move + * the close-paren to the same line as the arrow. + * + * See https://github.com/alangpierce/sucrase/issues/391 for more details. + */ + processPossibleArrowParamEnd() { + if (this.tokens.matches2(tt.parenR, tt.colon) && this.tokens.tokenAtRelativeIndex(1).isType) { + let nextNonTypeIndex = this.tokens.currentIndex() + 1; + // Look ahead to see if this is an arrow function or something else. + while (this.tokens.tokens[nextNonTypeIndex].isType) { + nextNonTypeIndex++; + } + if (this.tokens.matches1AtIndex(nextNonTypeIndex, tt.arrow)) { + this.tokens.removeInitialToken(); + while (this.tokens.currentIndex() < nextNonTypeIndex) { + this.tokens.removeToken(); + } + this.tokens.replaceTokenTrimmingLeftWhitespace(") =>"); + return true; + } + } + return false; + } + + /** + * An async arrow function might be of the form: + * + * async < + * T + * >() => {} + * + * in which case, removing the type parameters will cause a syntax error. Detect this case and + * move the open-paren earlier. + */ + processPossibleAsyncArrowWithTypeParams() { + if ( + !this.tokens.matchesContextual(ContextualKeyword._async) && + !this.tokens.matches1(tt._async) + ) { + return false; + } + const nextToken = this.tokens.tokenAtRelativeIndex(1); + if (nextToken.type !== tt.lessThan || !nextToken.isType) { + return false; + } + + let nextNonTypeIndex = this.tokens.currentIndex() + 1; + // Look ahead to see if this is an arrow function or something else. + while (this.tokens.tokens[nextNonTypeIndex].isType) { + nextNonTypeIndex++; + } + if (this.tokens.matches1AtIndex(nextNonTypeIndex, tt.parenL)) { + this.tokens.replaceToken("async ("); + this.tokens.removeInitialToken(); + while (this.tokens.currentIndex() < nextNonTypeIndex) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + // We ate a ( token, so we need to process the tokens in between and then the ) token so that + // we remain balanced. + this.processBalancedCode(); + this.processToken(); + return true; + } + return false; + } + + processPossibleTypeRange() { + if (this.tokens.currentToken().isType) { + this.tokens.removeInitialToken(); + while (this.tokens.currentToken().isType) { + this.tokens.removeToken(); + } + return true; + } + return false; + } + + shiftMappings( + mappings, + prefixLength, + ) { + for (let i = 0; i < mappings.length; i++) { + const mapping = mappings[i]; + if (mapping !== undefined) { + mappings[i] = mapping + prefixLength; + } + } + return mappings; + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/Transformer.js b/node_modules/sucrase/dist/esm/transformers/Transformer.js new file mode 100644 index 0000000..5e8e9e7 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/Transformer.js @@ -0,0 +1,16 @@ +export default class Transformer { + // Return true if anything was processed, false otherwise. + + + getPrefixCode() { + return ""; + } + + getHoistedCode() { + return ""; + } + + getSuffixCode() { + return ""; + } +} diff --git a/node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js b/node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js new file mode 100644 index 0000000..67e1274 --- /dev/null +++ b/node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js @@ -0,0 +1,279 @@ + +import {TokenType as tt} from "../parser/tokenizer/types"; + +import isIdentifier from "../util/isIdentifier"; + +import Transformer from "./Transformer"; + +export default class TypeScriptTransformer extends Transformer { + constructor( + rootTransformer, + tokens, + isImportsTransformEnabled, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; + } + + process() { + if ( + this.rootTransformer.processPossibleArrowParamEnd() || + this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || + this.rootTransformer.processPossibleTypeRange() + ) { + return true; + } + if ( + this.tokens.matches1(tt._public) || + this.tokens.matches1(tt._protected) || + this.tokens.matches1(tt._private) || + this.tokens.matches1(tt._abstract) || + this.tokens.matches1(tt._readonly) || + this.tokens.matches1(tt._override) || + this.tokens.matches1(tt.nonNullAssertion) + ) { + this.tokens.removeInitialToken(); + return true; + } + if (this.tokens.matches1(tt._enum) || this.tokens.matches2(tt._const, tt._enum)) { + this.processEnum(); + return true; + } + if ( + this.tokens.matches2(tt._export, tt._enum) || + this.tokens.matches3(tt._export, tt._const, tt._enum) + ) { + this.processEnum(true); + return true; + } + return false; + } + + processEnum(isExport = false) { + // We might have "export const enum", so just remove all relevant tokens. + this.tokens.removeInitialToken(); + while (this.tokens.matches1(tt._const) || this.tokens.matches1(tt._enum)) { + this.tokens.removeToken(); + } + const enumName = this.tokens.identifierName(); + this.tokens.removeToken(); + if (isExport && !this.isImportsTransformEnabled) { + this.tokens.appendCode("export "); + } + this.tokens.appendCode(`var ${enumName}; (function (${enumName})`); + this.tokens.copyExpectedToken(tt.braceL); + this.processEnumBody(enumName); + this.tokens.copyExpectedToken(tt.braceR); + if (isExport && this.isImportsTransformEnabled) { + this.tokens.appendCode(`)(${enumName} || (exports.${enumName} = ${enumName} = {}));`); + } else { + this.tokens.appendCode(`)(${enumName} || (${enumName} = {}));`); + } + } + + /** + * Transform an enum into equivalent JS. This has complexity in a few places: + * - TS allows string enums, numeric enums, and a mix of the two styles within an enum. + * - Enum keys are allowed to be referenced in later enum values. + * - Enum keys are allowed to be strings. + * - When enum values are omitted, they should follow an auto-increment behavior. + */ + processEnumBody(enumName) { + // Code that can be used to reference the previous enum member, or null if this is the first + // enum member. + let previousValueCode = null; + while (true) { + if (this.tokens.matches1(tt.braceR)) { + break; + } + const {nameStringCode, variableName} = this.extractEnumKeyInfo(this.tokens.currentToken()); + this.tokens.removeInitialToken(); + + if ( + this.tokens.matches3(tt.eq, tt.string, tt.comma) || + this.tokens.matches3(tt.eq, tt.string, tt.braceR) + ) { + this.processStringLiteralEnumMember(enumName, nameStringCode, variableName); + } else if (this.tokens.matches1(tt.eq)) { + this.processExplicitValueEnumMember(enumName, nameStringCode, variableName); + } else { + this.processImplicitValueEnumMember( + enumName, + nameStringCode, + variableName, + previousValueCode, + ); + } + if (this.tokens.matches1(tt.comma)) { + this.tokens.removeToken(); + } + + if (variableName != null) { + previousValueCode = variableName; + } else { + previousValueCode = `${enumName}[${nameStringCode}]`; + } + } + } + + /** + * Detect name information about this enum key, which will be used to determine which code to emit + * and whether we should declare a variable as part of this declaration. + * + * Some cases to keep in mind: + * - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement + * this by declaring a variable `X` so that later expressions can use it. + * - In addition to the usual identifier key syntax, enum keys are allowed to be string literals, + * e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed. + * - Even if the enum key is defined as a string literal, it may still be referenced by identifier + * later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string + * literal is identifier-like and emit a variable if so, even if the declaration did not use an + * identifier. + * - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later + * and would be a syntax error if we emitted a variable, so we need to skip the variable + * declaration in those cases. + * + * The variableName return value captures these nuances: if non-null, we can and must emit a + * variable declaration, and if null, we can't and shouldn't. + */ + extractEnumKeyInfo(nameToken) { + if (nameToken.type === tt.name) { + const name = this.tokens.identifierNameForToken(nameToken); + return { + nameStringCode: `"${name}"`, + variableName: isIdentifier(name) ? name : null, + }; + } else if (nameToken.type === tt.string) { + const name = this.tokens.stringValueForToken(nameToken); + return { + nameStringCode: this.tokens.code.slice(nameToken.start, nameToken.end), + variableName: isIdentifier(name) ? name : null, + }; + } else { + throw new Error("Expected name or string at beginning of enum element."); + } + } + + /** + * Handle an enum member where the RHS is just a string literal (not omitted, not a number, and + * not a complex expression). This is the typical form for TS string enums, and in this case, we + * do *not* create a reverse mapping. + * + * This is called after deleting the key token, when the token processor is at the equals sign. + * + * Example 1: + * someKey = "some value" + * -> + * const someKey = "some value"; MyEnum["someKey"] = someKey; + * + * Example 2: + * "some key" = "some value" + * -> + * MyEnum["some key"] = "some value"; + */ + processStringLiteralEnumMember( + enumName, + nameStringCode, + variableName, + ) { + if (variableName != null) { + this.tokens.appendCode(`const ${variableName}`); + // = + this.tokens.copyToken(); + // value string + this.tokens.copyToken(); + this.tokens.appendCode(`; ${enumName}[${nameStringCode}] = ${variableName};`); + } else { + this.tokens.appendCode(`${enumName}[${nameStringCode}]`); + // = + this.tokens.copyToken(); + // value string + this.tokens.copyToken(); + this.tokens.appendCode(";"); + } + } + + /** + * Handle an enum member initialized with an expression on the right-hand side (other than a + * string literal). In these cases, we should transform the expression and emit code that sets up + * a reverse mapping. + * + * The TypeScript implementation of this operation distinguishes between expressions that can be + * "constant folded" at compile time (i.e. consist of number literals and simple math operations + * on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved + * numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at + * compile time would add significant complexity to Sucrase, so Sucrase instead leaves the + * expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement + * auto-incrementing. + * + * This is called after deleting the key token, when the token processor is at the equals sign. + * + * Example 1: + * someKey = 1 + 1 + * -> + * const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey"; + * + * Example 2: + * "some key" = 1 + 1 + * -> + * MyEnum[MyEnum["some key"] = 1 + 1] = "some key"; + */ + processExplicitValueEnumMember( + enumName, + nameStringCode, + variableName, + ) { + const rhsEndIndex = this.tokens.currentToken().rhsEndIndex; + if (rhsEndIndex == null) { + throw new Error("Expected rhsEndIndex on enum assign."); + } + + if (variableName != null) { + this.tokens.appendCode(`const ${variableName}`); + this.tokens.copyToken(); + while (this.tokens.currentIndex() < rhsEndIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode( + `; ${enumName}[${enumName}[${nameStringCode}] = ${variableName}] = ${nameStringCode};`, + ); + } else { + this.tokens.appendCode(`${enumName}[${enumName}[${nameStringCode}]`); + this.tokens.copyToken(); + while (this.tokens.currentIndex() < rhsEndIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode(`] = ${nameStringCode};`); + } + } + + /** + * Handle an enum member with no right-hand side expression. In this case, the value is the + * previous value plus 1, or 0 if there was no previous value. We should also always emit a + * reverse mapping. + * + * Example 1: + * someKey2 + * -> + * const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2"; + * + * Example 2: + * "some key 2" + * -> + * MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2"; + */ + processImplicitValueEnumMember( + enumName, + nameStringCode, + variableName, + previousValueCode, + ) { + let valueCode = previousValueCode != null ? `${previousValueCode} + 1` : "0"; + if (variableName != null) { + this.tokens.appendCode(`const ${variableName} = ${valueCode}; `); + valueCode = variableName; + } + this.tokens.appendCode( + `${enumName}[${enumName}[${nameStringCode}] = ${valueCode}] = ${nameStringCode};`, + ); + } +} diff --git a/node_modules/sucrase/dist/esm/util/elideImportEquals.js b/node_modules/sucrase/dist/esm/util/elideImportEquals.js new file mode 100644 index 0000000..6b18a7a --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/elideImportEquals.js @@ -0,0 +1,29 @@ +import {TokenType as tt} from "../parser/tokenizer/types"; + + +export default function elideImportEquals(tokens) { + // import + tokens.removeInitialToken(); + // name + tokens.removeToken(); + // = + tokens.removeToken(); + // name or require + tokens.removeToken(); + // Handle either `import A = require('A')` or `import A = B.C.D`. + if (tokens.matches1(tt.parenL)) { + // ( + tokens.removeToken(); + // path string + tokens.removeToken(); + // ) + tokens.removeToken(); + } else { + while (tokens.matches1(tt.dot)) { + // . + tokens.removeToken(); + // name + tokens.removeToken(); + } + } +} diff --git a/node_modules/sucrase/dist/esm/util/formatTokens.js b/node_modules/sucrase/dist/esm/util/formatTokens.js new file mode 100644 index 0000000..eea07d2 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/formatTokens.js @@ -0,0 +1,74 @@ +import LinesAndColumns from "lines-and-columns"; + + +import {formatTokenType} from "../parser/tokenizer/types"; + +export default function formatTokens(code, tokens) { + if (tokens.length === 0) { + return ""; + } + + const tokenKeys = Object.keys(tokens[0]).filter( + (k) => k !== "type" && k !== "value" && k !== "start" && k !== "end" && k !== "loc", + ); + const typeKeys = Object.keys(tokens[0].type).filter((k) => k !== "label" && k !== "keyword"); + + const headings = ["Location", "Label", "Raw", ...tokenKeys, ...typeKeys]; + + const lines = new LinesAndColumns(code); + const rows = [headings, ...tokens.map(getTokenComponents)]; + const padding = headings.map(() => 0); + for (const components of rows) { + for (let i = 0; i < components.length; i++) { + padding[i] = Math.max(padding[i], components[i].length); + } + } + return rows + .map((components) => components.map((component, i) => component.padEnd(padding[i])).join(" ")) + .join("\n"); + + function getTokenComponents(token) { + const raw = code.slice(token.start, token.end); + return [ + formatRange(token.start, token.end), + formatTokenType(token.type), + truncate(String(raw), 14), + // @ts-ignore: Intentional dynamic access by key. + ...tokenKeys.map((key) => formatValue(token[key], key)), + // @ts-ignore: Intentional dynamic access by key. + ...typeKeys.map((key) => formatValue(token.type[key], key)), + ]; + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function formatValue(value, key) { + if (value === true) { + return key; + } else if (value === false || value === null) { + return ""; + } else { + return String(value); + } + } + + function formatRange(start, end) { + return `${formatPos(start)}-${formatPos(end)}`; + } + + function formatPos(pos) { + const location = lines.locationForIndex(pos); + if (!location) { + return "Unknown"; + } else { + return `${location.line + 1}:${location.column + 1}`; + } + } +} + +function truncate(s, length) { + if (s.length > length) { + return `${s.slice(0, length - 3)}...`; + } else { + return s; + } +} diff --git a/node_modules/sucrase/dist/esm/util/getClassInfo.js b/node_modules/sucrase/dist/esm/util/getClassInfo.js new file mode 100644 index 0000000..0100ad6 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getClassInfo.js @@ -0,0 +1,352 @@ + + +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/** + * Get information about the class fields for this class, given a token processor pointing to the + * open-brace at the start of the class. + */ +export default function getClassInfo( + rootTransformer, + tokens, + nameManager, + disableESTransforms, +) { + const snapshot = tokens.snapshot(); + + const headerInfo = processClassHeader(tokens); + + let constructorInitializerStatements = []; + const instanceInitializerNames = []; + const staticInitializerNames = []; + let constructorInsertPos = null; + const fields = []; + const rangesToRemove = []; + + const classContextId = tokens.currentToken().contextId; + if (classContextId == null) { + throw new Error("Expected non-null class context ID on class open-brace."); + } + + tokens.nextToken(); + while (!tokens.matchesContextIdAndLabel(tt.braceR, classContextId)) { + if (tokens.matchesContextual(ContextualKeyword._constructor) && !tokens.currentToken().isType) { + ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); + } else if (tokens.matches1(tt.semi)) { + if (!disableESTransforms) { + rangesToRemove.push({start: tokens.currentIndex(), end: tokens.currentIndex() + 1}); + } + tokens.nextToken(); + } else if (tokens.currentToken().isType) { + tokens.nextToken(); + } else { + // Either a method or a field. Skip to the identifier part. + const statementStartIndex = tokens.currentIndex(); + let isStatic = false; + let isESPrivate = false; + let isDeclareOrAbstract = false; + while (isAccessModifier(tokens.currentToken())) { + if (tokens.matches1(tt._static)) { + isStatic = true; + } + if (tokens.matches1(tt.hash)) { + isESPrivate = true; + } + if (tokens.matches1(tt._declare) || tokens.matches1(tt._abstract)) { + isDeclareOrAbstract = true; + } + tokens.nextToken(); + } + if (isStatic && tokens.matches1(tt.braceL)) { + // This is a static block, so don't process it in any special way. + skipToNextClassElement(tokens, classContextId); + continue; + } + if (isESPrivate) { + // Sucrase doesn't attempt to transpile private fields; just leave them as-is. + skipToNextClassElement(tokens, classContextId); + continue; + } + if ( + tokens.matchesContextual(ContextualKeyword._constructor) && + !tokens.currentToken().isType + ) { + ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); + continue; + } + + const nameStartIndex = tokens.currentIndex(); + skipFieldName(tokens); + if (tokens.matches1(tt.lessThan) || tokens.matches1(tt.parenL)) { + // This is a method, so nothing to process. + skipToNextClassElement(tokens, classContextId); + continue; + } + // There might be a type annotation that we need to skip. + while (tokens.currentToken().isType) { + tokens.nextToken(); + } + if (tokens.matches1(tt.eq)) { + const equalsIndex = tokens.currentIndex(); + // This is an initializer, so we need to wrap in an initializer method. + const valueEnd = tokens.currentToken().rhsEndIndex; + if (valueEnd == null) { + throw new Error("Expected rhsEndIndex on class field assignment."); + } + tokens.nextToken(); + while (tokens.currentIndex() < valueEnd) { + rootTransformer.processToken(); + } + let initializerName; + if (isStatic) { + initializerName = nameManager.claimFreeName("__initStatic"); + staticInitializerNames.push(initializerName); + } else { + initializerName = nameManager.claimFreeName("__init"); + instanceInitializerNames.push(initializerName); + } + // Fields start at the name, so `static x = 1;` has a field range of `x = 1;`. + fields.push({ + initializerName, + equalsIndex, + start: nameStartIndex, + end: tokens.currentIndex(), + }); + } else if (!disableESTransforms || isDeclareOrAbstract) { + // This is a regular field declaration, like `x;`. With the class transform enabled, we just + // remove the line so that no output is produced. With the class transform disabled, we + // usually want to preserve the declaration (but still strip types), but if the `declare` + // or `abstract` keyword is specified, we should remove the line to avoid initializing the + // value to undefined. + rangesToRemove.push({start: statementStartIndex, end: tokens.currentIndex()}); + } + } + } + + tokens.restoreToSnapshot(snapshot); + if (disableESTransforms) { + // With ES transforms disabled, we don't want to transform regular class + // field declarations, and we don't need to do any additional tricks to + // reference the constructor for static init, but we still need to transform + // TypeScript field initializers defined as constructor parameters and we + // still need to remove `declare` fields. For now, we run the same code + // path but omit any field information, as if the class had no field + // declarations. In the future, when we fully drop the class fields + // transform, we can simplify this code significantly. + return { + headerInfo, + constructorInitializerStatements, + instanceInitializerNames: [], + staticInitializerNames: [], + constructorInsertPos, + fields: [], + rangesToRemove, + }; + } else { + return { + headerInfo, + constructorInitializerStatements, + instanceInitializerNames, + staticInitializerNames, + constructorInsertPos, + fields, + rangesToRemove, + }; + } +} + +/** + * Move the token processor to the next method/field in the class. + * + * To do that, we seek forward to the next start of a class name (either an open + * bracket or an identifier, or the closing curly brace), then seek backward to + * include any access modifiers. + */ +function skipToNextClassElement(tokens, classContextId) { + tokens.nextToken(); + while (tokens.currentToken().contextId !== classContextId) { + tokens.nextToken(); + } + while (isAccessModifier(tokens.tokenAtRelativeIndex(-1))) { + tokens.previousToken(); + } +} + +function processClassHeader(tokens) { + const classToken = tokens.currentToken(); + const contextId = classToken.contextId; + if (contextId == null) { + throw new Error("Expected context ID on class token."); + } + const isExpression = classToken.isExpression; + if (isExpression == null) { + throw new Error("Expected isExpression on class token."); + } + let className = null; + let hasSuperclass = false; + tokens.nextToken(); + if (tokens.matches1(tt.name)) { + className = tokens.identifierName(); + } + while (!tokens.matchesContextIdAndLabel(tt.braceL, contextId)) { + // If this has a superclass, there will always be an `extends` token. If it doesn't have a + // superclass, only type parameters and `implements` clauses can show up here, all of which + // consist only of type tokens. A declaration like `class A {` should *not* count + // as having a superclass. + if (tokens.matches1(tt._extends) && !tokens.currentToken().isType) { + hasSuperclass = true; + } + tokens.nextToken(); + } + return {isExpression, className, hasSuperclass}; +} + +/** + * Extract useful information out of a constructor, starting at the "constructor" name. + */ +function processConstructor(tokens) + + + { + const constructorInitializerStatements = []; + + tokens.nextToken(); + const constructorContextId = tokens.currentToken().contextId; + if (constructorContextId == null) { + throw new Error("Expected context ID on open-paren starting constructor params."); + } + // Advance through parameters looking for access modifiers. + while (!tokens.matchesContextIdAndLabel(tt.parenR, constructorContextId)) { + if (tokens.currentToken().contextId === constructorContextId) { + // Current token is an open paren or comma just before a param, so check + // that param for access modifiers. + tokens.nextToken(); + if (isAccessModifier(tokens.currentToken())) { + tokens.nextToken(); + while (isAccessModifier(tokens.currentToken())) { + tokens.nextToken(); + } + const token = tokens.currentToken(); + if (token.type !== tt.name) { + throw new Error("Expected identifier after access modifiers in constructor arg."); + } + const name = tokens.identifierNameForToken(token); + constructorInitializerStatements.push(`this.${name} = ${name}`); + } + } else { + tokens.nextToken(); + } + } + // ) + tokens.nextToken(); + // Constructor type annotations are invalid, but skip them anyway since + // they're easy to skip. + while (tokens.currentToken().isType) { + tokens.nextToken(); + } + let constructorInsertPos = tokens.currentIndex(); + + // Advance through body looking for a super call. + let foundSuperCall = false; + while (!tokens.matchesContextIdAndLabel(tt.braceR, constructorContextId)) { + if (!foundSuperCall && tokens.matches2(tt._super, tt.parenL)) { + tokens.nextToken(); + const superCallContextId = tokens.currentToken().contextId; + if (superCallContextId == null) { + throw new Error("Expected a context ID on the super call"); + } + while (!tokens.matchesContextIdAndLabel(tt.parenR, superCallContextId)) { + tokens.nextToken(); + } + constructorInsertPos = tokens.currentIndex(); + foundSuperCall = true; + } + tokens.nextToken(); + } + // } + tokens.nextToken(); + + return {constructorInitializerStatements, constructorInsertPos}; +} + +/** + * Determine if this is any token that can go before the name in a method/field. + */ +function isAccessModifier(token) { + return [ + tt._async, + tt._get, + tt._set, + tt.plus, + tt.minus, + tt._readonly, + tt._static, + tt._public, + tt._private, + tt._protected, + tt._override, + tt._abstract, + tt.star, + tt._declare, + tt.hash, + ].includes(token.type); +} + +/** + * The next token or set of tokens is either an identifier or an expression in square brackets, for + * a method or field name. + */ +function skipFieldName(tokens) { + if (tokens.matches1(tt.bracketL)) { + const startToken = tokens.currentToken(); + const classContextId = startToken.contextId; + if (classContextId == null) { + throw new Error("Expected class context ID on computed name open bracket."); + } + while (!tokens.matchesContextIdAndLabel(tt.bracketR, classContextId)) { + tokens.nextToken(); + } + tokens.nextToken(); + } else { + tokens.nextToken(); + } +} diff --git a/node_modules/sucrase/dist/esm/util/getDeclarationInfo.js b/node_modules/sucrase/dist/esm/util/getDeclarationInfo.js new file mode 100644 index 0000000..ade9a81 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getDeclarationInfo.js @@ -0,0 +1,40 @@ +import {isTopLevelDeclaration} from "../parser/tokenizer"; +import {TokenType as tt} from "../parser/tokenizer/types"; + + + + + + + +export const EMPTY_DECLARATION_INFO = { + typeDeclarations: new Set(), + valueDeclarations: new Set(), +}; + +/** + * Get all top-level identifiers that should be preserved when exported in TypeScript. + * + * Examples: + * - If an identifier is declared as `const x`, then `export {x}` should be preserved. + * - If it's declared as `type x`, then `export {x}` should be removed. + * - If it's declared as both `const x` and `type x`, then the export should be preserved. + * - Classes and enums should be preserved (even though they also introduce types). + * - Imported identifiers should be preserved since we don't have enough information to + * rule them out. --isolatedModules disallows re-exports, which catches errors here. + */ +export default function getDeclarationInfo(tokens) { + const typeDeclarations = new Set(); + const valueDeclarations = new Set(); + for (let i = 0; i < tokens.tokens.length; i++) { + const token = tokens.tokens[i]; + if (token.type === tt.name && isTopLevelDeclaration(token)) { + if (token.isType) { + typeDeclarations.add(tokens.identifierNameForToken(token)); + } else { + valueDeclarations.add(tokens.identifierNameForToken(token)); + } + } + } + return {typeDeclarations, valueDeclarations}; +} diff --git a/node_modules/sucrase/dist/esm/util/getIdentifierNames.js b/node_modules/sucrase/dist/esm/util/getIdentifierNames.js new file mode 100644 index 0000000..5b85901 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getIdentifierNames.js @@ -0,0 +1,15 @@ + +import {TokenType as tt} from "../parser/tokenizer/types"; + +/** + * Get all identifier names in the code, in order, including duplicates. + */ +export default function getIdentifierNames(code, tokens) { + const names = []; + for (const token of tokens) { + if (token.type === tt.name) { + names.push(code.slice(token.start, token.end)); + } + } + return names; +} diff --git a/node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js b/node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js new file mode 100644 index 0000000..3dc6d2c --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js @@ -0,0 +1,92 @@ +import {TokenType as tt} from "../parser/tokenizer/types"; + + + + + + + + + + + + + + + + +/** + * Determine information about this named import or named export specifier. + * + * This syntax is the `a` from statements like these: + * import {A} from "./foo"; + * export {A}; + * export {A} from "./foo"; + * + * As it turns out, we can exactly characterize the syntax meaning by simply + * counting the number of tokens, which can be from 1 to 4: + * {A} + * {type A} + * {A as B} + * {type A as B} + * + * In the type case, we never actually need the names in practice, so don't get + * them. + * + * TODO: There's some redundancy with the type detection here and the isType + * flag that's already present on tokens in TS mode. This function could + * potentially be simplified and/or pushed to the call sites to avoid the object + * allocation. + */ +export default function getImportExportSpecifierInfo( + tokens, + index = tokens.currentIndex(), +) { + let endIndex = index + 1; + if (isSpecifierEnd(tokens, endIndex)) { + // import {A} + const name = tokens.identifierNameAtIndex(index); + return { + isType: false, + leftName: name, + rightName: name, + endIndex, + }; + } + endIndex++; + if (isSpecifierEnd(tokens, endIndex)) { + // import {type A} + return { + isType: true, + leftName: null, + rightName: null, + endIndex, + }; + } + endIndex++; + if (isSpecifierEnd(tokens, endIndex)) { + // import {A as B} + return { + isType: false, + leftName: tokens.identifierNameAtIndex(index), + rightName: tokens.identifierNameAtIndex(index + 2), + endIndex, + }; + } + endIndex++; + if (isSpecifierEnd(tokens, endIndex)) { + // import {type A as B} + return { + isType: true, + leftName: null, + rightName: null, + endIndex, + }; + } + throw new Error(`Unexpected import/export specifier at ${index}`); +} + +function isSpecifierEnd(tokens, index) { + const token = tokens.tokens[index]; + return token.type === tt.braceR || token.type === tt.comma; +} diff --git a/node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js b/node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js new file mode 100644 index 0000000..9972342 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js @@ -0,0 +1,22 @@ + + + + + + + + + +export default function getJSXPragmaInfo(options) { + const [base, suffix] = splitPragma(options.jsxPragma || "React.createElement"); + const [fragmentBase, fragmentSuffix] = splitPragma(options.jsxFragmentPragma || "React.Fragment"); + return {base, suffix, fragmentBase, fragmentSuffix}; +} + +function splitPragma(pragma) { + let dotIndex = pragma.indexOf("."); + if (dotIndex === -1) { + dotIndex = pragma.length; + } + return [pragma.slice(0, dotIndex), pragma.slice(dotIndex)]; +} diff --git a/node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js b/node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js new file mode 100644 index 0000000..24c73dd --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js @@ -0,0 +1,43 @@ + +import {IdentifierRole} from "../parser/tokenizer"; +import {TokenType, TokenType as tt} from "../parser/tokenizer/types"; + +import {startsWithLowerCase} from "../transformers/JSXTransformer"; +import getJSXPragmaInfo from "./getJSXPragmaInfo"; + +export function getNonTypeIdentifiers(tokens, options) { + const jsxPragmaInfo = getJSXPragmaInfo(options); + const nonTypeIdentifiers = new Set(); + for (let i = 0; i < tokens.tokens.length; i++) { + const token = tokens.tokens[i]; + if ( + token.type === tt.name && + !token.isType && + (token.identifierRole === IdentifierRole.Access || + token.identifierRole === IdentifierRole.ObjectShorthand || + token.identifierRole === IdentifierRole.ExportAccess) && + !token.shadowsGlobal + ) { + nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); + } + if (token.type === tt.jsxTagStart) { + nonTypeIdentifiers.add(jsxPragmaInfo.base); + } + if ( + token.type === tt.jsxTagStart && + i + 1 < tokens.tokens.length && + tokens.tokens[i + 1].type === tt.jsxTagEnd + ) { + nonTypeIdentifiers.add(jsxPragmaInfo.base); + nonTypeIdentifiers.add(jsxPragmaInfo.fragmentBase); + } + if (token.type === tt.jsxName && token.identifierRole === IdentifierRole.Access) { + const identifierName = tokens.identifierNameForToken(token); + // Lower-case single-component tag names like "div" don't count. + if (!startsWithLowerCase(identifierName) || tokens.tokens[i + 1].type === TokenType.dot) { + nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); + } + } + } + return nonTypeIdentifiers; +} diff --git a/node_modules/sucrase/dist/esm/util/getTSImportedNames.js b/node_modules/sucrase/dist/esm/util/getTSImportedNames.js new file mode 100644 index 0000000..523181a --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/getTSImportedNames.js @@ -0,0 +1,84 @@ +import {TokenType as tt} from "../parser/tokenizer/types"; + +import getImportExportSpecifierInfo from "./getImportExportSpecifierInfo"; + +/** + * Special case code to scan for imported names in ESM TypeScript. We need to do this so we can + * properly get globals so we can compute shadowed globals. + * + * This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS + * replacement and flow type imports. + */ +export default function getTSImportedNames(tokens) { + const importedNames = new Set(); + for (let i = 0; i < tokens.tokens.length; i++) { + if ( + tokens.matches1AtIndex(i, tt._import) && + !tokens.matches3AtIndex(i, tt._import, tt.name, tt.eq) + ) { + collectNamesForImport(tokens, i, importedNames); + } + } + return importedNames; +} + +function collectNamesForImport( + tokens, + index, + importedNames, +) { + index++; + + if (tokens.matches1AtIndex(index, tt.parenL)) { + // Dynamic import, so nothing to do + return; + } + + if (tokens.matches1AtIndex(index, tt.name)) { + importedNames.add(tokens.identifierNameAtIndex(index)); + index++; + if (tokens.matches1AtIndex(index, tt.comma)) { + index++; + } + } + + if (tokens.matches1AtIndex(index, tt.star)) { + // * as + index += 2; + importedNames.add(tokens.identifierNameAtIndex(index)); + index++; + } + + if (tokens.matches1AtIndex(index, tt.braceL)) { + index++; + collectNamesForNamedImport(tokens, index, importedNames); + } +} + +function collectNamesForNamedImport( + tokens, + index, + importedNames, +) { + while (true) { + if (tokens.matches1AtIndex(index, tt.braceR)) { + return; + } + + const specifierInfo = getImportExportSpecifierInfo(tokens, index); + index = specifierInfo.endIndex; + if (!specifierInfo.isType) { + importedNames.add(specifierInfo.rightName); + } + + if (tokens.matches2AtIndex(index, tt.comma, tt.braceR)) { + return; + } else if (tokens.matches1AtIndex(index, tt.braceR)) { + return; + } else if (tokens.matches1AtIndex(index, tt.comma)) { + index++; + } else { + throw new Error(`Unexpected token: ${JSON.stringify(tokens.tokens[index])}`); + } + } +} diff --git a/node_modules/sucrase/dist/esm/util/isAsyncOperation.js b/node_modules/sucrase/dist/esm/util/isAsyncOperation.js new file mode 100644 index 0000000..af40e9a --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/isAsyncOperation.js @@ -0,0 +1,38 @@ +import {ContextualKeyword} from "../parser/tokenizer/keywords"; + + +/** + * Determine whether this optional chain or nullish coalescing operation has any await statements in + * it. If so, we'll need to transpile to an async operation. + * + * We compute this by walking the length of the operation and returning true if we see an await + * keyword used as a real await (rather than an object key or property access). Nested optional + * chain/nullish operations need to be tracked but don't silence await, but a nested async function + * (or any other nested scope) will make the await not count. + */ +export default function isAsyncOperation(tokens) { + let index = tokens.currentIndex(); + let depth = 0; + const startToken = tokens.currentToken(); + do { + const token = tokens.tokens[index]; + if (token.isOptionalChainStart) { + depth++; + } + if (token.isOptionalChainEnd) { + depth--; + } + depth += token.numNullishCoalesceStarts; + depth -= token.numNullishCoalesceEnds; + + if ( + token.contextualKeyword === ContextualKeyword._await && + token.identifierRole == null && + token.scopeDepth === startToken.scopeDepth + ) { + return true; + } + index += 1; + } while (depth > 0 && index < tokens.tokens.length); + return false; +} diff --git a/node_modules/sucrase/dist/esm/util/isExportFrom.js b/node_modules/sucrase/dist/esm/util/isExportFrom.js new file mode 100644 index 0000000..fd33665 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/isExportFrom.js @@ -0,0 +1,18 @@ +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + + +/** + * Starting at `export {`, look ahead and return `true` if this is an + * `export {...} from` statement and `false` if this is a plain multi-export. + */ +export default function isExportFrom(tokens) { + let closeBraceIndex = tokens.currentIndex(); + while (!tokens.matches1AtIndex(closeBraceIndex, tt.braceR)) { + closeBraceIndex++; + } + return ( + tokens.matchesContextualAtIndex(closeBraceIndex + 1, ContextualKeyword._from) && + tokens.matches1AtIndex(closeBraceIndex + 2, tt.string) + ); +} diff --git a/node_modules/sucrase/dist/esm/util/isIdentifier.js b/node_modules/sucrase/dist/esm/util/isIdentifier.js new file mode 100644 index 0000000..4a62ff6 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/isIdentifier.js @@ -0,0 +1,81 @@ +import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../parser/util/identifier"; + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar +// Hard-code a list of reserved words rather than trying to use keywords or contextual keywords +// from the parser, since currently there are various exceptions, like `package` being reserved +// but unused and various contextual keywords being reserved. Note that we assume that all code +// compiled by Sucrase is in a module, so strict mode words and await are all considered reserved +// here. +const RESERVED_WORDS = new Set([ + // Reserved keywords as of ECMAScript 2015 + "break", + "case", + "catch", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "export", + "extends", + "finally", + "for", + "function", + "if", + "import", + "in", + "instanceof", + "new", + "return", + "super", + "switch", + "this", + "throw", + "try", + "typeof", + "var", + "void", + "while", + "with", + "yield", + // Future reserved keywords + "enum", + "implements", + "interface", + "let", + "package", + "private", + "protected", + "public", + "static", + "await", + // Literals that cannot be used as identifiers + "false", + "null", + "true", +]); + +/** + * Determine if the given name is a legal variable name. + * + * This is needed when transforming TypeScript enums; if an enum key is a valid + * variable name, it might be referenced later in the enum, so we need to + * declare a variable. + */ +export default function isIdentifier(name) { + if (name.length === 0) { + return false; + } + if (!IS_IDENTIFIER_START[name.charCodeAt(0)]) { + return false; + } + for (let i = 1; i < name.length; i++) { + if (!IS_IDENTIFIER_CHAR[name.charCodeAt(i)]) { + return false; + } + } + return !RESERVED_WORDS.has(name); +} diff --git a/node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js b/node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js new file mode 100644 index 0000000..abced0e --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js @@ -0,0 +1,22 @@ +import {ContextualKeyword} from "../parser/tokenizer/keywords"; +import {TokenType as tt} from "../parser/tokenizer/types"; + + +/** + * Starting at a potential `with` or (legacy) `assert` token, remove the import + * attributes if they exist. + */ +export function removeMaybeImportAttributes(tokens) { + if ( + tokens.matches2(tt._with, tt.braceL) || + (tokens.matches2(tt.name, tt.braceL) && tokens.matchesContextual(ContextualKeyword._assert)) + ) { + // assert + tokens.removeToken(); + // { + tokens.removeToken(); + tokens.removeBalancedCode(); + // } + tokens.removeToken(); + } +} diff --git a/node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js b/node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js new file mode 100644 index 0000000..d3c4693 --- /dev/null +++ b/node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js @@ -0,0 +1,38 @@ +import {TokenType as tt} from "../parser/tokenizer/types"; + + + +/** + * Common method sharing code between CJS and ESM cases, since they're the same here. + */ +export default function shouldElideDefaultExport( + isTypeScriptTransformEnabled, + keepUnusedImports, + tokens, + declarationInfo, +) { + if (!isTypeScriptTransformEnabled || keepUnusedImports) { + return false; + } + const exportToken = tokens.currentToken(); + if (exportToken.rhsEndIndex == null) { + throw new Error("Expected non-null rhsEndIndex on export token."); + } + // The export must be of the form `export default a` or `export default a;`. + const numTokens = exportToken.rhsEndIndex - tokens.currentIndex(); + if ( + numTokens !== 3 && + !(numTokens === 4 && tokens.matches1AtIndex(exportToken.rhsEndIndex - 1, tt.semi)) + ) { + return false; + } + const identifierToken = tokens.tokenAtRelativeIndex(2); + if (identifierToken.type !== tt.name) { + return false; + } + const exportedName = tokens.identifierNameForToken(identifierToken); + return ( + declarationInfo.typeDeclarations.has(exportedName) && + !declarationInfo.valueDeclarations.has(exportedName) + ); +} diff --git a/node_modules/sucrase/dist/identifyShadowedGlobals.js b/node_modules/sucrase/dist/identifyShadowedGlobals.js new file mode 100644 index 0000000..41c8eef --- /dev/null +++ b/node_modules/sucrase/dist/identifyShadowedGlobals.js @@ -0,0 +1,98 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + + +var _tokenizer = require('./parser/tokenizer'); + +var _types = require('./parser/tokenizer/types'); + + +/** + * Traverse the given tokens and modify them if necessary to indicate that some names shadow global + * variables. + */ + function identifyShadowedGlobals( + tokens, + scopes, + globalNames, +) { + if (!hasShadowedGlobals(tokens, globalNames)) { + return; + } + markShadowedGlobals(tokens, scopes, globalNames); +} exports.default = identifyShadowedGlobals; + +/** + * We can do a fast up-front check to see if there are any declarations to global names. If not, + * then there's no point in computing scope assignments. + */ +// Exported for testing. + function hasShadowedGlobals(tokens, globalNames) { + for (const token of tokens.tokens) { + if ( + token.type === _types.TokenType.name && + !token.isType && + _tokenizer.isNonTopLevelDeclaration.call(void 0, token) && + globalNames.has(tokens.identifierNameForToken(token)) + ) { + return true; + } + } + return false; +} exports.hasShadowedGlobals = hasShadowedGlobals; + +function markShadowedGlobals( + tokens, + scopes, + globalNames, +) { + const scopeStack = []; + let scopeIndex = scopes.length - 1; + // Scopes were generated at completion time, so they're sorted by end index, so we can maintain a + // good stack by going backwards through them. + for (let i = tokens.tokens.length - 1; ; i--) { + while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i + 1) { + scopeStack.pop(); + } + while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i + 1) { + scopeStack.push(scopes[scopeIndex]); + scopeIndex--; + } + // Process scopes after the last iteration so we can make sure we pop all of them. + if (i < 0) { + break; + } + + const token = tokens.tokens[i]; + const name = tokens.identifierNameForToken(token); + if (scopeStack.length > 1 && !token.isType && token.type === _types.TokenType.name && globalNames.has(name)) { + if (_tokenizer.isBlockScopedDeclaration.call(void 0, token)) { + markShadowedForScope(scopeStack[scopeStack.length - 1], tokens, name); + } else if (_tokenizer.isFunctionScopedDeclaration.call(void 0, token)) { + let stackIndex = scopeStack.length - 1; + while (stackIndex > 0 && !scopeStack[stackIndex].isFunctionScope) { + stackIndex--; + } + if (stackIndex < 0) { + throw new Error("Did not find parent function scope."); + } + markShadowedForScope(scopeStack[stackIndex], tokens, name); + } + } + } + if (scopeStack.length > 0) { + throw new Error("Expected empty scope stack after processing file."); + } +} + +function markShadowedForScope(scope, tokens, name) { + for (let i = scope.startTokenIndex; i < scope.endTokenIndex; i++) { + const token = tokens.tokens[i]; + if ( + (token.type === _types.TokenType.name || token.type === _types.TokenType.jsxName) && + tokens.identifierNameForToken(token) === name + ) { + token.shadowsGlobal = true; + } + } +} diff --git a/node_modules/sucrase/dist/index.js b/node_modules/sucrase/dist/index.js new file mode 100644 index 0000000..1517bca --- /dev/null +++ b/node_modules/sucrase/dist/index.js @@ -0,0 +1,133 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _CJSImportProcessor = require('./CJSImportProcessor'); var _CJSImportProcessor2 = _interopRequireDefault(_CJSImportProcessor); +var _computeSourceMap = require('./computeSourceMap'); var _computeSourceMap2 = _interopRequireDefault(_computeSourceMap); +var _HelperManager = require('./HelperManager'); +var _identifyShadowedGlobals = require('./identifyShadowedGlobals'); var _identifyShadowedGlobals2 = _interopRequireDefault(_identifyShadowedGlobals); +var _NameManager = require('./NameManager'); var _NameManager2 = _interopRequireDefault(_NameManager); +var _Options = require('./Options'); + +var _parser = require('./parser'); + +var _TokenProcessor = require('./TokenProcessor'); var _TokenProcessor2 = _interopRequireDefault(_TokenProcessor); +var _RootTransformer = require('./transformers/RootTransformer'); var _RootTransformer2 = _interopRequireDefault(_RootTransformer); +var _formatTokens = require('./util/formatTokens'); var _formatTokens2 = _interopRequireDefault(_formatTokens); +var _getTSImportedNames = require('./util/getTSImportedNames'); var _getTSImportedNames2 = _interopRequireDefault(_getTSImportedNames); + + + + + + + + + + + + + + +; + + function getVersion() { + /* istanbul ignore next */ + return "3.34.0"; +} exports.getVersion = getVersion; + + function transform(code, options) { + _Options.validateOptions.call(void 0, options); + try { + const sucraseContext = getSucraseContext(code, options); + const transformer = new (0, _RootTransformer2.default)( + sucraseContext, + options.transforms, + Boolean(options.enableLegacyBabel5ModuleInterop), + options, + ); + const transformerResult = transformer.transform(); + let result = {code: transformerResult.code}; + if (options.sourceMapOptions) { + if (!options.filePath) { + throw new Error("filePath must be specified when generating a source map."); + } + result = { + ...result, + sourceMap: _computeSourceMap2.default.call(void 0, + transformerResult, + options.filePath, + options.sourceMapOptions, + code, + sucraseContext.tokenProcessor.tokens, + ), + }; + } + return result; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e) { + if (options.filePath) { + e.message = `Error transforming ${options.filePath}: ${e.message}`; + } + throw e; + } +} exports.transform = transform; + +/** + * Return a string representation of the sucrase tokens, mostly useful for + * diagnostic purposes. + */ + function getFormattedTokens(code, options) { + const tokens = getSucraseContext(code, options).tokenProcessor.tokens; + return _formatTokens2.default.call(void 0, code, tokens); +} exports.getFormattedTokens = getFormattedTokens; + +/** + * Call into the parser/tokenizer and do some further preprocessing: + * - Come up with a set of used names so that we can assign new names. + * - Preprocess all import/export statements so we know which globals we are interested in. + * - Compute situations where any of those globals are shadowed. + * + * In the future, some of these preprocessing steps can be skipped based on what actual work is + * being done. + */ +function getSucraseContext(code, options) { + const isJSXEnabled = options.transforms.includes("jsx"); + const isTypeScriptEnabled = options.transforms.includes("typescript"); + const isFlowEnabled = options.transforms.includes("flow"); + const disableESTransforms = options.disableESTransforms === true; + const file = _parser.parse.call(void 0, code, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); + const tokens = file.tokens; + const scopes = file.scopes; + + const nameManager = new (0, _NameManager2.default)(code, tokens); + const helperManager = new (0, _HelperManager.HelperManager)(nameManager); + const tokenProcessor = new (0, _TokenProcessor2.default)( + code, + tokens, + isFlowEnabled, + disableESTransforms, + helperManager, + ); + const enableLegacyTypeScriptModuleInterop = Boolean(options.enableLegacyTypeScriptModuleInterop); + + let importProcessor = null; + if (options.transforms.includes("imports")) { + importProcessor = new (0, _CJSImportProcessor2.default)( + nameManager, + tokenProcessor, + enableLegacyTypeScriptModuleInterop, + options, + options.transforms.includes("typescript"), + Boolean(options.keepUnusedImports), + helperManager, + ); + importProcessor.preprocessTokens(); + // We need to mark shadowed globals after processing imports so we know that the globals are, + // but before type-only import pruning, since that relies on shadowing information. + _identifyShadowedGlobals2.default.call(void 0, tokenProcessor, scopes, importProcessor.getGlobalNames()); + if (options.transforms.includes("typescript") && !options.keepUnusedImports) { + importProcessor.pruneTypeOnlyImports(); + } + } else if (options.transforms.includes("typescript") && !options.keepUnusedImports) { + // Shadowed global detection is needed for TS implicit elision of imported names. + _identifyShadowedGlobals2.default.call(void 0, tokenProcessor, scopes, _getTSImportedNames2.default.call(void 0, tokenProcessor)); + } + return {tokenProcessor, scopes, nameManager, importProcessor, helperManager}; +} diff --git a/node_modules/sucrase/dist/parser/index.js b/node_modules/sucrase/dist/parser/index.js new file mode 100644 index 0000000..35d832a --- /dev/null +++ b/node_modules/sucrase/dist/parser/index.js @@ -0,0 +1,31 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +var _base = require('./traverser/base'); +var _index = require('./traverser/index'); + + class File { + + + + constructor(tokens, scopes) { + this.tokens = tokens; + this.scopes = scopes; + } +} exports.File = File; + + function parse( + input, + isJSXEnabled, + isTypeScriptEnabled, + isFlowEnabled, +) { + if (isFlowEnabled && isTypeScriptEnabled) { + throw new Error("Cannot combine flow and typescript plugins."); + } + _base.initParser.call(void 0, input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); + const result = _index.parseFile.call(void 0, ); + if (_base.state.error) { + throw _base.augmentError.call(void 0, _base.state.error); + } + return result; +} exports.parse = parse; diff --git a/node_modules/sucrase/dist/parser/plugins/flow.js b/node_modules/sucrase/dist/parser/plugins/flow.js new file mode 100644 index 0000000..9401895 --- /dev/null +++ b/node_modules/sucrase/dist/parser/plugins/flow.js @@ -0,0 +1,1105 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* eslint max-len: 0 */ + + + + + + + + + + +var _index = require('../tokenizer/index'); +var _keywords = require('../tokenizer/keywords'); +var _types = require('../tokenizer/types'); +var _base = require('../traverser/base'); + + + + + + + + + + + + + +var _expression = require('../traverser/expression'); + + + + + + + + +var _statement = require('../traverser/statement'); + + + + + + + + + +var _util = require('../traverser/util'); + +function isMaybeDefaultImport(lookahead) { + return ( + (lookahead.type === _types.TokenType.name || !!(lookahead.type & _types.TokenType.IS_KEYWORD)) && + lookahead.contextualKeyword !== _keywords.ContextualKeyword._from + ); +} + +function flowParseTypeInitialiser(tok) { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _util.expect.call(void 0, tok || _types.TokenType.colon); + flowParseType(); + _index.popTypeContext.call(void 0, oldIsType); +} + +function flowParsePredicate() { + _util.expect.call(void 0, _types.TokenType.modulo); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._checks); + if (_index.eat.call(void 0, _types.TokenType.parenL)) { + _expression.parseExpression.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.parenR); + } +} + +function flowParseTypeAndPredicateInitialiser() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _util.expect.call(void 0, _types.TokenType.colon); + if (_index.match.call(void 0, _types.TokenType.modulo)) { + flowParsePredicate(); + } else { + flowParseType(); + if (_index.match.call(void 0, _types.TokenType.modulo)) { + flowParsePredicate(); + } + } + _index.popTypeContext.call(void 0, oldIsType); +} + +function flowParseDeclareClass() { + _index.next.call(void 0, ); + flowParseInterfaceish(/* isClass */ true); +} + +function flowParseDeclareFunction() { + _index.next.call(void 0, ); + _expression.parseIdentifier.call(void 0, ); + + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + _util.expect.call(void 0, _types.TokenType.parenL); + flowParseFunctionTypeParams(); + _util.expect.call(void 0, _types.TokenType.parenR); + + flowParseTypeAndPredicateInitialiser(); + + _util.semicolon.call(void 0, ); +} + +function flowParseDeclare() { + if (_index.match.call(void 0, _types.TokenType._class)) { + flowParseDeclareClass(); + } else if (_index.match.call(void 0, _types.TokenType._function)) { + flowParseDeclareFunction(); + } else if (_index.match.call(void 0, _types.TokenType._var)) { + flowParseDeclareVariable(); + } else if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._module)) { + if (_index.eat.call(void 0, _types.TokenType.dot)) { + flowParseDeclareModuleExports(); + } else { + flowParseDeclareModule(); + } + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { + flowParseDeclareTypeAlias(); + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque)) { + flowParseDeclareOpaqueType(); + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { + flowParseDeclareInterface(); + } else if (_index.match.call(void 0, _types.TokenType._export)) { + flowParseDeclareExportDeclaration(); + } else { + _util.unexpected.call(void 0, ); + } +} + +function flowParseDeclareVariable() { + _index.next.call(void 0, ); + flowParseTypeAnnotatableIdentifier(); + _util.semicolon.call(void 0, ); +} + +function flowParseDeclareModule() { + if (_index.match.call(void 0, _types.TokenType.string)) { + _expression.parseExprAtom.call(void 0, ); + } else { + _expression.parseIdentifier.call(void 0, ); + } + + _util.expect.call(void 0, _types.TokenType.braceL); + while (!_index.match.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + if (_index.match.call(void 0, _types.TokenType._import)) { + _index.next.call(void 0, ); + _statement.parseImport.call(void 0, ); + } else { + _util.unexpected.call(void 0, ); + } + } + _util.expect.call(void 0, _types.TokenType.braceR); +} + +function flowParseDeclareExportDeclaration() { + _util.expect.call(void 0, _types.TokenType._export); + + if (_index.eat.call(void 0, _types.TokenType._default)) { + if (_index.match.call(void 0, _types.TokenType._function) || _index.match.call(void 0, _types.TokenType._class)) { + // declare export default class ... + // declare export default function ... + flowParseDeclare(); + } else { + // declare export default [type]; + flowParseType(); + _util.semicolon.call(void 0, ); + } + } else if ( + _index.match.call(void 0, _types.TokenType._var) || // declare export var ... + _index.match.call(void 0, _types.TokenType._function) || // declare export function ... + _index.match.call(void 0, _types.TokenType._class) || // declare export class ... + _util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque) // declare export opaque .. + ) { + flowParseDeclare(); + } else if ( + _index.match.call(void 0, _types.TokenType.star) || // declare export * from '' + _index.match.call(void 0, _types.TokenType.braceL) || // declare export {} ... + _util.isContextual.call(void 0, _keywords.ContextualKeyword._interface) || // declare export interface ... + _util.isContextual.call(void 0, _keywords.ContextualKeyword._type) || // declare export type ... + _util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque) // declare export opaque type ... + ) { + _statement.parseExport.call(void 0, ); + } else { + _util.unexpected.call(void 0, ); + } +} + +function flowParseDeclareModuleExports() { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._exports); + flowParseTypeAnnotation(); + _util.semicolon.call(void 0, ); +} + +function flowParseDeclareTypeAlias() { + _index.next.call(void 0, ); + flowParseTypeAlias(); +} + +function flowParseDeclareOpaqueType() { + _index.next.call(void 0, ); + flowParseOpaqueType(true); +} + +function flowParseDeclareInterface() { + _index.next.call(void 0, ); + flowParseInterfaceish(); +} + +// Interfaces + +function flowParseInterfaceish(isClass = false) { + flowParseRestrictedIdentifier(); + + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + if (_index.eat.call(void 0, _types.TokenType._extends)) { + do { + flowParseInterfaceExtends(); + } while (!isClass && _index.eat.call(void 0, _types.TokenType.comma)); + } + + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._mixins)) { + _index.next.call(void 0, ); + do { + flowParseInterfaceExtends(); + } while (_index.eat.call(void 0, _types.TokenType.comma)); + } + + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._implements)) { + _index.next.call(void 0, ); + do { + flowParseInterfaceExtends(); + } while (_index.eat.call(void 0, _types.TokenType.comma)); + } + + flowParseObjectType(isClass, false, isClass); +} + +function flowParseInterfaceExtends() { + flowParseQualifiedTypeIdentifier(false); + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterInstantiation(); + } +} + +function flowParseInterface() { + flowParseInterfaceish(); +} + +function flowParseRestrictedIdentifier() { + _expression.parseIdentifier.call(void 0, ); +} + +function flowParseTypeAlias() { + flowParseRestrictedIdentifier(); + + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + flowParseTypeInitialiser(_types.TokenType.eq); + _util.semicolon.call(void 0, ); +} + +function flowParseOpaqueType(declare) { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); + flowParseRestrictedIdentifier(); + + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + // Parse the supertype + if (_index.match.call(void 0, _types.TokenType.colon)) { + flowParseTypeInitialiser(_types.TokenType.colon); + } + + if (!declare) { + flowParseTypeInitialiser(_types.TokenType.eq); + } + _util.semicolon.call(void 0, ); +} + +function flowParseTypeParameter() { + flowParseVariance(); + flowParseTypeAnnotatableIdentifier(); + + if (_index.eat.call(void 0, _types.TokenType.eq)) { + flowParseType(); + } +} + + function flowParseTypeParameterDeclaration() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + // istanbul ignore else: this condition is already checked at all call sites + if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.typeParameterStart)) { + _index.next.call(void 0, ); + } else { + _util.unexpected.call(void 0, ); + } + + do { + flowParseTypeParameter(); + if (!_index.match.call(void 0, _types.TokenType.greaterThan)) { + _util.expect.call(void 0, _types.TokenType.comma); + } + } while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error); + _util.expect.call(void 0, _types.TokenType.greaterThan); + _index.popTypeContext.call(void 0, oldIsType); +} exports.flowParseTypeParameterDeclaration = flowParseTypeParameterDeclaration; + +function flowParseTypeParameterInstantiation() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _util.expect.call(void 0, _types.TokenType.lessThan); + while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { + flowParseType(); + if (!_index.match.call(void 0, _types.TokenType.greaterThan)) { + _util.expect.call(void 0, _types.TokenType.comma); + } + } + _util.expect.call(void 0, _types.TokenType.greaterThan); + _index.popTypeContext.call(void 0, oldIsType); +} + +function flowParseInterfaceType() { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._interface); + if (_index.eat.call(void 0, _types.TokenType._extends)) { + do { + flowParseInterfaceExtends(); + } while (_index.eat.call(void 0, _types.TokenType.comma)); + } + flowParseObjectType(false, false, false); +} + +function flowParseObjectPropertyKey() { + if (_index.match.call(void 0, _types.TokenType.num) || _index.match.call(void 0, _types.TokenType.string)) { + _expression.parseExprAtom.call(void 0, ); + } else { + _expression.parseIdentifier.call(void 0, ); + } +} + +function flowParseObjectTypeIndexer() { + // Note: bracketL has already been consumed + if (_index.lookaheadType.call(void 0, ) === _types.TokenType.colon) { + flowParseObjectPropertyKey(); + flowParseTypeInitialiser(); + } else { + flowParseType(); + } + _util.expect.call(void 0, _types.TokenType.bracketR); + flowParseTypeInitialiser(); +} + +function flowParseObjectTypeInternalSlot() { + // Note: both bracketL have already been consumed + flowParseObjectPropertyKey(); + _util.expect.call(void 0, _types.TokenType.bracketR); + _util.expect.call(void 0, _types.TokenType.bracketR); + if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.parenL)) { + flowParseObjectTypeMethodish(); + } else { + _index.eat.call(void 0, _types.TokenType.question); + flowParseTypeInitialiser(); + } +} + +function flowParseObjectTypeMethodish() { + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterDeclaration(); + } + + _util.expect.call(void 0, _types.TokenType.parenL); + while (!_index.match.call(void 0, _types.TokenType.parenR) && !_index.match.call(void 0, _types.TokenType.ellipsis) && !_base.state.error) { + flowParseFunctionTypeParam(); + if (!_index.match.call(void 0, _types.TokenType.parenR)) { + _util.expect.call(void 0, _types.TokenType.comma); + } + } + + if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { + flowParseFunctionTypeParam(); + } + _util.expect.call(void 0, _types.TokenType.parenR); + flowParseTypeInitialiser(); +} + +function flowParseObjectTypeCallProperty() { + flowParseObjectTypeMethodish(); +} + +function flowParseObjectType(allowStatic, allowExact, allowProto) { + let endDelim; + if (allowExact && _index.match.call(void 0, _types.TokenType.braceBarL)) { + _util.expect.call(void 0, _types.TokenType.braceBarL); + endDelim = _types.TokenType.braceBarR; + } else { + _util.expect.call(void 0, _types.TokenType.braceL); + endDelim = _types.TokenType.braceR; + } + + while (!_index.match.call(void 0, endDelim) && !_base.state.error) { + if (allowProto && _util.isContextual.call(void 0, _keywords.ContextualKeyword._proto)) { + const lookahead = _index.lookaheadType.call(void 0, ); + if (lookahead !== _types.TokenType.colon && lookahead !== _types.TokenType.question) { + _index.next.call(void 0, ); + allowStatic = false; + } + } + if (allowStatic && _util.isContextual.call(void 0, _keywords.ContextualKeyword._static)) { + const lookahead = _index.lookaheadType.call(void 0, ); + if (lookahead !== _types.TokenType.colon && lookahead !== _types.TokenType.question) { + _index.next.call(void 0, ); + } + } + + flowParseVariance(); + + if (_index.eat.call(void 0, _types.TokenType.bracketL)) { + if (_index.eat.call(void 0, _types.TokenType.bracketL)) { + flowParseObjectTypeInternalSlot(); + } else { + flowParseObjectTypeIndexer(); + } + } else if (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseObjectTypeCallProperty(); + } else { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._get) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._set)) { + const lookahead = _index.lookaheadType.call(void 0, ); + if (lookahead === _types.TokenType.name || lookahead === _types.TokenType.string || lookahead === _types.TokenType.num) { + _index.next.call(void 0, ); + } + } + + flowParseObjectTypeProperty(); + } + + flowObjectTypeSemicolon(); + } + + _util.expect.call(void 0, endDelim); +} + +function flowParseObjectTypeProperty() { + if (_index.match.call(void 0, _types.TokenType.ellipsis)) { + _util.expect.call(void 0, _types.TokenType.ellipsis); + if (!_index.eat.call(void 0, _types.TokenType.comma)) { + _index.eat.call(void 0, _types.TokenType.semi); + } + // Explicit inexact object syntax. + if (_index.match.call(void 0, _types.TokenType.braceR)) { + return; + } + flowParseType(); + } else { + flowParseObjectPropertyKey(); + if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.parenL)) { + // This is a method property + flowParseObjectTypeMethodish(); + } else { + _index.eat.call(void 0, _types.TokenType.question); + flowParseTypeInitialiser(); + } + } +} + +function flowObjectTypeSemicolon() { + if (!_index.eat.call(void 0, _types.TokenType.semi) && !_index.eat.call(void 0, _types.TokenType.comma) && !_index.match.call(void 0, _types.TokenType.braceR) && !_index.match.call(void 0, _types.TokenType.braceBarR)) { + _util.unexpected.call(void 0, ); + } +} + +function flowParseQualifiedTypeIdentifier(initialIdAlreadyParsed) { + if (!initialIdAlreadyParsed) { + _expression.parseIdentifier.call(void 0, ); + } + while (_index.eat.call(void 0, _types.TokenType.dot)) { + _expression.parseIdentifier.call(void 0, ); + } +} + +function flowParseGenericType() { + flowParseQualifiedTypeIdentifier(true); + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterInstantiation(); + } +} + +function flowParseTypeofType() { + _util.expect.call(void 0, _types.TokenType._typeof); + flowParsePrimaryType(); +} + +function flowParseTupleType() { + _util.expect.call(void 0, _types.TokenType.bracketL); + // We allow trailing commas + while (_base.state.pos < _base.input.length && !_index.match.call(void 0, _types.TokenType.bracketR)) { + flowParseType(); + if (_index.match.call(void 0, _types.TokenType.bracketR)) { + break; + } + _util.expect.call(void 0, _types.TokenType.comma); + } + _util.expect.call(void 0, _types.TokenType.bracketR); +} + +function flowParseFunctionTypeParam() { + const lookahead = _index.lookaheadType.call(void 0, ); + if (lookahead === _types.TokenType.colon || lookahead === _types.TokenType.question) { + _expression.parseIdentifier.call(void 0, ); + _index.eat.call(void 0, _types.TokenType.question); + flowParseTypeInitialiser(); + } else { + flowParseType(); + } +} + +function flowParseFunctionTypeParams() { + while (!_index.match.call(void 0, _types.TokenType.parenR) && !_index.match.call(void 0, _types.TokenType.ellipsis) && !_base.state.error) { + flowParseFunctionTypeParam(); + if (!_index.match.call(void 0, _types.TokenType.parenR)) { + _util.expect.call(void 0, _types.TokenType.comma); + } + } + if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { + flowParseFunctionTypeParam(); + } +} + +// The parsing of types roughly parallels the parsing of expressions, and +// primary types are kind of like primary expressions...they're the +// primitives with which other types are constructed. +function flowParsePrimaryType() { + let isGroupedType = false; + const oldNoAnonFunctionType = _base.state.noAnonFunctionType; + + switch (_base.state.type) { + case _types.TokenType.name: { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { + flowParseInterfaceType(); + return; + } + _expression.parseIdentifier.call(void 0, ); + flowParseGenericType(); + return; + } + + case _types.TokenType.braceL: + flowParseObjectType(false, false, false); + return; + + case _types.TokenType.braceBarL: + flowParseObjectType(false, true, false); + return; + + case _types.TokenType.bracketL: + flowParseTupleType(); + return; + + case _types.TokenType.lessThan: + flowParseTypeParameterDeclaration(); + _util.expect.call(void 0, _types.TokenType.parenL); + flowParseFunctionTypeParams(); + _util.expect.call(void 0, _types.TokenType.parenR); + _util.expect.call(void 0, _types.TokenType.arrow); + flowParseType(); + return; + + case _types.TokenType.parenL: + _index.next.call(void 0, ); + + // Check to see if this is actually a grouped type + if (!_index.match.call(void 0, _types.TokenType.parenR) && !_index.match.call(void 0, _types.TokenType.ellipsis)) { + if (_index.match.call(void 0, _types.TokenType.name)) { + const token = _index.lookaheadType.call(void 0, ); + isGroupedType = token !== _types.TokenType.question && token !== _types.TokenType.colon; + } else { + isGroupedType = true; + } + } + + if (isGroupedType) { + _base.state.noAnonFunctionType = false; + flowParseType(); + _base.state.noAnonFunctionType = oldNoAnonFunctionType; + + // A `,` or a `) =>` means this is an anonymous function type + if ( + _base.state.noAnonFunctionType || + !(_index.match.call(void 0, _types.TokenType.comma) || (_index.match.call(void 0, _types.TokenType.parenR) && _index.lookaheadType.call(void 0, ) === _types.TokenType.arrow)) + ) { + _util.expect.call(void 0, _types.TokenType.parenR); + return; + } else { + // Eat a comma if there is one + _index.eat.call(void 0, _types.TokenType.comma); + } + } + + flowParseFunctionTypeParams(); + + _util.expect.call(void 0, _types.TokenType.parenR); + _util.expect.call(void 0, _types.TokenType.arrow); + flowParseType(); + return; + + case _types.TokenType.minus: + _index.next.call(void 0, ); + _expression.parseLiteral.call(void 0, ); + return; + + case _types.TokenType.string: + case _types.TokenType.num: + case _types.TokenType._true: + case _types.TokenType._false: + case _types.TokenType._null: + case _types.TokenType._this: + case _types.TokenType._void: + case _types.TokenType.star: + _index.next.call(void 0, ); + return; + + default: + if (_base.state.type === _types.TokenType._typeof) { + flowParseTypeofType(); + return; + } else if (_base.state.type & _types.TokenType.IS_KEYWORD) { + _index.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.name; + return; + } + } + + _util.unexpected.call(void 0, ); +} + +function flowParsePostfixType() { + flowParsePrimaryType(); + while (!_util.canInsertSemicolon.call(void 0, ) && (_index.match.call(void 0, _types.TokenType.bracketL) || _index.match.call(void 0, _types.TokenType.questionDot))) { + _index.eat.call(void 0, _types.TokenType.questionDot); + _util.expect.call(void 0, _types.TokenType.bracketL); + if (_index.eat.call(void 0, _types.TokenType.bracketR)) { + // Array type + } else { + // Indexed access type + flowParseType(); + _util.expect.call(void 0, _types.TokenType.bracketR); + } + } +} + +function flowParsePrefixType() { + if (_index.eat.call(void 0, _types.TokenType.question)) { + flowParsePrefixType(); + } else { + flowParsePostfixType(); + } +} + +function flowParseAnonFunctionWithoutParens() { + flowParsePrefixType(); + if (!_base.state.noAnonFunctionType && _index.eat.call(void 0, _types.TokenType.arrow)) { + flowParseType(); + } +} + +function flowParseIntersectionType() { + _index.eat.call(void 0, _types.TokenType.bitwiseAND); + flowParseAnonFunctionWithoutParens(); + while (_index.eat.call(void 0, _types.TokenType.bitwiseAND)) { + flowParseAnonFunctionWithoutParens(); + } +} + +function flowParseUnionType() { + _index.eat.call(void 0, _types.TokenType.bitwiseOR); + flowParseIntersectionType(); + while (_index.eat.call(void 0, _types.TokenType.bitwiseOR)) { + flowParseIntersectionType(); + } +} + +function flowParseType() { + flowParseUnionType(); +} + + function flowParseTypeAnnotation() { + flowParseTypeInitialiser(); +} exports.flowParseTypeAnnotation = flowParseTypeAnnotation; + +function flowParseTypeAnnotatableIdentifier() { + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.colon)) { + flowParseTypeAnnotation(); + } +} + + function flowParseVariance() { + if (_index.match.call(void 0, _types.TokenType.plus) || _index.match.call(void 0, _types.TokenType.minus)) { + _index.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].isType = true; + } +} exports.flowParseVariance = flowParseVariance; + +// ================================== +// Overrides +// ================================== + + function flowParseFunctionBodyAndFinish(funcContextId) { + // For arrow functions, `parseArrow` handles the return type itself. + if (_index.match.call(void 0, _types.TokenType.colon)) { + flowParseTypeAndPredicateInitialiser(); + } + + _expression.parseFunctionBody.call(void 0, false, funcContextId); +} exports.flowParseFunctionBodyAndFinish = flowParseFunctionBodyAndFinish; + + function flowParseSubscript( + startTokenIndex, + noCalls, + stopState, +) { + if (_index.match.call(void 0, _types.TokenType.questionDot) && _index.lookaheadType.call(void 0, ) === _types.TokenType.lessThan) { + if (noCalls) { + stopState.stop = true; + return; + } + _index.next.call(void 0, ); + flowParseTypeParameterInstantiation(); + _util.expect.call(void 0, _types.TokenType.parenL); + _expression.parseCallExpressionArguments.call(void 0, ); + return; + } else if (!noCalls && _index.match.call(void 0, _types.TokenType.lessThan)) { + const snapshot = _base.state.snapshot(); + flowParseTypeParameterInstantiation(); + _util.expect.call(void 0, _types.TokenType.parenL); + _expression.parseCallExpressionArguments.call(void 0, ); + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } else { + return; + } + } + _expression.baseParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); +} exports.flowParseSubscript = flowParseSubscript; + + function flowStartParseNewArguments() { + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + const snapshot = _base.state.snapshot(); + flowParseTypeParameterInstantiation(); + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } + } +} exports.flowStartParseNewArguments = flowStartParseNewArguments; + +// interfaces + function flowTryParseStatement() { + if (_index.match.call(void 0, _types.TokenType.name) && _base.state.contextualKeyword === _keywords.ContextualKeyword._interface) { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _index.next.call(void 0, ); + flowParseInterface(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._enum)) { + flowParseEnumDeclaration(); + return true; + } + return false; +} exports.flowTryParseStatement = flowTryParseStatement; + + function flowTryParseExportDefaultExpression() { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._enum)) { + flowParseEnumDeclaration(); + return true; + } + return false; +} exports.flowTryParseExportDefaultExpression = flowTryParseExportDefaultExpression; + +// declares, interfaces and type aliases + function flowParseIdentifierStatement(contextualKeyword) { + if (contextualKeyword === _keywords.ContextualKeyword._declare) { + if ( + _index.match.call(void 0, _types.TokenType._class) || + _index.match.call(void 0, _types.TokenType.name) || + _index.match.call(void 0, _types.TokenType._function) || + _index.match.call(void 0, _types.TokenType._var) || + _index.match.call(void 0, _types.TokenType._export) + ) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + flowParseDeclare(); + _index.popTypeContext.call(void 0, oldIsType); + } + } else if (_index.match.call(void 0, _types.TokenType.name)) { + if (contextualKeyword === _keywords.ContextualKeyword._interface) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + flowParseInterface(); + _index.popTypeContext.call(void 0, oldIsType); + } else if (contextualKeyword === _keywords.ContextualKeyword._type) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + flowParseTypeAlias(); + _index.popTypeContext.call(void 0, oldIsType); + } else if (contextualKeyword === _keywords.ContextualKeyword._opaque) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + flowParseOpaqueType(false); + _index.popTypeContext.call(void 0, oldIsType); + } + } + _util.semicolon.call(void 0, ); +} exports.flowParseIdentifierStatement = flowParseIdentifierStatement; + +// export type + function flowShouldParseExportDeclaration() { + return ( + _util.isContextual.call(void 0, _keywords.ContextualKeyword._type) || + _util.isContextual.call(void 0, _keywords.ContextualKeyword._interface) || + _util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque) || + _util.isContextual.call(void 0, _keywords.ContextualKeyword._enum) + ); +} exports.flowShouldParseExportDeclaration = flowShouldParseExportDeclaration; + + function flowShouldDisallowExportDefaultSpecifier() { + return ( + _index.match.call(void 0, _types.TokenType.name) && + (_base.state.contextualKeyword === _keywords.ContextualKeyword._type || + _base.state.contextualKeyword === _keywords.ContextualKeyword._interface || + _base.state.contextualKeyword === _keywords.ContextualKeyword._opaque || + _base.state.contextualKeyword === _keywords.ContextualKeyword._enum) + ); +} exports.flowShouldDisallowExportDefaultSpecifier = flowShouldDisallowExportDefaultSpecifier; + + function flowParseExportDeclaration() { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + _index.next.call(void 0, ); + + if (_index.match.call(void 0, _types.TokenType.braceL)) { + // export type { foo, bar }; + _statement.parseExportSpecifiers.call(void 0, ); + _statement.parseExportFrom.call(void 0, ); + } else { + // export type Foo = Bar; + flowParseTypeAlias(); + } + _index.popTypeContext.call(void 0, oldIsType); + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque)) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + _index.next.call(void 0, ); + // export opaque type Foo = Bar; + flowParseOpaqueType(false); + _index.popTypeContext.call(void 0, oldIsType); + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + _index.next.call(void 0, ); + flowParseInterface(); + _index.popTypeContext.call(void 0, oldIsType); + } else { + _statement.parseStatement.call(void 0, true); + } +} exports.flowParseExportDeclaration = flowParseExportDeclaration; + + function flowShouldParseExportStar() { + return _index.match.call(void 0, _types.TokenType.star) || (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type) && _index.lookaheadType.call(void 0, ) === _types.TokenType.star); +} exports.flowShouldParseExportStar = flowShouldParseExportStar; + + function flowParseExportStar() { + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._type)) { + const oldIsType = _index.pushTypeContext.call(void 0, 2); + _statement.baseParseExportStar.call(void 0, ); + _index.popTypeContext.call(void 0, oldIsType); + } else { + _statement.baseParseExportStar.call(void 0, ); + } +} exports.flowParseExportStar = flowParseExportStar; + +// parse a the super class type parameters and implements + function flowAfterParseClassSuper(hasSuper) { + if (hasSuper && _index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterInstantiation(); + } + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._implements)) { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _index.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._implements; + do { + flowParseRestrictedIdentifier(); + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterInstantiation(); + } + } while (_index.eat.call(void 0, _types.TokenType.comma)); + _index.popTypeContext.call(void 0, oldIsType); + } +} exports.flowAfterParseClassSuper = flowAfterParseClassSuper; + +// parse type parameters for object method shorthand + function flowStartParseObjPropValue() { + // method shorthand + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + flowParseTypeParameterDeclaration(); + if (!_index.match.call(void 0, _types.TokenType.parenL)) _util.unexpected.call(void 0, ); + } +} exports.flowStartParseObjPropValue = flowStartParseObjPropValue; + + function flowParseAssignableListItemTypes() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _index.eat.call(void 0, _types.TokenType.question); + if (_index.match.call(void 0, _types.TokenType.colon)) { + flowParseTypeAnnotation(); + } + _index.popTypeContext.call(void 0, oldIsType); +} exports.flowParseAssignableListItemTypes = flowParseAssignableListItemTypes; + +// parse typeof and type imports + function flowStartParseImportSpecifiers() { + if (_index.match.call(void 0, _types.TokenType._typeof) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { + const lh = _index.lookaheadTypeAndKeyword.call(void 0, ); + if (isMaybeDefaultImport(lh) || lh.type === _types.TokenType.braceL || lh.type === _types.TokenType.star) { + _index.next.call(void 0, ); + } + } +} exports.flowStartParseImportSpecifiers = flowStartParseImportSpecifiers; + +// parse import-type/typeof shorthand + function flowParseImportSpecifier() { + const isTypeKeyword = + _base.state.contextualKeyword === _keywords.ContextualKeyword._type || _base.state.type === _types.TokenType._typeof; + if (isTypeKeyword) { + _index.next.call(void 0, ); + } else { + _expression.parseIdentifier.call(void 0, ); + } + + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._as) && !_util.isLookaheadContextual.call(void 0, _keywords.ContextualKeyword._as)) { + _expression.parseIdentifier.call(void 0, ); + if (isTypeKeyword && !_index.match.call(void 0, _types.TokenType.name) && !(_base.state.type & _types.TokenType.IS_KEYWORD)) { + // `import {type as ,` or `import {type as }` + } else { + // `import {type as foo` + _expression.parseIdentifier.call(void 0, ); + } + } else { + if (isTypeKeyword && (_index.match.call(void 0, _types.TokenType.name) || !!(_base.state.type & _types.TokenType.IS_KEYWORD))) { + // `import {type foo` + _expression.parseIdentifier.call(void 0, ); + } + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { + _expression.parseIdentifier.call(void 0, ); + } + } +} exports.flowParseImportSpecifier = flowParseImportSpecifier; + +// parse function type parameters - function foo() {} + function flowStartParseFunctionParams() { + // Originally this checked if the method is a getter/setter, but if it was, we'd crash soon + // anyway, so don't try to propagate that information. + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + flowParseTypeParameterDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + } +} exports.flowStartParseFunctionParams = flowStartParseFunctionParams; + +// parse flow type annotations on variable declarator heads - let foo: string = bar + function flowAfterParseVarHead() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + flowParseTypeAnnotation(); + } +} exports.flowAfterParseVarHead = flowAfterParseVarHead; + +// parse the return type of an async arrow function - let foo = (async (): number => {}); + function flowStartParseAsyncArrowFromCallExpression() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + const oldNoAnonFunctionType = _base.state.noAnonFunctionType; + _base.state.noAnonFunctionType = true; + flowParseTypeAnnotation(); + _base.state.noAnonFunctionType = oldNoAnonFunctionType; + } +} exports.flowStartParseAsyncArrowFromCallExpression = flowStartParseAsyncArrowFromCallExpression; + +// We need to support type parameter declarations for arrow functions. This +// is tricky. There are three situations we need to handle +// +// 1. This is either JSX or an arrow function. We'll try JSX first. If that +// fails, we'll try an arrow function. If that fails, we'll throw the JSX +// error. +// 2. This is an arrow function. We'll parse the type parameter declaration, +// parse the rest, make sure the rest is an arrow function, and go from +// there +// 3. This is neither. Just call the super method + function flowParseMaybeAssign(noIn, isWithinParens) { + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + const snapshot = _base.state.snapshot(); + let wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + _base.state.type = _types.TokenType.typeParameterStart; + } else { + return wasArrow; + } + + const oldIsType = _index.pushTypeContext.call(void 0, 0); + flowParseTypeParameterDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + if (wasArrow) { + return true; + } + _util.unexpected.call(void 0, ); + } + + return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); +} exports.flowParseMaybeAssign = flowParseMaybeAssign; + +// handle return types for arrow functions + function flowParseArrow() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + const snapshot = _base.state.snapshot(); + + const oldNoAnonFunctionType = _base.state.noAnonFunctionType; + _base.state.noAnonFunctionType = true; + flowParseTypeAndPredicateInitialiser(); + _base.state.noAnonFunctionType = oldNoAnonFunctionType; + + if (_util.canInsertSemicolon.call(void 0, )) _util.unexpected.call(void 0, ); + if (!_index.match.call(void 0, _types.TokenType.arrow)) _util.unexpected.call(void 0, ); + + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } + _index.popTypeContext.call(void 0, oldIsType); + } + return _index.eat.call(void 0, _types.TokenType.arrow); +} exports.flowParseArrow = flowParseArrow; + + function flowParseSubscripts(startTokenIndex, noCalls = false) { + if ( + _base.state.tokens[_base.state.tokens.length - 1].contextualKeyword === _keywords.ContextualKeyword._async && + _index.match.call(void 0, _types.TokenType.lessThan) + ) { + const snapshot = _base.state.snapshot(); + const wasArrow = parseAsyncArrowWithTypeParameters(); + if (wasArrow && !_base.state.error) { + return; + } + _base.state.restoreFromSnapshot(snapshot); + } + + _expression.baseParseSubscripts.call(void 0, startTokenIndex, noCalls); +} exports.flowParseSubscripts = flowParseSubscripts; + +// Returns true if there was an arrow function here. +function parseAsyncArrowWithTypeParameters() { + _base.state.scopeDepth++; + const startTokenIndex = _base.state.tokens.length; + _statement.parseFunctionParams.call(void 0, ); + if (!_expression.parseArrow.call(void 0, )) { + return false; + } + _expression.parseArrowExpression.call(void 0, startTokenIndex); + return true; +} + +function flowParseEnumDeclaration() { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._enum); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; + _expression.parseIdentifier.call(void 0, ); + flowParseEnumBody(); +} + +function flowParseEnumBody() { + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._of)) { + _index.next.call(void 0, ); + } + _util.expect.call(void 0, _types.TokenType.braceL); + flowParseEnumMembers(); + _util.expect.call(void 0, _types.TokenType.braceR); +} + +function flowParseEnumMembers() { + while (!_index.match.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { + break; + } + flowParseEnumMember(); + if (!_index.match.call(void 0, _types.TokenType.braceR)) { + _util.expect.call(void 0, _types.TokenType.comma); + } + } +} + +function flowParseEnumMember() { + _expression.parseIdentifier.call(void 0, ); + if (_index.eat.call(void 0, _types.TokenType.eq)) { + // Flow enum values are always just one token (a string, number, or boolean literal). + _index.next.call(void 0, ); + } +} diff --git a/node_modules/sucrase/dist/parser/plugins/jsx/index.js b/node_modules/sucrase/dist/parser/plugins/jsx/index.js new file mode 100644 index 0000000..41797de --- /dev/null +++ b/node_modules/sucrase/dist/parser/plugins/jsx/index.js @@ -0,0 +1,367 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + + + + + + + + +var _index = require('../../tokenizer/index'); +var _types = require('../../tokenizer/types'); +var _base = require('../../traverser/base'); +var _expression = require('../../traverser/expression'); +var _util = require('../../traverser/util'); +var _charcodes = require('../../util/charcodes'); +var _identifier = require('../../util/identifier'); +var _typescript = require('../typescript'); + +/** + * Read token with JSX contents. + * + * In addition to detecting jsxTagStart and also regular tokens that might be + * part of an expression, this code detects the start and end of text ranges + * within JSX children. In order to properly count the number of children, we + * distinguish jsxText from jsxEmptyText, which is a text range that simplifies + * to the empty string after JSX whitespace trimming. + * + * It turns out that a JSX text range will simplify to the empty string if and + * only if both of these conditions hold: + * - The range consists entirely of whitespace characters (only counting space, + * tab, \r, and \n). + * - The range has at least one newline. + * This can be proven by analyzing any implementation of whitespace trimming, + * e.g. formatJSXTextLiteral in Sucrase or cleanJSXElementLiteralChild in Babel. + */ +function jsxReadToken() { + let sawNewline = false; + let sawNonWhitespace = false; + while (true) { + if (_base.state.pos >= _base.input.length) { + _util.unexpected.call(void 0, "Unterminated JSX contents"); + return; + } + + const ch = _base.input.charCodeAt(_base.state.pos); + if (ch === _charcodes.charCodes.lessThan || ch === _charcodes.charCodes.leftCurlyBrace) { + if (_base.state.pos === _base.state.start) { + if (ch === _charcodes.charCodes.lessThan) { + _base.state.pos++; + _index.finishToken.call(void 0, _types.TokenType.jsxTagStart); + return; + } + _index.getTokenFromCode.call(void 0, ch); + return; + } + if (sawNewline && !sawNonWhitespace) { + _index.finishToken.call(void 0, _types.TokenType.jsxEmptyText); + } else { + _index.finishToken.call(void 0, _types.TokenType.jsxText); + } + return; + } + + // This is part of JSX text. + if (ch === _charcodes.charCodes.lineFeed) { + sawNewline = true; + } else if (ch !== _charcodes.charCodes.space && ch !== _charcodes.charCodes.carriageReturn && ch !== _charcodes.charCodes.tab) { + sawNonWhitespace = true; + } + _base.state.pos++; + } +} + +function jsxReadString(quote) { + _base.state.pos++; + for (;;) { + if (_base.state.pos >= _base.input.length) { + _util.unexpected.call(void 0, "Unterminated string constant"); + return; + } + + const ch = _base.input.charCodeAt(_base.state.pos); + if (ch === quote) { + _base.state.pos++; + break; + } + _base.state.pos++; + } + _index.finishToken.call(void 0, _types.TokenType.string); +} + +// Read a JSX identifier (valid tag or attribute name). +// +// Optimized version since JSX identifiers can't contain +// escape characters and so can be read as single slice. +// Also assumes that first character was already checked +// by isIdentifierStart in readToken. + +function jsxReadWord() { + let ch; + do { + if (_base.state.pos > _base.input.length) { + _util.unexpected.call(void 0, "Unexpectedly reached the end of input."); + return; + } + ch = _base.input.charCodeAt(++_base.state.pos); + } while (_identifier.IS_IDENTIFIER_CHAR[ch] || ch === _charcodes.charCodes.dash); + _index.finishToken.call(void 0, _types.TokenType.jsxName); +} + +// Parse next token as JSX identifier +function jsxParseIdentifier() { + nextJSXTagToken(); +} + +// Parse namespaced identifier. +function jsxParseNamespacedName(identifierRole) { + jsxParseIdentifier(); + if (!_index.eat.call(void 0, _types.TokenType.colon)) { + // Plain identifier, so this is an access. + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole; + return; + } + // Process the second half of the namespaced name. + jsxParseIdentifier(); +} + +// Parses element name in any form - namespaced, member +// or single identifier. +function jsxParseElementName() { + const firstTokenIndex = _base.state.tokens.length; + jsxParseNamespacedName(_index.IdentifierRole.Access); + let hadDot = false; + while (_index.match.call(void 0, _types.TokenType.dot)) { + hadDot = true; + nextJSXTagToken(); + jsxParseIdentifier(); + } + // For tags like
with a lowercase letter and no dots, the name is + // actually *not* an identifier access, since it's referring to a built-in + // tag name. Remove the identifier role in this case so that it's not + // accidentally transformed by the imports transform when preserving JSX. + if (!hadDot) { + const firstToken = _base.state.tokens[firstTokenIndex]; + const firstChar = _base.input.charCodeAt(firstToken.start); + if (firstChar >= _charcodes.charCodes.lowercaseA && firstChar <= _charcodes.charCodes.lowercaseZ) { + firstToken.identifierRole = null; + } + } +} + +// Parses any type of JSX attribute value. +function jsxParseAttributeValue() { + switch (_base.state.type) { + case _types.TokenType.braceL: + _index.next.call(void 0, ); + _expression.parseExpression.call(void 0, ); + nextJSXTagToken(); + return; + + case _types.TokenType.jsxTagStart: + jsxParseElement(); + nextJSXTagToken(); + return; + + case _types.TokenType.string: + nextJSXTagToken(); + return; + + default: + _util.unexpected.call(void 0, "JSX value should be either an expression or a quoted JSX text"); + } +} + +// Parse JSX spread child, after already processing the { +// Does not parse the closing } +function jsxParseSpreadChild() { + _util.expect.call(void 0, _types.TokenType.ellipsis); + _expression.parseExpression.call(void 0, ); +} + +// Parses JSX opening tag starting after "<". +// Returns true if the tag was self-closing. +// Does not parse the last token. +function jsxParseOpeningElement(initialTokenIndex) { + if (_index.match.call(void 0, _types.TokenType.jsxTagEnd)) { + // This is an open-fragment. + return false; + } + jsxParseElementName(); + if (_base.isTypeScriptEnabled) { + _typescript.tsTryParseJSXTypeArgument.call(void 0, ); + } + let hasSeenPropSpread = false; + while (!_index.match.call(void 0, _types.TokenType.slash) && !_index.match.call(void 0, _types.TokenType.jsxTagEnd) && !_base.state.error) { + if (_index.eat.call(void 0, _types.TokenType.braceL)) { + hasSeenPropSpread = true; + _util.expect.call(void 0, _types.TokenType.ellipsis); + _expression.parseMaybeAssign.call(void 0, ); + // } + nextJSXTagToken(); + continue; + } + if ( + hasSeenPropSpread && + _base.state.end - _base.state.start === 3 && + _base.input.charCodeAt(_base.state.start) === _charcodes.charCodes.lowercaseK && + _base.input.charCodeAt(_base.state.start + 1) === _charcodes.charCodes.lowercaseE && + _base.input.charCodeAt(_base.state.start + 2) === _charcodes.charCodes.lowercaseY + ) { + _base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.KeyAfterPropSpread; + } + jsxParseNamespacedName(_index.IdentifierRole.ObjectKey); + if (_index.match.call(void 0, _types.TokenType.eq)) { + nextJSXTagToken(); + jsxParseAttributeValue(); + } + } + const isSelfClosing = _index.match.call(void 0, _types.TokenType.slash); + if (isSelfClosing) { + // / + nextJSXTagToken(); + } + return isSelfClosing; +} + +// Parses JSX closing tag starting after " 1) { + _base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.StaticChildren; + } + } + return; + } + numExplicitChildren++; + jsxParseElementAt(); + nextJSXExprToken(); + break; + + case _types.TokenType.jsxText: + numExplicitChildren++; + nextJSXExprToken(); + break; + + case _types.TokenType.jsxEmptyText: + nextJSXExprToken(); + break; + + case _types.TokenType.braceL: + _index.next.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.ellipsis)) { + jsxParseSpreadChild(); + nextJSXExprToken(); + // Spread children are a mechanism to explicitly mark children as + // static, so count it as 2 children to satisfy the "more than one + // child" condition. + numExplicitChildren += 2; + } else { + // If we see {}, this is an empty pseudo-expression that doesn't + // count as a child. + if (!_index.match.call(void 0, _types.TokenType.braceR)) { + numExplicitChildren++; + _expression.parseExpression.call(void 0, ); + } + nextJSXExprToken(); + } + + break; + + // istanbul ignore next - should never happen + default: + _util.unexpected.call(void 0, ); + return; + } + } + } +} + +// Parses entire JSX element from current position. +// Does not parse the last token. + function jsxParseElement() { + nextJSXTagToken(); + jsxParseElementAt(); +} exports.jsxParseElement = jsxParseElement; + +// ================================== +// Overrides +// ================================== + + function nextJSXTagToken() { + _base.state.tokens.push(new (0, _index.Token)()); + _index.skipSpace.call(void 0, ); + _base.state.start = _base.state.pos; + const code = _base.input.charCodeAt(_base.state.pos); + + if (_identifier.IS_IDENTIFIER_START[code]) { + jsxReadWord(); + } else if (code === _charcodes.charCodes.quotationMark || code === _charcodes.charCodes.apostrophe) { + jsxReadString(code); + } else { + // The following tokens are just one character each. + ++_base.state.pos; + switch (code) { + case _charcodes.charCodes.greaterThan: + _index.finishToken.call(void 0, _types.TokenType.jsxTagEnd); + break; + case _charcodes.charCodes.lessThan: + _index.finishToken.call(void 0, _types.TokenType.jsxTagStart); + break; + case _charcodes.charCodes.slash: + _index.finishToken.call(void 0, _types.TokenType.slash); + break; + case _charcodes.charCodes.equalsTo: + _index.finishToken.call(void 0, _types.TokenType.eq); + break; + case _charcodes.charCodes.leftCurlyBrace: + _index.finishToken.call(void 0, _types.TokenType.braceL); + break; + case _charcodes.charCodes.dot: + _index.finishToken.call(void 0, _types.TokenType.dot); + break; + case _charcodes.charCodes.colon: + _index.finishToken.call(void 0, _types.TokenType.colon); + break; + default: + _util.unexpected.call(void 0, ); + } + } +} exports.nextJSXTagToken = nextJSXTagToken; + +function nextJSXExprToken() { + _base.state.tokens.push(new (0, _index.Token)()); + _base.state.start = _base.state.pos; + jsxReadToken(); +} diff --git a/node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js b/node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js new file mode 100644 index 0000000..d8e91c5 --- /dev/null +++ b/node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js @@ -0,0 +1,256 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Use a Map rather than object to avoid unexpected __proto__ access. +exports. default = new Map([ + ["quot", "\u0022"], + ["amp", "&"], + ["apos", "\u0027"], + ["lt", "<"], + ["gt", ">"], + ["nbsp", "\u00A0"], + ["iexcl", "\u00A1"], + ["cent", "\u00A2"], + ["pound", "\u00A3"], + ["curren", "\u00A4"], + ["yen", "\u00A5"], + ["brvbar", "\u00A6"], + ["sect", "\u00A7"], + ["uml", "\u00A8"], + ["copy", "\u00A9"], + ["ordf", "\u00AA"], + ["laquo", "\u00AB"], + ["not", "\u00AC"], + ["shy", "\u00AD"], + ["reg", "\u00AE"], + ["macr", "\u00AF"], + ["deg", "\u00B0"], + ["plusmn", "\u00B1"], + ["sup2", "\u00B2"], + ["sup3", "\u00B3"], + ["acute", "\u00B4"], + ["micro", "\u00B5"], + ["para", "\u00B6"], + ["middot", "\u00B7"], + ["cedil", "\u00B8"], + ["sup1", "\u00B9"], + ["ordm", "\u00BA"], + ["raquo", "\u00BB"], + ["frac14", "\u00BC"], + ["frac12", "\u00BD"], + ["frac34", "\u00BE"], + ["iquest", "\u00BF"], + ["Agrave", "\u00C0"], + ["Aacute", "\u00C1"], + ["Acirc", "\u00C2"], + ["Atilde", "\u00C3"], + ["Auml", "\u00C4"], + ["Aring", "\u00C5"], + ["AElig", "\u00C6"], + ["Ccedil", "\u00C7"], + ["Egrave", "\u00C8"], + ["Eacute", "\u00C9"], + ["Ecirc", "\u00CA"], + ["Euml", "\u00CB"], + ["Igrave", "\u00CC"], + ["Iacute", "\u00CD"], + ["Icirc", "\u00CE"], + ["Iuml", "\u00CF"], + ["ETH", "\u00D0"], + ["Ntilde", "\u00D1"], + ["Ograve", "\u00D2"], + ["Oacute", "\u00D3"], + ["Ocirc", "\u00D4"], + ["Otilde", "\u00D5"], + ["Ouml", "\u00D6"], + ["times", "\u00D7"], + ["Oslash", "\u00D8"], + ["Ugrave", "\u00D9"], + ["Uacute", "\u00DA"], + ["Ucirc", "\u00DB"], + ["Uuml", "\u00DC"], + ["Yacute", "\u00DD"], + ["THORN", "\u00DE"], + ["szlig", "\u00DF"], + ["agrave", "\u00E0"], + ["aacute", "\u00E1"], + ["acirc", "\u00E2"], + ["atilde", "\u00E3"], + ["auml", "\u00E4"], + ["aring", "\u00E5"], + ["aelig", "\u00E6"], + ["ccedil", "\u00E7"], + ["egrave", "\u00E8"], + ["eacute", "\u00E9"], + ["ecirc", "\u00EA"], + ["euml", "\u00EB"], + ["igrave", "\u00EC"], + ["iacute", "\u00ED"], + ["icirc", "\u00EE"], + ["iuml", "\u00EF"], + ["eth", "\u00F0"], + ["ntilde", "\u00F1"], + ["ograve", "\u00F2"], + ["oacute", "\u00F3"], + ["ocirc", "\u00F4"], + ["otilde", "\u00F5"], + ["ouml", "\u00F6"], + ["divide", "\u00F7"], + ["oslash", "\u00F8"], + ["ugrave", "\u00F9"], + ["uacute", "\u00FA"], + ["ucirc", "\u00FB"], + ["uuml", "\u00FC"], + ["yacute", "\u00FD"], + ["thorn", "\u00FE"], + ["yuml", "\u00FF"], + ["OElig", "\u0152"], + ["oelig", "\u0153"], + ["Scaron", "\u0160"], + ["scaron", "\u0161"], + ["Yuml", "\u0178"], + ["fnof", "\u0192"], + ["circ", "\u02C6"], + ["tilde", "\u02DC"], + ["Alpha", "\u0391"], + ["Beta", "\u0392"], + ["Gamma", "\u0393"], + ["Delta", "\u0394"], + ["Epsilon", "\u0395"], + ["Zeta", "\u0396"], + ["Eta", "\u0397"], + ["Theta", "\u0398"], + ["Iota", "\u0399"], + ["Kappa", "\u039A"], + ["Lambda", "\u039B"], + ["Mu", "\u039C"], + ["Nu", "\u039D"], + ["Xi", "\u039E"], + ["Omicron", "\u039F"], + ["Pi", "\u03A0"], + ["Rho", "\u03A1"], + ["Sigma", "\u03A3"], + ["Tau", "\u03A4"], + ["Upsilon", "\u03A5"], + ["Phi", "\u03A6"], + ["Chi", "\u03A7"], + ["Psi", "\u03A8"], + ["Omega", "\u03A9"], + ["alpha", "\u03B1"], + ["beta", "\u03B2"], + ["gamma", "\u03B3"], + ["delta", "\u03B4"], + ["epsilon", "\u03B5"], + ["zeta", "\u03B6"], + ["eta", "\u03B7"], + ["theta", "\u03B8"], + ["iota", "\u03B9"], + ["kappa", "\u03BA"], + ["lambda", "\u03BB"], + ["mu", "\u03BC"], + ["nu", "\u03BD"], + ["xi", "\u03BE"], + ["omicron", "\u03BF"], + ["pi", "\u03C0"], + ["rho", "\u03C1"], + ["sigmaf", "\u03C2"], + ["sigma", "\u03C3"], + ["tau", "\u03C4"], + ["upsilon", "\u03C5"], + ["phi", "\u03C6"], + ["chi", "\u03C7"], + ["psi", "\u03C8"], + ["omega", "\u03C9"], + ["thetasym", "\u03D1"], + ["upsih", "\u03D2"], + ["piv", "\u03D6"], + ["ensp", "\u2002"], + ["emsp", "\u2003"], + ["thinsp", "\u2009"], + ["zwnj", "\u200C"], + ["zwj", "\u200D"], + ["lrm", "\u200E"], + ["rlm", "\u200F"], + ["ndash", "\u2013"], + ["mdash", "\u2014"], + ["lsquo", "\u2018"], + ["rsquo", "\u2019"], + ["sbquo", "\u201A"], + ["ldquo", "\u201C"], + ["rdquo", "\u201D"], + ["bdquo", "\u201E"], + ["dagger", "\u2020"], + ["Dagger", "\u2021"], + ["bull", "\u2022"], + ["hellip", "\u2026"], + ["permil", "\u2030"], + ["prime", "\u2032"], + ["Prime", "\u2033"], + ["lsaquo", "\u2039"], + ["rsaquo", "\u203A"], + ["oline", "\u203E"], + ["frasl", "\u2044"], + ["euro", "\u20AC"], + ["image", "\u2111"], + ["weierp", "\u2118"], + ["real", "\u211C"], + ["trade", "\u2122"], + ["alefsym", "\u2135"], + ["larr", "\u2190"], + ["uarr", "\u2191"], + ["rarr", "\u2192"], + ["darr", "\u2193"], + ["harr", "\u2194"], + ["crarr", "\u21B5"], + ["lArr", "\u21D0"], + ["uArr", "\u21D1"], + ["rArr", "\u21D2"], + ["dArr", "\u21D3"], + ["hArr", "\u21D4"], + ["forall", "\u2200"], + ["part", "\u2202"], + ["exist", "\u2203"], + ["empty", "\u2205"], + ["nabla", "\u2207"], + ["isin", "\u2208"], + ["notin", "\u2209"], + ["ni", "\u220B"], + ["prod", "\u220F"], + ["sum", "\u2211"], + ["minus", "\u2212"], + ["lowast", "\u2217"], + ["radic", "\u221A"], + ["prop", "\u221D"], + ["infin", "\u221E"], + ["ang", "\u2220"], + ["and", "\u2227"], + ["or", "\u2228"], + ["cap", "\u2229"], + ["cup", "\u222A"], + ["int", "\u222B"], + ["there4", "\u2234"], + ["sim", "\u223C"], + ["cong", "\u2245"], + ["asymp", "\u2248"], + ["ne", "\u2260"], + ["equiv", "\u2261"], + ["le", "\u2264"], + ["ge", "\u2265"], + ["sub", "\u2282"], + ["sup", "\u2283"], + ["nsub", "\u2284"], + ["sube", "\u2286"], + ["supe", "\u2287"], + ["oplus", "\u2295"], + ["otimes", "\u2297"], + ["perp", "\u22A5"], + ["sdot", "\u22C5"], + ["lceil", "\u2308"], + ["rceil", "\u2309"], + ["lfloor", "\u230A"], + ["rfloor", "\u230B"], + ["lang", "\u2329"], + ["rang", "\u232A"], + ["loz", "\u25CA"], + ["spades", "\u2660"], + ["clubs", "\u2663"], + ["hearts", "\u2665"], + ["diams", "\u2666"], +]); diff --git a/node_modules/sucrase/dist/parser/plugins/types.js b/node_modules/sucrase/dist/parser/plugins/types.js new file mode 100644 index 0000000..c892994 --- /dev/null +++ b/node_modules/sucrase/dist/parser/plugins/types.js @@ -0,0 +1,37 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _index = require('../tokenizer/index'); +var _types = require('../tokenizer/types'); +var _base = require('../traverser/base'); +var _expression = require('../traverser/expression'); +var _flow = require('./flow'); +var _typescript = require('./typescript'); + +/** + * Common parser code for TypeScript and Flow. + */ + +// An apparent conditional expression could actually be an optional parameter in an arrow function. + function typedParseConditional(noIn) { + // If we see ?:, this can't possibly be a valid conditional. typedParseParenItem will be called + // later to finish off the arrow parameter. We also need to handle bare ? tokens for optional + // parameters without type annotations, i.e. ?, and ?) . + if (_index.match.call(void 0, _types.TokenType.question)) { + const nextType = _index.lookaheadType.call(void 0, ); + if (nextType === _types.TokenType.colon || nextType === _types.TokenType.comma || nextType === _types.TokenType.parenR) { + return; + } + } + _expression.baseParseConditional.call(void 0, noIn); +} exports.typedParseConditional = typedParseConditional; + +// Note: These "type casts" are *not* valid TS expressions. +// But we parse them here and change them when completing the arrow function. + function typedParseParenItem() { + _index.eatTypeToken.call(void 0, _types.TokenType.question); + if (_index.match.call(void 0, _types.TokenType.colon)) { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseTypeAnnotation.call(void 0, ); + } else if (_base.isFlowEnabled) { + _flow.flowParseTypeAnnotation.call(void 0, ); + } + } +} exports.typedParseParenItem = typedParseParenItem; diff --git a/node_modules/sucrase/dist/parser/plugins/typescript.js b/node_modules/sucrase/dist/parser/plugins/typescript.js new file mode 100644 index 0000000..d1ec6d3 --- /dev/null +++ b/node_modules/sucrase/dist/parser/plugins/typescript.js @@ -0,0 +1,1632 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + + + + + + + + + + +var _index = require('../tokenizer/index'); +var _keywords = require('../tokenizer/keywords'); +var _types = require('../tokenizer/types'); +var _base = require('../traverser/base'); + + + + + + + + + + + + + + + +var _expression = require('../traverser/expression'); +var _lval = require('../traverser/lval'); + + + + + + + + +var _statement = require('../traverser/statement'); + + + + + + + + + + + +var _util = require('../traverser/util'); +var _jsx = require('./jsx'); + +function tsIsIdentifier() { + // TODO: actually a bit more complex in TypeScript, but shouldn't matter. + // See https://github.com/Microsoft/TypeScript/issues/15008 + return _index.match.call(void 0, _types.TokenType.name); +} + +function isLiteralPropertyName() { + return ( + _index.match.call(void 0, _types.TokenType.name) || + Boolean(_base.state.type & _types.TokenType.IS_KEYWORD) || + _index.match.call(void 0, _types.TokenType.string) || + _index.match.call(void 0, _types.TokenType.num) || + _index.match.call(void 0, _types.TokenType.bigint) || + _index.match.call(void 0, _types.TokenType.decimal) + ); +} + +function tsNextTokenCanFollowModifier() { + // Note: TypeScript's implementation is much more complicated because + // more things are considered modifiers there. + // This implementation only handles modifiers not handled by babylon itself. And "static". + // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method... + const snapshot = _base.state.snapshot(); + + _index.next.call(void 0, ); + const canFollowModifier = + (_index.match.call(void 0, _types.TokenType.bracketL) || + _index.match.call(void 0, _types.TokenType.braceL) || + _index.match.call(void 0, _types.TokenType.star) || + _index.match.call(void 0, _types.TokenType.ellipsis) || + _index.match.call(void 0, _types.TokenType.hash) || + isLiteralPropertyName()) && + !_util.hasPrecedingLineBreak.call(void 0, ); + + if (canFollowModifier) { + return true; + } else { + _base.state.restoreFromSnapshot(snapshot); + return false; + } +} + + function tsParseModifiers(allowedModifiers) { + while (true) { + const modifier = tsParseModifier(allowedModifiers); + if (modifier === null) { + break; + } + } +} exports.tsParseModifiers = tsParseModifiers; + +/** Parses a modifier matching one the given modifier names. */ + function tsParseModifier( + allowedModifiers, +) { + if (!_index.match.call(void 0, _types.TokenType.name)) { + return null; + } + + const modifier = _base.state.contextualKeyword; + if (allowedModifiers.indexOf(modifier) !== -1 && tsNextTokenCanFollowModifier()) { + switch (modifier) { + case _keywords.ContextualKeyword._readonly: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._readonly; + break; + case _keywords.ContextualKeyword._abstract: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._abstract; + break; + case _keywords.ContextualKeyword._static: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._static; + break; + case _keywords.ContextualKeyword._public: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._public; + break; + case _keywords.ContextualKeyword._private: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._private; + break; + case _keywords.ContextualKeyword._protected: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._protected; + break; + case _keywords.ContextualKeyword._override: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._override; + break; + case _keywords.ContextualKeyword._declare: + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._declare; + break; + default: + break; + } + return modifier; + } + return null; +} exports.tsParseModifier = tsParseModifier; + +function tsParseEntityName() { + _expression.parseIdentifier.call(void 0, ); + while (_index.eat.call(void 0, _types.TokenType.dot)) { + _expression.parseIdentifier.call(void 0, ); + } +} + +function tsParseTypeReference() { + tsParseEntityName(); + if (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.match.call(void 0, _types.TokenType.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseThisTypePredicate() { + _index.next.call(void 0, ); + tsParseTypeAnnotation(); +} + +function tsParseThisTypeNode() { + _index.next.call(void 0, ); +} + +function tsParseTypeQuery() { + _util.expect.call(void 0, _types.TokenType._typeof); + if (_index.match.call(void 0, _types.TokenType._import)) { + tsParseImportType(); + } else { + tsParseEntityName(); + } + if (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.match.call(void 0, _types.TokenType.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseImportType() { + _util.expect.call(void 0, _types.TokenType._import); + _util.expect.call(void 0, _types.TokenType.parenL); + _util.expect.call(void 0, _types.TokenType.string); + _util.expect.call(void 0, _types.TokenType.parenR); + if (_index.eat.call(void 0, _types.TokenType.dot)) { + tsParseEntityName(); + } + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseTypeParameter() { + _index.eat.call(void 0, _types.TokenType._const); + const hadIn = _index.eat.call(void 0, _types.TokenType._in); + const hadOut = _util.eatContextual.call(void 0, _keywords.ContextualKeyword._out); + _index.eat.call(void 0, _types.TokenType._const); + if ((hadIn || hadOut) && !_index.match.call(void 0, _types.TokenType.name)) { + // The "in" or "out" keyword must have actually been the type parameter + // name, so set it as the name. + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.name; + } else { + _expression.parseIdentifier.call(void 0, ); + } + + if (_index.eat.call(void 0, _types.TokenType._extends)) { + tsParseType(); + } + if (_index.eat.call(void 0, _types.TokenType.eq)) { + tsParseType(); + } +} + + function tsTryParseTypeParameters() { + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + tsParseTypeParameters(); + } +} exports.tsTryParseTypeParameters = tsTryParseTypeParameters; + +function tsParseTypeParameters() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.typeParameterStart)) { + _index.next.call(void 0, ); + } else { + _util.unexpected.call(void 0, ); + } + + while (!_index.eat.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { + tsParseTypeParameter(); + _index.eat.call(void 0, _types.TokenType.comma); + } + _index.popTypeContext.call(void 0, oldIsType); +} + +// Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, +// but here it's always false, because this is only used for types. +function tsFillSignature(returnToken) { + // Arrow fns *must* have return token (`=>`). Normal functions can omit it. + const returnTokenRequired = returnToken === _types.TokenType.arrow; + tsTryParseTypeParameters(); + _util.expect.call(void 0, _types.TokenType.parenL); + // Create a scope even though we're doing type parsing so we don't accidentally + // treat params as top-level bindings. + _base.state.scopeDepth++; + tsParseBindingListForSignature(false /* isBlockScope */); + _base.state.scopeDepth--; + if (returnTokenRequired) { + tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (_index.match.call(void 0, returnToken)) { + tsParseTypeOrTypePredicateAnnotation(returnToken); + } +} + +function tsParseBindingListForSignature(isBlockScope) { + _lval.parseBindingList.call(void 0, _types.TokenType.parenR, isBlockScope); +} + +function tsParseTypeMemberSemicolon() { + if (!_index.eat.call(void 0, _types.TokenType.comma)) { + _util.semicolon.call(void 0, ); + } +} + +function tsParseSignatureMember() { + tsFillSignature(_types.TokenType.colon); + tsParseTypeMemberSemicolon(); +} + +function tsIsUnambiguouslyIndexSignature() { + const snapshot = _base.state.snapshot(); + _index.next.call(void 0, ); // Skip '{' + const isIndexSignature = _index.eat.call(void 0, _types.TokenType.name) && _index.match.call(void 0, _types.TokenType.colon); + _base.state.restoreFromSnapshot(snapshot); + return isIndexSignature; +} + +function tsTryParseIndexSignature() { + if (!(_index.match.call(void 0, _types.TokenType.bracketL) && tsIsUnambiguouslyIndexSignature())) { + return false; + } + + const oldIsType = _index.pushTypeContext.call(void 0, 0); + + _util.expect.call(void 0, _types.TokenType.bracketL); + _expression.parseIdentifier.call(void 0, ); + tsParseTypeAnnotation(); + _util.expect.call(void 0, _types.TokenType.bracketR); + + tsTryParseTypeAnnotation(); + tsParseTypeMemberSemicolon(); + + _index.popTypeContext.call(void 0, oldIsType); + return true; +} + +function tsParsePropertyOrMethodSignature(isReadonly) { + _index.eat.call(void 0, _types.TokenType.question); + + if (!isReadonly && (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan))) { + tsFillSignature(_types.TokenType.colon); + tsParseTypeMemberSemicolon(); + } else { + tsTryParseTypeAnnotation(); + tsParseTypeMemberSemicolon(); + } +} + +function tsParseTypeMember() { + if (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan)) { + // call signature + tsParseSignatureMember(); + return; + } + if (_index.match.call(void 0, _types.TokenType._new)) { + _index.next.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan)) { + // constructor signature + tsParseSignatureMember(); + } else { + tsParsePropertyOrMethodSignature(false); + } + return; + } + const readonly = !!tsParseModifier([_keywords.ContextualKeyword._readonly]); + + const found = tsTryParseIndexSignature(); + if (found) { + return; + } + if ( + (_util.isContextual.call(void 0, _keywords.ContextualKeyword._get) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._set)) && + tsNextTokenCanFollowModifier() + ) { + // This is a getter/setter on a type. The tsNextTokenCanFollowModifier + // function already called next() for us, so continue parsing the name. + } + _expression.parsePropertyName.call(void 0, -1 /* Types don't need context IDs. */); + tsParsePropertyOrMethodSignature(readonly); +} + +function tsParseTypeLiteral() { + tsParseObjectTypeMembers(); +} + +function tsParseObjectTypeMembers() { + _util.expect.call(void 0, _types.TokenType.braceL); + while (!_index.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + tsParseTypeMember(); + } +} + +function tsLookaheadIsStartOfMappedType() { + const snapshot = _base.state.snapshot(); + const isStartOfMappedType = tsIsStartOfMappedType(); + _base.state.restoreFromSnapshot(snapshot); + return isStartOfMappedType; +} + +function tsIsStartOfMappedType() { + _index.next.call(void 0, ); + if (_index.eat.call(void 0, _types.TokenType.plus) || _index.eat.call(void 0, _types.TokenType.minus)) { + return _util.isContextual.call(void 0, _keywords.ContextualKeyword._readonly); + } + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._readonly)) { + _index.next.call(void 0, ); + } + if (!_index.match.call(void 0, _types.TokenType.bracketL)) { + return false; + } + _index.next.call(void 0, ); + if (!tsIsIdentifier()) { + return false; + } + _index.next.call(void 0, ); + return _index.match.call(void 0, _types.TokenType._in); +} + +function tsParseMappedTypeParameter() { + _expression.parseIdentifier.call(void 0, ); + _util.expect.call(void 0, _types.TokenType._in); + tsParseType(); +} + +function tsParseMappedType() { + _util.expect.call(void 0, _types.TokenType.braceL); + if (_index.match.call(void 0, _types.TokenType.plus) || _index.match.call(void 0, _types.TokenType.minus)) { + _index.next.call(void 0, ); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._readonly); + } else { + _util.eatContextual.call(void 0, _keywords.ContextualKeyword._readonly); + } + _util.expect.call(void 0, _types.TokenType.bracketL); + tsParseMappedTypeParameter(); + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { + tsParseType(); + } + _util.expect.call(void 0, _types.TokenType.bracketR); + if (_index.match.call(void 0, _types.TokenType.plus) || _index.match.call(void 0, _types.TokenType.minus)) { + _index.next.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.question); + } else { + _index.eat.call(void 0, _types.TokenType.question); + } + tsTryParseType(); + _util.semicolon.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.braceR); +} + +function tsParseTupleType() { + _util.expect.call(void 0, _types.TokenType.bracketL); + while (!_index.eat.call(void 0, _types.TokenType.bracketR) && !_base.state.error) { + // Do not validate presence of either none or only labeled elements + tsParseTupleElementType(); + _index.eat.call(void 0, _types.TokenType.comma); + } +} + +function tsParseTupleElementType() { + // parses `...TsType[]` + if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { + tsParseType(); + } else { + // parses `TsType?` + tsParseType(); + _index.eat.call(void 0, _types.TokenType.question); + } + + // The type we parsed above was actually a label + if (_index.eat.call(void 0, _types.TokenType.colon)) { + // Labeled tuple types must affix the label with `...` or `?`, so no need to handle those here + tsParseType(); + } +} + +function tsParseParenthesizedType() { + _util.expect.call(void 0, _types.TokenType.parenL); + tsParseType(); + _util.expect.call(void 0, _types.TokenType.parenR); +} + +function tsParseTemplateLiteralType() { + // Finish `, read quasi + _index.nextTemplateToken.call(void 0, ); + // Finish quasi, read ${ + _index.nextTemplateToken.call(void 0, ); + while (!_index.match.call(void 0, _types.TokenType.backQuote) && !_base.state.error) { + _util.expect.call(void 0, _types.TokenType.dollarBraceL); + tsParseType(); + // Finish }, read quasi + _index.nextTemplateToken.call(void 0, ); + // Finish quasi, read either ${ or ` + _index.nextTemplateToken.call(void 0, ); + } + _index.next.call(void 0, ); +} + +var FunctionType; (function (FunctionType) { + const TSFunctionType = 0; FunctionType[FunctionType["TSFunctionType"] = TSFunctionType] = "TSFunctionType"; + const TSConstructorType = TSFunctionType + 1; FunctionType[FunctionType["TSConstructorType"] = TSConstructorType] = "TSConstructorType"; + const TSAbstractConstructorType = TSConstructorType + 1; FunctionType[FunctionType["TSAbstractConstructorType"] = TSAbstractConstructorType] = "TSAbstractConstructorType"; +})(FunctionType || (FunctionType = {})); + +function tsParseFunctionOrConstructorType(type) { + if (type === FunctionType.TSAbstractConstructorType) { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._abstract); + } + if (type === FunctionType.TSConstructorType || type === FunctionType.TSAbstractConstructorType) { + _util.expect.call(void 0, _types.TokenType._new); + } + const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; + _base.state.inDisallowConditionalTypesContext = false; + tsFillSignature(_types.TokenType.arrow); + _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; +} + +function tsParseNonArrayType() { + switch (_base.state.type) { + case _types.TokenType.name: + tsParseTypeReference(); + return; + case _types.TokenType._void: + case _types.TokenType._null: + _index.next.call(void 0, ); + return; + case _types.TokenType.string: + case _types.TokenType.num: + case _types.TokenType.bigint: + case _types.TokenType.decimal: + case _types.TokenType._true: + case _types.TokenType._false: + _expression.parseLiteral.call(void 0, ); + return; + case _types.TokenType.minus: + _index.next.call(void 0, ); + _expression.parseLiteral.call(void 0, ); + return; + case _types.TokenType._this: { + tsParseThisTypeNode(); + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._is) && !_util.hasPrecedingLineBreak.call(void 0, )) { + tsParseThisTypePredicate(); + } + return; + } + case _types.TokenType._typeof: + tsParseTypeQuery(); + return; + case _types.TokenType._import: + tsParseImportType(); + return; + case _types.TokenType.braceL: + if (tsLookaheadIsStartOfMappedType()) { + tsParseMappedType(); + } else { + tsParseTypeLiteral(); + } + return; + case _types.TokenType.bracketL: + tsParseTupleType(); + return; + case _types.TokenType.parenL: + tsParseParenthesizedType(); + return; + case _types.TokenType.backQuote: + tsParseTemplateLiteralType(); + return; + default: + if (_base.state.type & _types.TokenType.IS_KEYWORD) { + _index.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.name; + return; + } + break; + } + + _util.unexpected.call(void 0, ); +} + +function tsParseArrayTypeOrHigher() { + tsParseNonArrayType(); + while (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.eat.call(void 0, _types.TokenType.bracketL)) { + if (!_index.eat.call(void 0, _types.TokenType.bracketR)) { + // If we hit ] immediately, this is an array type, otherwise it's an indexed access type. + tsParseType(); + _util.expect.call(void 0, _types.TokenType.bracketR); + } + } +} + +function tsParseInferType() { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._infer); + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType._extends)) { + // Infer type constraints introduce an ambiguity about whether the "extends" + // is a constraint for this infer type or is another conditional type. + const snapshot = _base.state.snapshot(); + _util.expect.call(void 0, _types.TokenType._extends); + const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; + _base.state.inDisallowConditionalTypesContext = true; + tsParseType(); + _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + if (_base.state.error || (!_base.state.inDisallowConditionalTypesContext && _index.match.call(void 0, _types.TokenType.question))) { + _base.state.restoreFromSnapshot(snapshot); + } + } +} + +function tsParseTypeOperatorOrHigher() { + if ( + _util.isContextual.call(void 0, _keywords.ContextualKeyword._keyof) || + _util.isContextual.call(void 0, _keywords.ContextualKeyword._unique) || + _util.isContextual.call(void 0, _keywords.ContextualKeyword._readonly) + ) { + _index.next.call(void 0, ); + tsParseTypeOperatorOrHigher(); + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._infer)) { + tsParseInferType(); + } else { + const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; + _base.state.inDisallowConditionalTypesContext = false; + tsParseArrayTypeOrHigher(); + _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } +} + +function tsParseIntersectionTypeOrHigher() { + _index.eat.call(void 0, _types.TokenType.bitwiseAND); + tsParseTypeOperatorOrHigher(); + if (_index.match.call(void 0, _types.TokenType.bitwiseAND)) { + while (_index.eat.call(void 0, _types.TokenType.bitwiseAND)) { + tsParseTypeOperatorOrHigher(); + } + } +} + +function tsParseUnionTypeOrHigher() { + _index.eat.call(void 0, _types.TokenType.bitwiseOR); + tsParseIntersectionTypeOrHigher(); + if (_index.match.call(void 0, _types.TokenType.bitwiseOR)) { + while (_index.eat.call(void 0, _types.TokenType.bitwiseOR)) { + tsParseIntersectionTypeOrHigher(); + } + } +} + +function tsIsStartOfFunctionType() { + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + return true; + } + return _index.match.call(void 0, _types.TokenType.parenL) && tsLookaheadIsUnambiguouslyStartOfFunctionType(); +} + +function tsSkipParameterStart() { + if (_index.match.call(void 0, _types.TokenType.name) || _index.match.call(void 0, _types.TokenType._this)) { + _index.next.call(void 0, ); + return true; + } + // If this is a possible array/object destructure, walk to the matching bracket/brace. + // The next token after will tell us definitively whether this is a function param. + if (_index.match.call(void 0, _types.TokenType.braceL) || _index.match.call(void 0, _types.TokenType.bracketL)) { + let depth = 1; + _index.next.call(void 0, ); + while (depth > 0 && !_base.state.error) { + if (_index.match.call(void 0, _types.TokenType.braceL) || _index.match.call(void 0, _types.TokenType.bracketL)) { + depth++; + } else if (_index.match.call(void 0, _types.TokenType.braceR) || _index.match.call(void 0, _types.TokenType.bracketR)) { + depth--; + } + _index.next.call(void 0, ); + } + return true; + } + return false; +} + +function tsLookaheadIsUnambiguouslyStartOfFunctionType() { + const snapshot = _base.state.snapshot(); + const isUnambiguouslyStartOfFunctionType = tsIsUnambiguouslyStartOfFunctionType(); + _base.state.restoreFromSnapshot(snapshot); + return isUnambiguouslyStartOfFunctionType; +} + +function tsIsUnambiguouslyStartOfFunctionType() { + _index.next.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.parenR) || _index.match.call(void 0, _types.TokenType.ellipsis)) { + // ( ) + // ( ... + return true; + } + if (tsSkipParameterStart()) { + if (_index.match.call(void 0, _types.TokenType.colon) || _index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.question) || _index.match.call(void 0, _types.TokenType.eq)) { + // ( xxx : + // ( xxx , + // ( xxx ? + // ( xxx = + return true; + } + if (_index.match.call(void 0, _types.TokenType.parenR)) { + _index.next.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.arrow)) { + // ( xxx ) => + return true; + } + } + } + return false; +} + +function tsParseTypeOrTypePredicateAnnotation(returnToken) { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _util.expect.call(void 0, returnToken); + const finishedReturn = tsParseTypePredicateOrAssertsPrefix(); + if (!finishedReturn) { + tsParseType(); + } + _index.popTypeContext.call(void 0, oldIsType); +} + +function tsTryParseTypeOrTypePredicateAnnotation() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + tsParseTypeOrTypePredicateAnnotation(_types.TokenType.colon); + } +} + + function tsTryParseTypeAnnotation() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + tsParseTypeAnnotation(); + } +} exports.tsTryParseTypeAnnotation = tsTryParseTypeAnnotation; + +function tsTryParseType() { + if (_index.eat.call(void 0, _types.TokenType.colon)) { + tsParseType(); + } +} + +/** + * Detect a few special return syntax cases: `x is T`, `asserts x`, `asserts x is T`, + * `asserts this is T`. + * + * Returns true if we parsed the return type, false if there's still a type to be parsed. + */ +function tsParseTypePredicateOrAssertsPrefix() { + const snapshot = _base.state.snapshot(); + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._asserts)) { + // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user- + // defined type guard on the `asserts` variable) or just a type called `asserts`. + _index.next.call(void 0, ); + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._is)) { + // If we see `asserts is`, then this must be of the form `asserts is T`, since + // `asserts is is T` isn't valid. + tsParseType(); + return true; + } else if (tsIsIdentifier() || _index.match.call(void 0, _types.TokenType._this)) { + _index.next.call(void 0, ); + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._is)) { + // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`. + tsParseType(); + } + return true; + } else { + // Regular type, so bail out and start type parsing from scratch. + _base.state.restoreFromSnapshot(snapshot); + return false; + } + } else if (tsIsIdentifier() || _index.match.call(void 0, _types.TokenType._this)) { + // This is a regular identifier, which may or may not have "is" after it. + _index.next.call(void 0, ); + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._is) && !_util.hasPrecedingLineBreak.call(void 0, )) { + _index.next.call(void 0, ); + tsParseType(); + return true; + } else { + // Regular type, so bail out and start type parsing from scratch. + _base.state.restoreFromSnapshot(snapshot); + return false; + } + } + return false; +} + + function tsParseTypeAnnotation() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _util.expect.call(void 0, _types.TokenType.colon); + tsParseType(); + _index.popTypeContext.call(void 0, oldIsType); +} exports.tsParseTypeAnnotation = tsParseTypeAnnotation; + + function tsParseType() { + tsParseNonConditionalType(); + if (_base.state.inDisallowConditionalTypesContext || _util.hasPrecedingLineBreak.call(void 0, ) || !_index.eat.call(void 0, _types.TokenType._extends)) { + return; + } + // extends type + const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; + _base.state.inDisallowConditionalTypesContext = true; + tsParseNonConditionalType(); + _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + + _util.expect.call(void 0, _types.TokenType.question); + // true type + tsParseType(); + _util.expect.call(void 0, _types.TokenType.colon); + // false type + tsParseType(); +} exports.tsParseType = tsParseType; + +function isAbstractConstructorSignature() { + return _util.isContextual.call(void 0, _keywords.ContextualKeyword._abstract) && _index.lookaheadType.call(void 0, ) === _types.TokenType._new; +} + + function tsParseNonConditionalType() { + if (tsIsStartOfFunctionType()) { + tsParseFunctionOrConstructorType(FunctionType.TSFunctionType); + return; + } + if (_index.match.call(void 0, _types.TokenType._new)) { + // As in `new () => Date` + tsParseFunctionOrConstructorType(FunctionType.TSConstructorType); + return; + } else if (isAbstractConstructorSignature()) { + // As in `abstract new () => Date` + tsParseFunctionOrConstructorType(FunctionType.TSAbstractConstructorType); + return; + } + tsParseUnionTypeOrHigher(); +} exports.tsParseNonConditionalType = tsParseNonConditionalType; + + function tsParseTypeAssertion() { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + tsParseType(); + _util.expect.call(void 0, _types.TokenType.greaterThan); + _index.popTypeContext.call(void 0, oldIsType); + _expression.parseMaybeUnary.call(void 0, ); +} exports.tsParseTypeAssertion = tsParseTypeAssertion; + + function tsTryParseJSXTypeArgument() { + if (_index.eat.call(void 0, _types.TokenType.jsxTagStart)) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.typeParameterStart; + const oldIsType = _index.pushTypeContext.call(void 0, 1); + while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { + tsParseType(); + _index.eat.call(void 0, _types.TokenType.comma); + } + // Process >, but the one after needs to be parsed JSX-style. + _jsx.nextJSXTagToken.call(void 0, ); + _index.popTypeContext.call(void 0, oldIsType); + } +} exports.tsTryParseJSXTypeArgument = tsTryParseJSXTypeArgument; + +function tsParseHeritageClause() { + while (!_index.match.call(void 0, _types.TokenType.braceL) && !_base.state.error) { + tsParseExpressionWithTypeArguments(); + _index.eat.call(void 0, _types.TokenType.comma); + } +} + +function tsParseExpressionWithTypeArguments() { + // Note: TS uses parseLeftHandSideExpressionOrHigher, + // then has grammar errors later if it's not an EntityName. + tsParseEntityName(); + if (_index.match.call(void 0, _types.TokenType.lessThan)) { + tsParseTypeArguments(); + } +} + +function tsParseInterfaceDeclaration() { + _lval.parseBindingIdentifier.call(void 0, false); + tsTryParseTypeParameters(); + if (_index.eat.call(void 0, _types.TokenType._extends)) { + tsParseHeritageClause(); + } + tsParseObjectTypeMembers(); +} + +function tsParseTypeAliasDeclaration() { + _lval.parseBindingIdentifier.call(void 0, false); + tsTryParseTypeParameters(); + _util.expect.call(void 0, _types.TokenType.eq); + tsParseType(); + _util.semicolon.call(void 0, ); +} + +function tsParseEnumMember() { + // Computed property names are grammar errors in an enum, so accept just string literal or identifier. + if (_index.match.call(void 0, _types.TokenType.string)) { + _expression.parseLiteral.call(void 0, ); + } else { + _expression.parseIdentifier.call(void 0, ); + } + if (_index.eat.call(void 0, _types.TokenType.eq)) { + const eqIndex = _base.state.tokens.length - 1; + _expression.parseMaybeAssign.call(void 0, ); + _base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length; + } +} + +function tsParseEnumDeclaration() { + _lval.parseBindingIdentifier.call(void 0, false); + _util.expect.call(void 0, _types.TokenType.braceL); + while (!_index.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + tsParseEnumMember(); + _index.eat.call(void 0, _types.TokenType.comma); + } +} + +function tsParseModuleBlock() { + _util.expect.call(void 0, _types.TokenType.braceL); + _statement.parseBlockBody.call(void 0, /* end */ _types.TokenType.braceR); +} + +function tsParseModuleOrNamespaceDeclaration() { + _lval.parseBindingIdentifier.call(void 0, false); + if (_index.eat.call(void 0, _types.TokenType.dot)) { + tsParseModuleOrNamespaceDeclaration(); + } else { + tsParseModuleBlock(); + } +} + +function tsParseAmbientExternalModuleDeclaration() { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._global)) { + _expression.parseIdentifier.call(void 0, ); + } else if (_index.match.call(void 0, _types.TokenType.string)) { + _expression.parseExprAtom.call(void 0, ); + } else { + _util.unexpected.call(void 0, ); + } + + if (_index.match.call(void 0, _types.TokenType.braceL)) { + tsParseModuleBlock(); + } else { + _util.semicolon.call(void 0, ); + } +} + + function tsParseImportEqualsDeclaration() { + _lval.parseImportedIdentifier.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.eq); + tsParseModuleReference(); + _util.semicolon.call(void 0, ); +} exports.tsParseImportEqualsDeclaration = tsParseImportEqualsDeclaration; + +function tsIsExternalModuleReference() { + return _util.isContextual.call(void 0, _keywords.ContextualKeyword._require) && _index.lookaheadType.call(void 0, ) === _types.TokenType.parenL; +} + +function tsParseModuleReference() { + if (tsIsExternalModuleReference()) { + tsParseExternalModuleReference(); + } else { + tsParseEntityName(); + } +} + +function tsParseExternalModuleReference() { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._require); + _util.expect.call(void 0, _types.TokenType.parenL); + if (!_index.match.call(void 0, _types.TokenType.string)) { + _util.unexpected.call(void 0, ); + } + _expression.parseLiteral.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.parenR); +} + +// Utilities + +// Returns true if a statement matched. +function tsTryParseDeclare() { + if (_util.isLineTerminator.call(void 0, )) { + return false; + } + switch (_base.state.type) { + case _types.TokenType._function: { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + _index.next.call(void 0, ); + // We don't need to precisely get the function start here, since it's only used to mark + // the function as a type if it's bodiless, and it's already a type here. + const functionStart = _base.state.start; + _statement.parseFunction.call(void 0, functionStart, /* isStatement */ true); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + case _types.TokenType._class: { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + _statement.parseClass.call(void 0, /* isStatement */ true, /* optionalId */ false); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + case _types.TokenType._const: { + if (_index.match.call(void 0, _types.TokenType._const) && _util.isLookaheadContextual.call(void 0, _keywords.ContextualKeyword._enum)) { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + // `const enum = 0;` not allowed because "enum" is a strict mode reserved word. + _util.expect.call(void 0, _types.TokenType._const); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._enum); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; + tsParseEnumDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + } + // falls through + case _types.TokenType._var: + case _types.TokenType._let: { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + _statement.parseVarStatement.call(void 0, _base.state.type !== _types.TokenType._var); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + case _types.TokenType.name: { + const oldIsType = _index.pushTypeContext.call(void 0, 1); + const contextualKeyword = _base.state.contextualKeyword; + let matched = false; + if (contextualKeyword === _keywords.ContextualKeyword._global) { + tsParseAmbientExternalModuleDeclaration(); + matched = true; + } else { + matched = tsParseDeclaration(contextualKeyword, /* isBeforeToken */ true); + } + _index.popTypeContext.call(void 0, oldIsType); + return matched; + } + default: + return false; + } +} + +// Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`. +// Returns true if it matched a declaration. +function tsTryParseExportDeclaration() { + return tsParseDeclaration(_base.state.contextualKeyword, /* isBeforeToken */ true); +} + +// Returns true if it matched a statement. +function tsParseExpressionStatement(contextualKeyword) { + switch (contextualKeyword) { + case _keywords.ContextualKeyword._declare: { + const declareTokenIndex = _base.state.tokens.length - 1; + const matched = tsTryParseDeclare(); + if (matched) { + _base.state.tokens[declareTokenIndex].type = _types.TokenType._declare; + return true; + } + break; + } + case _keywords.ContextualKeyword._global: + // `global { }` (with no `declare`) may appear inside an ambient module declaration. + // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past "global". + if (_index.match.call(void 0, _types.TokenType.braceL)) { + tsParseModuleBlock(); + return true; + } + break; + + default: + return tsParseDeclaration(contextualKeyword, /* isBeforeToken */ false); + } + return false; +} + +/** + * Common code for parsing a declaration. + * + * isBeforeToken indicates that the current parser state is at the contextual + * keyword (and that it is not yet emitted) rather than reading the token after + * it. When isBeforeToken is true, we may be preceded by an `export` token and + * should include that token in a type context we create, e.g. to handle + * `export interface` or `export type`. (This is a bit of a hack and should be + * cleaned up at some point.) + * + * Returns true if it matched a declaration. + */ +function tsParseDeclaration(contextualKeyword, isBeforeToken) { + switch (contextualKeyword) { + case _keywords.ContextualKeyword._abstract: + if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType._class)) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._abstract; + _statement.parseClass.call(void 0, /* isStatement */ true, /* optionalId */ false); + return true; + } + break; + + case _keywords.ContextualKeyword._enum: + if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; + tsParseEnumDeclaration(); + return true; + } + break; + + case _keywords.ContextualKeyword._interface: + if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { + // `next` is true in "export" and "declare" contexts, so we want to remove that token + // as well. + const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); + tsParseInterfaceDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + break; + + case _keywords.ContextualKeyword._module: + if (tsCheckLineTerminator(isBeforeToken)) { + if (_index.match.call(void 0, _types.TokenType.string)) { + const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); + tsParseAmbientExternalModuleDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } else if (_index.match.call(void 0, _types.TokenType.name)) { + const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); + tsParseModuleOrNamespaceDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + } + break; + + case _keywords.ContextualKeyword._namespace: + if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { + const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); + tsParseModuleOrNamespaceDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + break; + + case _keywords.ContextualKeyword._type: + if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { + const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); + tsParseTypeAliasDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + break; + + default: + break; + } + return false; +} + +function tsCheckLineTerminator(isBeforeToken) { + if (isBeforeToken) { + // Babel checks hasFollowingLineBreak here and returns false, but this + // doesn't actually come up, e.g. `export interface` can never be on its own + // line in valid code. + _index.next.call(void 0, ); + return true; + } else { + return !_util.isLineTerminator.call(void 0, ); + } +} + +// Returns true if there was a generic async arrow function. +function tsTryParseGenericAsyncArrowFunction() { + const snapshot = _base.state.snapshot(); + + tsParseTypeParameters(); + _statement.parseFunctionParams.call(void 0, ); + tsTryParseTypeOrTypePredicateAnnotation(); + _util.expect.call(void 0, _types.TokenType.arrow); + + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + return false; + } + + _expression.parseFunctionBody.call(void 0, true); + return true; +} + +/** + * If necessary, hack the tokenizer state so that this bitshift was actually a + * less-than token, then keep parsing. This should only be used in situations + * where we restore from snapshot on error (which reverts this change) or + * where bitshift would be illegal anyway (e.g. in a class "extends" clause). + * + * This hack is useful to handle situations like foo<() => void>() where + * there can legitimately be two open-angle-brackets in a row in TS. + */ +function tsParseTypeArgumentsWithPossibleBitshift() { + if (_base.state.type === _types.TokenType.bitShiftL) { + _base.state.pos -= 1; + _index.finishToken.call(void 0, _types.TokenType.lessThan); + } + tsParseTypeArguments(); +} + +function tsParseTypeArguments() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _util.expect.call(void 0, _types.TokenType.lessThan); + while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { + tsParseType(); + _index.eat.call(void 0, _types.TokenType.comma); + } + if (!oldIsType) { + // If the type arguments are present in an expression context, e.g. + // f(), then the > sign should be tokenized as a non-type token. + // In particular, f(a < b, c >= d) should parse the >= as a single token, + // resulting in a syntax error and fallback to the non-type-args + // interpretation. In the success case, even though the > is tokenized as a + // non-type token, it still must be marked as a type token so that it is + // erased. + _index.popTypeContext.call(void 0, oldIsType); + _index.rescan_gt.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.greaterThan); + _base.state.tokens[_base.state.tokens.length - 1].isType = true; + } else { + _util.expect.call(void 0, _types.TokenType.greaterThan); + _index.popTypeContext.call(void 0, oldIsType); + } +} + + function tsIsDeclarationStart() { + if (_index.match.call(void 0, _types.TokenType.name)) { + switch (_base.state.contextualKeyword) { + case _keywords.ContextualKeyword._abstract: + case _keywords.ContextualKeyword._declare: + case _keywords.ContextualKeyword._enum: + case _keywords.ContextualKeyword._interface: + case _keywords.ContextualKeyword._module: + case _keywords.ContextualKeyword._namespace: + case _keywords.ContextualKeyword._type: + return true; + default: + break; + } + } + + return false; +} exports.tsIsDeclarationStart = tsIsDeclarationStart; + +// ====================================================== +// OVERRIDES +// ====================================================== + + function tsParseFunctionBodyAndFinish(functionStart, funcContextId) { + // For arrow functions, `parseArrow` handles the return type itself. + if (_index.match.call(void 0, _types.TokenType.colon)) { + tsParseTypeOrTypePredicateAnnotation(_types.TokenType.colon); + } + + // The original code checked the node type to make sure this function type allows a missing + // body, but we skip that to avoid sending around the node type. We instead just use the + // allowExpressionBody boolean to make sure it's not an arrow function. + if (!_index.match.call(void 0, _types.TokenType.braceL) && _util.isLineTerminator.call(void 0, )) { + // Retroactively mark the function declaration as a type. + let i = _base.state.tokens.length - 1; + while ( + i >= 0 && + (_base.state.tokens[i].start >= functionStart || + _base.state.tokens[i].type === _types.TokenType._default || + _base.state.tokens[i].type === _types.TokenType._export) + ) { + _base.state.tokens[i].isType = true; + i--; + } + return; + } + + _expression.parseFunctionBody.call(void 0, false, funcContextId); +} exports.tsParseFunctionBodyAndFinish = tsParseFunctionBodyAndFinish; + + function tsParseSubscript( + startTokenIndex, + noCalls, + stopState, +) { + if (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.eat.call(void 0, _types.TokenType.bang)) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.nonNullAssertion; + return; + } + + if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.bitShiftL)) { + // There are number of things we are going to "maybe" parse, like type arguments on + // tagged template expressions. If any of them fail, walk it back and continue. + const snapshot = _base.state.snapshot(); + + if (!noCalls && _expression.atPossibleAsync.call(void 0, )) { + // Almost certainly this is a generic async function `async () => ... + // But it might be a call with a type argument `async();` + const asyncArrowFn = tsTryParseGenericAsyncArrowFunction(); + if (asyncArrowFn) { + return; + } + } + tsParseTypeArgumentsWithPossibleBitshift(); + if (!noCalls && _index.eat.call(void 0, _types.TokenType.parenL)) { + // With f(), the subscriptStartIndex marker is on the ( token. + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + _expression.parseCallExpressionArguments.call(void 0, ); + } else if (_index.match.call(void 0, _types.TokenType.backQuote)) { + // Tagged template with a type argument. + _expression.parseTemplate.call(void 0, ); + } else if ( + // The remaining possible case is an instantiation expression, e.g. + // Array . Check for a few cases that would disqualify it and + // cause us to bail out. + // a>c is not (a)>c, but a<(b>>c) + _base.state.type === _types.TokenType.greaterThan || + // ac is (ac + (_base.state.type !== _types.TokenType.parenL && + Boolean(_base.state.type & _types.TokenType.IS_EXPRESSION_START) && + !_util.hasPrecedingLineBreak.call(void 0, )) + ) { + // Bail out. We have something like ac, which is not an expression with + // type arguments but an (a < b) > c comparison. + _util.unexpected.call(void 0, ); + } + + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } else { + return; + } + } else if (!noCalls && _index.match.call(void 0, _types.TokenType.questionDot) && _index.lookaheadType.call(void 0, ) === _types.TokenType.lessThan) { + // If we see f?.<, then this must be an optional call with a type argument. + _index.next.call(void 0, ); + _base.state.tokens[startTokenIndex].isOptionalChainStart = true; + // With f?.(), the subscriptStartIndex marker is on the ?. token. + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + + tsParseTypeArguments(); + _util.expect.call(void 0, _types.TokenType.parenL); + _expression.parseCallExpressionArguments.call(void 0, ); + } + _expression.baseParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); +} exports.tsParseSubscript = tsParseSubscript; + + function tsTryParseExport() { + if (_index.eat.call(void 0, _types.TokenType._import)) { + // One of these cases: + // export import A = B; + // export import type A = require("A"); + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type) && _index.lookaheadType.call(void 0, ) !== _types.TokenType.eq) { + // Eat a `type` token, unless it's actually an identifier name. + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); + } + tsParseImportEqualsDeclaration(); + return true; + } else if (_index.eat.call(void 0, _types.TokenType.eq)) { + // `export = x;` + _expression.parseExpression.call(void 0, ); + _util.semicolon.call(void 0, ); + return true; + } else if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { + // `export as namespace A;` + // See `parseNamespaceExportDeclaration` in TypeScript's own parser + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._namespace); + _expression.parseIdentifier.call(void 0, ); + _util.semicolon.call(void 0, ); + return true; + } else { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { + const nextType = _index.lookaheadType.call(void 0, ); + // export type {foo} from 'a'; + // export type * from 'a';' + // export type * as ns from 'a';' + if (nextType === _types.TokenType.braceL || nextType === _types.TokenType.star) { + _index.next.call(void 0, ); + } + } + return false; + } +} exports.tsTryParseExport = tsTryParseExport; + +/** + * Parse a TS import specifier, which may be prefixed with "type" and may be of + * the form `foo as bar`. + * + * The number of identifier-like tokens we see happens to be enough to uniquely + * identify the form, so simply count the number of identifiers rather than + * matching the words `type` or `as`. This is particularly important because + * `type` and `as` could each actually be plain identifiers rather than + * keywords. + */ + function tsParseImportSpecifier() { + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { + // import {foo} + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; + return; + } + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { + // import {type foo} + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; + _base.state.tokens[_base.state.tokens.length - 2].isType = true; + _base.state.tokens[_base.state.tokens.length - 1].isType = true; + return; + } + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { + // import {foo as bar} + _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ImportAccess; + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; + return; + } + _expression.parseIdentifier.call(void 0, ); + // import {type foo as bar} + _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ImportAccess; + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; + _base.state.tokens[_base.state.tokens.length - 4].isType = true; + _base.state.tokens[_base.state.tokens.length - 3].isType = true; + _base.state.tokens[_base.state.tokens.length - 2].isType = true; + _base.state.tokens[_base.state.tokens.length - 1].isType = true; +} exports.tsParseImportSpecifier = tsParseImportSpecifier; + +/** + * Just like named import specifiers, export specifiers can have from 1 to 4 + * tokens, inclusive, and the number of tokens determines the role of each token. + */ + function tsParseExportSpecifier() { + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { + // export {foo} + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ExportAccess; + return; + } + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { + // export {type foo} + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ExportAccess; + _base.state.tokens[_base.state.tokens.length - 2].isType = true; + _base.state.tokens[_base.state.tokens.length - 1].isType = true; + return; + } + _expression.parseIdentifier.call(void 0, ); + if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { + // export {foo as bar} + _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ExportAccess; + return; + } + _expression.parseIdentifier.call(void 0, ); + // export {type foo as bar} + _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ExportAccess; + _base.state.tokens[_base.state.tokens.length - 4].isType = true; + _base.state.tokens[_base.state.tokens.length - 3].isType = true; + _base.state.tokens[_base.state.tokens.length - 2].isType = true; + _base.state.tokens[_base.state.tokens.length - 1].isType = true; +} exports.tsParseExportSpecifier = tsParseExportSpecifier; + + function tsTryParseExportDefaultExpression() { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._abstract) && _index.lookaheadType.call(void 0, ) === _types.TokenType._class) { + _base.state.type = _types.TokenType._abstract; + _index.next.call(void 0, ); // Skip "abstract" + _statement.parseClass.call(void 0, true, true); + return true; + } + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { + // Make sure "export default" are considered type tokens so the whole thing is removed. + const oldIsType = _index.pushTypeContext.call(void 0, 2); + tsParseDeclaration(_keywords.ContextualKeyword._interface, true); + _index.popTypeContext.call(void 0, oldIsType); + return true; + } + return false; +} exports.tsTryParseExportDefaultExpression = tsTryParseExportDefaultExpression; + + function tsTryParseStatementContent() { + if (_base.state.type === _types.TokenType._const) { + const ahead = _index.lookaheadTypeAndKeyword.call(void 0, ); + if (ahead.type === _types.TokenType.name && ahead.contextualKeyword === _keywords.ContextualKeyword._enum) { + _util.expect.call(void 0, _types.TokenType._const); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._enum); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; + tsParseEnumDeclaration(); + return true; + } + } + return false; +} exports.tsTryParseStatementContent = tsTryParseStatementContent; + + function tsTryParseClassMemberWithIsStatic(isStatic) { + const memberStartIndexAfterStatic = _base.state.tokens.length; + tsParseModifiers([ + _keywords.ContextualKeyword._abstract, + _keywords.ContextualKeyword._readonly, + _keywords.ContextualKeyword._declare, + _keywords.ContextualKeyword._static, + _keywords.ContextualKeyword._override, + ]); + + const modifiersEndIndex = _base.state.tokens.length; + const found = tsTryParseIndexSignature(); + if (found) { + // Index signatures are type declarations, so set the modifier tokens as + // type tokens. Most tokens could be assumed to be type tokens, but `static` + // is ambiguous unless we set it explicitly here. + const memberStartIndex = isStatic + ? memberStartIndexAfterStatic - 1 + : memberStartIndexAfterStatic; + for (let i = memberStartIndex; i < modifiersEndIndex; i++) { + _base.state.tokens[i].isType = true; + } + return true; + } + return false; +} exports.tsTryParseClassMemberWithIsStatic = tsTryParseClassMemberWithIsStatic; + +// Note: The reason we do this in `parseIdentifierStatement` and not `parseStatement` +// is that e.g. `type()` is valid JS, so we must try parsing that first. +// If it's really a type, we will parse `type` as the statement, and can correct it here +// by parsing the rest. + function tsParseIdentifierStatement(contextualKeyword) { + const matched = tsParseExpressionStatement(contextualKeyword); + if (!matched) { + _util.semicolon.call(void 0, ); + } +} exports.tsParseIdentifierStatement = tsParseIdentifierStatement; + + function tsParseExportDeclaration() { + // "export declare" is equivalent to just "export". + const isDeclare = _util.eatContextual.call(void 0, _keywords.ContextualKeyword._declare); + if (isDeclare) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._declare; + } + + let matchedDeclaration = false; + if (_index.match.call(void 0, _types.TokenType.name)) { + if (isDeclare) { + const oldIsType = _index.pushTypeContext.call(void 0, 2); + matchedDeclaration = tsTryParseExportDeclaration(); + _index.popTypeContext.call(void 0, oldIsType); + } else { + matchedDeclaration = tsTryParseExportDeclaration(); + } + } + if (!matchedDeclaration) { + if (isDeclare) { + const oldIsType = _index.pushTypeContext.call(void 0, 2); + _statement.parseStatement.call(void 0, true); + _index.popTypeContext.call(void 0, oldIsType); + } else { + _statement.parseStatement.call(void 0, true); + } + } +} exports.tsParseExportDeclaration = tsParseExportDeclaration; + + function tsAfterParseClassSuper(hasSuper) { + if (hasSuper && (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.bitShiftL))) { + tsParseTypeArgumentsWithPossibleBitshift(); + } + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._implements)) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._implements; + const oldIsType = _index.pushTypeContext.call(void 0, 1); + tsParseHeritageClause(); + _index.popTypeContext.call(void 0, oldIsType); + } +} exports.tsAfterParseClassSuper = tsAfterParseClassSuper; + + function tsStartParseObjPropValue() { + tsTryParseTypeParameters(); +} exports.tsStartParseObjPropValue = tsStartParseObjPropValue; + + function tsStartParseFunctionParams() { + tsTryParseTypeParameters(); +} exports.tsStartParseFunctionParams = tsStartParseFunctionParams; + +// `let x: number;` + function tsAfterParseVarHead() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + if (!_util.hasPrecedingLineBreak.call(void 0, )) { + _index.eat.call(void 0, _types.TokenType.bang); + } + tsTryParseTypeAnnotation(); + _index.popTypeContext.call(void 0, oldIsType); +} exports.tsAfterParseVarHead = tsAfterParseVarHead; + +// parse the return type of an async arrow function - let foo = (async (): number => {}); + function tsStartParseAsyncArrowFromCallExpression() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + tsParseTypeAnnotation(); + } +} exports.tsStartParseAsyncArrowFromCallExpression = tsStartParseAsyncArrowFromCallExpression; + +// Returns true if the expression was an arrow function. + function tsParseMaybeAssign(noIn, isWithinParens) { + // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax. + if (_base.isJSXEnabled) { + return tsParseMaybeAssignWithJSX(noIn, isWithinParens); + } else { + return tsParseMaybeAssignWithoutJSX(noIn, isWithinParens); + } +} exports.tsParseMaybeAssign = tsParseMaybeAssign; + + function tsParseMaybeAssignWithJSX(noIn, isWithinParens) { + if (!_index.match.call(void 0, _types.TokenType.lessThan)) { + return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + } + + // Prefer to parse JSX if possible. But may be an arrow fn. + const snapshot = _base.state.snapshot(); + let wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } else { + return wasArrow; + } + + // Otherwise, try as type-parameterized arrow function. + _base.state.type = _types.TokenType.typeParameterStart; + // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. + tsParseTypeParameters(); + wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + if (!wasArrow) { + _util.unexpected.call(void 0, ); + } + + return wasArrow; +} exports.tsParseMaybeAssignWithJSX = tsParseMaybeAssignWithJSX; + + function tsParseMaybeAssignWithoutJSX(noIn, isWithinParens) { + if (!_index.match.call(void 0, _types.TokenType.lessThan)) { + return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + } + + const snapshot = _base.state.snapshot(); + // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. + tsParseTypeParameters(); + const wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); + if (!wasArrow) { + _util.unexpected.call(void 0, ); + } + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } else { + return wasArrow; + } + + // Try parsing a type cast instead of an arrow function. + // This will start with a type assertion (via parseMaybeUnary). + // But don't directly call `tsParseTypeAssertion` because we want to handle any binary after it. + return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); +} exports.tsParseMaybeAssignWithoutJSX = tsParseMaybeAssignWithoutJSX; + + function tsParseArrow() { + if (_index.match.call(void 0, _types.TokenType.colon)) { + // This is different from how the TS parser does it. + // TS uses lookahead. Babylon parses it as a parenthesized expression and converts. + const snapshot = _base.state.snapshot(); + + tsParseTypeOrTypePredicateAnnotation(_types.TokenType.colon); + if (_util.canInsertSemicolon.call(void 0, )) _util.unexpected.call(void 0, ); + if (!_index.match.call(void 0, _types.TokenType.arrow)) _util.unexpected.call(void 0, ); + + if (_base.state.error) { + _base.state.restoreFromSnapshot(snapshot); + } + } + return _index.eat.call(void 0, _types.TokenType.arrow); +} exports.tsParseArrow = tsParseArrow; + +// Allow type annotations inside of a parameter list. + function tsParseAssignableListItemTypes() { + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _index.eat.call(void 0, _types.TokenType.question); + tsTryParseTypeAnnotation(); + _index.popTypeContext.call(void 0, oldIsType); +} exports.tsParseAssignableListItemTypes = tsParseAssignableListItemTypes; + + function tsParseMaybeDecoratorArguments() { + if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.bitShiftL)) { + tsParseTypeArgumentsWithPossibleBitshift(); + } + _statement.baseParseMaybeDecoratorArguments.call(void 0, ); +} exports.tsParseMaybeDecoratorArguments = tsParseMaybeDecoratorArguments; diff --git a/node_modules/sucrase/dist/parser/tokenizer/index.js b/node_modules/sucrase/dist/parser/tokenizer/index.js new file mode 100644 index 0000000..84f5e14 --- /dev/null +++ b/node_modules/sucrase/dist/parser/tokenizer/index.js @@ -0,0 +1,1004 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/* eslint max-len: 0 */ + +var _base = require('../traverser/base'); +var _util = require('../traverser/util'); +var _charcodes = require('../util/charcodes'); +var _identifier = require('../util/identifier'); +var _whitespace = require('../util/whitespace'); +var _keywords = require('./keywords'); +var _readWord = require('./readWord'); var _readWord2 = _interopRequireDefault(_readWord); +var _types = require('./types'); + +var IdentifierRole; (function (IdentifierRole) { + const Access = 0; IdentifierRole[IdentifierRole["Access"] = Access] = "Access"; + const ExportAccess = Access + 1; IdentifierRole[IdentifierRole["ExportAccess"] = ExportAccess] = "ExportAccess"; + const TopLevelDeclaration = ExportAccess + 1; IdentifierRole[IdentifierRole["TopLevelDeclaration"] = TopLevelDeclaration] = "TopLevelDeclaration"; + const FunctionScopedDeclaration = TopLevelDeclaration + 1; IdentifierRole[IdentifierRole["FunctionScopedDeclaration"] = FunctionScopedDeclaration] = "FunctionScopedDeclaration"; + const BlockScopedDeclaration = FunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["BlockScopedDeclaration"] = BlockScopedDeclaration] = "BlockScopedDeclaration"; + const ObjectShorthandTopLevelDeclaration = BlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandTopLevelDeclaration"] = ObjectShorthandTopLevelDeclaration] = "ObjectShorthandTopLevelDeclaration"; + const ObjectShorthandFunctionScopedDeclaration = ObjectShorthandTopLevelDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandFunctionScopedDeclaration"] = ObjectShorthandFunctionScopedDeclaration] = "ObjectShorthandFunctionScopedDeclaration"; + const ObjectShorthandBlockScopedDeclaration = ObjectShorthandFunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandBlockScopedDeclaration"] = ObjectShorthandBlockScopedDeclaration] = "ObjectShorthandBlockScopedDeclaration"; + const ObjectShorthand = ObjectShorthandBlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthand"] = ObjectShorthand] = "ObjectShorthand"; + // Any identifier bound in an import statement, e.g. both A and b from + // `import A, * as b from 'A';` + const ImportDeclaration = ObjectShorthand + 1; IdentifierRole[IdentifierRole["ImportDeclaration"] = ImportDeclaration] = "ImportDeclaration"; + const ObjectKey = ImportDeclaration + 1; IdentifierRole[IdentifierRole["ObjectKey"] = ObjectKey] = "ObjectKey"; + // The `foo` in `import {foo as bar} from "./abc";`. + const ImportAccess = ObjectKey + 1; IdentifierRole[IdentifierRole["ImportAccess"] = ImportAccess] = "ImportAccess"; +})(IdentifierRole || (exports.IdentifierRole = IdentifierRole = {})); + +/** + * Extra information on jsxTagStart tokens, used to determine which of the three + * jsx functions are called in the automatic transform. + */ +var JSXRole; (function (JSXRole) { + // The element is self-closing or has a body that resolves to empty. We + // shouldn't emit children at all in this case. + const NoChildren = 0; JSXRole[JSXRole["NoChildren"] = NoChildren] = "NoChildren"; + // The element has a single explicit child, which might still be an arbitrary + // expression like an array. We should emit that expression as the children. + const OneChild = NoChildren + 1; JSXRole[JSXRole["OneChild"] = OneChild] = "OneChild"; + // The element has at least two explicitly-specified children or has spread + // children, so child positions are assumed to be "static". We should wrap + // these children in an array. + const StaticChildren = OneChild + 1; JSXRole[JSXRole["StaticChildren"] = StaticChildren] = "StaticChildren"; + // The element has a prop named "key" after a prop spread, so we should fall + // back to the createElement function. + const KeyAfterPropSpread = StaticChildren + 1; JSXRole[JSXRole["KeyAfterPropSpread"] = KeyAfterPropSpread] = "KeyAfterPropSpread"; +})(JSXRole || (exports.JSXRole = JSXRole = {})); + + function isDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.TopLevelDeclaration || + role === IdentifierRole.FunctionScopedDeclaration || + role === IdentifierRole.BlockScopedDeclaration || + role === IdentifierRole.ObjectShorthandTopLevelDeclaration || + role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || + role === IdentifierRole.ObjectShorthandBlockScopedDeclaration + ); +} exports.isDeclaration = isDeclaration; + + function isNonTopLevelDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.FunctionScopedDeclaration || + role === IdentifierRole.BlockScopedDeclaration || + role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || + role === IdentifierRole.ObjectShorthandBlockScopedDeclaration + ); +} exports.isNonTopLevelDeclaration = isNonTopLevelDeclaration; + + function isTopLevelDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.TopLevelDeclaration || + role === IdentifierRole.ObjectShorthandTopLevelDeclaration || + role === IdentifierRole.ImportDeclaration + ); +} exports.isTopLevelDeclaration = isTopLevelDeclaration; + + function isBlockScopedDeclaration(token) { + const role = token.identifierRole; + // Treat top-level declarations as block scope since the distinction doesn't matter here. + return ( + role === IdentifierRole.TopLevelDeclaration || + role === IdentifierRole.BlockScopedDeclaration || + role === IdentifierRole.ObjectShorthandTopLevelDeclaration || + role === IdentifierRole.ObjectShorthandBlockScopedDeclaration + ); +} exports.isBlockScopedDeclaration = isBlockScopedDeclaration; + + function isFunctionScopedDeclaration(token) { + const role = token.identifierRole; + return ( + role === IdentifierRole.FunctionScopedDeclaration || + role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration + ); +} exports.isFunctionScopedDeclaration = isFunctionScopedDeclaration; + + function isObjectShorthandDeclaration(token) { + return ( + token.identifierRole === IdentifierRole.ObjectShorthandTopLevelDeclaration || + token.identifierRole === IdentifierRole.ObjectShorthandBlockScopedDeclaration || + token.identifierRole === IdentifierRole.ObjectShorthandFunctionScopedDeclaration + ); +} exports.isObjectShorthandDeclaration = isObjectShorthandDeclaration; + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + class Token { + constructor() { + this.type = _base.state.type; + this.contextualKeyword = _base.state.contextualKeyword; + this.start = _base.state.start; + this.end = _base.state.end; + this.scopeDepth = _base.state.scopeDepth; + this.isType = _base.state.isType; + this.identifierRole = null; + this.jsxRole = null; + this.shadowsGlobal = false; + this.isAsyncOperation = false; + this.contextId = null; + this.rhsEndIndex = null; + this.isExpression = false; + this.numNullishCoalesceStarts = 0; + this.numNullishCoalesceEnds = 0; + this.isOptionalChainStart = false; + this.isOptionalChainEnd = false; + this.subscriptStartIndex = null; + this.nullishStartIndex = null; + } + + + + + + + + + + // Initially false for all tokens, then may be computed in a follow-up step that does scope + // analysis. + + // Initially false for all tokens, but may be set during transform to mark it as containing an + // await operation. + + + // For assignments, the index of the RHS. For export tokens, the end of the export. + + // For class tokens, records if the class is a class expression or a class statement. + + // Number of times to insert a `nullishCoalesce(` snippet before this token. + + // Number of times to insert a `)` snippet after this token. + + // If true, insert an `optionalChain([` snippet before this token. + + // If true, insert a `])` snippet after this token. + + // Tag for `.`, `?.`, `[`, `?.[`, `(`, and `?.(` to denote the "root" token for this + // subscript chain. This can be used to determine if this chain is an optional chain. + + // Tag for `??` operators to denote the root token for this nullish coalescing call. + +} exports.Token = Token; + +// ## Tokenizer + +// Move to the next token + function next() { + _base.state.tokens.push(new Token()); + nextToken(); +} exports.next = next; + +// Call instead of next when inside a template, since that needs to be handled differently. + function nextTemplateToken() { + _base.state.tokens.push(new Token()); + _base.state.start = _base.state.pos; + readTmplToken(); +} exports.nextTemplateToken = nextTemplateToken; + +// The tokenizer never parses regexes by default. Instead, the parser is responsible for +// instructing it to parse a regex when we see a slash at the start of an expression. + function retokenizeSlashAsRegex() { + if (_base.state.type === _types.TokenType.assign) { + --_base.state.pos; + } + readRegexp(); +} exports.retokenizeSlashAsRegex = retokenizeSlashAsRegex; + + function pushTypeContext(existingTokensInType) { + for (let i = _base.state.tokens.length - existingTokensInType; i < _base.state.tokens.length; i++) { + _base.state.tokens[i].isType = true; + } + const oldIsType = _base.state.isType; + _base.state.isType = true; + return oldIsType; +} exports.pushTypeContext = pushTypeContext; + + function popTypeContext(oldIsType) { + _base.state.isType = oldIsType; +} exports.popTypeContext = popTypeContext; + + function eat(type) { + if (match(type)) { + next(); + return true; + } else { + return false; + } +} exports.eat = eat; + + function eatTypeToken(tokenType) { + const oldIsType = _base.state.isType; + _base.state.isType = true; + eat(tokenType); + _base.state.isType = oldIsType; +} exports.eatTypeToken = eatTypeToken; + + function match(type) { + return _base.state.type === type; +} exports.match = match; + + function lookaheadType() { + const snapshot = _base.state.snapshot(); + next(); + const type = _base.state.type; + _base.state.restoreFromSnapshot(snapshot); + return type; +} exports.lookaheadType = lookaheadType; + + class TypeAndKeyword { + + + constructor(type, contextualKeyword) { + this.type = type; + this.contextualKeyword = contextualKeyword; + } +} exports.TypeAndKeyword = TypeAndKeyword; + + function lookaheadTypeAndKeyword() { + const snapshot = _base.state.snapshot(); + next(); + const type = _base.state.type; + const contextualKeyword = _base.state.contextualKeyword; + _base.state.restoreFromSnapshot(snapshot); + return new TypeAndKeyword(type, contextualKeyword); +} exports.lookaheadTypeAndKeyword = lookaheadTypeAndKeyword; + + function nextTokenStart() { + return nextTokenStartSince(_base.state.pos); +} exports.nextTokenStart = nextTokenStart; + + function nextTokenStartSince(pos) { + _whitespace.skipWhiteSpace.lastIndex = pos; + const skip = _whitespace.skipWhiteSpace.exec(_base.input); + return pos + skip[0].length; +} exports.nextTokenStartSince = nextTokenStartSince; + + function lookaheadCharCode() { + return _base.input.charCodeAt(nextTokenStart()); +} exports.lookaheadCharCode = lookaheadCharCode; + +// Read a single token, updating the parser object's token-related +// properties. + function nextToken() { + skipSpace(); + _base.state.start = _base.state.pos; + if (_base.state.pos >= _base.input.length) { + const tokens = _base.state.tokens; + // We normally run past the end a bit, but if we're way past the end, avoid an infinite loop. + // Also check the token positions rather than the types since sometimes we rewrite the token + // type to something else. + if ( + tokens.length >= 2 && + tokens[tokens.length - 1].start >= _base.input.length && + tokens[tokens.length - 2].start >= _base.input.length + ) { + _util.unexpected.call(void 0, "Unexpectedly reached the end of input."); + } + finishToken(_types.TokenType.eof); + return; + } + readToken(_base.input.charCodeAt(_base.state.pos)); +} exports.nextToken = nextToken; + +function readToken(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if ( + _identifier.IS_IDENTIFIER_START[code] || + code === _charcodes.charCodes.backslash || + (code === _charcodes.charCodes.atSign && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.atSign) + ) { + _readWord2.default.call(void 0, ); + } else { + getTokenFromCode(code); + } +} + +function skipBlockComment() { + while ( + _base.input.charCodeAt(_base.state.pos) !== _charcodes.charCodes.asterisk || + _base.input.charCodeAt(_base.state.pos + 1) !== _charcodes.charCodes.slash + ) { + _base.state.pos++; + if (_base.state.pos > _base.input.length) { + _util.unexpected.call(void 0, "Unterminated comment", _base.state.pos - 2); + return; + } + } + _base.state.pos += 2; +} + + function skipLineComment(startSkip) { + let ch = _base.input.charCodeAt((_base.state.pos += startSkip)); + if (_base.state.pos < _base.input.length) { + while ( + ch !== _charcodes.charCodes.lineFeed && + ch !== _charcodes.charCodes.carriageReturn && + ch !== _charcodes.charCodes.lineSeparator && + ch !== _charcodes.charCodes.paragraphSeparator && + ++_base.state.pos < _base.input.length + ) { + ch = _base.input.charCodeAt(_base.state.pos); + } + } +} exports.skipLineComment = skipLineComment; + +// Called at the start of the parse and after every token. Skips +// whitespace and comments. + function skipSpace() { + while (_base.state.pos < _base.input.length) { + const ch = _base.input.charCodeAt(_base.state.pos); + switch (ch) { + case _charcodes.charCodes.carriageReturn: + if (_base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.lineFeed) { + ++_base.state.pos; + } + + case _charcodes.charCodes.lineFeed: + case _charcodes.charCodes.lineSeparator: + case _charcodes.charCodes.paragraphSeparator: + ++_base.state.pos; + break; + + case _charcodes.charCodes.slash: + switch (_base.input.charCodeAt(_base.state.pos + 1)) { + case _charcodes.charCodes.asterisk: + _base.state.pos += 2; + skipBlockComment(); + break; + + case _charcodes.charCodes.slash: + skipLineComment(2); + break; + + default: + return; + } + break; + + default: + if (_whitespace.IS_WHITESPACE[ch]) { + ++_base.state.pos; + } else { + return; + } + } + } +} exports.skipSpace = skipSpace; + +// Called at the end of every token. Sets various fields, and skips the space after the token, so +// that the next one's `start` will point at the right position. + function finishToken( + type, + contextualKeyword = _keywords.ContextualKeyword.NONE, +) { + _base.state.end = _base.state.pos; + _base.state.type = type; + _base.state.contextualKeyword = contextualKeyword; +} exports.finishToken = finishToken; + +// ### Token reading + +// This is the function that is called to fetch the next token. It +// is somewhat obscure, because it works in character codes rather +// than characters, and because operator parsing has been inlined +// into it. +// +// All in the name of speed. +function readToken_dot() { + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + if (nextChar >= _charcodes.charCodes.digit0 && nextChar <= _charcodes.charCodes.digit9) { + readNumber(true); + return; + } + + if (nextChar === _charcodes.charCodes.dot && _base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.dot) { + _base.state.pos += 3; + finishToken(_types.TokenType.ellipsis); + } else { + ++_base.state.pos; + finishToken(_types.TokenType.dot); + } +} + +function readToken_slash() { + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + if (nextChar === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.assign, 2); + } else { + finishOp(_types.TokenType.slash, 1); + } +} + +function readToken_mult_modulo(code) { + // '%*' + let tokenType = code === _charcodes.charCodes.asterisk ? _types.TokenType.star : _types.TokenType.modulo; + let width = 1; + let nextChar = _base.input.charCodeAt(_base.state.pos + 1); + + // Exponentiation operator ** + if (code === _charcodes.charCodes.asterisk && nextChar === _charcodes.charCodes.asterisk) { + width++; + nextChar = _base.input.charCodeAt(_base.state.pos + 2); + tokenType = _types.TokenType.exponent; + } + + // Match *= or %=, disallowing *=> which can be valid in flow. + if ( + nextChar === _charcodes.charCodes.equalsTo && + _base.input.charCodeAt(_base.state.pos + 2) !== _charcodes.charCodes.greaterThan + ) { + width++; + tokenType = _types.TokenType.assign; + } + + finishOp(tokenType, width); +} + +function readToken_pipe_amp(code) { + // '|&' + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + + if (nextChar === code) { + if (_base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.equalsTo) { + // ||= or &&= + finishOp(_types.TokenType.assign, 3); + } else { + // || or && + finishOp(code === _charcodes.charCodes.verticalBar ? _types.TokenType.logicalOR : _types.TokenType.logicalAND, 2); + } + return; + } + + if (code === _charcodes.charCodes.verticalBar) { + // '|>' + if (nextChar === _charcodes.charCodes.greaterThan) { + finishOp(_types.TokenType.pipeline, 2); + return; + } else if (nextChar === _charcodes.charCodes.rightCurlyBrace && _base.isFlowEnabled) { + // '|}' + finishOp(_types.TokenType.braceBarR, 2); + return; + } + } + + if (nextChar === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.assign, 2); + return; + } + + finishOp(code === _charcodes.charCodes.verticalBar ? _types.TokenType.bitwiseOR : _types.TokenType.bitwiseAND, 1); +} + +function readToken_caret() { + // '^' + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + if (nextChar === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.assign, 2); + } else { + finishOp(_types.TokenType.bitwiseXOR, 1); + } +} + +function readToken_plus_min(code) { + // '+-' + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + + if (nextChar === code) { + // Tentatively call this a prefix operator, but it might be changed to postfix later. + finishOp(_types.TokenType.preIncDec, 2); + return; + } + + if (nextChar === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.assign, 2); + } else if (code === _charcodes.charCodes.plusSign) { + finishOp(_types.TokenType.plus, 1); + } else { + finishOp(_types.TokenType.minus, 1); + } +} + +function readToken_lt() { + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + + if (nextChar === _charcodes.charCodes.lessThan) { + if (_base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.assign, 3); + return; + } + // We see <<, but need to be really careful about whether to treat it as a + // true left-shift or as two < tokens. + if (_base.state.isType) { + // Within a type, << might come up in a snippet like `Array<() => void>`, + // so treat it as two < tokens. Importantly, this should only override << + // rather than other tokens like <= . If we treated <= as < in a type + // context, then the snippet `a as T <= 1` would incorrectly start parsing + // a type argument on T. We don't need to worry about `a as T << 1` + // because TypeScript disallows that syntax. + finishOp(_types.TokenType.lessThan, 1); + } else { + // Outside a type, this might be a true left-shift operator, or it might + // still be two open-type-arg tokens, such as in `f<() => void>()`. We + // look at the token while considering the `f`, so we don't yet know that + // we're in a type context. In this case, we initially tokenize as a + // left-shift and correct after-the-fact as necessary in + // tsParseTypeArgumentsWithPossibleBitshift . + finishOp(_types.TokenType.bitShiftL, 2); + } + return; + } + + if (nextChar === _charcodes.charCodes.equalsTo) { + // <= + finishOp(_types.TokenType.relationalOrEqual, 2); + } else { + finishOp(_types.TokenType.lessThan, 1); + } +} + +function readToken_gt() { + if (_base.state.isType) { + // Avoid right-shift for things like `Array>` and + // greater-than-or-equal for things like `const a: Array=[];`. + finishOp(_types.TokenType.greaterThan, 1); + return; + } + + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + + if (nextChar === _charcodes.charCodes.greaterThan) { + const size = _base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.greaterThan ? 3 : 2; + if (_base.input.charCodeAt(_base.state.pos + size) === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.assign, size + 1); + return; + } + finishOp(_types.TokenType.bitShiftR, size); + return; + } + + if (nextChar === _charcodes.charCodes.equalsTo) { + // >= + finishOp(_types.TokenType.relationalOrEqual, 2); + } else { + finishOp(_types.TokenType.greaterThan, 1); + } +} + +/** + * Reinterpret a possible > token when transitioning from a type to a non-type + * context. + * + * This comes up in two situations where >= needs to be treated as one token: + * - After an `as` expression, like in the code `a as T >= 1`. + * - In a type argument in an expression context, e.g. `f(a < b, c >= d)`, we + * need to see the token as >= so that we get an error and backtrack to + * normal expression parsing. + * + * Other situations require >= to be seen as two tokens, e.g. + * `const x: Array=[];`, so it's important to treat > as its own token in + * typical type parsing situations. + */ + function rescan_gt() { + if (_base.state.type === _types.TokenType.greaterThan) { + _base.state.pos -= 1; + readToken_gt(); + } +} exports.rescan_gt = rescan_gt; + +function readToken_eq_excl(code) { + // '=!' + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + if (nextChar === _charcodes.charCodes.equalsTo) { + finishOp(_types.TokenType.equality, _base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.equalsTo ? 3 : 2); + return; + } + if (code === _charcodes.charCodes.equalsTo && nextChar === _charcodes.charCodes.greaterThan) { + // '=>' + _base.state.pos += 2; + finishToken(_types.TokenType.arrow); + return; + } + finishOp(code === _charcodes.charCodes.equalsTo ? _types.TokenType.eq : _types.TokenType.bang, 1); +} + +function readToken_question() { + // '?' + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + const nextChar2 = _base.input.charCodeAt(_base.state.pos + 2); + if ( + nextChar === _charcodes.charCodes.questionMark && + // In Flow (but not TypeScript), ??string is a valid type that should be + // tokenized as two individual ? tokens. + !(_base.isFlowEnabled && _base.state.isType) + ) { + if (nextChar2 === _charcodes.charCodes.equalsTo) { + // '??=' + finishOp(_types.TokenType.assign, 3); + } else { + // '??' + finishOp(_types.TokenType.nullishCoalescing, 2); + } + } else if ( + nextChar === _charcodes.charCodes.dot && + !(nextChar2 >= _charcodes.charCodes.digit0 && nextChar2 <= _charcodes.charCodes.digit9) + ) { + // '.' not followed by a number + _base.state.pos += 2; + finishToken(_types.TokenType.questionDot); + } else { + ++_base.state.pos; + finishToken(_types.TokenType.question); + } +} + + function getTokenFromCode(code) { + switch (code) { + case _charcodes.charCodes.numberSign: + ++_base.state.pos; + finishToken(_types.TokenType.hash); + return; + + // The interpretation of a dot depends on whether it is followed + // by a digit or another two dots. + + case _charcodes.charCodes.dot: + readToken_dot(); + return; + + // Punctuation tokens. + case _charcodes.charCodes.leftParenthesis: + ++_base.state.pos; + finishToken(_types.TokenType.parenL); + return; + case _charcodes.charCodes.rightParenthesis: + ++_base.state.pos; + finishToken(_types.TokenType.parenR); + return; + case _charcodes.charCodes.semicolon: + ++_base.state.pos; + finishToken(_types.TokenType.semi); + return; + case _charcodes.charCodes.comma: + ++_base.state.pos; + finishToken(_types.TokenType.comma); + return; + case _charcodes.charCodes.leftSquareBracket: + ++_base.state.pos; + finishToken(_types.TokenType.bracketL); + return; + case _charcodes.charCodes.rightSquareBracket: + ++_base.state.pos; + finishToken(_types.TokenType.bracketR); + return; + + case _charcodes.charCodes.leftCurlyBrace: + if (_base.isFlowEnabled && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.verticalBar) { + finishOp(_types.TokenType.braceBarL, 2); + } else { + ++_base.state.pos; + finishToken(_types.TokenType.braceL); + } + return; + + case _charcodes.charCodes.rightCurlyBrace: + ++_base.state.pos; + finishToken(_types.TokenType.braceR); + return; + + case _charcodes.charCodes.colon: + if (_base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.colon) { + finishOp(_types.TokenType.doubleColon, 2); + } else { + ++_base.state.pos; + finishToken(_types.TokenType.colon); + } + return; + + case _charcodes.charCodes.questionMark: + readToken_question(); + return; + case _charcodes.charCodes.atSign: + ++_base.state.pos; + finishToken(_types.TokenType.at); + return; + + case _charcodes.charCodes.graveAccent: + ++_base.state.pos; + finishToken(_types.TokenType.backQuote); + return; + + case _charcodes.charCodes.digit0: { + const nextChar = _base.input.charCodeAt(_base.state.pos + 1); + // '0x', '0X', '0o', '0O', '0b', '0B' + if ( + nextChar === _charcodes.charCodes.lowercaseX || + nextChar === _charcodes.charCodes.uppercaseX || + nextChar === _charcodes.charCodes.lowercaseO || + nextChar === _charcodes.charCodes.uppercaseO || + nextChar === _charcodes.charCodes.lowercaseB || + nextChar === _charcodes.charCodes.uppercaseB + ) { + readRadixNumber(); + return; + } + } + // Anything else beginning with a digit is an integer, octal + // number, or float. + case _charcodes.charCodes.digit1: + case _charcodes.charCodes.digit2: + case _charcodes.charCodes.digit3: + case _charcodes.charCodes.digit4: + case _charcodes.charCodes.digit5: + case _charcodes.charCodes.digit6: + case _charcodes.charCodes.digit7: + case _charcodes.charCodes.digit8: + case _charcodes.charCodes.digit9: + readNumber(false); + return; + + // Quotes produce strings. + case _charcodes.charCodes.quotationMark: + case _charcodes.charCodes.apostrophe: + readString(code); + return; + + // Operators are parsed inline in tiny state machines. '=' (charCodes.equalsTo) is + // often referred to. `finishOp` simply skips the amount of + // characters it is given as second argument, and returns a token + // of the type given by its first argument. + + case _charcodes.charCodes.slash: + readToken_slash(); + return; + + case _charcodes.charCodes.percentSign: + case _charcodes.charCodes.asterisk: + readToken_mult_modulo(code); + return; + + case _charcodes.charCodes.verticalBar: + case _charcodes.charCodes.ampersand: + readToken_pipe_amp(code); + return; + + case _charcodes.charCodes.caret: + readToken_caret(); + return; + + case _charcodes.charCodes.plusSign: + case _charcodes.charCodes.dash: + readToken_plus_min(code); + return; + + case _charcodes.charCodes.lessThan: + readToken_lt(); + return; + + case _charcodes.charCodes.greaterThan: + readToken_gt(); + return; + + case _charcodes.charCodes.equalsTo: + case _charcodes.charCodes.exclamationMark: + readToken_eq_excl(code); + return; + + case _charcodes.charCodes.tilde: + finishOp(_types.TokenType.tilde, 1); + return; + + default: + break; + } + + _util.unexpected.call(void 0, `Unexpected character '${String.fromCharCode(code)}'`, _base.state.pos); +} exports.getTokenFromCode = getTokenFromCode; + +function finishOp(type, size) { + _base.state.pos += size; + finishToken(type); +} + +function readRegexp() { + const start = _base.state.pos; + let escaped = false; + let inClass = false; + for (;;) { + if (_base.state.pos >= _base.input.length) { + _util.unexpected.call(void 0, "Unterminated regular expression", start); + return; + } + const code = _base.input.charCodeAt(_base.state.pos); + if (escaped) { + escaped = false; + } else { + if (code === _charcodes.charCodes.leftSquareBracket) { + inClass = true; + } else if (code === _charcodes.charCodes.rightSquareBracket && inClass) { + inClass = false; + } else if (code === _charcodes.charCodes.slash && !inClass) { + break; + } + escaped = code === _charcodes.charCodes.backslash; + } + ++_base.state.pos; + } + ++_base.state.pos; + // Need to use `skipWord` because '\uXXXX' sequences are allowed here (don't ask). + skipWord(); + + finishToken(_types.TokenType.regexp); +} + +/** + * Read a decimal integer. Note that this can't be unified with the similar code + * in readRadixNumber (which also handles hex digits) because "e" needs to be + * the end of the integer so that we can properly handle scientific notation. + */ +function readInt() { + while (true) { + const code = _base.input.charCodeAt(_base.state.pos); + if ((code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) || code === _charcodes.charCodes.underscore) { + _base.state.pos++; + } else { + break; + } + } +} + +function readRadixNumber() { + _base.state.pos += 2; // 0x + + // Walk to the end of the number, allowing hex digits. + while (true) { + const code = _base.input.charCodeAt(_base.state.pos); + if ( + (code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) || + (code >= _charcodes.charCodes.lowercaseA && code <= _charcodes.charCodes.lowercaseF) || + (code >= _charcodes.charCodes.uppercaseA && code <= _charcodes.charCodes.uppercaseF) || + code === _charcodes.charCodes.underscore + ) { + _base.state.pos++; + } else { + break; + } + } + + const nextChar = _base.input.charCodeAt(_base.state.pos); + if (nextChar === _charcodes.charCodes.lowercaseN) { + ++_base.state.pos; + finishToken(_types.TokenType.bigint); + } else { + finishToken(_types.TokenType.num); + } +} + +// Read an integer, octal integer, or floating-point number. +function readNumber(startsWithDot) { + let isBigInt = false; + let isDecimal = false; + + if (!startsWithDot) { + readInt(); + } + + let nextChar = _base.input.charCodeAt(_base.state.pos); + if (nextChar === _charcodes.charCodes.dot) { + ++_base.state.pos; + readInt(); + nextChar = _base.input.charCodeAt(_base.state.pos); + } + + if (nextChar === _charcodes.charCodes.uppercaseE || nextChar === _charcodes.charCodes.lowercaseE) { + nextChar = _base.input.charCodeAt(++_base.state.pos); + if (nextChar === _charcodes.charCodes.plusSign || nextChar === _charcodes.charCodes.dash) { + ++_base.state.pos; + } + readInt(); + nextChar = _base.input.charCodeAt(_base.state.pos); + } + + if (nextChar === _charcodes.charCodes.lowercaseN) { + ++_base.state.pos; + isBigInt = true; + } else if (nextChar === _charcodes.charCodes.lowercaseM) { + ++_base.state.pos; + isDecimal = true; + } + + if (isBigInt) { + finishToken(_types.TokenType.bigint); + return; + } + + if (isDecimal) { + finishToken(_types.TokenType.decimal); + return; + } + + finishToken(_types.TokenType.num); +} + +function readString(quote) { + _base.state.pos++; + for (;;) { + if (_base.state.pos >= _base.input.length) { + _util.unexpected.call(void 0, "Unterminated string constant"); + return; + } + const ch = _base.input.charCodeAt(_base.state.pos); + if (ch === _charcodes.charCodes.backslash) { + _base.state.pos++; + } else if (ch === quote) { + break; + } + _base.state.pos++; + } + _base.state.pos++; + finishToken(_types.TokenType.string); +} + +// Reads template string tokens. +function readTmplToken() { + for (;;) { + if (_base.state.pos >= _base.input.length) { + _util.unexpected.call(void 0, "Unterminated template"); + return; + } + const ch = _base.input.charCodeAt(_base.state.pos); + if ( + ch === _charcodes.charCodes.graveAccent || + (ch === _charcodes.charCodes.dollarSign && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.leftCurlyBrace) + ) { + if (_base.state.pos === _base.state.start && match(_types.TokenType.template)) { + if (ch === _charcodes.charCodes.dollarSign) { + _base.state.pos += 2; + finishToken(_types.TokenType.dollarBraceL); + return; + } else { + ++_base.state.pos; + finishToken(_types.TokenType.backQuote); + return; + } + } + finishToken(_types.TokenType.template); + return; + } + if (ch === _charcodes.charCodes.backslash) { + _base.state.pos++; + } + _base.state.pos++; + } +} + +// Skip to the end of the current word. Note that this is the same as the snippet at the end of +// readWord, but calling skipWord from readWord seems to slightly hurt performance from some rough +// measurements. + function skipWord() { + while (_base.state.pos < _base.input.length) { + const ch = _base.input.charCodeAt(_base.state.pos); + if (_identifier.IS_IDENTIFIER_CHAR[ch]) { + _base.state.pos++; + } else if (ch === _charcodes.charCodes.backslash) { + // \u + _base.state.pos += 2; + if (_base.input.charCodeAt(_base.state.pos) === _charcodes.charCodes.leftCurlyBrace) { + while ( + _base.state.pos < _base.input.length && + _base.input.charCodeAt(_base.state.pos) !== _charcodes.charCodes.rightCurlyBrace + ) { + _base.state.pos++; + } + _base.state.pos++; + } + } else { + break; + } + } +} exports.skipWord = skipWord; diff --git a/node_modules/sucrase/dist/parser/tokenizer/keywords.js b/node_modules/sucrase/dist/parser/tokenizer/keywords.js new file mode 100644 index 0000000..e741926 --- /dev/null +++ b/node_modules/sucrase/dist/parser/tokenizer/keywords.js @@ -0,0 +1,43 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var ContextualKeyword; (function (ContextualKeyword) { + const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE"; + const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract"; + const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor"; + const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as"; + const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert"; + const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts"; + const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async"; + const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await"; + const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks"; + const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor"; + const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare"; + const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum"; + const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports"; + const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from"; + const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get"; + const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global"; + const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements"; + const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer"; + const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface"; + const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is"; + const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof"; + const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins"; + const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module"; + const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace"; + const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of"; + const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque"; + const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out"; + const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override"; + const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private"; + const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected"; + const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto"; + const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public"; + const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly"; + const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require"; + const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies"; + const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set"; + const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static"; + const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol"; + const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type"; + const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique"; + const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using"; +})(ContextualKeyword || (exports.ContextualKeyword = ContextualKeyword = {})); diff --git a/node_modules/sucrase/dist/parser/tokenizer/readWord.js b/node_modules/sucrase/dist/parser/tokenizer/readWord.js new file mode 100644 index 0000000..69ed5c9 --- /dev/null +++ b/node_modules/sucrase/dist/parser/tokenizer/readWord.js @@ -0,0 +1,64 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _base = require('../traverser/base'); +var _charcodes = require('../util/charcodes'); +var _identifier = require('../util/identifier'); +var _index = require('./index'); +var _readWordTree = require('./readWordTree'); +var _types = require('./types'); + +/** + * Read an identifier, producing either a name token or matching on one of the existing keywords. + * For performance, we pre-generate big decision tree that we traverse. Each node represents a + * prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if + * not), and the other 26 values are the transitions to other nodes, or -1 to stop. + */ + function readWord() { + let treePos = 0; + let code = 0; + let pos = _base.state.pos; + while (pos < _base.input.length) { + code = _base.input.charCodeAt(pos); + if (code < _charcodes.charCodes.lowercaseA || code > _charcodes.charCodes.lowercaseZ) { + break; + } + const next = _readWordTree.READ_WORD_TREE[treePos + (code - _charcodes.charCodes.lowercaseA) + 1]; + if (next === -1) { + break; + } else { + treePos = next; + pos++; + } + } + + const keywordValue = _readWordTree.READ_WORD_TREE[treePos]; + if (keywordValue > -1 && !_identifier.IS_IDENTIFIER_CHAR[code]) { + _base.state.pos = pos; + if (keywordValue & 1) { + _index.finishToken.call(void 0, keywordValue >>> 1); + } else { + _index.finishToken.call(void 0, _types.TokenType.name, keywordValue >>> 1); + } + return; + } + + while (pos < _base.input.length) { + const ch = _base.input.charCodeAt(pos); + if (_identifier.IS_IDENTIFIER_CHAR[ch]) { + pos++; + } else if (ch === _charcodes.charCodes.backslash) { + // \u + pos += 2; + if (_base.input.charCodeAt(pos) === _charcodes.charCodes.leftCurlyBrace) { + while (pos < _base.input.length && _base.input.charCodeAt(pos) !== _charcodes.charCodes.rightCurlyBrace) { + pos++; + } + pos++; + } + } else if (ch === _charcodes.charCodes.atSign && _base.input.charCodeAt(pos + 1) === _charcodes.charCodes.atSign) { + pos += 2; + } else { + break; + } + } + _base.state.pos = pos; + _index.finishToken.call(void 0, _types.TokenType.name); +} exports.default = readWord; diff --git a/node_modules/sucrase/dist/parser/tokenizer/readWordTree.js b/node_modules/sucrase/dist/parser/tokenizer/readWordTree.js new file mode 100644 index 0000000..fcc7733 --- /dev/null +++ b/node_modules/sucrase/dist/parser/tokenizer/readWordTree.js @@ -0,0 +1,671 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Generated file, do not edit! Run "yarn generate" to re-generate this file. +var _keywords = require('./keywords'); +var _types = require('./types'); + +// prettier-ignore + const READ_WORD_TREE = new Int32Array([ + // "" + -1, 27, 783, 918, 1755, 2376, 2862, 3483, -1, 3699, -1, 4617, 4752, 4833, 5130, 5508, 5940, -1, 6480, 6939, 7749, 8181, 8451, 8613, -1, 8829, -1, + // "a" + -1, -1, 54, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, -1, -1, -1, 675, -1, -1, -1, + // "ab" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, + // "abs" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, + // "abst" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, -1, -1, + // "abstr" + -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "abstra" + -1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "abstrac" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1, + // "abstract" + _keywords.ContextualKeyword._abstract << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ac" + -1, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "acc" + -1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "acce" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, + // "acces" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1, + // "access" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "accesso" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1, + // "accessor" + _keywords.ContextualKeyword._accessor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "as" + _keywords.ContextualKeyword._as << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, 594, -1, + // "ass" + -1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "asse" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, + // "asser" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, -1, + // "assert" + _keywords.ContextualKeyword._assert << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, -1, -1, -1, -1, -1, -1, -1, + // "asserts" + _keywords.ContextualKeyword._asserts << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "asy" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "asyn" + -1, -1, -1, 648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "async" + _keywords.ContextualKeyword._async << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "aw" + -1, 702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "awa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "awai" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1, + // "await" + _keywords.ContextualKeyword._await << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "b" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, -1, -1, + // "br" + -1, -1, -1, -1, -1, 837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "bre" + -1, 864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "brea" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "break" + (_types.TokenType._break << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "c" + -1, 945, -1, -1, -1, -1, -1, -1, 1107, -1, -1, -1, 1242, -1, -1, 1350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ca" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 972, 1026, -1, -1, -1, -1, -1, -1, + // "cas" + -1, -1, -1, -1, -1, 999, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "case" + (_types.TokenType._case << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cat" + -1, -1, -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "catc" + -1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "catch" + (_types.TokenType._catch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ch" + -1, -1, -1, -1, -1, 1134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "che" + -1, -1, -1, 1161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "chec" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "check" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1215, -1, -1, -1, -1, -1, -1, -1, + // "checks" + _keywords.ContextualKeyword._checks << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cl" + -1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cla" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1296, -1, -1, -1, -1, -1, -1, -1, + // "clas" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1323, -1, -1, -1, -1, -1, -1, -1, + // "class" + (_types.TokenType._class << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "co" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "con" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, 1620, -1, -1, -1, -1, -1, -1, + // "cons" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1431, -1, -1, -1, -1, -1, -1, + // "const" + (_types.TokenType._const << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1458, -1, -1, -1, -1, -1, -1, -1, -1, + // "constr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, -1, -1, -1, -1, + // "constru" + -1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "construc" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1539, -1, -1, -1, -1, -1, -1, + // "construct" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "constructo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, -1, -1, -1, -1, -1, -1, -1, -1, + // "constructor" + _keywords.ContextualKeyword._constructor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "cont" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "conti" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1674, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "contin" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1701, -1, -1, -1, -1, -1, + // "continu" + -1, -1, -1, -1, -1, 1728, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "continue" + (_types.TokenType._continue << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "d" + -1, -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "de" + -1, -1, 1809, 1971, -1, -1, 2106, -1, -1, -1, -1, -1, 2241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "deb" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, -1, -1, + // "debu" + -1, -1, -1, -1, -1, -1, -1, 1863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "debug" + -1, -1, -1, -1, -1, -1, -1, 1890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "debugg" + -1, -1, -1, -1, -1, 1917, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "debugge" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, -1, -1, + // "debugger" + (_types.TokenType._debugger << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "dec" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "decl" + -1, 2025, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "decla" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2052, -1, -1, -1, -1, -1, -1, -1, -1, + // "declar" + -1, -1, -1, -1, -1, 2079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "declare" + _keywords.ContextualKeyword._declare << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "def" + -1, 2133, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "defa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2160, -1, -1, -1, -1, -1, + // "defau" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "defaul" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, -1, -1, -1, -1, + // "default" + (_types.TokenType._default << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "del" + -1, -1, -1, -1, -1, 2268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "dele" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1, + // "delet" + -1, -1, -1, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "delete" + (_types.TokenType._delete << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "do" + (_types.TokenType._do << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "e" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2403, -1, 2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2565, -1, -1, + // "el" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2430, -1, -1, -1, -1, -1, -1, -1, + // "els" + -1, -1, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "else" + (_types.TokenType._else << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "en" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2511, -1, -1, -1, -1, -1, + // "enu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "enum" + _keywords.ContextualKeyword._enum << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ex" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, 2727, -1, -1, -1, -1, -1, -1, + // "exp" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2619, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "expo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2646, -1, -1, -1, -1, -1, -1, -1, -1, + // "expor" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2673, -1, -1, -1, -1, -1, -1, + // "export" + (_types.TokenType._export << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2700, -1, -1, -1, -1, -1, -1, -1, + // "exports" + _keywords.ContextualKeyword._exports << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ext" + -1, -1, -1, -1, -1, 2754, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "exte" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "exten" + -1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "extend" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2835, -1, -1, -1, -1, -1, -1, -1, + // "extends" + (_types.TokenType._extends << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "f" + -1, 2889, -1, -1, -1, -1, -1, -1, -1, 2997, -1, -1, -1, -1, -1, 3159, -1, -1, 3213, -1, -1, 3294, -1, -1, -1, -1, -1, + // "fa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fal" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2943, -1, -1, -1, -1, -1, -1, -1, + // "fals" + -1, -1, -1, -1, -1, 2970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "false" + (_types.TokenType._false << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fin" + -1, 3051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fina" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "final" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "finall" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1, + // "finally" + (_types.TokenType._finally << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3186, -1, -1, -1, -1, -1, -1, -1, -1, + // "for" + (_types.TokenType._for << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fro" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "from" + _keywords.ContextualKeyword._from << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "fun" + -1, -1, -1, 3348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "func" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3375, -1, -1, -1, -1, -1, -1, + // "funct" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "functi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "functio" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "function" + (_types.TokenType._function << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "g" + -1, -1, -1, -1, -1, 3510, -1, -1, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ge" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3537, -1, -1, -1, -1, -1, -1, + // "get" + _keywords.ContextualKeyword._get << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "gl" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "glo" + -1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "glob" + -1, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "globa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "global" + _keywords.ContextualKeyword._global << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "i" + -1, -1, -1, -1, -1, -1, 3726, -1, -1, -1, -1, -1, -1, 3753, 4077, -1, -1, -1, -1, 4590, -1, -1, -1, -1, -1, -1, -1, + // "if" + (_types.TokenType._if << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "im" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "imp" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3807, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "impl" + -1, -1, -1, -1, -1, 3834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "imple" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "implem" + -1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "impleme" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "implemen" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, -1, -1, + // "implement" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3969, -1, -1, -1, -1, -1, -1, -1, + // "implements" + _keywords.ContextualKeyword._implements << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "impo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, -1, -1, -1, -1, -1, + // "impor" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4050, -1, -1, -1, -1, -1, -1, + // "import" + (_types.TokenType._import << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "in" + (_types.TokenType._in << 1) + 1, -1, -1, -1, -1, -1, 4104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, 4401, -1, -1, -1, -1, -1, -1, + // "inf" + -1, -1, -1, -1, -1, 4131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "infe" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, + // "infer" + _keywords.ContextualKeyword._infer << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ins" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, -1, + // "inst" + -1, 4239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "insta" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instan" + -1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instanc" + -1, -1, -1, -1, -1, 4320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instance" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instanceo" + -1, -1, -1, -1, -1, -1, 4374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "instanceof" + (_types.TokenType._instanceof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "int" + -1, -1, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "inte" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4455, -1, -1, -1, -1, -1, -1, -1, -1, + // "inter" + -1, -1, -1, -1, -1, -1, 4482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interf" + -1, 4509, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interfa" + -1, -1, -1, 4536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interfac" + -1, -1, -1, -1, -1, 4563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "interface" + _keywords.ContextualKeyword._interface << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "is" + _keywords.ContextualKeyword._is << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "k" + -1, -1, -1, -1, -1, 4644, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ke" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4671, -1, + // "key" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "keyo" + -1, -1, -1, -1, -1, -1, 4725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "keyof" + _keywords.ContextualKeyword._keyof << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "l" + -1, -1, -1, -1, -1, 4779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "le" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4806, -1, -1, -1, -1, -1, -1, + // "let" + (_types.TokenType._let << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "m" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4860, -1, -1, -1, -1, -1, 4995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4887, -1, -1, + // "mix" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mixi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mixin" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, + // "mixins" + _keywords.ContextualKeyword._mixins << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mo" + -1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "mod" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, -1, -1, -1, + // "modu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "modul" + -1, -1, -1, -1, -1, 5103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "module" + _keywords.ContextualKeyword._module << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "n" + -1, 5157, -1, -1, -1, 5373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1, + // "na" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "nam" + -1, -1, -1, -1, -1, 5211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "name" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1, + // "names" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namesp" + -1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namespa" + -1, -1, -1, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namespac" + -1, -1, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "namespace" + _keywords.ContextualKeyword._namespace << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ne" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5400, -1, -1, -1, + // "new" + (_types.TokenType._new << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "nu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "nul" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "null" + (_types.TokenType._null << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "o" + -1, -1, -1, -1, -1, -1, 5535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5562, -1, -1, -1, -1, 5697, 5751, -1, -1, -1, -1, + // "of" + _keywords.ContextualKeyword._of << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "op" + -1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "opa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5616, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "opaq" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5643, -1, -1, -1, -1, -1, + // "opaqu" + -1, -1, -1, -1, -1, 5670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "opaque" + _keywords.ContextualKeyword._opaque << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ou" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5724, -1, -1, -1, -1, -1, -1, + // "out" + _keywords.ContextualKeyword._out << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ov" + -1, -1, -1, -1, -1, 5778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ove" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5805, -1, -1, -1, -1, -1, -1, -1, -1, + // "over" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1, + // "overr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "overri" + -1, -1, -1, -1, 5886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "overrid" + -1, -1, -1, -1, -1, 5913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "override" + _keywords.ContextualKeyword._override << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "p" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5967, -1, -1, 6345, -1, -1, -1, -1, -1, + // "pr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, -1, -1, -1, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pri" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6021, -1, -1, -1, -1, + // "priv" + -1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "priva" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, -1, -1, -1, -1, -1, -1, + // "privat" + -1, -1, -1, -1, -1, 6102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "private" + _keywords.ContextualKeyword._private << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pro" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6156, -1, -1, -1, -1, -1, -1, + // "prot" + -1, -1, -1, -1, -1, 6183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "prote" + -1, -1, -1, 6210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "protec" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, -1, -1, -1, -1, + // "protect" + -1, -1, -1, -1, -1, 6264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "protecte" + -1, -1, -1, -1, 6291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "protected" + _keywords.ContextualKeyword._protected << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "proto" + _keywords.ContextualKeyword._proto << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pu" + -1, -1, 6372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "pub" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "publ" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 6426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "publi" + -1, -1, -1, 6453, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "public" + _keywords.ContextualKeyword._public << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "r" + -1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "re" + -1, 6534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6696, -1, -1, 6831, -1, -1, -1, -1, -1, -1, + // "rea" + -1, -1, -1, -1, 6561, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "read" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "reado" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "readon" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "readonl" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6669, -1, + // "readonly" + _keywords.ContextualKeyword._readonly << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "req" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6723, -1, -1, -1, -1, -1, + // "requ" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 6750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "requi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6777, -1, -1, -1, -1, -1, -1, -1, -1, + // "requir" + -1, -1, -1, -1, -1, 6804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "require" + _keywords.ContextualKeyword._require << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ret" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6858, -1, -1, -1, -1, -1, + // "retu" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6885, -1, -1, -1, -1, -1, -1, -1, -1, + // "retur" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "return" + (_types.TokenType._return << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "s" + -1, 6966, -1, -1, -1, 7182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7236, 7371, -1, 7479, -1, 7614, -1, + // "sa" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6993, -1, -1, -1, -1, -1, -1, + // "sat" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sati" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7047, -1, -1, -1, -1, -1, -1, -1, + // "satis" + -1, -1, -1, -1, -1, -1, 7074, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "satisf" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "satisfi" + -1, -1, -1, -1, -1, 7128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "satisfie" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7155, -1, -1, -1, -1, -1, -1, -1, + // "satisfies" + _keywords.ContextualKeyword._satisfies << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "se" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7209, -1, -1, -1, -1, -1, -1, + // "set" + _keywords.ContextualKeyword._set << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "st" + -1, 7263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sta" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7290, -1, -1, -1, -1, -1, -1, + // "stat" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "stati" + -1, -1, -1, 7344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "static" + _keywords.ContextualKeyword._static << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "su" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7398, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sup" + -1, -1, -1, -1, -1, 7425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "supe" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7452, -1, -1, -1, -1, -1, -1, -1, -1, + // "super" + (_types.TokenType._super << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sw" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7506, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "swi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7533, -1, -1, -1, -1, -1, -1, + // "swit" + -1, -1, -1, 7560, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "switc" + -1, -1, -1, -1, -1, -1, -1, -1, 7587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "switch" + (_types.TokenType._switch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sy" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "sym" + -1, -1, 7668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "symb" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "symbo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "symbol" + _keywords.ContextualKeyword._symbol << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "t" + -1, -1, -1, -1, -1, -1, -1, -1, 7776, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7938, -1, -1, -1, -1, -1, -1, 8046, -1, + // "th" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7803, -1, -1, -1, -1, -1, -1, -1, -1, 7857, -1, -1, -1, -1, -1, -1, -1, -1, + // "thi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7830, -1, -1, -1, -1, -1, -1, -1, + // "this" + (_types.TokenType._this << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "thr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "thro" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7911, -1, -1, -1, + // "throw" + (_types.TokenType._throw << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "tr" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7965, -1, -1, -1, 8019, -1, + // "tru" + -1, -1, -1, -1, -1, 7992, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "true" + (_types.TokenType._true << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "try" + (_types.TokenType._try << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "ty" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "typ" + -1, -1, -1, -1, -1, 8100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "type" + _keywords.ContextualKeyword._type << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "typeo" + -1, -1, -1, -1, -1, -1, 8154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "typeof" + (_types.TokenType._typeof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "u" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8208, -1, -1, -1, -1, 8343, -1, -1, -1, -1, -1, -1, -1, + // "un" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "uni" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8262, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "uniq" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8289, -1, -1, -1, -1, -1, + // "uniqu" + -1, -1, -1, -1, -1, 8316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "unique" + _keywords.ContextualKeyword._unique << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "us" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "usi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "usin" + -1, -1, -1, -1, -1, -1, -1, 8424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "using" + _keywords.ContextualKeyword._using << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "v" + -1, 8478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "va" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8505, -1, -1, -1, -1, -1, -1, -1, -1, + // "var" + (_types.TokenType._var << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "vo" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "voi" + -1, -1, -1, -1, 8586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "void" + (_types.TokenType._void << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "w" + -1, -1, -1, -1, -1, -1, -1, -1, 8640, 8748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "wh" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "whi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "whil" + -1, -1, -1, -1, -1, 8721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "while" + (_types.TokenType._while << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "wi" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8775, -1, -1, -1, -1, -1, -1, + // "wit" + -1, -1, -1, -1, -1, -1, -1, -1, 8802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "with" + (_types.TokenType._with << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "y" + -1, -1, -1, -1, -1, -1, -1, -1, -1, 8856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yi" + -1, -1, -1, -1, -1, 8883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yie" + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yiel" + -1, -1, -1, -1, 8937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + // "yield" + (_types.TokenType._yield << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +]); exports.READ_WORD_TREE = READ_WORD_TREE; diff --git a/node_modules/sucrase/dist/parser/tokenizer/state.js b/node_modules/sucrase/dist/parser/tokenizer/state.js new file mode 100644 index 0000000..359e1b4 --- /dev/null +++ b/node_modules/sucrase/dist/parser/tokenizer/state.js @@ -0,0 +1,106 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); +var _keywords = require('./keywords'); +var _types = require('./types'); + + class Scope { + + + + + constructor(startTokenIndex, endTokenIndex, isFunctionScope) { + this.startTokenIndex = startTokenIndex; + this.endTokenIndex = endTokenIndex; + this.isFunctionScope = isFunctionScope; + } +} exports.Scope = Scope; + + class StateSnapshot { + constructor( + potentialArrowAt, + noAnonFunctionType, + inDisallowConditionalTypesContext, + tokensLength, + scopesLength, + pos, + type, + contextualKeyword, + start, + end, + isType, + scopeDepth, + error, + ) {;this.potentialArrowAt = potentialArrowAt;this.noAnonFunctionType = noAnonFunctionType;this.inDisallowConditionalTypesContext = inDisallowConditionalTypesContext;this.tokensLength = tokensLength;this.scopesLength = scopesLength;this.pos = pos;this.type = type;this.contextualKeyword = contextualKeyword;this.start = start;this.end = end;this.isType = isType;this.scopeDepth = scopeDepth;this.error = error;} +} exports.StateSnapshot = StateSnapshot; + + class State {constructor() { State.prototype.__init.call(this);State.prototype.__init2.call(this);State.prototype.__init3.call(this);State.prototype.__init4.call(this);State.prototype.__init5.call(this);State.prototype.__init6.call(this);State.prototype.__init7.call(this);State.prototype.__init8.call(this);State.prototype.__init9.call(this);State.prototype.__init10.call(this);State.prototype.__init11.call(this);State.prototype.__init12.call(this);State.prototype.__init13.call(this); } + // Used to signify the start of a potential arrow function + __init() {this.potentialArrowAt = -1} + + // Used by Flow to handle an edge case involving function type parsing. + __init2() {this.noAnonFunctionType = false} + + // Used by TypeScript to handle ambiguities when parsing conditional types. + __init3() {this.inDisallowConditionalTypesContext = false} + + // Token store. + __init4() {this.tokens = []} + + // Array of all observed scopes, ordered by their ending position. + __init5() {this.scopes = []} + + // The current position of the tokenizer in the input. + __init6() {this.pos = 0} + + // Information about the current token. + __init7() {this.type = _types.TokenType.eof} + __init8() {this.contextualKeyword = _keywords.ContextualKeyword.NONE} + __init9() {this.start = 0} + __init10() {this.end = 0} + + __init11() {this.isType = false} + __init12() {this.scopeDepth = 0} + + /** + * If the parser is in an error state, then the token is always tt.eof and all functions can + * keep executing but should be written so they don't get into an infinite loop in this situation. + * + * This approach, combined with the ability to snapshot and restore state, allows us to implement + * backtracking without exceptions and without needing to explicitly propagate error states + * everywhere. + */ + __init13() {this.error = null} + + snapshot() { + return new StateSnapshot( + this.potentialArrowAt, + this.noAnonFunctionType, + this.inDisallowConditionalTypesContext, + this.tokens.length, + this.scopes.length, + this.pos, + this.type, + this.contextualKeyword, + this.start, + this.end, + this.isType, + this.scopeDepth, + this.error, + ); + } + + restoreFromSnapshot(snapshot) { + this.potentialArrowAt = snapshot.potentialArrowAt; + this.noAnonFunctionType = snapshot.noAnonFunctionType; + this.inDisallowConditionalTypesContext = snapshot.inDisallowConditionalTypesContext; + this.tokens.length = snapshot.tokensLength; + this.scopes.length = snapshot.scopesLength; + this.pos = snapshot.pos; + this.type = snapshot.type; + this.contextualKeyword = snapshot.contextualKeyword; + this.start = snapshot.start; + this.end = snapshot.end; + this.isType = snapshot.isType; + this.scopeDepth = snapshot.scopeDepth; + this.error = snapshot.error; + } +} exports.default = State; diff --git a/node_modules/sucrase/dist/parser/tokenizer/types.js b/node_modules/sucrase/dist/parser/tokenizer/types.js new file mode 100644 index 0000000..c1f2a81 --- /dev/null +++ b/node_modules/sucrase/dist/parser/tokenizer/types.js @@ -0,0 +1,361 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Generated file, do not edit! Run "yarn generate" to re-generate this file. +/* istanbul ignore file */ +/** + * Enum of all token types, with bit fields to signify meaningful properties. + */ +var TokenType; (function (TokenType) { + // Precedence 0 means not an operator; otherwise it is a positive number up to 12. + const PRECEDENCE_MASK = 0xf; TokenType[TokenType["PRECEDENCE_MASK"] = PRECEDENCE_MASK] = "PRECEDENCE_MASK"; + const IS_KEYWORD = 1 << 4; TokenType[TokenType["IS_KEYWORD"] = IS_KEYWORD] = "IS_KEYWORD"; + const IS_ASSIGN = 1 << 5; TokenType[TokenType["IS_ASSIGN"] = IS_ASSIGN] = "IS_ASSIGN"; + const IS_RIGHT_ASSOCIATIVE = 1 << 6; TokenType[TokenType["IS_RIGHT_ASSOCIATIVE"] = IS_RIGHT_ASSOCIATIVE] = "IS_RIGHT_ASSOCIATIVE"; + const IS_PREFIX = 1 << 7; TokenType[TokenType["IS_PREFIX"] = IS_PREFIX] = "IS_PREFIX"; + const IS_POSTFIX = 1 << 8; TokenType[TokenType["IS_POSTFIX"] = IS_POSTFIX] = "IS_POSTFIX"; + const IS_EXPRESSION_START = 1 << 9; TokenType[TokenType["IS_EXPRESSION_START"] = IS_EXPRESSION_START] = "IS_EXPRESSION_START"; + + const num = 512; TokenType[TokenType["num"] = num] = "num"; // num startsExpr + const bigint = 1536; TokenType[TokenType["bigint"] = bigint] = "bigint"; // bigint startsExpr + const decimal = 2560; TokenType[TokenType["decimal"] = decimal] = "decimal"; // decimal startsExpr + const regexp = 3584; TokenType[TokenType["regexp"] = regexp] = "regexp"; // regexp startsExpr + const string = 4608; TokenType[TokenType["string"] = string] = "string"; // string startsExpr + const name = 5632; TokenType[TokenType["name"] = name] = "name"; // name startsExpr + const eof = 6144; TokenType[TokenType["eof"] = eof] = "eof"; // eof + const bracketL = 7680; TokenType[TokenType["bracketL"] = bracketL] = "bracketL"; // [ startsExpr + const bracketR = 8192; TokenType[TokenType["bracketR"] = bracketR] = "bracketR"; // ] + const braceL = 9728; TokenType[TokenType["braceL"] = braceL] = "braceL"; // { startsExpr + const braceBarL = 10752; TokenType[TokenType["braceBarL"] = braceBarL] = "braceBarL"; // {| startsExpr + const braceR = 11264; TokenType[TokenType["braceR"] = braceR] = "braceR"; // } + const braceBarR = 12288; TokenType[TokenType["braceBarR"] = braceBarR] = "braceBarR"; // |} + const parenL = 13824; TokenType[TokenType["parenL"] = parenL] = "parenL"; // ( startsExpr + const parenR = 14336; TokenType[TokenType["parenR"] = parenR] = "parenR"; // ) + const comma = 15360; TokenType[TokenType["comma"] = comma] = "comma"; // , + const semi = 16384; TokenType[TokenType["semi"] = semi] = "semi"; // ; + const colon = 17408; TokenType[TokenType["colon"] = colon] = "colon"; // : + const doubleColon = 18432; TokenType[TokenType["doubleColon"] = doubleColon] = "doubleColon"; // :: + const dot = 19456; TokenType[TokenType["dot"] = dot] = "dot"; // . + const question = 20480; TokenType[TokenType["question"] = question] = "question"; // ? + const questionDot = 21504; TokenType[TokenType["questionDot"] = questionDot] = "questionDot"; // ?. + const arrow = 22528; TokenType[TokenType["arrow"] = arrow] = "arrow"; // => + const template = 23552; TokenType[TokenType["template"] = template] = "template"; // template + const ellipsis = 24576; TokenType[TokenType["ellipsis"] = ellipsis] = "ellipsis"; // ... + const backQuote = 25600; TokenType[TokenType["backQuote"] = backQuote] = "backQuote"; // ` + const dollarBraceL = 27136; TokenType[TokenType["dollarBraceL"] = dollarBraceL] = "dollarBraceL"; // ${ startsExpr + const at = 27648; TokenType[TokenType["at"] = at] = "at"; // @ + const hash = 29184; TokenType[TokenType["hash"] = hash] = "hash"; // # startsExpr + const eq = 29728; TokenType[TokenType["eq"] = eq] = "eq"; // = isAssign + const assign = 30752; TokenType[TokenType["assign"] = assign] = "assign"; // _= isAssign + const preIncDec = 32640; TokenType[TokenType["preIncDec"] = preIncDec] = "preIncDec"; // ++/-- prefix postfix startsExpr + const postIncDec = 33664; TokenType[TokenType["postIncDec"] = postIncDec] = "postIncDec"; // ++/-- prefix postfix startsExpr + const bang = 34432; TokenType[TokenType["bang"] = bang] = "bang"; // ! prefix startsExpr + const tilde = 35456; TokenType[TokenType["tilde"] = tilde] = "tilde"; // ~ prefix startsExpr + const pipeline = 35841; TokenType[TokenType["pipeline"] = pipeline] = "pipeline"; // |> prec:1 + const nullishCoalescing = 36866; TokenType[TokenType["nullishCoalescing"] = nullishCoalescing] = "nullishCoalescing"; // ?? prec:2 + const logicalOR = 37890; TokenType[TokenType["logicalOR"] = logicalOR] = "logicalOR"; // || prec:2 + const logicalAND = 38915; TokenType[TokenType["logicalAND"] = logicalAND] = "logicalAND"; // && prec:3 + const bitwiseOR = 39940; TokenType[TokenType["bitwiseOR"] = bitwiseOR] = "bitwiseOR"; // | prec:4 + const bitwiseXOR = 40965; TokenType[TokenType["bitwiseXOR"] = bitwiseXOR] = "bitwiseXOR"; // ^ prec:5 + const bitwiseAND = 41990; TokenType[TokenType["bitwiseAND"] = bitwiseAND] = "bitwiseAND"; // & prec:6 + const equality = 43015; TokenType[TokenType["equality"] = equality] = "equality"; // ==/!= prec:7 + const lessThan = 44040; TokenType[TokenType["lessThan"] = lessThan] = "lessThan"; // < prec:8 + const greaterThan = 45064; TokenType[TokenType["greaterThan"] = greaterThan] = "greaterThan"; // > prec:8 + const relationalOrEqual = 46088; TokenType[TokenType["relationalOrEqual"] = relationalOrEqual] = "relationalOrEqual"; // <=/>= prec:8 + const bitShiftL = 47113; TokenType[TokenType["bitShiftL"] = bitShiftL] = "bitShiftL"; // << prec:9 + const bitShiftR = 48137; TokenType[TokenType["bitShiftR"] = bitShiftR] = "bitShiftR"; // >>/>>> prec:9 + const plus = 49802; TokenType[TokenType["plus"] = plus] = "plus"; // + prec:10 prefix startsExpr + const minus = 50826; TokenType[TokenType["minus"] = minus] = "minus"; // - prec:10 prefix startsExpr + const modulo = 51723; TokenType[TokenType["modulo"] = modulo] = "modulo"; // % prec:11 startsExpr + const star = 52235; TokenType[TokenType["star"] = star] = "star"; // * prec:11 + const slash = 53259; TokenType[TokenType["slash"] = slash] = "slash"; // / prec:11 + const exponent = 54348; TokenType[TokenType["exponent"] = exponent] = "exponent"; // ** prec:12 rightAssociative + const jsxName = 55296; TokenType[TokenType["jsxName"] = jsxName] = "jsxName"; // jsxName + const jsxText = 56320; TokenType[TokenType["jsxText"] = jsxText] = "jsxText"; // jsxText + const jsxEmptyText = 57344; TokenType[TokenType["jsxEmptyText"] = jsxEmptyText] = "jsxEmptyText"; // jsxEmptyText + const jsxTagStart = 58880; TokenType[TokenType["jsxTagStart"] = jsxTagStart] = "jsxTagStart"; // jsxTagStart startsExpr + const jsxTagEnd = 59392; TokenType[TokenType["jsxTagEnd"] = jsxTagEnd] = "jsxTagEnd"; // jsxTagEnd + const typeParameterStart = 60928; TokenType[TokenType["typeParameterStart"] = typeParameterStart] = "typeParameterStart"; // typeParameterStart startsExpr + const nonNullAssertion = 61440; TokenType[TokenType["nonNullAssertion"] = nonNullAssertion] = "nonNullAssertion"; // nonNullAssertion + const _break = 62480; TokenType[TokenType["_break"] = _break] = "_break"; // break keyword + const _case = 63504; TokenType[TokenType["_case"] = _case] = "_case"; // case keyword + const _catch = 64528; TokenType[TokenType["_catch"] = _catch] = "_catch"; // catch keyword + const _continue = 65552; TokenType[TokenType["_continue"] = _continue] = "_continue"; // continue keyword + const _debugger = 66576; TokenType[TokenType["_debugger"] = _debugger] = "_debugger"; // debugger keyword + const _default = 67600; TokenType[TokenType["_default"] = _default] = "_default"; // default keyword + const _do = 68624; TokenType[TokenType["_do"] = _do] = "_do"; // do keyword + const _else = 69648; TokenType[TokenType["_else"] = _else] = "_else"; // else keyword + const _finally = 70672; TokenType[TokenType["_finally"] = _finally] = "_finally"; // finally keyword + const _for = 71696; TokenType[TokenType["_for"] = _for] = "_for"; // for keyword + const _function = 73232; TokenType[TokenType["_function"] = _function] = "_function"; // function keyword startsExpr + const _if = 73744; TokenType[TokenType["_if"] = _if] = "_if"; // if keyword + const _return = 74768; TokenType[TokenType["_return"] = _return] = "_return"; // return keyword + const _switch = 75792; TokenType[TokenType["_switch"] = _switch] = "_switch"; // switch keyword + const _throw = 77456; TokenType[TokenType["_throw"] = _throw] = "_throw"; // throw keyword prefix startsExpr + const _try = 77840; TokenType[TokenType["_try"] = _try] = "_try"; // try keyword + const _var = 78864; TokenType[TokenType["_var"] = _var] = "_var"; // var keyword + const _let = 79888; TokenType[TokenType["_let"] = _let] = "_let"; // let keyword + const _const = 80912; TokenType[TokenType["_const"] = _const] = "_const"; // const keyword + const _while = 81936; TokenType[TokenType["_while"] = _while] = "_while"; // while keyword + const _with = 82960; TokenType[TokenType["_with"] = _with] = "_with"; // with keyword + const _new = 84496; TokenType[TokenType["_new"] = _new] = "_new"; // new keyword startsExpr + const _this = 85520; TokenType[TokenType["_this"] = _this] = "_this"; // this keyword startsExpr + const _super = 86544; TokenType[TokenType["_super"] = _super] = "_super"; // super keyword startsExpr + const _class = 87568; TokenType[TokenType["_class"] = _class] = "_class"; // class keyword startsExpr + const _extends = 88080; TokenType[TokenType["_extends"] = _extends] = "_extends"; // extends keyword + const _export = 89104; TokenType[TokenType["_export"] = _export] = "_export"; // export keyword + const _import = 90640; TokenType[TokenType["_import"] = _import] = "_import"; // import keyword startsExpr + const _yield = 91664; TokenType[TokenType["_yield"] = _yield] = "_yield"; // yield keyword startsExpr + const _null = 92688; TokenType[TokenType["_null"] = _null] = "_null"; // null keyword startsExpr + const _true = 93712; TokenType[TokenType["_true"] = _true] = "_true"; // true keyword startsExpr + const _false = 94736; TokenType[TokenType["_false"] = _false] = "_false"; // false keyword startsExpr + const _in = 95256; TokenType[TokenType["_in"] = _in] = "_in"; // in prec:8 keyword + const _instanceof = 96280; TokenType[TokenType["_instanceof"] = _instanceof] = "_instanceof"; // instanceof prec:8 keyword + const _typeof = 97936; TokenType[TokenType["_typeof"] = _typeof] = "_typeof"; // typeof keyword prefix startsExpr + const _void = 98960; TokenType[TokenType["_void"] = _void] = "_void"; // void keyword prefix startsExpr + const _delete = 99984; TokenType[TokenType["_delete"] = _delete] = "_delete"; // delete keyword prefix startsExpr + const _async = 100880; TokenType[TokenType["_async"] = _async] = "_async"; // async keyword startsExpr + const _get = 101904; TokenType[TokenType["_get"] = _get] = "_get"; // get keyword startsExpr + const _set = 102928; TokenType[TokenType["_set"] = _set] = "_set"; // set keyword startsExpr + const _declare = 103952; TokenType[TokenType["_declare"] = _declare] = "_declare"; // declare keyword startsExpr + const _readonly = 104976; TokenType[TokenType["_readonly"] = _readonly] = "_readonly"; // readonly keyword startsExpr + const _abstract = 106000; TokenType[TokenType["_abstract"] = _abstract] = "_abstract"; // abstract keyword startsExpr + const _static = 107024; TokenType[TokenType["_static"] = _static] = "_static"; // static keyword startsExpr + const _public = 107536; TokenType[TokenType["_public"] = _public] = "_public"; // public keyword + const _private = 108560; TokenType[TokenType["_private"] = _private] = "_private"; // private keyword + const _protected = 109584; TokenType[TokenType["_protected"] = _protected] = "_protected"; // protected keyword + const _override = 110608; TokenType[TokenType["_override"] = _override] = "_override"; // override keyword + const _as = 112144; TokenType[TokenType["_as"] = _as] = "_as"; // as keyword startsExpr + const _enum = 113168; TokenType[TokenType["_enum"] = _enum] = "_enum"; // enum keyword startsExpr + const _type = 114192; TokenType[TokenType["_type"] = _type] = "_type"; // type keyword startsExpr + const _implements = 115216; TokenType[TokenType["_implements"] = _implements] = "_implements"; // implements keyword startsExpr +})(TokenType || (exports.TokenType = TokenType = {})); + function formatTokenType(tokenType) { + switch (tokenType) { + case TokenType.num: + return "num"; + case TokenType.bigint: + return "bigint"; + case TokenType.decimal: + return "decimal"; + case TokenType.regexp: + return "regexp"; + case TokenType.string: + return "string"; + case TokenType.name: + return "name"; + case TokenType.eof: + return "eof"; + case TokenType.bracketL: + return "["; + case TokenType.bracketR: + return "]"; + case TokenType.braceL: + return "{"; + case TokenType.braceBarL: + return "{|"; + case TokenType.braceR: + return "}"; + case TokenType.braceBarR: + return "|}"; + case TokenType.parenL: + return "("; + case TokenType.parenR: + return ")"; + case TokenType.comma: + return ","; + case TokenType.semi: + return ";"; + case TokenType.colon: + return ":"; + case TokenType.doubleColon: + return "::"; + case TokenType.dot: + return "."; + case TokenType.question: + return "?"; + case TokenType.questionDot: + return "?."; + case TokenType.arrow: + return "=>"; + case TokenType.template: + return "template"; + case TokenType.ellipsis: + return "..."; + case TokenType.backQuote: + return "`"; + case TokenType.dollarBraceL: + return "${"; + case TokenType.at: + return "@"; + case TokenType.hash: + return "#"; + case TokenType.eq: + return "="; + case TokenType.assign: + return "_="; + case TokenType.preIncDec: + return "++/--"; + case TokenType.postIncDec: + return "++/--"; + case TokenType.bang: + return "!"; + case TokenType.tilde: + return "~"; + case TokenType.pipeline: + return "|>"; + case TokenType.nullishCoalescing: + return "??"; + case TokenType.logicalOR: + return "||"; + case TokenType.logicalAND: + return "&&"; + case TokenType.bitwiseOR: + return "|"; + case TokenType.bitwiseXOR: + return "^"; + case TokenType.bitwiseAND: + return "&"; + case TokenType.equality: + return "==/!="; + case TokenType.lessThan: + return "<"; + case TokenType.greaterThan: + return ">"; + case TokenType.relationalOrEqual: + return "<=/>="; + case TokenType.bitShiftL: + return "<<"; + case TokenType.bitShiftR: + return ">>/>>>"; + case TokenType.plus: + return "+"; + case TokenType.minus: + return "-"; + case TokenType.modulo: + return "%"; + case TokenType.star: + return "*"; + case TokenType.slash: + return "/"; + case TokenType.exponent: + return "**"; + case TokenType.jsxName: + return "jsxName"; + case TokenType.jsxText: + return "jsxText"; + case TokenType.jsxEmptyText: + return "jsxEmptyText"; + case TokenType.jsxTagStart: + return "jsxTagStart"; + case TokenType.jsxTagEnd: + return "jsxTagEnd"; + case TokenType.typeParameterStart: + return "typeParameterStart"; + case TokenType.nonNullAssertion: + return "nonNullAssertion"; + case TokenType._break: + return "break"; + case TokenType._case: + return "case"; + case TokenType._catch: + return "catch"; + case TokenType._continue: + return "continue"; + case TokenType._debugger: + return "debugger"; + case TokenType._default: + return "default"; + case TokenType._do: + return "do"; + case TokenType._else: + return "else"; + case TokenType._finally: + return "finally"; + case TokenType._for: + return "for"; + case TokenType._function: + return "function"; + case TokenType._if: + return "if"; + case TokenType._return: + return "return"; + case TokenType._switch: + return "switch"; + case TokenType._throw: + return "throw"; + case TokenType._try: + return "try"; + case TokenType._var: + return "var"; + case TokenType._let: + return "let"; + case TokenType._const: + return "const"; + case TokenType._while: + return "while"; + case TokenType._with: + return "with"; + case TokenType._new: + return "new"; + case TokenType._this: + return "this"; + case TokenType._super: + return "super"; + case TokenType._class: + return "class"; + case TokenType._extends: + return "extends"; + case TokenType._export: + return "export"; + case TokenType._import: + return "import"; + case TokenType._yield: + return "yield"; + case TokenType._null: + return "null"; + case TokenType._true: + return "true"; + case TokenType._false: + return "false"; + case TokenType._in: + return "in"; + case TokenType._instanceof: + return "instanceof"; + case TokenType._typeof: + return "typeof"; + case TokenType._void: + return "void"; + case TokenType._delete: + return "delete"; + case TokenType._async: + return "async"; + case TokenType._get: + return "get"; + case TokenType._set: + return "set"; + case TokenType._declare: + return "declare"; + case TokenType._readonly: + return "readonly"; + case TokenType._abstract: + return "abstract"; + case TokenType._static: + return "static"; + case TokenType._public: + return "public"; + case TokenType._private: + return "private"; + case TokenType._protected: + return "protected"; + case TokenType._override: + return "override"; + case TokenType._as: + return "as"; + case TokenType._enum: + return "enum"; + case TokenType._type: + return "type"; + case TokenType._implements: + return "implements"; + default: + return ""; + } +} exports.formatTokenType = formatTokenType; diff --git a/node_modules/sucrase/dist/parser/traverser/base.js b/node_modules/sucrase/dist/parser/traverser/base.js new file mode 100644 index 0000000..85c9c17 --- /dev/null +++ b/node_modules/sucrase/dist/parser/traverser/base.js @@ -0,0 +1,60 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _state = require('../tokenizer/state'); var _state2 = _interopRequireDefault(_state); +var _charcodes = require('../util/charcodes'); + + exports.isJSXEnabled; + exports.isTypeScriptEnabled; + exports.isFlowEnabled; + exports.state; + exports.input; + exports.nextContextId; + + function getNextContextId() { + return exports.nextContextId++; +} exports.getNextContextId = getNextContextId; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any + function augmentError(error) { + if ("pos" in error) { + const loc = locationForIndex(error.pos); + error.message += ` (${loc.line}:${loc.column})`; + error.loc = loc; + } + return error; +} exports.augmentError = augmentError; + + class Loc { + + + constructor(line, column) { + this.line = line; + this.column = column; + } +} exports.Loc = Loc; + + function locationForIndex(pos) { + let line = 1; + let column = 1; + for (let i = 0; i < pos; i++) { + if (exports.input.charCodeAt(i) === _charcodes.charCodes.lineFeed) { + line++; + column = 1; + } else { + column++; + } + } + return new Loc(line, column); +} exports.locationForIndex = locationForIndex; + + function initParser( + inputCode, + isJSXEnabledArg, + isTypeScriptEnabledArg, + isFlowEnabledArg, +) { + exports.input = inputCode; + exports.state = new (0, _state2.default)(); + exports.nextContextId = 1; + exports.isJSXEnabled = isJSXEnabledArg; + exports.isTypeScriptEnabled = isTypeScriptEnabledArg; + exports.isFlowEnabled = isFlowEnabledArg; +} exports.initParser = initParser; diff --git a/node_modules/sucrase/dist/parser/traverser/expression.js b/node_modules/sucrase/dist/parser/traverser/expression.js new file mode 100644 index 0000000..d0011e3 --- /dev/null +++ b/node_modules/sucrase/dist/parser/traverser/expression.js @@ -0,0 +1,1022 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* eslint max-len: 0 */ + +// A recursive descent parser operates by defining functions for all +// syntactic elements, and recursively calling those, each function +// advancing the input stream and returning an AST node. Precedence +// of constructs (for example, the fact that `!x[1]` means `!(x[1])` +// instead of `(!x)[1]` is handled by the fact that the parser +// function that parses unary prefix operators is called first, and +// in turn calls the function that parses `[]` subscripts — that +// way, it'll receive the node for `x[1]` already parsed, and wraps +// *that* in the unary operator node. +// +// Acorn uses an [operator precedence parser][opp] to handle binary +// operator precedence, because it is much more compact than using +// the technique outlined above, which uses different, nesting +// functions to specify precedence, for all of the ten binary +// precedence levels that JavaScript defines. +// +// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + + + + + + + + + + + +var _flow = require('../plugins/flow'); +var _index = require('../plugins/jsx/index'); +var _types = require('../plugins/types'); + + + + + + + + + +var _typescript = require('../plugins/typescript'); + + + + + + + + + + + + +var _index3 = require('../tokenizer/index'); +var _keywords = require('../tokenizer/keywords'); +var _state = require('../tokenizer/state'); +var _types3 = require('../tokenizer/types'); +var _charcodes = require('../util/charcodes'); +var _identifier = require('../util/identifier'); +var _base = require('./base'); + + + + + + +var _lval = require('./lval'); + + + + + + + +var _statement = require('./statement'); + + + + + + + + + +var _util = require('./util'); + + class StopState { + + constructor(stop) { + this.stop = stop; + } +} exports.StopState = StopState; + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function (s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. + function parseExpression(noIn = false) { + parseMaybeAssign(noIn); + if (_index3.match.call(void 0, _types3.TokenType.comma)) { + while (_index3.eat.call(void 0, _types3.TokenType.comma)) { + parseMaybeAssign(noIn); + } + } +} exports.parseExpression = parseExpression; + +/** + * noIn is used when parsing a for loop so that we don't interpret a following "in" as the binary + * operatior. + * isWithinParens is used to indicate that we're parsing something that might be a comma expression + * or might be an arrow function or might be a Flow type assertion (which requires explicit parens). + * In these cases, we should allow : and ?: after the initial "left" part. + */ + function parseMaybeAssign(noIn = false, isWithinParens = false) { + if (_base.isTypeScriptEnabled) { + return _typescript.tsParseMaybeAssign.call(void 0, noIn, isWithinParens); + } else if (_base.isFlowEnabled) { + return _flow.flowParseMaybeAssign.call(void 0, noIn, isWithinParens); + } else { + return baseParseMaybeAssign(noIn, isWithinParens); + } +} exports.parseMaybeAssign = parseMaybeAssign; + +// Parse an assignment expression. This includes applications of +// operators like `+=`. +// Returns true if the expression was an arrow function. + function baseParseMaybeAssign(noIn, isWithinParens) { + if (_index3.match.call(void 0, _types3.TokenType._yield)) { + parseYield(); + return false; + } + + if (_index3.match.call(void 0, _types3.TokenType.parenL) || _index3.match.call(void 0, _types3.TokenType.name) || _index3.match.call(void 0, _types3.TokenType._yield)) { + _base.state.potentialArrowAt = _base.state.start; + } + + const wasArrow = parseMaybeConditional(noIn); + if (isWithinParens) { + parseParenItem(); + } + if (_base.state.type & _types3.TokenType.IS_ASSIGN) { + _index3.next.call(void 0, ); + parseMaybeAssign(noIn); + return false; + } + return wasArrow; +} exports.baseParseMaybeAssign = baseParseMaybeAssign; + +// Parse a ternary conditional (`?:`) operator. +// Returns true if the expression was an arrow function. +function parseMaybeConditional(noIn) { + const wasArrow = parseExprOps(noIn); + if (wasArrow) { + return true; + } + parseConditional(noIn); + return false; +} + +function parseConditional(noIn) { + if (_base.isTypeScriptEnabled || _base.isFlowEnabled) { + _types.typedParseConditional.call(void 0, noIn); + } else { + baseParseConditional(noIn); + } +} + + function baseParseConditional(noIn) { + if (_index3.eat.call(void 0, _types3.TokenType.question)) { + parseMaybeAssign(); + _util.expect.call(void 0, _types3.TokenType.colon); + parseMaybeAssign(noIn); + } +} exports.baseParseConditional = baseParseConditional; + +// Start the precedence parser. +// Returns true if this was an arrow function +function parseExprOps(noIn) { + const startTokenIndex = _base.state.tokens.length; + const wasArrow = parseMaybeUnary(); + if (wasArrow) { + return true; + } + parseExprOp(startTokenIndex, -1, noIn); + return false; +} + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. +function parseExprOp(startTokenIndex, minPrec, noIn) { + if ( + _base.isTypeScriptEnabled && + (_types3.TokenType._in & _types3.TokenType.PRECEDENCE_MASK) > minPrec && + !_util.hasPrecedingLineBreak.call(void 0, ) && + (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as) || _util.eatContextual.call(void 0, _keywords.ContextualKeyword._satisfies)) + ) { + const oldIsType = _index3.pushTypeContext.call(void 0, 1); + _typescript.tsParseType.call(void 0, ); + _index3.popTypeContext.call(void 0, oldIsType); + _index3.rescan_gt.call(void 0, ); + parseExprOp(startTokenIndex, minPrec, noIn); + return; + } + + const prec = _base.state.type & _types3.TokenType.PRECEDENCE_MASK; + if (prec > 0 && (!noIn || !_index3.match.call(void 0, _types3.TokenType._in))) { + if (prec > minPrec) { + const op = _base.state.type; + _index3.next.call(void 0, ); + if (op === _types3.TokenType.nullishCoalescing) { + _base.state.tokens[_base.state.tokens.length - 1].nullishStartIndex = startTokenIndex; + } + + const rhsStartTokenIndex = _base.state.tokens.length; + parseMaybeUnary(); + // Extend the right operand of this operator if possible. + parseExprOp(rhsStartTokenIndex, op & _types3.TokenType.IS_RIGHT_ASSOCIATIVE ? prec - 1 : prec, noIn); + if (op === _types3.TokenType.nullishCoalescing) { + _base.state.tokens[startTokenIndex].numNullishCoalesceStarts++; + _base.state.tokens[_base.state.tokens.length - 1].numNullishCoalesceEnds++; + } + // Continue with any future operator holding this expression as the left operand. + parseExprOp(startTokenIndex, minPrec, noIn); + } + } +} + +// Parse unary operators, both prefix and postfix. +// Returns true if this was an arrow function. + function parseMaybeUnary() { + if (_base.isTypeScriptEnabled && !_base.isJSXEnabled && _index3.eat.call(void 0, _types3.TokenType.lessThan)) { + _typescript.tsParseTypeAssertion.call(void 0, ); + return false; + } + if ( + _util.isContextual.call(void 0, _keywords.ContextualKeyword._module) && + _index3.lookaheadCharCode.call(void 0, ) === _charcodes.charCodes.leftCurlyBrace && + !_util.hasFollowingLineBreak.call(void 0, ) + ) { + parseModuleExpression(); + return false; + } + if (_base.state.type & _types3.TokenType.IS_PREFIX) { + _index3.next.call(void 0, ); + parseMaybeUnary(); + return false; + } + + const wasArrow = parseExprSubscripts(); + if (wasArrow) { + return true; + } + while (_base.state.type & _types3.TokenType.IS_POSTFIX && !_util.canInsertSemicolon.call(void 0, )) { + // The tokenizer calls everything a preincrement, so make it a postincrement when + // we see it in that context. + if (_base.state.type === _types3.TokenType.preIncDec) { + _base.state.type = _types3.TokenType.postIncDec; + } + _index3.next.call(void 0, ); + } + return false; +} exports.parseMaybeUnary = parseMaybeUnary; + +// Parse call, dot, and `[]`-subscript expressions. +// Returns true if this was an arrow function. + function parseExprSubscripts() { + const startTokenIndex = _base.state.tokens.length; + const wasArrow = parseExprAtom(); + if (wasArrow) { + return true; + } + parseSubscripts(startTokenIndex); + // If there was any optional chain operation, the start token would be marked + // as such, so also mark the end now. + if (_base.state.tokens.length > startTokenIndex && _base.state.tokens[startTokenIndex].isOptionalChainStart) { + _base.state.tokens[_base.state.tokens.length - 1].isOptionalChainEnd = true; + } + return false; +} exports.parseExprSubscripts = parseExprSubscripts; + +function parseSubscripts(startTokenIndex, noCalls = false) { + if (_base.isFlowEnabled) { + _flow.flowParseSubscripts.call(void 0, startTokenIndex, noCalls); + } else { + baseParseSubscripts(startTokenIndex, noCalls); + } +} + + function baseParseSubscripts(startTokenIndex, noCalls = false) { + const stopState = new StopState(false); + do { + parseSubscript(startTokenIndex, noCalls, stopState); + } while (!stopState.stop && !_base.state.error); +} exports.baseParseSubscripts = baseParseSubscripts; + +function parseSubscript(startTokenIndex, noCalls, stopState) { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); + } else if (_base.isFlowEnabled) { + _flow.flowParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); + } else { + baseParseSubscript(startTokenIndex, noCalls, stopState); + } +} + +/** Set 'state.stop = true' to indicate that we should stop parsing subscripts. */ + function baseParseSubscript( + startTokenIndex, + noCalls, + stopState, +) { + if (!noCalls && _index3.eat.call(void 0, _types3.TokenType.doubleColon)) { + parseNoCallExpr(); + stopState.stop = true; + // Propagate startTokenIndex so that `a::b?.()` will keep `a` as the first token. We may want + // to revisit this in the future when fully supporting bind syntax. + parseSubscripts(startTokenIndex, noCalls); + } else if (_index3.match.call(void 0, _types3.TokenType.questionDot)) { + _base.state.tokens[startTokenIndex].isOptionalChainStart = true; + if (noCalls && _index3.lookaheadType.call(void 0, ) === _types3.TokenType.parenL) { + stopState.stop = true; + return; + } + _index3.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + + if (_index3.eat.call(void 0, _types3.TokenType.bracketL)) { + parseExpression(); + _util.expect.call(void 0, _types3.TokenType.bracketR); + } else if (_index3.eat.call(void 0, _types3.TokenType.parenL)) { + parseCallExpressionArguments(); + } else { + parseMaybePrivateName(); + } + } else if (_index3.eat.call(void 0, _types3.TokenType.dot)) { + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + parseMaybePrivateName(); + } else if (_index3.eat.call(void 0, _types3.TokenType.bracketL)) { + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + parseExpression(); + _util.expect.call(void 0, _types3.TokenType.bracketR); + } else if (!noCalls && _index3.match.call(void 0, _types3.TokenType.parenL)) { + if (atPossibleAsync()) { + // We see "async", but it's possible it's a usage of the name "async". Parse as if it's a + // function call, and if we see an arrow later, backtrack and re-parse as a parameter list. + const snapshot = _base.state.snapshot(); + const asyncStartTokenIndex = _base.state.tokens.length; + _index3.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + + const callContextId = _base.getNextContextId.call(void 0, ); + + _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; + parseCallExpressionArguments(); + _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; + + if (shouldParseAsyncArrow()) { + // We hit an arrow, so backtrack and start again parsing function parameters. + _base.state.restoreFromSnapshot(snapshot); + stopState.stop = true; + _base.state.scopeDepth++; + + _statement.parseFunctionParams.call(void 0, ); + parseAsyncArrowFromCallExpression(asyncStartTokenIndex); + } + } else { + _index3.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; + const callContextId = _base.getNextContextId.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; + parseCallExpressionArguments(); + _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; + } + } else if (_index3.match.call(void 0, _types3.TokenType.backQuote)) { + // Tagged template expression. + parseTemplate(); + } else { + stopState.stop = true; + } +} exports.baseParseSubscript = baseParseSubscript; + + function atPossibleAsync() { + // This was made less strict than the original version to avoid passing around nodes, but it + // should be safe to have rare false positives here. + return ( + _base.state.tokens[_base.state.tokens.length - 1].contextualKeyword === _keywords.ContextualKeyword._async && + !_util.canInsertSemicolon.call(void 0, ) + ); +} exports.atPossibleAsync = atPossibleAsync; + + function parseCallExpressionArguments() { + let first = true; + while (!_index3.eat.call(void 0, _types3.TokenType.parenR) && !_base.state.error) { + if (first) { + first = false; + } else { + _util.expect.call(void 0, _types3.TokenType.comma); + if (_index3.eat.call(void 0, _types3.TokenType.parenR)) { + break; + } + } + + parseExprListItem(false); + } +} exports.parseCallExpressionArguments = parseCallExpressionArguments; + +function shouldParseAsyncArrow() { + return _index3.match.call(void 0, _types3.TokenType.colon) || _index3.match.call(void 0, _types3.TokenType.arrow); +} + +function parseAsyncArrowFromCallExpression(startTokenIndex) { + if (_base.isTypeScriptEnabled) { + _typescript.tsStartParseAsyncArrowFromCallExpression.call(void 0, ); + } else if (_base.isFlowEnabled) { + _flow.flowStartParseAsyncArrowFromCallExpression.call(void 0, ); + } + _util.expect.call(void 0, _types3.TokenType.arrow); + parseArrowExpression(startTokenIndex); +} + +// Parse a no-call expression (like argument of `new` or `::` operators). + +function parseNoCallExpr() { + const startTokenIndex = _base.state.tokens.length; + parseExprAtom(); + parseSubscripts(startTokenIndex, true); +} + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. +// Returns true if the parsed expression was an arrow function. + function parseExprAtom() { + if (_index3.eat.call(void 0, _types3.TokenType.modulo)) { + // V8 intrinsic expression. Just parse the identifier, and the function invocation is parsed + // naturally. + parseIdentifier(); + return false; + } + + if (_index3.match.call(void 0, _types3.TokenType.jsxText) || _index3.match.call(void 0, _types3.TokenType.jsxEmptyText)) { + parseLiteral(); + return false; + } else if (_index3.match.call(void 0, _types3.TokenType.lessThan) && _base.isJSXEnabled) { + _base.state.type = _types3.TokenType.jsxTagStart; + _index.jsxParseElement.call(void 0, ); + _index3.next.call(void 0, ); + return false; + } + + const canBeArrow = _base.state.potentialArrowAt === _base.state.start; + switch (_base.state.type) { + case _types3.TokenType.slash: + case _types3.TokenType.assign: + _index3.retokenizeSlashAsRegex.call(void 0, ); + // Fall through. + + case _types3.TokenType._super: + case _types3.TokenType._this: + case _types3.TokenType.regexp: + case _types3.TokenType.num: + case _types3.TokenType.bigint: + case _types3.TokenType.decimal: + case _types3.TokenType.string: + case _types3.TokenType._null: + case _types3.TokenType._true: + case _types3.TokenType._false: + _index3.next.call(void 0, ); + return false; + + case _types3.TokenType._import: + _index3.next.call(void 0, ); + if (_index3.match.call(void 0, _types3.TokenType.dot)) { + // import.meta + _base.state.tokens[_base.state.tokens.length - 1].type = _types3.TokenType.name; + _index3.next.call(void 0, ); + parseIdentifier(); + } + return false; + + case _types3.TokenType.name: { + const startTokenIndex = _base.state.tokens.length; + const functionStart = _base.state.start; + const contextualKeyword = _base.state.contextualKeyword; + parseIdentifier(); + if (contextualKeyword === _keywords.ContextualKeyword._await) { + parseAwait(); + return false; + } else if ( + contextualKeyword === _keywords.ContextualKeyword._async && + _index3.match.call(void 0, _types3.TokenType._function) && + !_util.canInsertSemicolon.call(void 0, ) + ) { + _index3.next.call(void 0, ); + _statement.parseFunction.call(void 0, functionStart, false); + return false; + } else if ( + canBeArrow && + contextualKeyword === _keywords.ContextualKeyword._async && + !_util.canInsertSemicolon.call(void 0, ) && + _index3.match.call(void 0, _types3.TokenType.name) + ) { + _base.state.scopeDepth++; + _lval.parseBindingIdentifier.call(void 0, false); + _util.expect.call(void 0, _types3.TokenType.arrow); + // let foo = async bar => {}; + parseArrowExpression(startTokenIndex); + return true; + } else if (_index3.match.call(void 0, _types3.TokenType._do) && !_util.canInsertSemicolon.call(void 0, )) { + _index3.next.call(void 0, ); + _statement.parseBlock.call(void 0, ); + return false; + } + + if (canBeArrow && !_util.canInsertSemicolon.call(void 0, ) && _index3.match.call(void 0, _types3.TokenType.arrow)) { + _base.state.scopeDepth++; + _lval.markPriorBindingIdentifier.call(void 0, false); + _util.expect.call(void 0, _types3.TokenType.arrow); + parseArrowExpression(startTokenIndex); + return true; + } + + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index3.IdentifierRole.Access; + return false; + } + + case _types3.TokenType._do: { + _index3.next.call(void 0, ); + _statement.parseBlock.call(void 0, ); + return false; + } + + case _types3.TokenType.parenL: { + const wasArrow = parseParenAndDistinguishExpression(canBeArrow); + return wasArrow; + } + + case _types3.TokenType.bracketL: + _index3.next.call(void 0, ); + parseExprList(_types3.TokenType.bracketR, true); + return false; + + case _types3.TokenType.braceL: + parseObj(false, false); + return false; + + case _types3.TokenType._function: + parseFunctionExpression(); + return false; + + case _types3.TokenType.at: + _statement.parseDecorators.call(void 0, ); + // Fall through. + + case _types3.TokenType._class: + _statement.parseClass.call(void 0, false); + return false; + + case _types3.TokenType._new: + parseNew(); + return false; + + case _types3.TokenType.backQuote: + parseTemplate(); + return false; + + case _types3.TokenType.doubleColon: { + _index3.next.call(void 0, ); + parseNoCallExpr(); + return false; + } + + case _types3.TokenType.hash: { + const code = _index3.lookaheadCharCode.call(void 0, ); + if (_identifier.IS_IDENTIFIER_START[code] || code === _charcodes.charCodes.backslash) { + parseMaybePrivateName(); + } else { + _index3.next.call(void 0, ); + } + // Smart pipeline topic reference. + return false; + } + + default: + _util.unexpected.call(void 0, ); + return false; + } +} exports.parseExprAtom = parseExprAtom; + +function parseMaybePrivateName() { + _index3.eat.call(void 0, _types3.TokenType.hash); + parseIdentifier(); +} + +function parseFunctionExpression() { + const functionStart = _base.state.start; + parseIdentifier(); + if (_index3.eat.call(void 0, _types3.TokenType.dot)) { + // function.sent + parseIdentifier(); + } + _statement.parseFunction.call(void 0, functionStart, false); +} + + function parseLiteral() { + _index3.next.call(void 0, ); +} exports.parseLiteral = parseLiteral; + + function parseParenExpression() { + _util.expect.call(void 0, _types3.TokenType.parenL); + parseExpression(); + _util.expect.call(void 0, _types3.TokenType.parenR); +} exports.parseParenExpression = parseParenExpression; + +// Returns true if this was an arrow expression. +function parseParenAndDistinguishExpression(canBeArrow) { + // Assume this is a normal parenthesized expression, but if we see an arrow, we'll bail and + // start over as a parameter list. + const snapshot = _base.state.snapshot(); + + const startTokenIndex = _base.state.tokens.length; + _util.expect.call(void 0, _types3.TokenType.parenL); + + let first = true; + + while (!_index3.match.call(void 0, _types3.TokenType.parenR) && !_base.state.error) { + if (first) { + first = false; + } else { + _util.expect.call(void 0, _types3.TokenType.comma); + if (_index3.match.call(void 0, _types3.TokenType.parenR)) { + break; + } + } + + if (_index3.match.call(void 0, _types3.TokenType.ellipsis)) { + _lval.parseRest.call(void 0, false /* isBlockScope */); + parseParenItem(); + break; + } else { + parseMaybeAssign(false, true); + } + } + + _util.expect.call(void 0, _types3.TokenType.parenR); + + if (canBeArrow && shouldParseArrow()) { + const wasArrow = parseArrow(); + if (wasArrow) { + // It was an arrow function this whole time, so start over and parse it as params so that we + // get proper token annotations. + _base.state.restoreFromSnapshot(snapshot); + _base.state.scopeDepth++; + // Don't specify a context ID because arrow functions don't need a context ID. + _statement.parseFunctionParams.call(void 0, ); + parseArrow(); + parseArrowExpression(startTokenIndex); + if (_base.state.error) { + // Nevermind! This must have been something that looks very much like an + // arrow function but where its "parameter list" isn't actually a valid + // parameter list. Force non-arrow parsing. + // See https://github.com/alangpierce/sucrase/issues/666 for an example. + _base.state.restoreFromSnapshot(snapshot); + parseParenAndDistinguishExpression(false); + return false; + } + return true; + } + } + + return false; +} + +function shouldParseArrow() { + return _index3.match.call(void 0, _types3.TokenType.colon) || !_util.canInsertSemicolon.call(void 0, ); +} + +// Returns whether there was an arrow token. + function parseArrow() { + if (_base.isTypeScriptEnabled) { + return _typescript.tsParseArrow.call(void 0, ); + } else if (_base.isFlowEnabled) { + return _flow.flowParseArrow.call(void 0, ); + } else { + return _index3.eat.call(void 0, _types3.TokenType.arrow); + } +} exports.parseArrow = parseArrow; + +function parseParenItem() { + if (_base.isTypeScriptEnabled || _base.isFlowEnabled) { + _types.typedParseParenItem.call(void 0, ); + } +} + +// New's precedence is slightly tricky. It must allow its argument to +// be a `[]` or dot subscript expression, but not a call — at least, +// not without wrapping it in parentheses. Thus, it uses the noCalls +// argument to parseSubscripts to prevent it from consuming the +// argument list. +function parseNew() { + _util.expect.call(void 0, _types3.TokenType._new); + if (_index3.eat.call(void 0, _types3.TokenType.dot)) { + // new.target + parseIdentifier(); + return; + } + parseNewCallee(); + if (_base.isFlowEnabled) { + _flow.flowStartParseNewArguments.call(void 0, ); + } + if (_index3.eat.call(void 0, _types3.TokenType.parenL)) { + parseExprList(_types3.TokenType.parenR); + } +} + +function parseNewCallee() { + parseNoCallExpr(); + _index3.eat.call(void 0, _types3.TokenType.questionDot); +} + + function parseTemplate() { + // Finish `, read quasi + _index3.nextTemplateToken.call(void 0, ); + // Finish quasi, read ${ + _index3.nextTemplateToken.call(void 0, ); + while (!_index3.match.call(void 0, _types3.TokenType.backQuote) && !_base.state.error) { + _util.expect.call(void 0, _types3.TokenType.dollarBraceL); + parseExpression(); + // Finish }, read quasi + _index3.nextTemplateToken.call(void 0, ); + // Finish quasi, read either ${ or ` + _index3.nextTemplateToken.call(void 0, ); + } + _index3.next.call(void 0, ); +} exports.parseTemplate = parseTemplate; + +// Parse an object literal or binding pattern. + function parseObj(isPattern, isBlockScope) { + // Attach a context ID to the object open and close brace and each object key. + const contextId = _base.getNextContextId.call(void 0, ); + let first = true; + + _index3.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; + + while (!_index3.eat.call(void 0, _types3.TokenType.braceR) && !_base.state.error) { + if (first) { + first = false; + } else { + _util.expect.call(void 0, _types3.TokenType.comma); + if (_index3.eat.call(void 0, _types3.TokenType.braceR)) { + break; + } + } + + let isGenerator = false; + if (_index3.match.call(void 0, _types3.TokenType.ellipsis)) { + const previousIndex = _base.state.tokens.length; + _lval.parseSpread.call(void 0, ); + if (isPattern) { + // Mark role when the only thing being spread over is an identifier. + if (_base.state.tokens.length === previousIndex + 2) { + _lval.markPriorBindingIdentifier.call(void 0, isBlockScope); + } + if (_index3.eat.call(void 0, _types3.TokenType.braceR)) { + break; + } + } + continue; + } + + if (!isPattern) { + isGenerator = _index3.eat.call(void 0, _types3.TokenType.star); + } + + if (!isPattern && _util.isContextual.call(void 0, _keywords.ContextualKeyword._async)) { + if (isGenerator) _util.unexpected.call(void 0, ); + + parseIdentifier(); + if ( + _index3.match.call(void 0, _types3.TokenType.colon) || + _index3.match.call(void 0, _types3.TokenType.parenL) || + _index3.match.call(void 0, _types3.TokenType.braceR) || + _index3.match.call(void 0, _types3.TokenType.eq) || + _index3.match.call(void 0, _types3.TokenType.comma) + ) { + // This is a key called "async" rather than an async function. + } else { + if (_index3.match.call(void 0, _types3.TokenType.star)) { + _index3.next.call(void 0, ); + isGenerator = true; + } + parsePropertyName(contextId); + } + } else { + parsePropertyName(contextId); + } + + parseObjPropValue(isPattern, isBlockScope, contextId); + } + + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; +} exports.parseObj = parseObj; + +function isGetterOrSetterMethod(isPattern) { + // We go off of the next and don't bother checking if the node key is actually "get" or "set". + // This lets us avoid generating a node, and should only make the validation worse. + return ( + !isPattern && + (_index3.match.call(void 0, _types3.TokenType.string) || // get "string"() {} + _index3.match.call(void 0, _types3.TokenType.num) || // get 1() {} + _index3.match.call(void 0, _types3.TokenType.bracketL) || // get ["string"]() {} + _index3.match.call(void 0, _types3.TokenType.name) || // get foo() {} + !!(_base.state.type & _types3.TokenType.IS_KEYWORD)) // get debugger() {} + ); +} + +// Returns true if this was a method. +function parseObjectMethod(isPattern, objectContextId) { + // We don't need to worry about modifiers because object methods can't have optional bodies, so + // the start will never be used. + const functionStart = _base.state.start; + if (_index3.match.call(void 0, _types3.TokenType.parenL)) { + if (isPattern) _util.unexpected.call(void 0, ); + parseMethod(functionStart, /* isConstructor */ false); + return true; + } + + if (isGetterOrSetterMethod(isPattern)) { + parsePropertyName(objectContextId); + parseMethod(functionStart, /* isConstructor */ false); + return true; + } + return false; +} + +function parseObjectProperty(isPattern, isBlockScope) { + if (_index3.eat.call(void 0, _types3.TokenType.colon)) { + if (isPattern) { + _lval.parseMaybeDefault.call(void 0, isBlockScope); + } else { + parseMaybeAssign(false); + } + return; + } + + // Since there's no colon, we assume this is an object shorthand. + + // If we're in a destructuring, we've now discovered that the key was actually an assignee, so + // we need to tag it as a declaration with the appropriate scope. Otherwise, we might need to + // transform it on access, so mark it as a normal object shorthand. + let identifierRole; + if (isPattern) { + if (_base.state.scopeDepth === 0) { + identifierRole = _index3.IdentifierRole.ObjectShorthandTopLevelDeclaration; + } else if (isBlockScope) { + identifierRole = _index3.IdentifierRole.ObjectShorthandBlockScopedDeclaration; + } else { + identifierRole = _index3.IdentifierRole.ObjectShorthandFunctionScopedDeclaration; + } + } else { + identifierRole = _index3.IdentifierRole.ObjectShorthand; + } + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole; + + // Regardless of whether we know this to be a pattern or if we're in an ambiguous context, allow + // parsing as if there's a default value. + _lval.parseMaybeDefault.call(void 0, isBlockScope, true); +} + +function parseObjPropValue( + isPattern, + isBlockScope, + objectContextId, +) { + if (_base.isTypeScriptEnabled) { + _typescript.tsStartParseObjPropValue.call(void 0, ); + } else if (_base.isFlowEnabled) { + _flow.flowStartParseObjPropValue.call(void 0, ); + } + const wasMethod = parseObjectMethod(isPattern, objectContextId); + if (!wasMethod) { + parseObjectProperty(isPattern, isBlockScope); + } +} + + function parsePropertyName(objectContextId) { + if (_base.isFlowEnabled) { + _flow.flowParseVariance.call(void 0, ); + } + if (_index3.eat.call(void 0, _types3.TokenType.bracketL)) { + _base.state.tokens[_base.state.tokens.length - 1].contextId = objectContextId; + parseMaybeAssign(); + _util.expect.call(void 0, _types3.TokenType.bracketR); + _base.state.tokens[_base.state.tokens.length - 1].contextId = objectContextId; + } else { + if (_index3.match.call(void 0, _types3.TokenType.num) || _index3.match.call(void 0, _types3.TokenType.string) || _index3.match.call(void 0, _types3.TokenType.bigint) || _index3.match.call(void 0, _types3.TokenType.decimal)) { + parseExprAtom(); + } else { + parseMaybePrivateName(); + } + + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index3.IdentifierRole.ObjectKey; + _base.state.tokens[_base.state.tokens.length - 1].contextId = objectContextId; + } +} exports.parsePropertyName = parsePropertyName; + +// Parse object or class method. + function parseMethod(functionStart, isConstructor) { + const funcContextId = _base.getNextContextId.call(void 0, ); + + _base.state.scopeDepth++; + const startTokenIndex = _base.state.tokens.length; + const allowModifiers = isConstructor; // For TypeScript parameter properties + _statement.parseFunctionParams.call(void 0, allowModifiers, funcContextId); + parseFunctionBodyAndFinish(functionStart, funcContextId); + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, true)); + _base.state.scopeDepth--; +} exports.parseMethod = parseMethod; + +// Parse arrow function expression. +// If the parameters are provided, they will be converted to an +// assignable list. + function parseArrowExpression(startTokenIndex) { + parseFunctionBody(true); + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, true)); + _base.state.scopeDepth--; +} exports.parseArrowExpression = parseArrowExpression; + + function parseFunctionBodyAndFinish(functionStart, funcContextId = 0) { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseFunctionBodyAndFinish.call(void 0, functionStart, funcContextId); + } else if (_base.isFlowEnabled) { + _flow.flowParseFunctionBodyAndFinish.call(void 0, funcContextId); + } else { + parseFunctionBody(false, funcContextId); + } +} exports.parseFunctionBodyAndFinish = parseFunctionBodyAndFinish; + + function parseFunctionBody(allowExpression, funcContextId = 0) { + const isExpression = allowExpression && !_index3.match.call(void 0, _types3.TokenType.braceL); + + if (isExpression) { + parseMaybeAssign(); + } else { + _statement.parseBlock.call(void 0, true /* isFunctionScope */, funcContextId); + } +} exports.parseFunctionBody = parseFunctionBody; + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +function parseExprList(close, allowEmpty = false) { + let first = true; + while (!_index3.eat.call(void 0, close) && !_base.state.error) { + if (first) { + first = false; + } else { + _util.expect.call(void 0, _types3.TokenType.comma); + if (_index3.eat.call(void 0, close)) break; + } + parseExprListItem(allowEmpty); + } +} + +function parseExprListItem(allowEmpty) { + if (allowEmpty && _index3.match.call(void 0, _types3.TokenType.comma)) { + // Empty item; nothing more to parse for this item. + } else if (_index3.match.call(void 0, _types3.TokenType.ellipsis)) { + _lval.parseSpread.call(void 0, ); + parseParenItem(); + } else if (_index3.match.call(void 0, _types3.TokenType.question)) { + // Partial function application proposal. + _index3.next.call(void 0, ); + } else { + parseMaybeAssign(false, true); + } +} + +// Parse the next token as an identifier. + function parseIdentifier() { + _index3.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].type = _types3.TokenType.name; +} exports.parseIdentifier = parseIdentifier; + +// Parses await expression inside async function. +function parseAwait() { + parseMaybeUnary(); +} + +// Parses yield expression inside generator. +function parseYield() { + _index3.next.call(void 0, ); + if (!_index3.match.call(void 0, _types3.TokenType.semi) && !_util.canInsertSemicolon.call(void 0, )) { + _index3.eat.call(void 0, _types3.TokenType.star); + parseMaybeAssign(); + } +} + +// https://github.com/tc39/proposal-js-module-blocks +function parseModuleExpression() { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._module); + _util.expect.call(void 0, _types3.TokenType.braceL); + // For now, just call parseBlockBody to parse the block. In the future when we + // implement full support, we'll want to emit scopes and possibly other + // information. + _statement.parseBlockBody.call(void 0, _types3.TokenType.braceR); +} diff --git a/node_modules/sucrase/dist/parser/traverser/index.js b/node_modules/sucrase/dist/parser/traverser/index.js new file mode 100644 index 0000000..72e4130 --- /dev/null +++ b/node_modules/sucrase/dist/parser/traverser/index.js @@ -0,0 +1,18 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); +var _index = require('../tokenizer/index'); +var _charcodes = require('../util/charcodes'); +var _base = require('./base'); +var _statement = require('./statement'); + + function parseFile() { + // If enabled, skip leading hashbang line. + if ( + _base.state.pos === 0 && + _base.input.charCodeAt(0) === _charcodes.charCodes.numberSign && + _base.input.charCodeAt(1) === _charcodes.charCodes.exclamationMark + ) { + _index.skipLineComment.call(void 0, 2); + } + _index.nextToken.call(void 0, ); + return _statement.parseTopLevel.call(void 0, ); +} exports.parseFile = parseFile; diff --git a/node_modules/sucrase/dist/parser/traverser/lval.js b/node_modules/sucrase/dist/parser/traverser/lval.js new file mode 100644 index 0000000..9057497 --- /dev/null +++ b/node_modules/sucrase/dist/parser/traverser/lval.js @@ -0,0 +1,159 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _flow = require('../plugins/flow'); +var _typescript = require('../plugins/typescript'); + + + + + + + +var _index = require('../tokenizer/index'); +var _keywords = require('../tokenizer/keywords'); +var _types = require('../tokenizer/types'); +var _base = require('./base'); +var _expression = require('./expression'); +var _util = require('./util'); + + function parseSpread() { + _index.next.call(void 0, ); + _expression.parseMaybeAssign.call(void 0, false); +} exports.parseSpread = parseSpread; + + function parseRest(isBlockScope) { + _index.next.call(void 0, ); + parseBindingAtom(isBlockScope); +} exports.parseRest = parseRest; + + function parseBindingIdentifier(isBlockScope) { + _expression.parseIdentifier.call(void 0, ); + markPriorBindingIdentifier(isBlockScope); +} exports.parseBindingIdentifier = parseBindingIdentifier; + + function parseImportedIdentifier() { + _expression.parseIdentifier.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; +} exports.parseImportedIdentifier = parseImportedIdentifier; + + function markPriorBindingIdentifier(isBlockScope) { + let identifierRole; + if (_base.state.scopeDepth === 0) { + identifierRole = _index.IdentifierRole.TopLevelDeclaration; + } else if (isBlockScope) { + identifierRole = _index.IdentifierRole.BlockScopedDeclaration; + } else { + identifierRole = _index.IdentifierRole.FunctionScopedDeclaration; + } + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole; +} exports.markPriorBindingIdentifier = markPriorBindingIdentifier; + +// Parses lvalue (assignable) atom. + function parseBindingAtom(isBlockScope) { + switch (_base.state.type) { + case _types.TokenType._this: { + // In TypeScript, "this" may be the name of a parameter, so allow it. + const oldIsType = _index.pushTypeContext.call(void 0, 0); + _index.next.call(void 0, ); + _index.popTypeContext.call(void 0, oldIsType); + return; + } + + case _types.TokenType._yield: + case _types.TokenType.name: { + _base.state.type = _types.TokenType.name; + parseBindingIdentifier(isBlockScope); + return; + } + + case _types.TokenType.bracketL: { + _index.next.call(void 0, ); + parseBindingList(_types.TokenType.bracketR, isBlockScope, true /* allowEmpty */); + return; + } + + case _types.TokenType.braceL: + _expression.parseObj.call(void 0, true, isBlockScope); + return; + + default: + _util.unexpected.call(void 0, ); + } +} exports.parseBindingAtom = parseBindingAtom; + + function parseBindingList( + close, + isBlockScope, + allowEmpty = false, + allowModifiers = false, + contextId = 0, +) { + let first = true; + + let hasRemovedComma = false; + const firstItemTokenIndex = _base.state.tokens.length; + + while (!_index.eat.call(void 0, close) && !_base.state.error) { + if (first) { + first = false; + } else { + _util.expect.call(void 0, _types.TokenType.comma); + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; + // After a "this" type in TypeScript, we need to set the following comma (if any) to also be + // a type token so that it will be removed. + if (!hasRemovedComma && _base.state.tokens[firstItemTokenIndex].isType) { + _base.state.tokens[_base.state.tokens.length - 1].isType = true; + hasRemovedComma = true; + } + } + if (allowEmpty && _index.match.call(void 0, _types.TokenType.comma)) { + // Empty item; nothing further to parse for this item. + } else if (_index.eat.call(void 0, close)) { + break; + } else if (_index.match.call(void 0, _types.TokenType.ellipsis)) { + parseRest(isBlockScope); + parseAssignableListItemTypes(); + // Support rest element trailing commas allowed by TypeScript <2.9. + _index.eat.call(void 0, _types.TokenType.comma); + _util.expect.call(void 0, close); + break; + } else { + parseAssignableListItem(allowModifiers, isBlockScope); + } + } +} exports.parseBindingList = parseBindingList; + +function parseAssignableListItem(allowModifiers, isBlockScope) { + if (allowModifiers) { + _typescript.tsParseModifiers.call(void 0, [ + _keywords.ContextualKeyword._public, + _keywords.ContextualKeyword._protected, + _keywords.ContextualKeyword._private, + _keywords.ContextualKeyword._readonly, + _keywords.ContextualKeyword._override, + ]); + } + + parseMaybeDefault(isBlockScope); + parseAssignableListItemTypes(); + parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */); +} + +function parseAssignableListItemTypes() { + if (_base.isFlowEnabled) { + _flow.flowParseAssignableListItemTypes.call(void 0, ); + } else if (_base.isTypeScriptEnabled) { + _typescript.tsParseAssignableListItemTypes.call(void 0, ); + } +} + +// Parses assignment pattern around given atom if possible. + function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) { + if (!leftAlreadyParsed) { + parseBindingAtom(isBlockScope); + } + if (!_index.eat.call(void 0, _types.TokenType.eq)) { + return; + } + const eqIndex = _base.state.tokens.length - 1; + _expression.parseMaybeAssign.call(void 0, ); + _base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length; +} exports.parseMaybeDefault = parseMaybeDefault; diff --git a/node_modules/sucrase/dist/parser/traverser/statement.js b/node_modules/sucrase/dist/parser/traverser/statement.js new file mode 100644 index 0000000..6be3391 --- /dev/null +++ b/node_modules/sucrase/dist/parser/traverser/statement.js @@ -0,0 +1,1332 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* eslint max-len: 0 */ + +var _index = require('../index'); + + + + + + + + + + + + + + + + +var _flow = require('../plugins/flow'); + + + + + + + + + + + + + + + + + + +var _typescript = require('../plugins/typescript'); + + + + + + + + + + + + +var _tokenizer = require('../tokenizer'); +var _keywords = require('../tokenizer/keywords'); +var _state = require('../tokenizer/state'); +var _types = require('../tokenizer/types'); +var _charcodes = require('../util/charcodes'); +var _base = require('./base'); + + + + + + + + + + + + +var _expression = require('./expression'); + + + + + +var _lval = require('./lval'); + + + + + + + + + + + + +var _util = require('./util'); + + function parseTopLevel() { + parseBlockBody(_types.TokenType.eof); + _base.state.scopes.push(new (0, _state.Scope)(0, _base.state.tokens.length, true)); + if (_base.state.scopeDepth !== 0) { + throw new Error(`Invalid scope depth at end of file: ${_base.state.scopeDepth}`); + } + return new (0, _index.File)(_base.state.tokens, _base.state.scopes); +} exports.parseTopLevel = parseTopLevel; + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + + function parseStatement(declaration) { + if (_base.isFlowEnabled) { + if (_flow.flowTryParseStatement.call(void 0, )) { + return; + } + } + if (_tokenizer.match.call(void 0, _types.TokenType.at)) { + parseDecorators(); + } + parseStatementContent(declaration); +} exports.parseStatement = parseStatement; + +function parseStatementContent(declaration) { + if (_base.isTypeScriptEnabled) { + if (_typescript.tsTryParseStatementContent.call(void 0, )) { + return; + } + } + + const starttype = _base.state.type; + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case _types.TokenType._break: + case _types.TokenType._continue: + parseBreakContinueStatement(); + return; + case _types.TokenType._debugger: + parseDebuggerStatement(); + return; + case _types.TokenType._do: + parseDoStatement(); + return; + case _types.TokenType._for: + parseForStatement(); + return; + case _types.TokenType._function: + if (_tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.dot) break; + if (!declaration) _util.unexpected.call(void 0, ); + parseFunctionStatement(); + return; + + case _types.TokenType._class: + if (!declaration) _util.unexpected.call(void 0, ); + parseClass(true); + return; + + case _types.TokenType._if: + parseIfStatement(); + return; + case _types.TokenType._return: + parseReturnStatement(); + return; + case _types.TokenType._switch: + parseSwitchStatement(); + return; + case _types.TokenType._throw: + parseThrowStatement(); + return; + case _types.TokenType._try: + parseTryStatement(); + return; + + case _types.TokenType._let: + case _types.TokenType._const: + if (!declaration) _util.unexpected.call(void 0, ); // NOTE: falls through to _var + + case _types.TokenType._var: + parseVarStatement(starttype !== _types.TokenType._var); + return; + + case _types.TokenType._while: + parseWhileStatement(); + return; + case _types.TokenType.braceL: + parseBlock(); + return; + case _types.TokenType.semi: + parseEmptyStatement(); + return; + case _types.TokenType._export: + case _types.TokenType._import: { + const nextType = _tokenizer.lookaheadType.call(void 0, ); + if (nextType === _types.TokenType.parenL || nextType === _types.TokenType.dot) { + break; + } + _tokenizer.next.call(void 0, ); + if (starttype === _types.TokenType._import) { + parseImport(); + } else { + parseExport(); + } + return; + } + case _types.TokenType.name: + if (_base.state.contextualKeyword === _keywords.ContextualKeyword._async) { + const functionStart = _base.state.start; + // peek ahead and see if next token is a function + const snapshot = _base.state.snapshot(); + _tokenizer.next.call(void 0, ); + if (_tokenizer.match.call(void 0, _types.TokenType._function) && !_util.canInsertSemicolon.call(void 0, )) { + _util.expect.call(void 0, _types.TokenType._function); + parseFunction(functionStart, true); + return; + } else { + _base.state.restoreFromSnapshot(snapshot); + } + } else if ( + _base.state.contextualKeyword === _keywords.ContextualKeyword._using && + !_util.hasFollowingLineBreak.call(void 0, ) && + // Statements like `using[0]` and `using in foo` aren't actual using + // declarations. + _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.name + ) { + parseVarStatement(true); + return; + } else if (startsAwaitUsing()) { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._await); + parseVarStatement(true); + return; + } + default: + // Do nothing. + break; + } + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + const initialTokensLength = _base.state.tokens.length; + _expression.parseExpression.call(void 0, ); + let simpleName = null; + if (_base.state.tokens.length === initialTokensLength + 1) { + const token = _base.state.tokens[_base.state.tokens.length - 1]; + if (token.type === _types.TokenType.name) { + simpleName = token.contextualKeyword; + } + } + if (simpleName == null) { + _util.semicolon.call(void 0, ); + return; + } + if (_tokenizer.eat.call(void 0, _types.TokenType.colon)) { + parseLabeledStatement(); + } else { + // This was an identifier, so we might want to handle flow/typescript-specific cases. + parseIdentifierStatement(simpleName); + } +} + +/** + * Determine if we're positioned at an `await using` declaration. + * + * Note that this can happen either in place of a regular variable declaration + * or in a loop body, and in both places, there are similar-looking cases where + * we need to return false. + * + * Examples returning true: + * await using foo = bar(); + * for (await using a of b) {} + * + * Examples returning false: + * await using + * await using + 1 + * await using instanceof T + * for (await using;;) {} + * + * For now, we early return if we don't see `await`, then do a simple + * backtracking-based lookahead for the `using` and identifier tokens. In the + * future, this could be optimized with a character-based approach. + */ +function startsAwaitUsing() { + if (!_util.isContextual.call(void 0, _keywords.ContextualKeyword._await)) { + return false; + } + const snapshot = _base.state.snapshot(); + // await + _tokenizer.next.call(void 0, ); + if (!_util.isContextual.call(void 0, _keywords.ContextualKeyword._using) || _util.hasPrecedingLineBreak.call(void 0, )) { + _base.state.restoreFromSnapshot(snapshot); + return false; + } + // using + _tokenizer.next.call(void 0, ); + if (!_tokenizer.match.call(void 0, _types.TokenType.name) || _util.hasPrecedingLineBreak.call(void 0, )) { + _base.state.restoreFromSnapshot(snapshot); + return false; + } + _base.state.restoreFromSnapshot(snapshot); + return true; +} + + function parseDecorators() { + while (_tokenizer.match.call(void 0, _types.TokenType.at)) { + parseDecorator(); + } +} exports.parseDecorators = parseDecorators; + +function parseDecorator() { + _tokenizer.next.call(void 0, ); + if (_tokenizer.eat.call(void 0, _types.TokenType.parenL)) { + _expression.parseExpression.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.parenR); + } else { + _expression.parseIdentifier.call(void 0, ); + while (_tokenizer.eat.call(void 0, _types.TokenType.dot)) { + _expression.parseIdentifier.call(void 0, ); + } + parseMaybeDecoratorArguments(); + } +} + +function parseMaybeDecoratorArguments() { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseMaybeDecoratorArguments.call(void 0, ); + } else { + baseParseMaybeDecoratorArguments(); + } +} + + function baseParseMaybeDecoratorArguments() { + if (_tokenizer.eat.call(void 0, _types.TokenType.parenL)) { + _expression.parseCallExpressionArguments.call(void 0, ); + } +} exports.baseParseMaybeDecoratorArguments = baseParseMaybeDecoratorArguments; + +function parseBreakContinueStatement() { + _tokenizer.next.call(void 0, ); + if (!_util.isLineTerminator.call(void 0, )) { + _expression.parseIdentifier.call(void 0, ); + _util.semicolon.call(void 0, ); + } +} + +function parseDebuggerStatement() { + _tokenizer.next.call(void 0, ); + _util.semicolon.call(void 0, ); +} + +function parseDoStatement() { + _tokenizer.next.call(void 0, ); + parseStatement(false); + _util.expect.call(void 0, _types.TokenType._while); + _expression.parseParenExpression.call(void 0, ); + _tokenizer.eat.call(void 0, _types.TokenType.semi); +} + +function parseForStatement() { + _base.state.scopeDepth++; + const startTokenIndex = _base.state.tokens.length; + parseAmbiguousForStatement(); + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, false)); + _base.state.scopeDepth--; +} + +/** + * Determine if this token is a `using` declaration (explicit resource + * management) as part of a loop. + * https://github.com/tc39/proposal-explicit-resource-management + */ +function isUsingInLoop() { + if (!_util.isContextual.call(void 0, _keywords.ContextualKeyword._using)) { + return false; + } + // This must be `for (using of`, where `using` is the name of the loop + // variable. + if (_util.isLookaheadContextual.call(void 0, _keywords.ContextualKeyword._of)) { + return false; + } + return true; +} + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. +function parseAmbiguousForStatement() { + _tokenizer.next.call(void 0, ); + + let forAwait = false; + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._await)) { + forAwait = true; + _tokenizer.next.call(void 0, ); + } + _util.expect.call(void 0, _types.TokenType.parenL); + + if (_tokenizer.match.call(void 0, _types.TokenType.semi)) { + if (forAwait) { + _util.unexpected.call(void 0, ); + } + parseFor(); + return; + } + + const isAwaitUsing = startsAwaitUsing(); + if (isAwaitUsing || _tokenizer.match.call(void 0, _types.TokenType._var) || _tokenizer.match.call(void 0, _types.TokenType._let) || _tokenizer.match.call(void 0, _types.TokenType._const) || isUsingInLoop()) { + if (isAwaitUsing) { + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._await); + } + _tokenizer.next.call(void 0, ); + parseVar(true, _base.state.type !== _types.TokenType._var); + if (_tokenizer.match.call(void 0, _types.TokenType._in) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._of)) { + parseForIn(forAwait); + return; + } + parseFor(); + return; + } + + _expression.parseExpression.call(void 0, true); + if (_tokenizer.match.call(void 0, _types.TokenType._in) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._of)) { + parseForIn(forAwait); + return; + } + if (forAwait) { + _util.unexpected.call(void 0, ); + } + parseFor(); +} + +function parseFunctionStatement() { + const functionStart = _base.state.start; + _tokenizer.next.call(void 0, ); + parseFunction(functionStart, true); +} + +function parseIfStatement() { + _tokenizer.next.call(void 0, ); + _expression.parseParenExpression.call(void 0, ); + parseStatement(false); + if (_tokenizer.eat.call(void 0, _types.TokenType._else)) { + parseStatement(false); + } +} + +function parseReturnStatement() { + _tokenizer.next.call(void 0, ); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (!_util.isLineTerminator.call(void 0, )) { + _expression.parseExpression.call(void 0, ); + _util.semicolon.call(void 0, ); + } +} + +function parseSwitchStatement() { + _tokenizer.next.call(void 0, ); + _expression.parseParenExpression.call(void 0, ); + _base.state.scopeDepth++; + const startTokenIndex = _base.state.tokens.length; + _util.expect.call(void 0, _types.TokenType.braceL); + + // Don't bother validation; just go through any sequence of cases, defaults, and statements. + while (!_tokenizer.match.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + if (_tokenizer.match.call(void 0, _types.TokenType._case) || _tokenizer.match.call(void 0, _types.TokenType._default)) { + const isCase = _tokenizer.match.call(void 0, _types.TokenType._case); + _tokenizer.next.call(void 0, ); + if (isCase) { + _expression.parseExpression.call(void 0, ); + } + _util.expect.call(void 0, _types.TokenType.colon); + } else { + parseStatement(true); + } + } + _tokenizer.next.call(void 0, ); // Closing brace + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, false)); + _base.state.scopeDepth--; +} + +function parseThrowStatement() { + _tokenizer.next.call(void 0, ); + _expression.parseExpression.call(void 0, ); + _util.semicolon.call(void 0, ); +} + +function parseCatchClauseParam() { + _lval.parseBindingAtom.call(void 0, true /* isBlockScope */); + + if (_base.isTypeScriptEnabled) { + _typescript.tsTryParseTypeAnnotation.call(void 0, ); + } +} + +function parseTryStatement() { + _tokenizer.next.call(void 0, ); + + parseBlock(); + + if (_tokenizer.match.call(void 0, _types.TokenType._catch)) { + _tokenizer.next.call(void 0, ); + let catchBindingStartTokenIndex = null; + if (_tokenizer.match.call(void 0, _types.TokenType.parenL)) { + _base.state.scopeDepth++; + catchBindingStartTokenIndex = _base.state.tokens.length; + _util.expect.call(void 0, _types.TokenType.parenL); + parseCatchClauseParam(); + _util.expect.call(void 0, _types.TokenType.parenR); + } + parseBlock(); + if (catchBindingStartTokenIndex != null) { + // We need a special scope for the catch binding which includes the binding itself and the + // catch block. + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(catchBindingStartTokenIndex, endTokenIndex, false)); + _base.state.scopeDepth--; + } + } + if (_tokenizer.eat.call(void 0, _types.TokenType._finally)) { + parseBlock(); + } +} + + function parseVarStatement(isBlockScope) { + _tokenizer.next.call(void 0, ); + parseVar(false, isBlockScope); + _util.semicolon.call(void 0, ); +} exports.parseVarStatement = parseVarStatement; + +function parseWhileStatement() { + _tokenizer.next.call(void 0, ); + _expression.parseParenExpression.call(void 0, ); + parseStatement(false); +} + +function parseEmptyStatement() { + _tokenizer.next.call(void 0, ); +} + +function parseLabeledStatement() { + parseStatement(true); +} + +/** + * Parse a statement starting with an identifier of the given name. Subclasses match on the name + * to handle statements like "declare". + */ +function parseIdentifierStatement(contextualKeyword) { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseIdentifierStatement.call(void 0, contextualKeyword); + } else if (_base.isFlowEnabled) { + _flow.flowParseIdentifierStatement.call(void 0, contextualKeyword); + } else { + _util.semicolon.call(void 0, ); + } +} + +// Parse a semicolon-enclosed block of statements. + function parseBlock(isFunctionScope = false, contextId = 0) { + const startTokenIndex = _base.state.tokens.length; + _base.state.scopeDepth++; + _util.expect.call(void 0, _types.TokenType.braceL); + if (contextId) { + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; + } + parseBlockBody(_types.TokenType.braceR); + if (contextId) { + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; + } + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, isFunctionScope)); + _base.state.scopeDepth--; +} exports.parseBlock = parseBlock; + + function parseBlockBody(end) { + while (!_tokenizer.eat.call(void 0, end) && !_base.state.error) { + parseStatement(true); + } +} exports.parseBlockBody = parseBlockBody; + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +function parseFor() { + _util.expect.call(void 0, _types.TokenType.semi); + if (!_tokenizer.match.call(void 0, _types.TokenType.semi)) { + _expression.parseExpression.call(void 0, ); + } + _util.expect.call(void 0, _types.TokenType.semi); + if (!_tokenizer.match.call(void 0, _types.TokenType.parenR)) { + _expression.parseExpression.call(void 0, ); + } + _util.expect.call(void 0, _types.TokenType.parenR); + parseStatement(false); +} + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +function parseForIn(forAwait) { + if (forAwait) { + _util.eatContextual.call(void 0, _keywords.ContextualKeyword._of); + } else { + _tokenizer.next.call(void 0, ); + } + _expression.parseExpression.call(void 0, ); + _util.expect.call(void 0, _types.TokenType.parenR); + parseStatement(false); +} + +// Parse a list of variable declarations. + +function parseVar(isFor, isBlockScope) { + while (true) { + parseVarHead(isBlockScope); + if (_tokenizer.eat.call(void 0, _types.TokenType.eq)) { + const eqIndex = _base.state.tokens.length - 1; + _expression.parseMaybeAssign.call(void 0, isFor); + _base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length; + } + if (!_tokenizer.eat.call(void 0, _types.TokenType.comma)) { + break; + } + } +} + +function parseVarHead(isBlockScope) { + _lval.parseBindingAtom.call(void 0, isBlockScope); + if (_base.isTypeScriptEnabled) { + _typescript.tsAfterParseVarHead.call(void 0, ); + } else if (_base.isFlowEnabled) { + _flow.flowAfterParseVarHead.call(void 0, ); + } +} + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + + function parseFunction( + functionStart, + isStatement, + optionalId = false, +) { + if (_tokenizer.match.call(void 0, _types.TokenType.star)) { + _tokenizer.next.call(void 0, ); + } + + if (isStatement && !optionalId && !_tokenizer.match.call(void 0, _types.TokenType.name) && !_tokenizer.match.call(void 0, _types.TokenType._yield)) { + _util.unexpected.call(void 0, ); + } + + let nameScopeStartTokenIndex = null; + + if (_tokenizer.match.call(void 0, _types.TokenType.name)) { + // Expression-style functions should limit their name's scope to the function body, so we make + // a new function scope to enforce that. + if (!isStatement) { + nameScopeStartTokenIndex = _base.state.tokens.length; + _base.state.scopeDepth++; + } + _lval.parseBindingIdentifier.call(void 0, false); + } + + const startTokenIndex = _base.state.tokens.length; + _base.state.scopeDepth++; + parseFunctionParams(); + _expression.parseFunctionBodyAndFinish.call(void 0, functionStart); + const endTokenIndex = _base.state.tokens.length; + // In addition to the block scope of the function body, we need a separate function-style scope + // that includes the params. + _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, true)); + _base.state.scopeDepth--; + if (nameScopeStartTokenIndex !== null) { + _base.state.scopes.push(new (0, _state.Scope)(nameScopeStartTokenIndex, endTokenIndex, true)); + _base.state.scopeDepth--; + } +} exports.parseFunction = parseFunction; + + function parseFunctionParams( + allowModifiers = false, + funcContextId = 0, +) { + if (_base.isTypeScriptEnabled) { + _typescript.tsStartParseFunctionParams.call(void 0, ); + } else if (_base.isFlowEnabled) { + _flow.flowStartParseFunctionParams.call(void 0, ); + } + + _util.expect.call(void 0, _types.TokenType.parenL); + if (funcContextId) { + _base.state.tokens[_base.state.tokens.length - 1].contextId = funcContextId; + } + _lval.parseBindingList.call(void 0, + _types.TokenType.parenR, + false /* isBlockScope */, + false /* allowEmpty */, + allowModifiers, + funcContextId, + ); + if (funcContextId) { + _base.state.tokens[_base.state.tokens.length - 1].contextId = funcContextId; + } +} exports.parseFunctionParams = parseFunctionParams; + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + + function parseClass(isStatement, optionalId = false) { + // Put a context ID on the class keyword, the open-brace, and the close-brace, so that later + // code can easily navigate to meaningful points on the class. + const contextId = _base.getNextContextId.call(void 0, ); + + _tokenizer.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; + _base.state.tokens[_base.state.tokens.length - 1].isExpression = !isStatement; + // Like with functions, we declare a special "name scope" from the start of the name to the end + // of the class, but only with expression-style classes, to represent the fact that the name is + // available to the body of the class but not an outer declaration. + let nameScopeStartTokenIndex = null; + if (!isStatement) { + nameScopeStartTokenIndex = _base.state.tokens.length; + _base.state.scopeDepth++; + } + parseClassId(isStatement, optionalId); + parseClassSuper(); + const openBraceIndex = _base.state.tokens.length; + parseClassBody(contextId); + if (_base.state.error) { + return; + } + _base.state.tokens[openBraceIndex].contextId = contextId; + _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; + if (nameScopeStartTokenIndex !== null) { + const endTokenIndex = _base.state.tokens.length; + _base.state.scopes.push(new (0, _state.Scope)(nameScopeStartTokenIndex, endTokenIndex, false)); + _base.state.scopeDepth--; + } +} exports.parseClass = parseClass; + +function isClassProperty() { + return _tokenizer.match.call(void 0, _types.TokenType.eq) || _tokenizer.match.call(void 0, _types.TokenType.semi) || _tokenizer.match.call(void 0, _types.TokenType.braceR) || _tokenizer.match.call(void 0, _types.TokenType.bang) || _tokenizer.match.call(void 0, _types.TokenType.colon); +} + +function isClassMethod() { + return _tokenizer.match.call(void 0, _types.TokenType.parenL) || _tokenizer.match.call(void 0, _types.TokenType.lessThan); +} + +function parseClassBody(classContextId) { + _util.expect.call(void 0, _types.TokenType.braceL); + + while (!_tokenizer.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + if (_tokenizer.eat.call(void 0, _types.TokenType.semi)) { + continue; + } + + if (_tokenizer.match.call(void 0, _types.TokenType.at)) { + parseDecorator(); + continue; + } + const memberStart = _base.state.start; + parseClassMember(memberStart, classContextId); + } +} + +function parseClassMember(memberStart, classContextId) { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseModifiers.call(void 0, [ + _keywords.ContextualKeyword._declare, + _keywords.ContextualKeyword._public, + _keywords.ContextualKeyword._protected, + _keywords.ContextualKeyword._private, + _keywords.ContextualKeyword._override, + ]); + } + let isStatic = false; + if (_tokenizer.match.call(void 0, _types.TokenType.name) && _base.state.contextualKeyword === _keywords.ContextualKeyword._static) { + _expression.parseIdentifier.call(void 0, ); // eats 'static' + if (isClassMethod()) { + parseClassMethod(memberStart, /* isConstructor */ false); + return; + } else if (isClassProperty()) { + parseClassProperty(); + return; + } + // otherwise something static + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._static; + isStatic = true; + + if (_tokenizer.match.call(void 0, _types.TokenType.braceL)) { + // This is a static block. Mark the word "static" with the class context ID for class element + // detection and parse as a regular block. + _base.state.tokens[_base.state.tokens.length - 1].contextId = classContextId; + parseBlock(); + return; + } + } + + parseClassMemberWithIsStatic(memberStart, isStatic, classContextId); +} + +function parseClassMemberWithIsStatic( + memberStart, + isStatic, + classContextId, +) { + if (_base.isTypeScriptEnabled) { + if (_typescript.tsTryParseClassMemberWithIsStatic.call(void 0, isStatic)) { + return; + } + } + if (_tokenizer.eat.call(void 0, _types.TokenType.star)) { + // a generator + parseClassPropertyName(classContextId); + parseClassMethod(memberStart, /* isConstructor */ false); + return; + } + + // Get the identifier name so we can tell if it's actually a keyword like "async", "get", or + // "set". + parseClassPropertyName(classContextId); + let isConstructor = false; + const token = _base.state.tokens[_base.state.tokens.length - 1]; + // We allow "constructor" as either an identifier or a string. + if (token.contextualKeyword === _keywords.ContextualKeyword._constructor) { + isConstructor = true; + } + parsePostMemberNameModifiers(); + + if (isClassMethod()) { + parseClassMethod(memberStart, isConstructor); + } else if (isClassProperty()) { + parseClassProperty(); + } else if (token.contextualKeyword === _keywords.ContextualKeyword._async && !_util.isLineTerminator.call(void 0, )) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._async; + // an async method + const isGenerator = _tokenizer.match.call(void 0, _types.TokenType.star); + if (isGenerator) { + _tokenizer.next.call(void 0, ); + } + + // The so-called parsed name would have been "async": get the real name. + parseClassPropertyName(classContextId); + parsePostMemberNameModifiers(); + parseClassMethod(memberStart, false /* isConstructor */); + } else if ( + (token.contextualKeyword === _keywords.ContextualKeyword._get || + token.contextualKeyword === _keywords.ContextualKeyword._set) && + !(_util.isLineTerminator.call(void 0, ) && _tokenizer.match.call(void 0, _types.TokenType.star)) + ) { + if (token.contextualKeyword === _keywords.ContextualKeyword._get) { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._get; + } else { + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._set; + } + // `get\n*` is an uninitialized property named 'get' followed by a generator. + // a getter or setter + // The so-called parsed name would have been "get/set": get the real name. + parseClassPropertyName(classContextId); + parseClassMethod(memberStart, /* isConstructor */ false); + } else if (token.contextualKeyword === _keywords.ContextualKeyword._accessor && !_util.isLineTerminator.call(void 0, )) { + parseClassPropertyName(classContextId); + parseClassProperty(); + } else if (_util.isLineTerminator.call(void 0, )) { + // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) + parseClassProperty(); + } else { + _util.unexpected.call(void 0, ); + } +} + +function parseClassMethod(functionStart, isConstructor) { + if (_base.isTypeScriptEnabled) { + _typescript.tsTryParseTypeParameters.call(void 0, ); + } else if (_base.isFlowEnabled) { + if (_tokenizer.match.call(void 0, _types.TokenType.lessThan)) { + _flow.flowParseTypeParameterDeclaration.call(void 0, ); + } + } + _expression.parseMethod.call(void 0, functionStart, isConstructor); +} + +// Return the name of the class property, if it is a simple identifier. + function parseClassPropertyName(classContextId) { + _expression.parsePropertyName.call(void 0, classContextId); +} exports.parseClassPropertyName = parseClassPropertyName; + + function parsePostMemberNameModifiers() { + if (_base.isTypeScriptEnabled) { + const oldIsType = _tokenizer.pushTypeContext.call(void 0, 0); + _tokenizer.eat.call(void 0, _types.TokenType.question); + _tokenizer.popTypeContext.call(void 0, oldIsType); + } +} exports.parsePostMemberNameModifiers = parsePostMemberNameModifiers; + + function parseClassProperty() { + if (_base.isTypeScriptEnabled) { + _tokenizer.eatTypeToken.call(void 0, _types.TokenType.bang); + _typescript.tsTryParseTypeAnnotation.call(void 0, ); + } else if (_base.isFlowEnabled) { + if (_tokenizer.match.call(void 0, _types.TokenType.colon)) { + _flow.flowParseTypeAnnotation.call(void 0, ); + } + } + + if (_tokenizer.match.call(void 0, _types.TokenType.eq)) { + const equalsTokenIndex = _base.state.tokens.length; + _tokenizer.next.call(void 0, ); + _expression.parseMaybeAssign.call(void 0, ); + _base.state.tokens[equalsTokenIndex].rhsEndIndex = _base.state.tokens.length; + } + _util.semicolon.call(void 0, ); +} exports.parseClassProperty = parseClassProperty; + +function parseClassId(isStatement, optionalId = false) { + if ( + _base.isTypeScriptEnabled && + (!isStatement || optionalId) && + _util.isContextual.call(void 0, _keywords.ContextualKeyword._implements) + ) { + return; + } + + if (_tokenizer.match.call(void 0, _types.TokenType.name)) { + _lval.parseBindingIdentifier.call(void 0, true); + } + + if (_base.isTypeScriptEnabled) { + _typescript.tsTryParseTypeParameters.call(void 0, ); + } else if (_base.isFlowEnabled) { + if (_tokenizer.match.call(void 0, _types.TokenType.lessThan)) { + _flow.flowParseTypeParameterDeclaration.call(void 0, ); + } + } +} + +// Returns true if there was a superclass. +function parseClassSuper() { + let hasSuper = false; + if (_tokenizer.eat.call(void 0, _types.TokenType._extends)) { + _expression.parseExprSubscripts.call(void 0, ); + hasSuper = true; + } else { + hasSuper = false; + } + if (_base.isTypeScriptEnabled) { + _typescript.tsAfterParseClassSuper.call(void 0, hasSuper); + } else if (_base.isFlowEnabled) { + _flow.flowAfterParseClassSuper.call(void 0, hasSuper); + } +} + +// Parses module export declaration. + + function parseExport() { + const exportIndex = _base.state.tokens.length - 1; + if (_base.isTypeScriptEnabled) { + if (_typescript.tsTryParseExport.call(void 0, )) { + return; + } + } + // export * from '...' + if (shouldParseExportStar()) { + parseExportStar(); + } else if (isExportDefaultSpecifier()) { + // export default from + _expression.parseIdentifier.call(void 0, ); + if (_tokenizer.match.call(void 0, _types.TokenType.comma) && _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.star) { + _util.expect.call(void 0, _types.TokenType.comma); + _util.expect.call(void 0, _types.TokenType.star); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._as); + _expression.parseIdentifier.call(void 0, ); + } else { + parseExportSpecifiersMaybe(); + } + parseExportFrom(); + } else if (_tokenizer.eat.call(void 0, _types.TokenType._default)) { + // export default ... + parseExportDefaultExpression(); + } else if (shouldParseExportDeclaration()) { + parseExportDeclaration(); + } else { + // export { x, y as z } [from '...'] + parseExportSpecifiers(); + parseExportFrom(); + } + _base.state.tokens[exportIndex].rhsEndIndex = _base.state.tokens.length; +} exports.parseExport = parseExport; + +function parseExportDefaultExpression() { + if (_base.isTypeScriptEnabled) { + if (_typescript.tsTryParseExportDefaultExpression.call(void 0, )) { + return; + } + } + if (_base.isFlowEnabled) { + if (_flow.flowTryParseExportDefaultExpression.call(void 0, )) { + return; + } + } + const functionStart = _base.state.start; + if (_tokenizer.eat.call(void 0, _types.TokenType._function)) { + parseFunction(functionStart, true, true); + } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._async) && _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType._function) { + // async function declaration + _util.eatContextual.call(void 0, _keywords.ContextualKeyword._async); + _tokenizer.eat.call(void 0, _types.TokenType._function); + parseFunction(functionStart, true, true); + } else if (_tokenizer.match.call(void 0, _types.TokenType._class)) { + parseClass(true, true); + } else if (_tokenizer.match.call(void 0, _types.TokenType.at)) { + parseDecorators(); + parseClass(true, true); + } else { + _expression.parseMaybeAssign.call(void 0, ); + _util.semicolon.call(void 0, ); + } +} + +function parseExportDeclaration() { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseExportDeclaration.call(void 0, ); + } else if (_base.isFlowEnabled) { + _flow.flowParseExportDeclaration.call(void 0, ); + } else { + parseStatement(true); + } +} + +function isExportDefaultSpecifier() { + if (_base.isTypeScriptEnabled && _typescript.tsIsDeclarationStart.call(void 0, )) { + return false; + } else if (_base.isFlowEnabled && _flow.flowShouldDisallowExportDefaultSpecifier.call(void 0, )) { + return false; + } + if (_tokenizer.match.call(void 0, _types.TokenType.name)) { + return _base.state.contextualKeyword !== _keywords.ContextualKeyword._async; + } + + if (!_tokenizer.match.call(void 0, _types.TokenType._default)) { + return false; + } + + const _next = _tokenizer.nextTokenStart.call(void 0, ); + const lookahead = _tokenizer.lookaheadTypeAndKeyword.call(void 0, ); + const hasFrom = + lookahead.type === _types.TokenType.name && lookahead.contextualKeyword === _keywords.ContextualKeyword._from; + if (lookahead.type === _types.TokenType.comma) { + return true; + } + // lookahead again when `export default from` is seen + if (hasFrom) { + const nextAfterFrom = _base.input.charCodeAt(_tokenizer.nextTokenStartSince.call(void 0, _next + 4)); + return nextAfterFrom === _charcodes.charCodes.quotationMark || nextAfterFrom === _charcodes.charCodes.apostrophe; + } + return false; +} + +function parseExportSpecifiersMaybe() { + if (_tokenizer.eat.call(void 0, _types.TokenType.comma)) { + parseExportSpecifiers(); + } +} + + function parseExportFrom() { + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._from)) { + _expression.parseExprAtom.call(void 0, ); + maybeParseImportAttributes(); + } + _util.semicolon.call(void 0, ); +} exports.parseExportFrom = parseExportFrom; + +function shouldParseExportStar() { + if (_base.isFlowEnabled) { + return _flow.flowShouldParseExportStar.call(void 0, ); + } else { + return _tokenizer.match.call(void 0, _types.TokenType.star); + } +} + +function parseExportStar() { + if (_base.isFlowEnabled) { + _flow.flowParseExportStar.call(void 0, ); + } else { + baseParseExportStar(); + } +} + + function baseParseExportStar() { + _util.expect.call(void 0, _types.TokenType.star); + + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._as)) { + parseExportNamespace(); + } else { + parseExportFrom(); + } +} exports.baseParseExportStar = baseParseExportStar; + +function parseExportNamespace() { + _tokenizer.next.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._as; + _expression.parseIdentifier.call(void 0, ); + parseExportSpecifiersMaybe(); + parseExportFrom(); +} + +function shouldParseExportDeclaration() { + return ( + (_base.isTypeScriptEnabled && _typescript.tsIsDeclarationStart.call(void 0, )) || + (_base.isFlowEnabled && _flow.flowShouldParseExportDeclaration.call(void 0, )) || + _base.state.type === _types.TokenType._var || + _base.state.type === _types.TokenType._const || + _base.state.type === _types.TokenType._let || + _base.state.type === _types.TokenType._function || + _base.state.type === _types.TokenType._class || + _util.isContextual.call(void 0, _keywords.ContextualKeyword._async) || + _tokenizer.match.call(void 0, _types.TokenType.at) + ); +} + +// Parses a comma-separated list of module exports. + function parseExportSpecifiers() { + let first = true; + + // export { x, y as z } [from '...'] + _util.expect.call(void 0, _types.TokenType.braceL); + + while (!_tokenizer.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + if (first) { + first = false; + } else { + _util.expect.call(void 0, _types.TokenType.comma); + if (_tokenizer.eat.call(void 0, _types.TokenType.braceR)) { + break; + } + } + parseExportSpecifier(); + } +} exports.parseExportSpecifiers = parseExportSpecifiers; + +function parseExportSpecifier() { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseExportSpecifier.call(void 0, ); + return; + } + _expression.parseIdentifier.call(void 0, ); + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _tokenizer.IdentifierRole.ExportAccess; + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { + _expression.parseIdentifier.call(void 0, ); + } +} + +/** + * Starting at the `module` token in an import, determine if it was truly an + * import reflection token or just looks like one. + * + * Returns true for: + * import module foo from "foo"; + * import module from from "foo"; + * + * Returns false for: + * import module from "foo"; + * import module, {bar} from "foo"; + */ +function isImportReflection() { + const snapshot = _base.state.snapshot(); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._module); + if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._from)) { + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._from)) { + _base.state.restoreFromSnapshot(snapshot); + return true; + } else { + _base.state.restoreFromSnapshot(snapshot); + return false; + } + } else if (_tokenizer.match.call(void 0, _types.TokenType.comma)) { + _base.state.restoreFromSnapshot(snapshot); + return false; + } else { + _base.state.restoreFromSnapshot(snapshot); + return true; + } +} + +/** + * Eat the "module" token from the import reflection proposal. + * https://github.com/tc39/proposal-import-reflection + */ +function parseMaybeImportReflection() { + // isImportReflection does snapshot/restore, so only run it if we see the word + // "module". + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._module) && isImportReflection()) { + _tokenizer.next.call(void 0, ); + } +} + +// Parses import declaration. + + function parseImport() { + if (_base.isTypeScriptEnabled && _tokenizer.match.call(void 0, _types.TokenType.name) && _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.eq) { + _typescript.tsParseImportEqualsDeclaration.call(void 0, ); + return; + } + if (_base.isTypeScriptEnabled && _util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { + const lookahead = _tokenizer.lookaheadTypeAndKeyword.call(void 0, ); + if (lookahead.type === _types.TokenType.name && lookahead.contextualKeyword !== _keywords.ContextualKeyword._from) { + // One of these `import type` cases: + // import type T = require('T'); + // import type A from 'A'; + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); + if (_tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.eq) { + _typescript.tsParseImportEqualsDeclaration.call(void 0, ); + return; + } + // If this is an `import type...from` statement, then we already ate the + // type token, so proceed to the regular import parser. + } else if (lookahead.type === _types.TokenType.star || lookahead.type === _types.TokenType.braceL) { + // One of these `import type` cases, in which case we can eat the type token + // and proceed as normal: + // import type * as A from 'A'; + // import type {a} from 'A'; + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); + } + // Otherwise, we are importing the name "type". + } + + // import '...' + if (_tokenizer.match.call(void 0, _types.TokenType.string)) { + _expression.parseExprAtom.call(void 0, ); + } else { + parseMaybeImportReflection(); + parseImportSpecifiers(); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._from); + _expression.parseExprAtom.call(void 0, ); + } + maybeParseImportAttributes(); + _util.semicolon.call(void 0, ); +} exports.parseImport = parseImport; + +// eslint-disable-next-line no-unused-vars +function shouldParseDefaultImport() { + return _tokenizer.match.call(void 0, _types.TokenType.name); +} + +function parseImportSpecifierLocal() { + _lval.parseImportedIdentifier.call(void 0, ); +} + +// Parses a comma-separated list of module imports. +function parseImportSpecifiers() { + if (_base.isFlowEnabled) { + _flow.flowStartParseImportSpecifiers.call(void 0, ); + } + + let first = true; + if (shouldParseDefaultImport()) { + // import defaultObj, { x, y as z } from '...' + parseImportSpecifierLocal(); + + if (!_tokenizer.eat.call(void 0, _types.TokenType.comma)) return; + } + + if (_tokenizer.match.call(void 0, _types.TokenType.star)) { + _tokenizer.next.call(void 0, ); + _util.expectContextual.call(void 0, _keywords.ContextualKeyword._as); + + parseImportSpecifierLocal(); + + return; + } + + _util.expect.call(void 0, _types.TokenType.braceL); + while (!_tokenizer.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { + if (first) { + first = false; + } else { + // Detect an attempt to deep destructure + if (_tokenizer.eat.call(void 0, _types.TokenType.colon)) { + _util.unexpected.call(void 0, + "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", + ); + } + + _util.expect.call(void 0, _types.TokenType.comma); + if (_tokenizer.eat.call(void 0, _types.TokenType.braceR)) { + break; + } + } + + parseImportSpecifier(); + } +} + +function parseImportSpecifier() { + if (_base.isTypeScriptEnabled) { + _typescript.tsParseImportSpecifier.call(void 0, ); + return; + } + if (_base.isFlowEnabled) { + _flow.flowParseImportSpecifier.call(void 0, ); + return; + } + _lval.parseImportedIdentifier.call(void 0, ); + if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._as)) { + _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _tokenizer.IdentifierRole.ImportAccess; + _tokenizer.next.call(void 0, ); + _lval.parseImportedIdentifier.call(void 0, ); + } +} + +/** + * Parse import attributes like `with {type: "json"}`, or the legacy form + * `assert {type: "json"}`. + * + * Import attributes technically have their own syntax, but are always parseable + * as a plain JS object, so just do that for simplicity. + */ +function maybeParseImportAttributes() { + if (_tokenizer.match.call(void 0, _types.TokenType._with) || (_util.isContextual.call(void 0, _keywords.ContextualKeyword._assert) && !_util.hasPrecedingLineBreak.call(void 0, ))) { + _tokenizer.next.call(void 0, ); + _expression.parseObj.call(void 0, false, false); + } +} diff --git a/node_modules/sucrase/dist/parser/traverser/util.js b/node_modules/sucrase/dist/parser/traverser/util.js new file mode 100644 index 0000000..8ade800 --- /dev/null +++ b/node_modules/sucrase/dist/parser/traverser/util.js @@ -0,0 +1,104 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _index = require('../tokenizer/index'); + +var _types = require('../tokenizer/types'); +var _charcodes = require('../util/charcodes'); +var _base = require('./base'); + +// ## Parser utilities + +// Tests whether parsed token is a contextual keyword. + function isContextual(contextualKeyword) { + return _base.state.contextualKeyword === contextualKeyword; +} exports.isContextual = isContextual; + + function isLookaheadContextual(contextualKeyword) { + const l = _index.lookaheadTypeAndKeyword.call(void 0, ); + return l.type === _types.TokenType.name && l.contextualKeyword === contextualKeyword; +} exports.isLookaheadContextual = isLookaheadContextual; + +// Consumes contextual keyword if possible. + function eatContextual(contextualKeyword) { + return _base.state.contextualKeyword === contextualKeyword && _index.eat.call(void 0, _types.TokenType.name); +} exports.eatContextual = eatContextual; + +// Asserts that following token is given contextual keyword. + function expectContextual(contextualKeyword) { + if (!eatContextual(contextualKeyword)) { + unexpected(); + } +} exports.expectContextual = expectContextual; + +// Test whether a semicolon can be inserted at the current position. + function canInsertSemicolon() { + return _index.match.call(void 0, _types.TokenType.eof) || _index.match.call(void 0, _types.TokenType.braceR) || hasPrecedingLineBreak(); +} exports.canInsertSemicolon = canInsertSemicolon; + + function hasPrecedingLineBreak() { + const prevToken = _base.state.tokens[_base.state.tokens.length - 1]; + const lastTokEnd = prevToken ? prevToken.end : 0; + for (let i = lastTokEnd; i < _base.state.start; i++) { + const code = _base.input.charCodeAt(i); + if ( + code === _charcodes.charCodes.lineFeed || + code === _charcodes.charCodes.carriageReturn || + code === 0x2028 || + code === 0x2029 + ) { + return true; + } + } + return false; +} exports.hasPrecedingLineBreak = hasPrecedingLineBreak; + + function hasFollowingLineBreak() { + const nextStart = _index.nextTokenStart.call(void 0, ); + for (let i = _base.state.end; i < nextStart; i++) { + const code = _base.input.charCodeAt(i); + if ( + code === _charcodes.charCodes.lineFeed || + code === _charcodes.charCodes.carriageReturn || + code === 0x2028 || + code === 0x2029 + ) { + return true; + } + } + return false; +} exports.hasFollowingLineBreak = hasFollowingLineBreak; + + function isLineTerminator() { + return _index.eat.call(void 0, _types.TokenType.semi) || canInsertSemicolon(); +} exports.isLineTerminator = isLineTerminator; + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. + function semicolon() { + if (!isLineTerminator()) { + unexpected('Unexpected token, expected ";"'); + } +} exports.semicolon = semicolon; + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error at given pos. + function expect(type) { + const matched = _index.eat.call(void 0, type); + if (!matched) { + unexpected(`Unexpected token, expected "${_types.formatTokenType.call(void 0, type)}"`); + } +} exports.expect = expect; + +/** + * Transition the parser to an error state. All code needs to be written to naturally unwind in this + * state, which allows us to backtrack without exceptions and without error plumbing everywhere. + */ + function unexpected(message = "Unexpected token", pos = _base.state.start) { + if (_base.state.error) { + return; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const err = new SyntaxError(message); + err.pos = pos; + _base.state.error = err; + _base.state.pos = _base.input.length; + _index.finishToken.call(void 0, _types.TokenType.eof); +} exports.unexpected = unexpected; diff --git a/node_modules/sucrase/dist/parser/util/charcodes.js b/node_modules/sucrase/dist/parser/util/charcodes.js new file mode 100644 index 0000000..52bebc4 --- /dev/null +++ b/node_modules/sucrase/dist/parser/util/charcodes.js @@ -0,0 +1,115 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var charCodes; (function (charCodes) { + const backSpace = 8; charCodes[charCodes["backSpace"] = backSpace] = "backSpace"; + const lineFeed = 10; charCodes[charCodes["lineFeed"] = lineFeed] = "lineFeed"; // '\n' + const tab = 9; charCodes[charCodes["tab"] = tab] = "tab"; // '\t' + const carriageReturn = 13; charCodes[charCodes["carriageReturn"] = carriageReturn] = "carriageReturn"; // '\r' + const shiftOut = 14; charCodes[charCodes["shiftOut"] = shiftOut] = "shiftOut"; + const space = 32; charCodes[charCodes["space"] = space] = "space"; + const exclamationMark = 33; charCodes[charCodes["exclamationMark"] = exclamationMark] = "exclamationMark"; // '!' + const quotationMark = 34; charCodes[charCodes["quotationMark"] = quotationMark] = "quotationMark"; // '"' + const numberSign = 35; charCodes[charCodes["numberSign"] = numberSign] = "numberSign"; // '#' + const dollarSign = 36; charCodes[charCodes["dollarSign"] = dollarSign] = "dollarSign"; // '$' + const percentSign = 37; charCodes[charCodes["percentSign"] = percentSign] = "percentSign"; // '%' + const ampersand = 38; charCodes[charCodes["ampersand"] = ampersand] = "ampersand"; // '&' + const apostrophe = 39; charCodes[charCodes["apostrophe"] = apostrophe] = "apostrophe"; // ''' + const leftParenthesis = 40; charCodes[charCodes["leftParenthesis"] = leftParenthesis] = "leftParenthesis"; // '(' + const rightParenthesis = 41; charCodes[charCodes["rightParenthesis"] = rightParenthesis] = "rightParenthesis"; // ')' + const asterisk = 42; charCodes[charCodes["asterisk"] = asterisk] = "asterisk"; // '*' + const plusSign = 43; charCodes[charCodes["plusSign"] = plusSign] = "plusSign"; // '+' + const comma = 44; charCodes[charCodes["comma"] = comma] = "comma"; // ',' + const dash = 45; charCodes[charCodes["dash"] = dash] = "dash"; // '-' + const dot = 46; charCodes[charCodes["dot"] = dot] = "dot"; // '.' + const slash = 47; charCodes[charCodes["slash"] = slash] = "slash"; // '/' + const digit0 = 48; charCodes[charCodes["digit0"] = digit0] = "digit0"; // '0' + const digit1 = 49; charCodes[charCodes["digit1"] = digit1] = "digit1"; // '1' + const digit2 = 50; charCodes[charCodes["digit2"] = digit2] = "digit2"; // '2' + const digit3 = 51; charCodes[charCodes["digit3"] = digit3] = "digit3"; // '3' + const digit4 = 52; charCodes[charCodes["digit4"] = digit4] = "digit4"; // '4' + const digit5 = 53; charCodes[charCodes["digit5"] = digit5] = "digit5"; // '5' + const digit6 = 54; charCodes[charCodes["digit6"] = digit6] = "digit6"; // '6' + const digit7 = 55; charCodes[charCodes["digit7"] = digit7] = "digit7"; // '7' + const digit8 = 56; charCodes[charCodes["digit8"] = digit8] = "digit8"; // '8' + const digit9 = 57; charCodes[charCodes["digit9"] = digit9] = "digit9"; // '9' + const colon = 58; charCodes[charCodes["colon"] = colon] = "colon"; // ':' + const semicolon = 59; charCodes[charCodes["semicolon"] = semicolon] = "semicolon"; // ';' + const lessThan = 60; charCodes[charCodes["lessThan"] = lessThan] = "lessThan"; // '<' + const equalsTo = 61; charCodes[charCodes["equalsTo"] = equalsTo] = "equalsTo"; // '=' + const greaterThan = 62; charCodes[charCodes["greaterThan"] = greaterThan] = "greaterThan"; // '>' + const questionMark = 63; charCodes[charCodes["questionMark"] = questionMark] = "questionMark"; // '?' + const atSign = 64; charCodes[charCodes["atSign"] = atSign] = "atSign"; // '@' + const uppercaseA = 65; charCodes[charCodes["uppercaseA"] = uppercaseA] = "uppercaseA"; // 'A' + const uppercaseB = 66; charCodes[charCodes["uppercaseB"] = uppercaseB] = "uppercaseB"; // 'B' + const uppercaseC = 67; charCodes[charCodes["uppercaseC"] = uppercaseC] = "uppercaseC"; // 'C' + const uppercaseD = 68; charCodes[charCodes["uppercaseD"] = uppercaseD] = "uppercaseD"; // 'D' + const uppercaseE = 69; charCodes[charCodes["uppercaseE"] = uppercaseE] = "uppercaseE"; // 'E' + const uppercaseF = 70; charCodes[charCodes["uppercaseF"] = uppercaseF] = "uppercaseF"; // 'F' + const uppercaseG = 71; charCodes[charCodes["uppercaseG"] = uppercaseG] = "uppercaseG"; // 'G' + const uppercaseH = 72; charCodes[charCodes["uppercaseH"] = uppercaseH] = "uppercaseH"; // 'H' + const uppercaseI = 73; charCodes[charCodes["uppercaseI"] = uppercaseI] = "uppercaseI"; // 'I' + const uppercaseJ = 74; charCodes[charCodes["uppercaseJ"] = uppercaseJ] = "uppercaseJ"; // 'J' + const uppercaseK = 75; charCodes[charCodes["uppercaseK"] = uppercaseK] = "uppercaseK"; // 'K' + const uppercaseL = 76; charCodes[charCodes["uppercaseL"] = uppercaseL] = "uppercaseL"; // 'L' + const uppercaseM = 77; charCodes[charCodes["uppercaseM"] = uppercaseM] = "uppercaseM"; // 'M' + const uppercaseN = 78; charCodes[charCodes["uppercaseN"] = uppercaseN] = "uppercaseN"; // 'N' + const uppercaseO = 79; charCodes[charCodes["uppercaseO"] = uppercaseO] = "uppercaseO"; // 'O' + const uppercaseP = 80; charCodes[charCodes["uppercaseP"] = uppercaseP] = "uppercaseP"; // 'P' + const uppercaseQ = 81; charCodes[charCodes["uppercaseQ"] = uppercaseQ] = "uppercaseQ"; // 'Q' + const uppercaseR = 82; charCodes[charCodes["uppercaseR"] = uppercaseR] = "uppercaseR"; // 'R' + const uppercaseS = 83; charCodes[charCodes["uppercaseS"] = uppercaseS] = "uppercaseS"; // 'S' + const uppercaseT = 84; charCodes[charCodes["uppercaseT"] = uppercaseT] = "uppercaseT"; // 'T' + const uppercaseU = 85; charCodes[charCodes["uppercaseU"] = uppercaseU] = "uppercaseU"; // 'U' + const uppercaseV = 86; charCodes[charCodes["uppercaseV"] = uppercaseV] = "uppercaseV"; // 'V' + const uppercaseW = 87; charCodes[charCodes["uppercaseW"] = uppercaseW] = "uppercaseW"; // 'W' + const uppercaseX = 88; charCodes[charCodes["uppercaseX"] = uppercaseX] = "uppercaseX"; // 'X' + const uppercaseY = 89; charCodes[charCodes["uppercaseY"] = uppercaseY] = "uppercaseY"; // 'Y' + const uppercaseZ = 90; charCodes[charCodes["uppercaseZ"] = uppercaseZ] = "uppercaseZ"; // 'Z' + const leftSquareBracket = 91; charCodes[charCodes["leftSquareBracket"] = leftSquareBracket] = "leftSquareBracket"; // '[' + const backslash = 92; charCodes[charCodes["backslash"] = backslash] = "backslash"; // '\ ' + const rightSquareBracket = 93; charCodes[charCodes["rightSquareBracket"] = rightSquareBracket] = "rightSquareBracket"; // ']' + const caret = 94; charCodes[charCodes["caret"] = caret] = "caret"; // '^' + const underscore = 95; charCodes[charCodes["underscore"] = underscore] = "underscore"; // '_' + const graveAccent = 96; charCodes[charCodes["graveAccent"] = graveAccent] = "graveAccent"; // '`' + const lowercaseA = 97; charCodes[charCodes["lowercaseA"] = lowercaseA] = "lowercaseA"; // 'a' + const lowercaseB = 98; charCodes[charCodes["lowercaseB"] = lowercaseB] = "lowercaseB"; // 'b' + const lowercaseC = 99; charCodes[charCodes["lowercaseC"] = lowercaseC] = "lowercaseC"; // 'c' + const lowercaseD = 100; charCodes[charCodes["lowercaseD"] = lowercaseD] = "lowercaseD"; // 'd' + const lowercaseE = 101; charCodes[charCodes["lowercaseE"] = lowercaseE] = "lowercaseE"; // 'e' + const lowercaseF = 102; charCodes[charCodes["lowercaseF"] = lowercaseF] = "lowercaseF"; // 'f' + const lowercaseG = 103; charCodes[charCodes["lowercaseG"] = lowercaseG] = "lowercaseG"; // 'g' + const lowercaseH = 104; charCodes[charCodes["lowercaseH"] = lowercaseH] = "lowercaseH"; // 'h' + const lowercaseI = 105; charCodes[charCodes["lowercaseI"] = lowercaseI] = "lowercaseI"; // 'i' + const lowercaseJ = 106; charCodes[charCodes["lowercaseJ"] = lowercaseJ] = "lowercaseJ"; // 'j' + const lowercaseK = 107; charCodes[charCodes["lowercaseK"] = lowercaseK] = "lowercaseK"; // 'k' + const lowercaseL = 108; charCodes[charCodes["lowercaseL"] = lowercaseL] = "lowercaseL"; // 'l' + const lowercaseM = 109; charCodes[charCodes["lowercaseM"] = lowercaseM] = "lowercaseM"; // 'm' + const lowercaseN = 110; charCodes[charCodes["lowercaseN"] = lowercaseN] = "lowercaseN"; // 'n' + const lowercaseO = 111; charCodes[charCodes["lowercaseO"] = lowercaseO] = "lowercaseO"; // 'o' + const lowercaseP = 112; charCodes[charCodes["lowercaseP"] = lowercaseP] = "lowercaseP"; // 'p' + const lowercaseQ = 113; charCodes[charCodes["lowercaseQ"] = lowercaseQ] = "lowercaseQ"; // 'q' + const lowercaseR = 114; charCodes[charCodes["lowercaseR"] = lowercaseR] = "lowercaseR"; // 'r' + const lowercaseS = 115; charCodes[charCodes["lowercaseS"] = lowercaseS] = "lowercaseS"; // 's' + const lowercaseT = 116; charCodes[charCodes["lowercaseT"] = lowercaseT] = "lowercaseT"; // 't' + const lowercaseU = 117; charCodes[charCodes["lowercaseU"] = lowercaseU] = "lowercaseU"; // 'u' + const lowercaseV = 118; charCodes[charCodes["lowercaseV"] = lowercaseV] = "lowercaseV"; // 'v' + const lowercaseW = 119; charCodes[charCodes["lowercaseW"] = lowercaseW] = "lowercaseW"; // 'w' + const lowercaseX = 120; charCodes[charCodes["lowercaseX"] = lowercaseX] = "lowercaseX"; // 'x' + const lowercaseY = 121; charCodes[charCodes["lowercaseY"] = lowercaseY] = "lowercaseY"; // 'y' + const lowercaseZ = 122; charCodes[charCodes["lowercaseZ"] = lowercaseZ] = "lowercaseZ"; // 'z' + const leftCurlyBrace = 123; charCodes[charCodes["leftCurlyBrace"] = leftCurlyBrace] = "leftCurlyBrace"; // '{' + const verticalBar = 124; charCodes[charCodes["verticalBar"] = verticalBar] = "verticalBar"; // '|' + const rightCurlyBrace = 125; charCodes[charCodes["rightCurlyBrace"] = rightCurlyBrace] = "rightCurlyBrace"; // '}' + const tilde = 126; charCodes[charCodes["tilde"] = tilde] = "tilde"; // '~' + const nonBreakingSpace = 160; charCodes[charCodes["nonBreakingSpace"] = nonBreakingSpace] = "nonBreakingSpace"; + // eslint-disable-next-line no-irregular-whitespace + const oghamSpaceMark = 5760; charCodes[charCodes["oghamSpaceMark"] = oghamSpaceMark] = "oghamSpaceMark"; // ' ' + const lineSeparator = 8232; charCodes[charCodes["lineSeparator"] = lineSeparator] = "lineSeparator"; + const paragraphSeparator = 8233; charCodes[charCodes["paragraphSeparator"] = paragraphSeparator] = "paragraphSeparator"; +})(charCodes || (exports.charCodes = charCodes = {})); + + function isDigit(code) { + return ( + (code >= charCodes.digit0 && code <= charCodes.digit9) || + (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || + (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) + ); +} exports.isDigit = isDigit; diff --git a/node_modules/sucrase/dist/parser/util/identifier.js b/node_modules/sucrase/dist/parser/util/identifier.js new file mode 100644 index 0000000..9a2813c --- /dev/null +++ b/node_modules/sucrase/dist/parser/util/identifier.js @@ -0,0 +1,34 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _charcodes = require('./charcodes'); +var _whitespace = require('./whitespace'); + +function computeIsIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code < 128) return false; + throw new Error("Should not be called with non-ASCII char code."); +} + + const IS_IDENTIFIER_CHAR = new Uint8Array(65536); exports.IS_IDENTIFIER_CHAR = IS_IDENTIFIER_CHAR; +for (let i = 0; i < 128; i++) { + exports.IS_IDENTIFIER_CHAR[i] = computeIsIdentifierChar(i) ? 1 : 0; +} +for (let i = 128; i < 65536; i++) { + exports.IS_IDENTIFIER_CHAR[i] = 1; +} +// Aside from whitespace and newlines, all characters outside the ASCII space are either +// identifier characters or invalid. Since we're not performing code validation, we can just +// treat all invalid characters as identifier characters. +for (const whitespaceChar of _whitespace.WHITESPACE_CHARS) { + exports.IS_IDENTIFIER_CHAR[whitespaceChar] = 0; +} +exports.IS_IDENTIFIER_CHAR[0x2028] = 0; +exports.IS_IDENTIFIER_CHAR[0x2029] = 0; + + const IS_IDENTIFIER_START = exports.IS_IDENTIFIER_CHAR.slice(); exports.IS_IDENTIFIER_START = IS_IDENTIFIER_START; +for (let numChar = _charcodes.charCodes.digit0; numChar <= _charcodes.charCodes.digit9; numChar++) { + exports.IS_IDENTIFIER_START[numChar] = 0; +} diff --git a/node_modules/sucrase/dist/parser/util/whitespace.js b/node_modules/sucrase/dist/parser/util/whitespace.js new file mode 100644 index 0000000..55bb994 --- /dev/null +++ b/node_modules/sucrase/dist/parser/util/whitespace.js @@ -0,0 +1,33 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _charcodes = require('./charcodes'); + +// https://tc39.github.io/ecma262/#sec-white-space + const WHITESPACE_CHARS = [ + 0x0009, + 0x000b, + 0x000c, + _charcodes.charCodes.space, + _charcodes.charCodes.nonBreakingSpace, + _charcodes.charCodes.oghamSpaceMark, + 0x2000, // EN QUAD + 0x2001, // EM QUAD + 0x2002, // EN SPACE + 0x2003, // EM SPACE + 0x2004, // THREE-PER-EM SPACE + 0x2005, // FOUR-PER-EM SPACE + 0x2006, // SIX-PER-EM SPACE + 0x2007, // FIGURE SPACE + 0x2008, // PUNCTUATION SPACE + 0x2009, // THIN SPACE + 0x200a, // HAIR SPACE + 0x202f, // NARROW NO-BREAK SPACE + 0x205f, // MEDIUM MATHEMATICAL SPACE + 0x3000, // IDEOGRAPHIC SPACE + 0xfeff, // ZERO WIDTH NO-BREAK SPACE +]; exports.WHITESPACE_CHARS = WHITESPACE_CHARS; + + const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; exports.skipWhiteSpace = skipWhiteSpace; + + const IS_WHITESPACE = new Uint8Array(65536); exports.IS_WHITESPACE = IS_WHITESPACE; +for (const char of exports.WHITESPACE_CHARS) { + exports.IS_WHITESPACE[char] = 1; +} diff --git a/node_modules/sucrase/dist/register.js b/node_modules/sucrase/dist/register.js new file mode 100644 index 0000000..1325f30 --- /dev/null +++ b/node_modules/sucrase/dist/register.js @@ -0,0 +1,88 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _pirates = require('pirates'); var pirates = _interopRequireWildcard(_pirates); + +var _index = require('./index'); + + + + + + + + + function addHook( + extension, + sucraseOptions, + hookOptions, +) { + let mergedSucraseOptions = sucraseOptions; + const sucraseOptionsEnvJSON = process.env.SUCRASE_OPTIONS; + if (sucraseOptionsEnvJSON) { + mergedSucraseOptions = {...mergedSucraseOptions, ...JSON.parse(sucraseOptionsEnvJSON)}; + } + return pirates.addHook( + (code, filePath) => { + const {code: transformedCode, sourceMap} = _index.transform.call(void 0, code, { + ...mergedSucraseOptions, + sourceMapOptions: {compiledFilename: filePath}, + filePath, + }); + const mapBase64 = Buffer.from(JSON.stringify(sourceMap)).toString("base64"); + const suffix = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${mapBase64}`; + return `${transformedCode}\n${suffix}`; + }, + {...hookOptions, exts: [extension]}, + ); +} exports.addHook = addHook; + + function registerJS(hookOptions) { + return addHook(".js", {transforms: ["imports", "flow", "jsx"]}, hookOptions); +} exports.registerJS = registerJS; + + function registerJSX(hookOptions) { + return addHook(".jsx", {transforms: ["imports", "flow", "jsx"]}, hookOptions); +} exports.registerJSX = registerJSX; + + function registerTS(hookOptions) { + return addHook(".ts", {transforms: ["imports", "typescript"]}, hookOptions); +} exports.registerTS = registerTS; + + function registerTSX(hookOptions) { + return addHook(".tsx", {transforms: ["imports", "typescript", "jsx"]}, hookOptions); +} exports.registerTSX = registerTSX; + + function registerTSLegacyModuleInterop(hookOptions) { + return addHook( + ".ts", + { + transforms: ["imports", "typescript"], + enableLegacyTypeScriptModuleInterop: true, + }, + hookOptions, + ); +} exports.registerTSLegacyModuleInterop = registerTSLegacyModuleInterop; + + function registerTSXLegacyModuleInterop(hookOptions) { + return addHook( + ".tsx", + { + transforms: ["imports", "typescript", "jsx"], + enableLegacyTypeScriptModuleInterop: true, + }, + hookOptions, + ); +} exports.registerTSXLegacyModuleInterop = registerTSXLegacyModuleInterop; + + function registerAll(hookOptions) { + const reverts = [ + registerJS(hookOptions), + registerJSX(hookOptions), + registerTS(hookOptions), + registerTSX(hookOptions), + ]; + + return () => { + for (const fn of reverts) { + fn(); + } + }; +} exports.registerAll = registerAll; diff --git a/node_modules/sucrase/dist/transformers/CJSImportTransformer.js b/node_modules/sucrase/dist/transformers/CJSImportTransformer.js new file mode 100644 index 0000000..170e5bb --- /dev/null +++ b/node_modules/sucrase/dist/transformers/CJSImportTransformer.js @@ -0,0 +1,916 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + +var _tokenizer = require('../parser/tokenizer'); +var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + +var _elideImportEquals = require('../util/elideImportEquals'); var _elideImportEquals2 = _interopRequireDefault(_elideImportEquals); + + + +var _getDeclarationInfo = require('../util/getDeclarationInfo'); var _getDeclarationInfo2 = _interopRequireDefault(_getDeclarationInfo); +var _getImportExportSpecifierInfo = require('../util/getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo); +var _isExportFrom = require('../util/isExportFrom'); var _isExportFrom2 = _interopRequireDefault(_isExportFrom); +var _removeMaybeImportAttributes = require('../util/removeMaybeImportAttributes'); +var _shouldElideDefaultExport = require('../util/shouldElideDefaultExport'); var _shouldElideDefaultExport2 = _interopRequireDefault(_shouldElideDefaultExport); + + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + +/** + * Class for editing import statements when we are transforming to commonjs. + */ + class CJSImportTransformer extends _Transformer2.default { + __init() {this.hadExport = false} + __init2() {this.hadNamedExport = false} + __init3() {this.hadDefaultExport = false} + + + constructor( + rootTransformer, + tokens, + importProcessor, + nameManager, + helperManager, + reactHotLoaderTransformer, + enableLegacyBabel5ModuleInterop, + enableLegacyTypeScriptModuleInterop, + isTypeScriptTransformEnabled, + isFlowTransformEnabled, + preserveDynamicImport, + keepUnusedImports, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.enableLegacyBabel5ModuleInterop = enableLegacyBabel5ModuleInterop;this.enableLegacyTypeScriptModuleInterop = enableLegacyTypeScriptModuleInterop;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.preserveDynamicImport = preserveDynamicImport;this.keepUnusedImports = keepUnusedImports;CJSImportTransformer.prototype.__init.call(this);CJSImportTransformer.prototype.__init2.call(this);CJSImportTransformer.prototype.__init3.call(this);; + this.declarationInfo = isTypeScriptTransformEnabled + ? _getDeclarationInfo2.default.call(void 0, tokens) + : _getDeclarationInfo.EMPTY_DECLARATION_INFO; + } + + getPrefixCode() { + let prefix = ""; + if (this.hadExport) { + prefix += 'Object.defineProperty(exports, "__esModule", {value: true});'; + } + return prefix; + } + + getSuffixCode() { + if (this.enableLegacyBabel5ModuleInterop && this.hadDefaultExport && !this.hadNamedExport) { + return "\nmodule.exports = exports.default;\n"; + } + return ""; + } + + process() { + // TypeScript `import foo = require('foo');` should always just be translated to plain require. + if (this.tokens.matches3(_types.TokenType._import, _types.TokenType.name, _types.TokenType.eq)) { + return this.processImportEquals(); + } + if (this.tokens.matches1(_types.TokenType._import)) { + this.processImport(); + return true; + } + if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.eq)) { + this.tokens.replaceToken("module.exports"); + return true; + } + if (this.tokens.matches1(_types.TokenType._export) && !this.tokens.currentToken().isType) { + this.hadExport = true; + return this.processExport(); + } + if (this.tokens.matches2(_types.TokenType.name, _types.TokenType.postIncDec)) { + // Fall through to normal identifier matching if this doesn't apply. + if (this.processPostIncDec()) { + return true; + } + } + if (this.tokens.matches1(_types.TokenType.name) || this.tokens.matches1(_types.TokenType.jsxName)) { + return this.processIdentifier(); + } + if (this.tokens.matches1(_types.TokenType.eq)) { + return this.processAssignment(); + } + if (this.tokens.matches1(_types.TokenType.assign)) { + return this.processComplexAssignment(); + } + if (this.tokens.matches1(_types.TokenType.preIncDec)) { + return this.processPreIncDec(); + } + return false; + } + + processImportEquals() { + const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + if (this.importProcessor.shouldAutomaticallyElideImportedName(importName)) { + // If this name is only used as a type, elide the whole import. + _elideImportEquals2.default.call(void 0, this.tokens); + } else { + // Otherwise, switch `import` to `const`. + this.tokens.replaceToken("const"); + } + return true; + } + + /** + * Transform this: + * import foo, {bar} from 'baz'; + * into + * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); + * + * The import code was already generated in the import preprocessing step, so + * we just need to look it up. + */ + processImport() { + if (this.tokens.matches2(_types.TokenType._import, _types.TokenType.parenL)) { + if (this.preserveDynamicImport) { + // Bail out, only making progress for this one token. + this.tokens.copyToken(); + return; + } + const requireWrapper = this.enableLegacyTypeScriptModuleInterop + ? "" + : `${this.helperManager.getHelperName("interopRequireWildcard")}(`; + this.tokens.replaceToken(`Promise.resolve().then(() => ${requireWrapper}require`); + const contextId = this.tokens.currentToken().contextId; + if (contextId == null) { + throw new Error("Expected context ID on dynamic import invocation."); + } + this.tokens.copyToken(); + while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.parenR, contextId)) { + this.rootTransformer.processToken(); + } + this.tokens.replaceToken(requireWrapper ? ")))" : "))"); + return; + } + + const shouldElideImport = this.removeImportAndDetectIfShouldElide(); + if (shouldElideImport) { + this.tokens.removeToken(); + } else { + const path = this.tokens.stringValue(); + this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); + this.tokens.appendCode(this.importProcessor.claimImportCode(path)); + } + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + if (this.tokens.matches1(_types.TokenType.semi)) { + this.tokens.removeToken(); + } + } + + /** + * Erase this import (since any CJS output would be completely different), and + * return true if this import is should be elided due to being a type-only + * import. Such imports will not be emitted at all to avoid side effects. + * + * Import elision only happens with the TypeScript or Flow transforms enabled. + * + * TODO: This function has some awkward overlap with + * CJSImportProcessor.pruneTypeOnlyImports , and the two should be unified. + * That function handles TypeScript implicit import name elision, and removes + * an import if all typical imported names (without `type`) are removed due + * to being type-only imports. This function handles Flow import removal and + * properly distinguishes `import 'foo'` from `import {} from 'foo'` for TS + * purposes. + * + * The position should end at the import string. + */ + removeImportAndDetectIfShouldElide() { + this.tokens.removeInitialToken(); + if ( + this.tokens.matchesContextual(_keywords.ContextualKeyword._type) && + !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.comma) && + !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._from) + ) { + // This is an "import type" statement, so exit early. + this.removeRemainingImport(); + return true; + } + + if (this.tokens.matches1(_types.TokenType.name) || this.tokens.matches1(_types.TokenType.star)) { + // We have a default import or namespace import, so there must be some + // non-type import. + this.removeRemainingImport(); + return false; + } + + if (this.tokens.matches1(_types.TokenType.string)) { + // This is a bare import, so we should proceed with the import. + return false; + } + + let foundNonTypeImport = false; + let foundAnyNamedImport = false; + while (!this.tokens.matches1(_types.TokenType.string)) { + // Check if any named imports are of the form "foo" or "foo as bar", with + // no leading "type". + if ( + (!foundNonTypeImport && this.tokens.matches1(_types.TokenType.braceL)) || + this.tokens.matches1(_types.TokenType.comma) + ) { + this.tokens.removeToken(); + if (!this.tokens.matches1(_types.TokenType.braceR)) { + foundAnyNamedImport = true; + } + if ( + this.tokens.matches2(_types.TokenType.name, _types.TokenType.comma) || + this.tokens.matches2(_types.TokenType.name, _types.TokenType.braceR) || + this.tokens.matches4(_types.TokenType.name, _types.TokenType.name, _types.TokenType.name, _types.TokenType.comma) || + this.tokens.matches4(_types.TokenType.name, _types.TokenType.name, _types.TokenType.name, _types.TokenType.braceR) + ) { + foundNonTypeImport = true; + } + } + this.tokens.removeToken(); + } + if (this.keepUnusedImports) { + return false; + } + if (this.isTypeScriptTransformEnabled) { + return !foundNonTypeImport; + } else if (this.isFlowTransformEnabled) { + // In Flow, unlike TS, `import {} from 'foo';` preserves the import. + return foundAnyNamedImport && !foundNonTypeImport; + } else { + return false; + } + } + + removeRemainingImport() { + while (!this.tokens.matches1(_types.TokenType.string)) { + this.tokens.removeToken(); + } + } + + processIdentifier() { + const token = this.tokens.currentToken(); + if (token.shadowsGlobal) { + return false; + } + + if (token.identifierRole === _tokenizer.IdentifierRole.ObjectShorthand) { + return this.processObjectShorthand(); + } + + if (token.identifierRole !== _tokenizer.IdentifierRole.Access) { + return false; + } + const replacement = this.importProcessor.getIdentifierReplacement( + this.tokens.identifierNameForToken(token), + ); + if (!replacement) { + return false; + } + // Tolerate any number of closing parens while looking for an opening paren + // that indicates a function call. + let possibleOpenParenIndex = this.tokens.currentIndex() + 1; + while ( + possibleOpenParenIndex < this.tokens.tokens.length && + this.tokens.tokens[possibleOpenParenIndex].type === _types.TokenType.parenR + ) { + possibleOpenParenIndex++; + } + // Avoid treating imported functions as methods of their `exports` object + // by using `(0, f)` when the identifier is in a paren expression. Else + // use `Function.prototype.call` when the identifier is a guaranteed + // function call. When using `call`, pass undefined as the context. + if (this.tokens.tokens[possibleOpenParenIndex].type === _types.TokenType.parenL) { + if ( + this.tokens.tokenAtRelativeIndex(1).type === _types.TokenType.parenL && + this.tokens.tokenAtRelativeIndex(-1).type !== _types.TokenType._new + ) { + this.tokens.replaceToken(`${replacement}.call(void 0, `); + // Remove the old paren. + this.tokens.removeToken(); + // Balance out the new paren. + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + } else { + // See here: http://2ality.com/2015/12/references.html + this.tokens.replaceToken(`(0, ${replacement})`); + } + } else { + this.tokens.replaceToken(replacement); + } + return true; + } + + processObjectShorthand() { + const identifier = this.tokens.identifierName(); + const replacement = this.importProcessor.getIdentifierReplacement(identifier); + if (!replacement) { + return false; + } + this.tokens.replaceToken(`${identifier}: ${replacement}`); + return true; + } + + processExport() { + if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType._enum) || + this.tokens.matches3(_types.TokenType._export, _types.TokenType._const, _types.TokenType._enum) + ) { + this.hadNamedExport = true; + // Let the TypeScript transform handle it. + return false; + } + if (this.tokens.matches2(_types.TokenType._export, _types.TokenType._default)) { + if (this.tokens.matches3(_types.TokenType._export, _types.TokenType._default, _types.TokenType._enum)) { + this.hadDefaultExport = true; + // Flow export default enums need some special handling, so handle them + // in that tranform rather than this one. + return false; + } + this.processExportDefault(); + return true; + } else if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.braceL)) { + this.processExportBindings(); + return true; + } else if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType.name) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._type) + ) { + // export type {a}; + // export type {a as b}; + // export type {a} from './b'; + // export type * from './b'; + // export type * as ns from './b'; + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + if (this.tokens.matches1(_types.TokenType.braceL)) { + while (!this.tokens.matches1(_types.TokenType.braceR)) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + } else { + // * + this.tokens.removeToken(); + if (this.tokens.matches1(_types.TokenType._as)) { + // as + this.tokens.removeToken(); + // ns + this.tokens.removeToken(); + } + } + // Remove type re-export `... } from './T'` + if ( + this.tokens.matchesContextual(_keywords.ContextualKeyword._from) && + this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.string) + ) { + this.tokens.removeToken(); + this.tokens.removeToken(); + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + } + return true; + } + this.hadNamedExport = true; + if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType._var) || + this.tokens.matches2(_types.TokenType._export, _types.TokenType._let) || + this.tokens.matches2(_types.TokenType._export, _types.TokenType._const) + ) { + this.processExportVar(); + return true; + } else if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType._function) || + // export async function + this.tokens.matches3(_types.TokenType._export, _types.TokenType.name, _types.TokenType._function) + ) { + this.processExportFunction(); + return true; + } else if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType._class) || + this.tokens.matches3(_types.TokenType._export, _types.TokenType._abstract, _types.TokenType._class) || + this.tokens.matches2(_types.TokenType._export, _types.TokenType.at) + ) { + this.processExportClass(); + return true; + } else if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.star)) { + this.processExportStar(); + return true; + } else { + throw new Error("Unrecognized export syntax."); + } + } + + processAssignment() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index - 1]; + // If the LHS is a type identifier, this must be a declaration like `let a: b = c;`, + // with `b` as the identifier, so nothing needs to be done in that case. + if (identifierToken.isType || identifierToken.type !== _types.TokenType.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + if (index >= 2 && this.tokens.matches1AtIndex(index - 2, _types.TokenType.dot)) { + return false; + } + if (index >= 2 && [_types.TokenType._var, _types.TokenType._let, _types.TokenType._const].includes(this.tokens.tokens[index - 2].type)) { + // Declarations don't need an extra assignment. This doesn't avoid the + // assignment for comma-separated declarations, but it's still correct + // since the assignment is just redundant. + return false; + } + const assignmentSnippet = this.importProcessor.resolveExportBinding( + this.tokens.identifierNameForToken(identifierToken), + ); + if (!assignmentSnippet) { + return false; + } + this.tokens.copyToken(); + this.tokens.appendCode(` ${assignmentSnippet} =`); + return true; + } + + /** + * Process something like `a += 3`, where `a` might be an exported value. + */ + processComplexAssignment() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index - 1]; + if (identifierToken.type !== _types.TokenType.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + if (index >= 2 && this.tokens.matches1AtIndex(index - 2, _types.TokenType.dot)) { + return false; + } + const assignmentSnippet = this.importProcessor.resolveExportBinding( + this.tokens.identifierNameForToken(identifierToken), + ); + if (!assignmentSnippet) { + return false; + } + this.tokens.appendCode(` = ${assignmentSnippet}`); + this.tokens.copyToken(); + return true; + } + + /** + * Process something like `++a`, where `a` might be an exported value. + */ + processPreIncDec() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index + 1]; + if (identifierToken.type !== _types.TokenType.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + // Ignore things like ++a.b and ++a[b] and ++a().b. + if ( + index + 2 < this.tokens.tokens.length && + (this.tokens.matches1AtIndex(index + 2, _types.TokenType.dot) || + this.tokens.matches1AtIndex(index + 2, _types.TokenType.bracketL) || + this.tokens.matches1AtIndex(index + 2, _types.TokenType.parenL)) + ) { + return false; + } + const identifierName = this.tokens.identifierNameForToken(identifierToken); + const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); + if (!assignmentSnippet) { + return false; + } + this.tokens.appendCode(`${assignmentSnippet} = `); + this.tokens.copyToken(); + return true; + } + + /** + * Process something like `a++`, where `a` might be an exported value. + * This starts at the `a`, not at the `++`. + */ + processPostIncDec() { + const index = this.tokens.currentIndex(); + const identifierToken = this.tokens.tokens[index]; + const operatorToken = this.tokens.tokens[index + 1]; + if (identifierToken.type !== _types.TokenType.name) { + return false; + } + if (identifierToken.shadowsGlobal) { + return false; + } + if (index >= 1 && this.tokens.matches1AtIndex(index - 1, _types.TokenType.dot)) { + return false; + } + const identifierName = this.tokens.identifierNameForToken(identifierToken); + const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); + if (!assignmentSnippet) { + return false; + } + const operatorCode = this.tokens.rawCodeForToken(operatorToken); + // We might also replace the identifier with something like exports.x, so + // do that replacement here as well. + const base = this.importProcessor.getIdentifierReplacement(identifierName) || identifierName; + if (operatorCode === "++") { + this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} + 1, ${base} - 1)`); + } else if (operatorCode === "--") { + this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} - 1, ${base} + 1)`); + } else { + throw new Error(`Unexpected operator: ${operatorCode}`); + } + this.tokens.removeToken(); + return true; + } + + processExportDefault() { + let exportedRuntimeValue = true; + if ( + this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._function, _types.TokenType.name) || + // export default async function + (this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType.name, _types.TokenType._function, _types.TokenType.name) && + this.tokens.matchesContextualAtIndex( + this.tokens.currentIndex() + 2, + _keywords.ContextualKeyword._async, + )) + ) { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + // Named function export case: change it to a top-level function + // declaration followed by exports statement. + const name = this.processNamedFunction(); + this.tokens.appendCode(` exports.default = ${name};`); + } else if ( + this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._class, _types.TokenType.name) || + this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType._abstract, _types.TokenType._class, _types.TokenType.name) || + this.tokens.matches3(_types.TokenType._export, _types.TokenType._default, _types.TokenType.at) + ) { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + this.copyDecorators(); + if (this.tokens.matches1(_types.TokenType._abstract)) { + this.tokens.removeToken(); + } + const name = this.rootTransformer.processNamedClass(); + this.tokens.appendCode(` exports.default = ${name};`); + // After this point, this is a plain "export default E" statement. + } else if ( + _shouldElideDefaultExport2.default.call(void 0, + this.isTypeScriptTransformEnabled, + this.keepUnusedImports, + this.tokens, + this.declarationInfo, + ) + ) { + // If the exported value is just an identifier and should be elided by TypeScript + // rules, then remove it entirely. It will always have the form `export default e`, + // where `e` is an identifier. + exportedRuntimeValue = false; + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + this.tokens.removeToken(); + } else if (this.reactHotLoaderTransformer) { + // We need to assign E to a variable. Change "export default E" to + // "let _default; exports.default = _default = E" + const defaultVarName = this.nameManager.claimFreeName("_default"); + this.tokens.replaceToken(`let ${defaultVarName}; exports.`); + this.tokens.copyToken(); + this.tokens.appendCode(` = ${defaultVarName} =`); + this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); + } else { + // Change "export default E" to "exports.default = E" + this.tokens.replaceToken("exports."); + this.tokens.copyToken(); + this.tokens.appendCode(" ="); + } + if (exportedRuntimeValue) { + this.hadDefaultExport = true; + } + } + + copyDecorators() { + while (this.tokens.matches1(_types.TokenType.at)) { + this.tokens.copyToken(); + if (this.tokens.matches1(_types.TokenType.parenL)) { + this.tokens.copyExpectedToken(_types.TokenType.parenL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + } else { + this.tokens.copyExpectedToken(_types.TokenType.name); + while (this.tokens.matches1(_types.TokenType.dot)) { + this.tokens.copyExpectedToken(_types.TokenType.dot); + this.tokens.copyExpectedToken(_types.TokenType.name); + } + if (this.tokens.matches1(_types.TokenType.parenL)) { + this.tokens.copyExpectedToken(_types.TokenType.parenL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + } + } + } + } + + /** + * Transform a declaration like `export var`, `export let`, or `export const`. + */ + processExportVar() { + if (this.isSimpleExportVar()) { + this.processSimpleExportVar(); + } else { + this.processComplexExportVar(); + } + } + + /** + * Determine if the export is of the form: + * export var/let/const [varName] = [expr]; + * In other words, determine if function name inference might apply. + */ + isSimpleExportVar() { + let tokenIndex = this.tokens.currentIndex(); + // export + tokenIndex++; + // var/let/const + tokenIndex++; + if (!this.tokens.matches1AtIndex(tokenIndex, _types.TokenType.name)) { + return false; + } + tokenIndex++; + while (tokenIndex < this.tokens.tokens.length && this.tokens.tokens[tokenIndex].isType) { + tokenIndex++; + } + if (!this.tokens.matches1AtIndex(tokenIndex, _types.TokenType.eq)) { + return false; + } + return true; + } + + /** + * Transform an `export var` declaration initializing a single variable. + * + * For example, this: + * export const f = () => {}; + * becomes this: + * const f = () => {}; exports.f = f; + * + * The variable is unused (e.g. exports.f has the true value of the export). + * We need to produce an assignment of this form so that the function will + * have an inferred name of "f", which wouldn't happen in the more general + * case below. + */ + processSimpleExportVar() { + // export + this.tokens.removeInitialToken(); + // var/let/const + this.tokens.copyToken(); + const varName = this.tokens.identifierName(); + // x: number -> x + while (!this.tokens.matches1(_types.TokenType.eq)) { + this.rootTransformer.processToken(); + } + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + while (this.tokens.currentIndex() < endIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode(`; exports.${varName} = ${varName}`); + } + + /** + * Transform normal declaration exports, including handling destructuring. + * For example, this: + * export const {x: [a = 2, b], c} = d; + * becomes this: + * ({x: [exports.a = 2, exports.b], c: exports.c} = d;) + */ + processComplexExportVar() { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + const needsParens = this.tokens.matches1(_types.TokenType.braceL); + if (needsParens) { + this.tokens.appendCode("("); + } + + let depth = 0; + while (true) { + if ( + this.tokens.matches1(_types.TokenType.braceL) || + this.tokens.matches1(_types.TokenType.dollarBraceL) || + this.tokens.matches1(_types.TokenType.bracketL) + ) { + depth++; + this.tokens.copyToken(); + } else if (this.tokens.matches1(_types.TokenType.braceR) || this.tokens.matches1(_types.TokenType.bracketR)) { + depth--; + this.tokens.copyToken(); + } else if ( + depth === 0 && + !this.tokens.matches1(_types.TokenType.name) && + !this.tokens.currentToken().isType + ) { + break; + } else if (this.tokens.matches1(_types.TokenType.eq)) { + // Default values might have assignments in the RHS that we want to ignore, so skip past + // them. + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + while (this.tokens.currentIndex() < endIndex) { + this.rootTransformer.processToken(); + } + } else { + const token = this.tokens.currentToken(); + if (_tokenizer.isDeclaration.call(void 0, token)) { + const name = this.tokens.identifierName(); + let replacement = this.importProcessor.getIdentifierReplacement(name); + if (replacement === null) { + throw new Error(`Expected a replacement for ${name} in \`export var\` syntax.`); + } + if (_tokenizer.isObjectShorthandDeclaration.call(void 0, token)) { + replacement = `${name}: ${replacement}`; + } + this.tokens.replaceToken(replacement); + } else { + this.rootTransformer.processToken(); + } + } + } + + if (needsParens) { + // Seek to the end of the RHS. + const endIndex = this.tokens.currentToken().rhsEndIndex; + if (endIndex == null) { + throw new Error("Expected = token with an end index."); + } + while (this.tokens.currentIndex() < endIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode(")"); + } + } + + /** + * Transform this: + * export function foo() {} + * into this: + * function foo() {} exports.foo = foo; + */ + processExportFunction() { + this.tokens.replaceToken(""); + const name = this.processNamedFunction(); + this.tokens.appendCode(` exports.${name} = ${name};`); + } + + /** + * Skip past a function with a name and return that name. + */ + processNamedFunction() { + if (this.tokens.matches1(_types.TokenType._function)) { + this.tokens.copyToken(); + } else if (this.tokens.matches2(_types.TokenType.name, _types.TokenType._function)) { + if (!this.tokens.matchesContextual(_keywords.ContextualKeyword._async)) { + throw new Error("Expected async keyword in function export."); + } + this.tokens.copyToken(); + this.tokens.copyToken(); + } + if (this.tokens.matches1(_types.TokenType.star)) { + this.tokens.copyToken(); + } + if (!this.tokens.matches1(_types.TokenType.name)) { + throw new Error("Expected identifier for exported function name."); + } + const name = this.tokens.identifierName(); + this.tokens.copyToken(); + if (this.tokens.currentToken().isType) { + this.tokens.removeInitialToken(); + while (this.tokens.currentToken().isType) { + this.tokens.removeToken(); + } + } + this.tokens.copyExpectedToken(_types.TokenType.parenL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + this.rootTransformer.processPossibleTypeRange(); + this.tokens.copyExpectedToken(_types.TokenType.braceL); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.braceR); + return name; + } + + /** + * Transform this: + * export class A {} + * into this: + * class A {} exports.A = A; + */ + processExportClass() { + this.tokens.removeInitialToken(); + this.copyDecorators(); + if (this.tokens.matches1(_types.TokenType._abstract)) { + this.tokens.removeToken(); + } + const name = this.rootTransformer.processNamedClass(); + this.tokens.appendCode(` exports.${name} = ${name};`); + } + + /** + * Transform this: + * export {a, b as c}; + * into this: + * exports.a = a; exports.c = b; + * + * OR + * + * Transform this: + * export {a, b as c} from './foo'; + * into the pre-generated Object.defineProperty code from the ImportProcessor. + * + * For the first case, if the TypeScript transform is enabled, we need to skip + * exports that are only defined as types. + */ + processExportBindings() { + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + + const isReExport = _isExportFrom2.default.call(void 0, this.tokens); + + const exportStatements = []; + while (true) { + if (this.tokens.matches1(_types.TokenType.braceR)) { + this.tokens.removeToken(); + break; + } + + const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens); + + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.removeToken(); + } + + const shouldRemoveExport = + specifierInfo.isType || + (!isReExport && this.shouldElideExportedIdentifier(specifierInfo.leftName)); + if (!shouldRemoveExport) { + const exportedName = specifierInfo.rightName; + if (exportedName === "default") { + this.hadDefaultExport = true; + } else { + this.hadNamedExport = true; + } + const localName = specifierInfo.leftName; + const newLocalName = this.importProcessor.getIdentifierReplacement(localName); + exportStatements.push(`exports.${exportedName} = ${newLocalName || localName};`); + } + + if (this.tokens.matches1(_types.TokenType.braceR)) { + this.tokens.removeToken(); + break; + } + if (this.tokens.matches2(_types.TokenType.comma, _types.TokenType.braceR)) { + this.tokens.removeToken(); + this.tokens.removeToken(); + break; + } else if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.removeToken(); + } else { + throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`); + } + } + + if (this.tokens.matchesContextual(_keywords.ContextualKeyword._from)) { + // This is an export...from, so throw away the normal named export code + // and use the Object.defineProperty code from ImportProcessor. + this.tokens.removeToken(); + const path = this.tokens.stringValue(); + this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + } else { + // This is a normal named export, so use that. + this.tokens.appendCode(exportStatements.join(" ")); + } + + if (this.tokens.matches1(_types.TokenType.semi)) { + this.tokens.removeToken(); + } + } + + processExportStar() { + this.tokens.removeInitialToken(); + while (!this.tokens.matches1(_types.TokenType.string)) { + this.tokens.removeToken(); + } + const path = this.tokens.stringValue(); + this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + if (this.tokens.matches1(_types.TokenType.semi)) { + this.tokens.removeToken(); + } + } + + shouldElideExportedIdentifier(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + !this.declarationInfo.valueDeclarations.has(name) + ); + } +} exports.default = CJSImportTransformer; diff --git a/node_modules/sucrase/dist/transformers/ESMImportTransformer.js b/node_modules/sucrase/dist/transformers/ESMImportTransformer.js new file mode 100644 index 0000000..d89e5ea --- /dev/null +++ b/node_modules/sucrase/dist/transformers/ESMImportTransformer.js @@ -0,0 +1,415 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + +var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + +var _elideImportEquals = require('../util/elideImportEquals'); var _elideImportEquals2 = _interopRequireDefault(_elideImportEquals); + + + +var _getDeclarationInfo = require('../util/getDeclarationInfo'); var _getDeclarationInfo2 = _interopRequireDefault(_getDeclarationInfo); +var _getImportExportSpecifierInfo = require('../util/getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo); +var _getNonTypeIdentifiers = require('../util/getNonTypeIdentifiers'); +var _isExportFrom = require('../util/isExportFrom'); var _isExportFrom2 = _interopRequireDefault(_isExportFrom); +var _removeMaybeImportAttributes = require('../util/removeMaybeImportAttributes'); +var _shouldElideDefaultExport = require('../util/shouldElideDefaultExport'); var _shouldElideDefaultExport2 = _interopRequireDefault(_shouldElideDefaultExport); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + +/** + * Class for editing import statements when we are keeping the code as ESM. We still need to remove + * type-only imports in TypeScript and Flow. + */ + class ESMImportTransformer extends _Transformer2.default { + + + + + constructor( + tokens, + nameManager, + helperManager, + reactHotLoaderTransformer, + isTypeScriptTransformEnabled, + isFlowTransformEnabled, + keepUnusedImports, + options, + ) { + super();this.tokens = tokens;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.keepUnusedImports = keepUnusedImports;; + this.nonTypeIdentifiers = + isTypeScriptTransformEnabled && !keepUnusedImports + ? _getNonTypeIdentifiers.getNonTypeIdentifiers.call(void 0, tokens, options) + : new Set(); + this.declarationInfo = + isTypeScriptTransformEnabled && !keepUnusedImports + ? _getDeclarationInfo2.default.call(void 0, tokens) + : _getDeclarationInfo.EMPTY_DECLARATION_INFO; + this.injectCreateRequireForImportRequire = Boolean(options.injectCreateRequireForImportRequire); + } + + process() { + // TypeScript `import foo = require('foo');` should always just be translated to plain require. + if (this.tokens.matches3(_types.TokenType._import, _types.TokenType.name, _types.TokenType.eq)) { + return this.processImportEquals(); + } + if ( + this.tokens.matches4(_types.TokenType._import, _types.TokenType.name, _types.TokenType.name, _types.TokenType.eq) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._type) + ) { + // import type T = require('T') + this.tokens.removeInitialToken(); + // This construct is always exactly 8 tokens long, so remove the 7 remaining tokens. + for (let i = 0; i < 7; i++) { + this.tokens.removeToken(); + } + return true; + } + if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.eq)) { + this.tokens.replaceToken("module.exports"); + return true; + } + if ( + this.tokens.matches5(_types.TokenType._export, _types.TokenType._import, _types.TokenType.name, _types.TokenType.name, _types.TokenType.eq) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, _keywords.ContextualKeyword._type) + ) { + // export import type T = require('T') + this.tokens.removeInitialToken(); + // This construct is always exactly 9 tokens long, so remove the 8 remaining tokens. + for (let i = 0; i < 8; i++) { + this.tokens.removeToken(); + } + return true; + } + if (this.tokens.matches1(_types.TokenType._import)) { + return this.processImport(); + } + if (this.tokens.matches2(_types.TokenType._export, _types.TokenType._default)) { + return this.processExportDefault(); + } + if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.braceL)) { + return this.processNamedExports(); + } + if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType.name) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._type) + ) { + // export type {a}; + // export type {a as b}; + // export type {a} from './b'; + // export type * from './b'; + // export type * as ns from './b'; + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + if (this.tokens.matches1(_types.TokenType.braceL)) { + while (!this.tokens.matches1(_types.TokenType.braceR)) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + } else { + // * + this.tokens.removeToken(); + if (this.tokens.matches1(_types.TokenType._as)) { + // as + this.tokens.removeToken(); + // ns + this.tokens.removeToken(); + } + } + // Remove type re-export `... } from './T'` + if ( + this.tokens.matchesContextual(_keywords.ContextualKeyword._from) && + this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.string) + ) { + this.tokens.removeToken(); + this.tokens.removeToken(); + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + } + return true; + } + return false; + } + + processImportEquals() { + const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + if (this.shouldAutomaticallyElideImportedName(importName)) { + // If this name is only used as a type, elide the whole import. + _elideImportEquals2.default.call(void 0, this.tokens); + } else if (this.injectCreateRequireForImportRequire) { + // We're using require in an environment (Node ESM) that doesn't provide + // it as a global, so generate a helper to import it. + // import -> const + this.tokens.replaceToken("const"); + // Foo + this.tokens.copyToken(); + // = + this.tokens.copyToken(); + // require + this.tokens.replaceToken(this.helperManager.getHelperName("require")); + } else { + // Otherwise, just switch `import` to `const`. + this.tokens.replaceToken("const"); + } + return true; + } + + processImport() { + if (this.tokens.matches2(_types.TokenType._import, _types.TokenType.parenL)) { + // Dynamic imports don't need to be transformed. + return false; + } + + const snapshot = this.tokens.snapshot(); + const allImportsRemoved = this.removeImportTypeBindings(); + if (allImportsRemoved) { + this.tokens.restoreToSnapshot(snapshot); + while (!this.tokens.matches1(_types.TokenType.string)) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + if (this.tokens.matches1(_types.TokenType.semi)) { + this.tokens.removeToken(); + } + } + return true; + } + + /** + * Remove type bindings from this import, leaving the rest of the import intact. + * + * Return true if this import was ONLY types, and thus is eligible for removal. This will bail out + * of the replacement operation, so we can return early here. + */ + removeImportTypeBindings() { + this.tokens.copyExpectedToken(_types.TokenType._import); + if ( + this.tokens.matchesContextual(_keywords.ContextualKeyword._type) && + !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.comma) && + !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._from) + ) { + // This is an "import type" statement, so exit early. + return true; + } + + if (this.tokens.matches1(_types.TokenType.string)) { + // This is a bare import, so we should proceed with the import. + this.tokens.copyToken(); + return false; + } + + // Skip the "module" token in import reflection. + if ( + this.tokens.matchesContextual(_keywords.ContextualKeyword._module) && + this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, _keywords.ContextualKeyword._from) + ) { + this.tokens.copyToken(); + } + + let foundNonTypeImport = false; + let foundAnyNamedImport = false; + let needsComma = false; + + // Handle default import. + if (this.tokens.matches1(_types.TokenType.name)) { + if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())) { + this.tokens.removeToken(); + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.removeToken(); + } + } else { + foundNonTypeImport = true; + this.tokens.copyToken(); + if (this.tokens.matches1(_types.TokenType.comma)) { + // We're in a statement like: + // import A, * as B from './A'; + // or + // import A, {foo} from './A'; + // where the `A` is being kept. The comma should be removed if an only + // if the next part of the import statement is elided, but that's hard + // to determine at this point in the code. Instead, always remove it + // and set a flag to add it back if necessary. + needsComma = true; + this.tokens.removeToken(); + } + } + } + + if (this.tokens.matches1(_types.TokenType.star)) { + if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))) { + this.tokens.removeToken(); + this.tokens.removeToken(); + this.tokens.removeToken(); + } else { + if (needsComma) { + this.tokens.appendCode(","); + } + foundNonTypeImport = true; + this.tokens.copyExpectedToken(_types.TokenType.star); + this.tokens.copyExpectedToken(_types.TokenType.name); + this.tokens.copyExpectedToken(_types.TokenType.name); + } + } else if (this.tokens.matches1(_types.TokenType.braceL)) { + if (needsComma) { + this.tokens.appendCode(","); + } + this.tokens.copyToken(); + while (!this.tokens.matches1(_types.TokenType.braceR)) { + foundAnyNamedImport = true; + const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens); + if ( + specifierInfo.isType || + this.shouldAutomaticallyElideImportedName(specifierInfo.rightName) + ) { + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.removeToken(); + } + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.removeToken(); + } + } else { + foundNonTypeImport = true; + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.copyToken(); + } + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.copyToken(); + } + } + } + this.tokens.copyExpectedToken(_types.TokenType.braceR); + } + + if (this.keepUnusedImports) { + return false; + } + if (this.isTypeScriptTransformEnabled) { + return !foundNonTypeImport; + } else if (this.isFlowTransformEnabled) { + // In Flow, unlike TS, `import {} from 'foo';` preserves the import. + return foundAnyNamedImport && !foundNonTypeImport; + } else { + return false; + } + } + + shouldAutomaticallyElideImportedName(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + !this.nonTypeIdentifiers.has(name) + ); + } + + processExportDefault() { + if ( + _shouldElideDefaultExport2.default.call(void 0, + this.isTypeScriptTransformEnabled, + this.keepUnusedImports, + this.tokens, + this.declarationInfo, + ) + ) { + // If the exported value is just an identifier and should be elided by TypeScript + // rules, then remove it entirely. It will always have the form `export default e`, + // where `e` is an identifier. + this.tokens.removeInitialToken(); + this.tokens.removeToken(); + this.tokens.removeToken(); + return true; + } + + const alreadyHasName = + this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._function, _types.TokenType.name) || + // export default async function + (this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType.name, _types.TokenType._function, _types.TokenType.name) && + this.tokens.matchesContextualAtIndex( + this.tokens.currentIndex() + 2, + _keywords.ContextualKeyword._async, + )) || + this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._class, _types.TokenType.name) || + this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType._abstract, _types.TokenType._class, _types.TokenType.name); + + if (!alreadyHasName && this.reactHotLoaderTransformer) { + // This is a plain "export default E" statement and we need to assign E to a variable. + // Change "export default E" to "let _default; export default _default = E" + const defaultVarName = this.nameManager.claimFreeName("_default"); + this.tokens.replaceToken(`let ${defaultVarName}; export`); + this.tokens.copyToken(); + this.tokens.appendCode(` ${defaultVarName} =`); + this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); + return true; + } + return false; + } + + /** + * Handle a statement with one of these forms: + * export {a, type b}; + * export {c, type d} from 'foo'; + * + * In both cases, any explicit type exports should be removed. In the first + * case, we also need to handle implicit export elision for names declared as + * types. In the second case, we must NOT do implicit named export elision, + * but we must remove the runtime import if all exports are type exports. + */ + processNamedExports() { + if (!this.isTypeScriptTransformEnabled) { + return false; + } + this.tokens.copyExpectedToken(_types.TokenType._export); + this.tokens.copyExpectedToken(_types.TokenType.braceL); + + const isReExport = _isExportFrom2.default.call(void 0, this.tokens); + let foundNonTypeExport = false; + while (!this.tokens.matches1(_types.TokenType.braceR)) { + const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens); + if ( + specifierInfo.isType || + (!isReExport && this.shouldElideExportedName(specifierInfo.leftName)) + ) { + // Type export, so remove all tokens, including any comma. + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.removeToken(); + } + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.removeToken(); + } + } else { + // Non-type export, so copy all tokens, including any comma. + foundNonTypeExport = true; + while (this.tokens.currentIndex() < specifierInfo.endIndex) { + this.tokens.copyToken(); + } + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.copyToken(); + } + } + } + this.tokens.copyExpectedToken(_types.TokenType.braceR); + + if (!this.keepUnusedImports && isReExport && !foundNonTypeExport) { + // This is a type-only re-export, so skip evaluating the other module. Technically this + // leaves the statement as `export {}`, but that's ok since that's a no-op. + this.tokens.removeToken(); + this.tokens.removeToken(); + _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); + } + + return true; + } + + /** + * ESM elides all imports with the rule that we only elide if we see that it's + * a type and never see it as a value. This is in contrast to CJS, which + * elides imports that are completely unknown. + */ + shouldElideExportedName(name) { + return ( + this.isTypeScriptTransformEnabled && + !this.keepUnusedImports && + this.declarationInfo.typeDeclarations.has(name) && + !this.declarationInfo.valueDeclarations.has(name) + ); + } +} exports.default = ESMImportTransformer; diff --git a/node_modules/sucrase/dist/transformers/FlowTransformer.js b/node_modules/sucrase/dist/transformers/FlowTransformer.js new file mode 100644 index 0000000..31c9744 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/FlowTransformer.js @@ -0,0 +1,182 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + + class FlowTransformer extends _Transformer2.default { + constructor( + rootTransformer, + tokens, + isImportsTransformEnabled, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; + } + + process() { + if ( + this.rootTransformer.processPossibleArrowParamEnd() || + this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || + this.rootTransformer.processPossibleTypeRange() + ) { + return true; + } + if (this.tokens.matches1(_types.TokenType._enum)) { + this.processEnum(); + return true; + } + if (this.tokens.matches2(_types.TokenType._export, _types.TokenType._enum)) { + this.processNamedExportEnum(); + return true; + } + if (this.tokens.matches3(_types.TokenType._export, _types.TokenType._default, _types.TokenType._enum)) { + this.processDefaultExportEnum(); + return true; + } + return false; + } + + /** + * Handle a declaration like: + * export enum E ... + * + * With this imports transform, this becomes: + * const E = [[enum]]; exports.E = E; + * + * otherwise, it becomes: + * export const E = [[enum]]; + */ + processNamedExportEnum() { + if (this.isImportsTransformEnabled) { + // export + this.tokens.removeInitialToken(); + const enumName = this.tokens.identifierNameAtRelativeIndex(1); + this.processEnum(); + this.tokens.appendCode(` exports.${enumName} = ${enumName};`); + } else { + this.tokens.copyToken(); + this.processEnum(); + } + } + + /** + * Handle a declaration like: + * export default enum E + * + * With the imports transform, this becomes: + * const E = [[enum]]; exports.default = E; + * + * otherwise, it becomes: + * const E = [[enum]]; export default E; + */ + processDefaultExportEnum() { + // export + this.tokens.removeInitialToken(); + // default + this.tokens.removeToken(); + const enumName = this.tokens.identifierNameAtRelativeIndex(1); + this.processEnum(); + if (this.isImportsTransformEnabled) { + this.tokens.appendCode(` exports.default = ${enumName};`); + } else { + this.tokens.appendCode(` export default ${enumName};`); + } + } + + /** + * Transpile flow enums to invoke the "flow-enums-runtime" library. + * + * Currently, the transpiled code always uses `require("flow-enums-runtime")`, + * but if future flexibility is needed, we could expose a config option for + * this string (similar to configurable JSX). Even when targeting ESM, the + * default behavior of babel-plugin-transform-flow-enums is to use require + * rather than injecting an import. + * + * Flow enums are quite a bit simpler than TS enums and have some convenient + * constraints: + * - Element initializers must be either always present or always absent. That + * means that we can use fixed lookahead on the first element (if any) and + * assume that all elements are like that. + * - The right-hand side of an element initializer must be a literal value, + * not a complex expression and not referencing other elements. That means + * we can simply copy a single token. + * + * Enums can be broken up into three basic cases: + * + * Mirrored enums: + * enum E {A, B} + * -> + * const E = require("flow-enums-runtime").Mirrored(["A", "B"]); + * + * Initializer enums: + * enum E {A = 1, B = 2} + * -> + * const E = require("flow-enums-runtime")({A: 1, B: 2}); + * + * Symbol enums: + * enum E of symbol {A, B} + * -> + * const E = require("flow-enums-runtime")({A: Symbol("A"), B: Symbol("B")}); + * + * We can statically detect which of the three cases this is by looking at the + * "of" declaration (if any) and seeing if the first element has an initializer. + * Since the other transform details are so similar between the three cases, we + * use a single implementation and vary the transform within processEnumElement + * based on case. + */ + processEnum() { + // enum E -> const E + this.tokens.replaceToken("const"); + this.tokens.copyExpectedToken(_types.TokenType.name); + + let isSymbolEnum = false; + if (this.tokens.matchesContextual(_keywords.ContextualKeyword._of)) { + this.tokens.removeToken(); + isSymbolEnum = this.tokens.matchesContextual(_keywords.ContextualKeyword._symbol); + this.tokens.removeToken(); + } + const hasInitializers = this.tokens.matches3(_types.TokenType.braceL, _types.TokenType.name, _types.TokenType.eq); + this.tokens.appendCode(' = require("flow-enums-runtime")'); + + const isMirrored = !isSymbolEnum && !hasInitializers; + this.tokens.replaceTokenTrimmingLeftWhitespace(isMirrored ? ".Mirrored([" : "({"); + + while (!this.tokens.matches1(_types.TokenType.braceR)) { + // ... is allowed at the end and has no runtime behavior. + if (this.tokens.matches1(_types.TokenType.ellipsis)) { + this.tokens.removeToken(); + break; + } + this.processEnumElement(isSymbolEnum, hasInitializers); + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.copyToken(); + } + } + + this.tokens.replaceToken(isMirrored ? "]);" : "});"); + } + + /** + * Process an individual enum element, producing either an array element or an + * object element based on what type of enum this is. + */ + processEnumElement(isSymbolEnum, hasInitializers) { + if (isSymbolEnum) { + // Symbol enums never have initializers and are expanded to object elements. + // A, -> A: Symbol("A"), + const elementName = this.tokens.identifierName(); + this.tokens.copyToken(); + this.tokens.appendCode(`: Symbol("${elementName}")`); + } else if (hasInitializers) { + // Initializers are expanded to object elements. + // A = 1, -> A: 1, + this.tokens.copyToken(); + this.tokens.replaceTokenTrimmingLeftWhitespace(":"); + this.tokens.copyToken(); + } else { + // Enum elements without initializers become string literal array elements. + // A, -> "A", + this.tokens.replaceToken(`"${this.tokens.identifierName()}"`); + } + } +} exports.default = FlowTransformer; diff --git a/node_modules/sucrase/dist/transformers/JSXTransformer.js b/node_modules/sucrase/dist/transformers/JSXTransformer.js new file mode 100644 index 0000000..df51be3 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/JSXTransformer.js @@ -0,0 +1,733 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + +var _xhtml = require('../parser/plugins/jsx/xhtml'); var _xhtml2 = _interopRequireDefault(_xhtml); +var _tokenizer = require('../parser/tokenizer'); +var _types = require('../parser/tokenizer/types'); +var _charcodes = require('../parser/util/charcodes'); + +var _getJSXPragmaInfo = require('../util/getJSXPragmaInfo'); var _getJSXPragmaInfo2 = _interopRequireDefault(_getJSXPragmaInfo); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + + class JSXTransformer extends _Transformer2.default { + + + + + // State for calculating the line number of each JSX tag in development. + __init() {this.lastLineNumber = 1} + __init2() {this.lastIndex = 0} + + // In development, variable name holding the name of the current file. + __init3() {this.filenameVarName = null} + // Mapping of claimed names for imports in the automatic transform, e,g. + // {jsx: "_jsx"}. This determines which imports to generate in the prefix. + __init4() {this.esmAutomaticImportNameResolutions = {}} + // When automatically adding imports in CJS mode, we store the variable name + // holding the imported CJS module so we can require it in the prefix. + __init5() {this.cjsAutomaticModuleNameResolutions = {}} + + constructor( + rootTransformer, + tokens, + importProcessor, + nameManager, + options, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.options = options;JSXTransformer.prototype.__init.call(this);JSXTransformer.prototype.__init2.call(this);JSXTransformer.prototype.__init3.call(this);JSXTransformer.prototype.__init4.call(this);JSXTransformer.prototype.__init5.call(this);; + this.jsxPragmaInfo = _getJSXPragmaInfo2.default.call(void 0, options); + this.isAutomaticRuntime = options.jsxRuntime === "automatic"; + this.jsxImportSource = options.jsxImportSource || "react"; + } + + process() { + if (this.tokens.matches1(_types.TokenType.jsxTagStart)) { + this.processJSXTag(); + return true; + } + return false; + } + + getPrefixCode() { + let prefix = ""; + if (this.filenameVarName) { + prefix += `const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath || "")};`; + } + if (this.isAutomaticRuntime) { + if (this.importProcessor) { + // CJS mode: emit require statements for all modules that were referenced. + for (const [path, resolvedName] of Object.entries(this.cjsAutomaticModuleNameResolutions)) { + prefix += `var ${resolvedName} = require("${path}");`; + } + } else { + // ESM mode: consolidate and emit import statements for referenced names. + const {createElement: createElementResolution, ...otherResolutions} = + this.esmAutomaticImportNameResolutions; + if (createElementResolution) { + prefix += `import {createElement as ${createElementResolution}} from "${this.jsxImportSource}";`; + } + const importSpecifiers = Object.entries(otherResolutions) + .map(([name, resolvedName]) => `${name} as ${resolvedName}`) + .join(", "); + if (importSpecifiers) { + const importPath = + this.jsxImportSource + (this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime"); + prefix += `import {${importSpecifiers}} from "${importPath}";`; + } + } + } + return prefix; + } + + processJSXTag() { + const {jsxRole, start} = this.tokens.currentToken(); + // Calculate line number information at the very start (if in development + // mode) so that the information is guaranteed to be queried in token order. + const elementLocationCode = this.options.production ? null : this.getElementLocationCode(start); + if (this.isAutomaticRuntime && jsxRole !== _tokenizer.JSXRole.KeyAfterPropSpread) { + this.transformTagToJSXFunc(elementLocationCode, jsxRole); + } else { + this.transformTagToCreateElement(elementLocationCode); + } + } + + getElementLocationCode(firstTokenStart) { + const lineNumber = this.getLineNumberForIndex(firstTokenStart); + return `lineNumber: ${lineNumber}`; + } + + /** + * Get the line number for this source position. This is calculated lazily and + * must be called in increasing order by index. + */ + getLineNumberForIndex(index) { + const code = this.tokens.code; + while (this.lastIndex < index && this.lastIndex < code.length) { + if (code[this.lastIndex] === "\n") { + this.lastLineNumber++; + } + this.lastIndex++; + } + return this.lastLineNumber; + } + + /** + * Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is + * the primary transformation for the automatic transform. + * + * Example: + *
Hello{x}
+ * becomes + * jsxs('div', {a: 1, children: ["Hello", x]}, 2) + */ + transformTagToJSXFunc(elementLocationCode, jsxRole) { + const isStatic = jsxRole === _tokenizer.JSXRole.StaticChildren; + // First tag is always jsxTagStart. + this.tokens.replaceToken(this.getJSXFuncInvocationCode(isStatic)); + + let keyCode = null; + if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { + // Fragment syntax. + this.tokens.replaceToken(`${this.getFragmentCode()}, {`); + this.processAutomaticChildrenAndEndProps(jsxRole); + } else { + // Normal open tag or self-closing tag. + this.processTagIntro(); + this.tokens.appendCode(", {"); + keyCode = this.processProps(true); + + if (this.tokens.matches2(_types.TokenType.slash, _types.TokenType.jsxTagEnd)) { + // Self-closing tag, no children to add, so close the props. + this.tokens.appendCode("}"); + } else if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { + // Tag with children. + this.tokens.removeToken(); + this.processAutomaticChildrenAndEndProps(jsxRole); + } else { + throw new Error("Expected either /> or > at the end of the tag."); + } + // If a key was present, move it to its own arg. Note that moving code + // like this will cause line numbers to get out of sync within the JSX + // element if the key expression has a newline in it. This is unfortunate, + // but hopefully should be rare. + if (keyCode) { + this.tokens.appendCode(`, ${keyCode}`); + } + } + if (!this.options.production) { + // If the key wasn't already added, add it now so we can correctly set + // positional args for jsxDEV. + if (keyCode === null) { + this.tokens.appendCode(", void 0"); + } + this.tokens.appendCode(`, ${isStatic}, ${this.getDevSource(elementLocationCode)}, this`); + } + // We're at the close-tag or the end of a self-closing tag, so remove + // everything else and close the function call. + this.tokens.removeInitialToken(); + while (!this.tokens.matches1(_types.TokenType.jsxTagEnd)) { + this.tokens.removeToken(); + } + this.tokens.replaceToken(")"); + } + + /** + * Convert the current JSX element to a createElement call. In the classic + * runtime, this is the only case. In the automatic runtime, this is called + * as a fallback in some situations. + * + * Example: + *
Hello{x}
+ * becomes + * React.createElement('div', {a: 1, key: 2}, "Hello", x) + */ + transformTagToCreateElement(elementLocationCode) { + // First tag is always jsxTagStart. + this.tokens.replaceToken(this.getCreateElementInvocationCode()); + + if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { + // Fragment syntax. + this.tokens.replaceToken(`${this.getFragmentCode()}, null`); + this.processChildren(true); + } else { + // Normal open tag or self-closing tag. + this.processTagIntro(); + this.processPropsObjectWithDevInfo(elementLocationCode); + + if (this.tokens.matches2(_types.TokenType.slash, _types.TokenType.jsxTagEnd)) { + // Self-closing tag; no children to process. + } else if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { + // Tag with children and a close-tag; process the children as args. + this.tokens.removeToken(); + this.processChildren(true); + } else { + throw new Error("Expected either /> or > at the end of the tag."); + } + } + // We're at the close-tag or the end of a self-closing tag, so remove + // everything else and close the function call. + this.tokens.removeInitialToken(); + while (!this.tokens.matches1(_types.TokenType.jsxTagEnd)) { + this.tokens.removeToken(); + } + this.tokens.replaceToken(")"); + } + + /** + * Get the code for the relevant function for this context: jsx, jsxs, + * or jsxDEV. The following open-paren is included as well. + * + * These functions are only used for the automatic runtime, so they are always + * auto-imported, but the auto-import will be either CJS or ESM based on the + * target module format. + */ + getJSXFuncInvocationCode(isStatic) { + if (this.options.production) { + if (isStatic) { + return this.claimAutoImportedFuncInvocation("jsxs", "/jsx-runtime"); + } else { + return this.claimAutoImportedFuncInvocation("jsx", "/jsx-runtime"); + } + } else { + return this.claimAutoImportedFuncInvocation("jsxDEV", "/jsx-dev-runtime"); + } + } + + /** + * Return the code to use for the createElement function, e.g. + * `React.createElement`, including the following open-paren. + * + * This is the main function to use for the classic runtime. For the + * automatic runtime, this function is used as a fallback function to + * preserve behavior when there is a prop spread followed by an explicit + * key. In that automatic runtime case, the function should be automatically + * imported. + */ + getCreateElementInvocationCode() { + if (this.isAutomaticRuntime) { + return this.claimAutoImportedFuncInvocation("createElement", ""); + } else { + const {jsxPragmaInfo} = this; + const resolvedPragmaBaseName = this.importProcessor + ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.base) || jsxPragmaInfo.base + : jsxPragmaInfo.base; + return `${resolvedPragmaBaseName}${jsxPragmaInfo.suffix}(`; + } + } + + /** + * Return the code to use as the component when compiling a shorthand + * fragment, e.g. `React.Fragment`. + * + * This may be called from either the classic or automatic runtime, and + * the value should be auto-imported for the automatic runtime. + */ + getFragmentCode() { + if (this.isAutomaticRuntime) { + return this.claimAutoImportedName( + "Fragment", + this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime", + ); + } else { + const {jsxPragmaInfo} = this; + const resolvedFragmentPragmaBaseName = this.importProcessor + ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.fragmentBase) || + jsxPragmaInfo.fragmentBase + : jsxPragmaInfo.fragmentBase; + return resolvedFragmentPragmaBaseName + jsxPragmaInfo.fragmentSuffix; + } + } + + /** + * Return code that invokes the given function. + * + * When the imports transform is enabled, use the CJSImportTransformer + * strategy of using `.call(void 0, ...` to avoid passing a `this` value in a + * situation that would otherwise look like a method call. + */ + claimAutoImportedFuncInvocation(funcName, importPathSuffix) { + const funcCode = this.claimAutoImportedName(funcName, importPathSuffix); + if (this.importProcessor) { + return `${funcCode}.call(void 0, `; + } else { + return `${funcCode}(`; + } + } + + claimAutoImportedName(funcName, importPathSuffix) { + if (this.importProcessor) { + // CJS mode: claim a name for the module and mark it for import. + const path = this.jsxImportSource + importPathSuffix; + if (!this.cjsAutomaticModuleNameResolutions[path]) { + this.cjsAutomaticModuleNameResolutions[path] = + this.importProcessor.getFreeIdentifierForPath(path); + } + return `${this.cjsAutomaticModuleNameResolutions[path]}.${funcName}`; + } else { + // ESM mode: claim a name for this function and add it to the names that + // should be auto-imported when the prefix is generated. + if (!this.esmAutomaticImportNameResolutions[funcName]) { + this.esmAutomaticImportNameResolutions[funcName] = this.nameManager.claimFreeName( + `_${funcName}`, + ); + } + return this.esmAutomaticImportNameResolutions[funcName]; + } + } + + /** + * Process the first part of a tag, before any props. + */ + processTagIntro() { + // Walk forward until we see one of these patterns: + // jsxName to start the first prop, preceded by another jsxName to end the tag name. + // jsxName to start the first prop, preceded by greaterThan to end the type argument. + // [open brace] to start the first prop. + // [jsxTagEnd] to end the open-tag. + // [slash, jsxTagEnd] to end the self-closing tag. + let introEnd = this.tokens.currentIndex() + 1; + while ( + this.tokens.tokens[introEnd].isType || + (!this.tokens.matches2AtIndex(introEnd - 1, _types.TokenType.jsxName, _types.TokenType.jsxName) && + !this.tokens.matches2AtIndex(introEnd - 1, _types.TokenType.greaterThan, _types.TokenType.jsxName) && + !this.tokens.matches1AtIndex(introEnd, _types.TokenType.braceL) && + !this.tokens.matches1AtIndex(introEnd, _types.TokenType.jsxTagEnd) && + !this.tokens.matches2AtIndex(introEnd, _types.TokenType.slash, _types.TokenType.jsxTagEnd)) + ) { + introEnd++; + } + if (introEnd === this.tokens.currentIndex() + 1) { + const tagName = this.tokens.identifierName(); + if (startsWithLowerCase(tagName)) { + this.tokens.replaceToken(`'${tagName}'`); + } + } + while (this.tokens.currentIndex() < introEnd) { + this.rootTransformer.processToken(); + } + } + + /** + * Starting at the beginning of the props, add the props argument to + * React.createElement, including the comma before it. + */ + processPropsObjectWithDevInfo(elementLocationCode) { + const devProps = this.options.production + ? "" + : `__self: this, __source: ${this.getDevSource(elementLocationCode)}`; + if (!this.tokens.matches1(_types.TokenType.jsxName) && !this.tokens.matches1(_types.TokenType.braceL)) { + if (devProps) { + this.tokens.appendCode(`, {${devProps}}`); + } else { + this.tokens.appendCode(`, null`); + } + return; + } + this.tokens.appendCode(`, {`); + this.processProps(false); + if (devProps) { + this.tokens.appendCode(` ${devProps}}`); + } else { + this.tokens.appendCode("}"); + } + } + + /** + * Transform the core part of the props, assuming that a { has already been + * inserted before us and that a } will be inserted after us. + * + * If extractKeyCode is true (i.e. when using any jsx... function), any prop + * named "key" has its code captured and returned rather than being emitted to + * the output code. This shifts line numbers, and emitting the code later will + * correct line numbers again. If no key is found or if extractKeyCode is + * false, this function returns null. + */ + processProps(extractKeyCode) { + let keyCode = null; + while (true) { + if (this.tokens.matches2(_types.TokenType.jsxName, _types.TokenType.eq)) { + // This is a regular key={value} or key="value" prop. + const propName = this.tokens.identifierName(); + if (extractKeyCode && propName === "key") { + if (keyCode !== null) { + // The props list has multiple keys. Different implementations are + // inconsistent about what to do here: as of this writing, Babel and + // swc keep the *last* key and completely remove the rest, while + // TypeScript uses the *first* key and leaves the others as regular + // props. The React team collaborated with Babel on the + // implementation of this behavior, so presumably the Babel behavior + // is the one to use. + // Since we won't ever be emitting the previous key code, we need to + // at least emit its newlines here so that the line numbers match up + // in the long run. + this.tokens.appendCode(keyCode.replace(/[^\n]/g, "")); + } + // key + this.tokens.removeToken(); + // = + this.tokens.removeToken(); + const snapshot = this.tokens.snapshot(); + this.processPropValue(); + keyCode = this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot); + // Don't add a comma + continue; + } else { + this.processPropName(propName); + this.tokens.replaceToken(": "); + this.processPropValue(); + } + } else if (this.tokens.matches1(_types.TokenType.jsxName)) { + // This is a shorthand prop like . + const propName = this.tokens.identifierName(); + this.processPropName(propName); + this.tokens.appendCode(": true"); + } else if (this.tokens.matches1(_types.TokenType.braceL)) { + // This is prop spread, like
, which we can pass + // through fairly directly as an object spread. + this.tokens.replaceToken(""); + this.rootTransformer.processBalancedCode(); + this.tokens.replaceToken(""); + } else { + break; + } + this.tokens.appendCode(","); + } + return keyCode; + } + + processPropName(propName) { + if (propName.includes("-")) { + this.tokens.replaceToken(`'${propName}'`); + } else { + this.tokens.copyToken(); + } + } + + processPropValue() { + if (this.tokens.matches1(_types.TokenType.braceL)) { + this.tokens.replaceToken(""); + this.rootTransformer.processBalancedCode(); + this.tokens.replaceToken(""); + } else if (this.tokens.matches1(_types.TokenType.jsxTagStart)) { + this.processJSXTag(); + } else { + this.processStringPropValue(); + } + } + + processStringPropValue() { + const token = this.tokens.currentToken(); + const valueCode = this.tokens.code.slice(token.start + 1, token.end - 1); + const replacementCode = formatJSXTextReplacement(valueCode); + const literalCode = formatJSXStringValueLiteral(valueCode); + this.tokens.replaceToken(literalCode + replacementCode); + } + + /** + * Starting in the middle of the props object literal, produce an additional + * prop for the children and close the object literal. + */ + processAutomaticChildrenAndEndProps(jsxRole) { + if (jsxRole === _tokenizer.JSXRole.StaticChildren) { + this.tokens.appendCode(" children: ["); + this.processChildren(false); + this.tokens.appendCode("]}"); + } else { + // The parser information tells us whether we will see a real child or if + // all remaining children (if any) will resolve to empty. If there are no + // non-empty children, don't emit a children prop at all, but still + // process children so that we properly transform the code into nothing. + if (jsxRole === _tokenizer.JSXRole.OneChild) { + this.tokens.appendCode(" children: "); + } + this.processChildren(false); + this.tokens.appendCode("}"); + } + } + + /** + * Transform children into a comma-separated list, which will be either + * arguments to createElement or array elements of a children prop. + */ + processChildren(needsInitialComma) { + let needsComma = needsInitialComma; + while (true) { + if (this.tokens.matches2(_types.TokenType.jsxTagStart, _types.TokenType.slash)) { + // Closing tag, so no more children. + return; + } + let didEmitElement = false; + if (this.tokens.matches1(_types.TokenType.braceL)) { + if (this.tokens.matches2(_types.TokenType.braceL, _types.TokenType.braceR)) { + // Empty interpolations and comment-only interpolations are allowed + // and don't create an extra child arg. + this.tokens.replaceToken(""); + this.tokens.replaceToken(""); + } else { + // Interpolated expression. + this.tokens.replaceToken(needsComma ? ", " : ""); + this.rootTransformer.processBalancedCode(); + this.tokens.replaceToken(""); + didEmitElement = true; + } + } else if (this.tokens.matches1(_types.TokenType.jsxTagStart)) { + // Child JSX element + this.tokens.appendCode(needsComma ? ", " : ""); + this.processJSXTag(); + didEmitElement = true; + } else if (this.tokens.matches1(_types.TokenType.jsxText) || this.tokens.matches1(_types.TokenType.jsxEmptyText)) { + didEmitElement = this.processChildTextElement(needsComma); + } else { + throw new Error("Unexpected token when processing JSX children."); + } + if (didEmitElement) { + needsComma = true; + } + } + } + + /** + * Turn a JSX text element into a string literal, or nothing at all if the JSX + * text resolves to the empty string. + * + * Returns true if a string literal is emitted, false otherwise. + */ + processChildTextElement(needsComma) { + const token = this.tokens.currentToken(); + const valueCode = this.tokens.code.slice(token.start, token.end); + const replacementCode = formatJSXTextReplacement(valueCode); + const literalCode = formatJSXTextLiteral(valueCode); + if (literalCode === '""') { + this.tokens.replaceToken(replacementCode); + return false; + } else { + this.tokens.replaceToken(`${needsComma ? ", " : ""}${literalCode}${replacementCode}`); + return true; + } + } + + getDevSource(elementLocationCode) { + return `{fileName: ${this.getFilenameVarName()}, ${elementLocationCode}}`; + } + + getFilenameVarName() { + if (!this.filenameVarName) { + this.filenameVarName = this.nameManager.claimFreeName("_jsxFileName"); + } + return this.filenameVarName; + } +} exports.default = JSXTransformer; + +/** + * Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart. + * + * Really only treat anything starting with a-z as tag names. `_`, `$`, `é` + * should be treated as component names + */ + function startsWithLowerCase(s) { + const firstChar = s.charCodeAt(0); + return firstChar >= _charcodes.charCodes.lowercaseA && firstChar <= _charcodes.charCodes.lowercaseZ; +} exports.startsWithLowerCase = startsWithLowerCase; + +/** + * Turn the given jsxText string into a JS string literal. Leading and trailing + * whitespace on lines is removed, except immediately after the open-tag and + * before the close-tag. Empty lines are completely removed, and spaces are + * added between lines after that. + * + * We use JSON.stringify to introduce escape characters as necessary, and trim + * the start and end of each line and remove blank lines. + */ +function formatJSXTextLiteral(text) { + let result = ""; + let whitespace = ""; + + let isInInitialLineWhitespace = false; + let seenNonWhitespace = false; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === " " || c === "\t" || c === "\r") { + if (!isInInitialLineWhitespace) { + whitespace += c; + } + } else if (c === "\n") { + whitespace = ""; + isInInitialLineWhitespace = true; + } else { + if (seenNonWhitespace && isInInitialLineWhitespace) { + result += " "; + } + result += whitespace; + whitespace = ""; + if (c === "&") { + const {entity, newI} = processEntity(text, i + 1); + i = newI - 1; + result += entity; + } else { + result += c; + } + seenNonWhitespace = true; + isInInitialLineWhitespace = false; + } + } + if (!isInInitialLineWhitespace) { + result += whitespace; + } + return JSON.stringify(result); +} + +/** + * Produce the code that should be printed after the JSX text string literal, + * with most content removed, but all newlines preserved and all spacing at the + * end preserved. + */ +function formatJSXTextReplacement(text) { + let numNewlines = 0; + let numSpaces = 0; + for (const c of text) { + if (c === "\n") { + numNewlines++; + numSpaces = 0; + } else if (c === " ") { + numSpaces++; + } + } + return "\n".repeat(numNewlines) + " ".repeat(numSpaces); +} + +/** + * Format a string in the value position of a JSX prop. + * + * Use the same implementation as convertAttribute from + * babel-helper-builder-react-jsx. + */ +function formatJSXStringValueLiteral(text) { + let result = ""; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === "\n") { + if (/\s/.test(text[i + 1])) { + result += " "; + while (i < text.length && /\s/.test(text[i + 1])) { + i++; + } + } else { + result += "\n"; + } + } else if (c === "&") { + const {entity, newI} = processEntity(text, i + 1); + result += entity; + i = newI - 1; + } else { + result += c; + } + } + return JSON.stringify(result); +} + +/** + * Starting at a &, see if there's an HTML entity (specified by name, decimal + * char code, or hex char code) and return it if so. + * + * Modified from jsxReadString in babel-parser. + */ +function processEntity(text, indexAfterAmpersand) { + let str = ""; + let count = 0; + let entity; + let i = indexAfterAmpersand; + + if (text[i] === "#") { + let radix = 10; + i++; + let numStart; + if (text[i] === "x") { + radix = 16; + i++; + numStart = i; + while (i < text.length && isHexDigit(text.charCodeAt(i))) { + i++; + } + } else { + numStart = i; + while (i < text.length && isDecimalDigit(text.charCodeAt(i))) { + i++; + } + } + if (text[i] === ";") { + const numStr = text.slice(numStart, i); + if (numStr) { + i++; + entity = String.fromCodePoint(parseInt(numStr, radix)); + } + } + } else { + while (i < text.length && count++ < 10) { + const ch = text[i]; + i++; + if (ch === ";") { + entity = _xhtml2.default.get(str); + break; + } + str += ch; + } + } + + if (!entity) { + return {entity: "&", newI: indexAfterAmpersand}; + } + return {entity, newI: i}; +} + +function isDecimalDigit(code) { + return code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9; +} + +function isHexDigit(code) { + return ( + (code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) || + (code >= _charcodes.charCodes.lowercaseA && code <= _charcodes.charCodes.lowercaseF) || + (code >= _charcodes.charCodes.uppercaseA && code <= _charcodes.charCodes.uppercaseF) + ); +} diff --git a/node_modules/sucrase/dist/transformers/JestHoistTransformer.js b/node_modules/sucrase/dist/transformers/JestHoistTransformer.js new file mode 100644 index 0000000..fb7f0fd --- /dev/null +++ b/node_modules/sucrase/dist/transformers/JestHoistTransformer.js @@ -0,0 +1,111 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } + +var _types = require('../parser/tokenizer/types'); + + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + +const JEST_GLOBAL_NAME = "jest"; +const HOISTED_METHODS = ["mock", "unmock", "enableAutomock", "disableAutomock"]; + +/** + * Implementation of babel-plugin-jest-hoist, which hoists up some jest method + * calls above the imports to allow them to override other imports. + * + * To preserve line numbers, rather than directly moving the jest.mock code, we + * wrap each invocation in a function statement and then call the function from + * the top of the file. + */ + class JestHoistTransformer extends _Transformer2.default { + __init() {this.hoistedFunctionNames = []} + + constructor( + rootTransformer, + tokens, + nameManager, + importProcessor, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.nameManager = nameManager;this.importProcessor = importProcessor;JestHoistTransformer.prototype.__init.call(this);; + } + + process() { + if ( + this.tokens.currentToken().scopeDepth === 0 && + this.tokens.matches4(_types.TokenType.name, _types.TokenType.dot, _types.TokenType.name, _types.TokenType.parenL) && + this.tokens.identifierName() === JEST_GLOBAL_NAME + ) { + // TODO: This only works if imports transform is active, which it will be for jest. + // But if jest adds module support and we no longer need the import transform, this needs fixing. + if (_optionalChain([this, 'access', _ => _.importProcessor, 'optionalAccess', _2 => _2.getGlobalNames, 'call', _3 => _3(), 'optionalAccess', _4 => _4.has, 'call', _5 => _5(JEST_GLOBAL_NAME)])) { + return false; + } + return this.extractHoistedCalls(); + } + + return false; + } + + getHoistedCode() { + if (this.hoistedFunctionNames.length > 0) { + // This will be placed before module interop code, but that's fine since + // imports aren't allowed in module mock factories. + return this.hoistedFunctionNames.map((name) => `${name}();`).join(""); + } + return ""; + } + + /** + * Extracts any methods calls on the jest-object that should be hoisted. + * + * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options, + * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted. + * + * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does. + */ + extractHoistedCalls() { + // We're handling a chain of calls where `jest` may or may not need to be inserted for each call + // in the chain, so remove the initial `jest` to make the loop implementation cleaner. + this.tokens.removeToken(); + // Track some state so that multiple non-hoisted chained calls in a row keep their chaining + // syntax. + let followsNonHoistedJestCall = false; + + // Iterate through all chained calls on the jest object. + while (this.tokens.matches3(_types.TokenType.dot, _types.TokenType.name, _types.TokenType.parenL)) { + const methodName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + const shouldHoist = HOISTED_METHODS.includes(methodName); + if (shouldHoist) { + // We've matched e.g. `.mock(...)` or similar call. + // Replace the initial `.` with `function __jestHoist(){jest.` + const hoistedFunctionName = this.nameManager.claimFreeName("__jestHoist"); + this.hoistedFunctionNames.push(hoistedFunctionName); + this.tokens.replaceToken(`function ${hoistedFunctionName}(){${JEST_GLOBAL_NAME}.`); + this.tokens.copyToken(); + this.tokens.copyToken(); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + this.tokens.appendCode(";}"); + followsNonHoistedJestCall = false; + } else { + // This is a non-hoisted method, so just transform the code as usual. + if (followsNonHoistedJestCall) { + // If we didn't hoist the previous call, we can leave the code as-is to chain off of the + // previous method call. It's important to preserve the code here because we don't know + // for sure that the method actually returned the jest object for chaining. + this.tokens.copyToken(); + } else { + // If we hoisted the previous call, we know it returns the jest object back, so we insert + // the identifier `jest` to continue the chain. + this.tokens.replaceToken(`${JEST_GLOBAL_NAME}.`); + } + this.tokens.copyToken(); + this.tokens.copyToken(); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + followsNonHoistedJestCall = true; + } + } + + return true; + } +} exports.default = JestHoistTransformer; diff --git a/node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js b/node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js new file mode 100644 index 0000000..7a30f09 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js @@ -0,0 +1,20 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _types = require('../parser/tokenizer/types'); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + + class NumericSeparatorTransformer extends _Transformer2.default { + constructor( tokens) { + super();this.tokens = tokens;; + } + + process() { + if (this.tokens.matches1(_types.TokenType.num)) { + const code = this.tokens.currentTokenCode(); + if (code.includes("_")) { + this.tokens.replaceToken(code.replace(/_/g, "")); + return true; + } + } + return false; + } +} exports.default = NumericSeparatorTransformer; diff --git a/node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js b/node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js new file mode 100644 index 0000000..79ae8bc --- /dev/null +++ b/node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js @@ -0,0 +1,19 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _types = require('../parser/tokenizer/types'); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + + class OptionalCatchBindingTransformer extends _Transformer2.default { + constructor( tokens, nameManager) { + super();this.tokens = tokens;this.nameManager = nameManager;; + } + + process() { + if (this.tokens.matches2(_types.TokenType._catch, _types.TokenType.braceL)) { + this.tokens.copyToken(); + this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`); + return true; + } + return false; + } +} exports.default = OptionalCatchBindingTransformer; diff --git a/node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js b/node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js new file mode 100644 index 0000000..3a68a0a --- /dev/null +++ b/node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js @@ -0,0 +1,155 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _types = require('../parser/tokenizer/types'); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + +/** + * Transformer supporting the optional chaining and nullish coalescing operators. + * + * Tech plan here: + * https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan + * + * The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles + * the operators themselves. + */ + class OptionalChainingNullishTransformer extends _Transformer2.default { + constructor( tokens, nameManager) { + super();this.tokens = tokens;this.nameManager = nameManager;; + } + + process() { + if (this.tokens.matches1(_types.TokenType.nullishCoalescing)) { + const token = this.tokens.currentToken(); + if (this.tokens.tokens[token.nullishStartIndex].isAsyncOperation) { + this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("); + } else { + this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("); + } + return true; + } + if (this.tokens.matches1(_types.TokenType._delete)) { + const nextToken = this.tokens.tokenAtRelativeIndex(1); + if (nextToken.isOptionalChainStart) { + this.tokens.removeInitialToken(); + return true; + } + } + const token = this.tokens.currentToken(); + const chainStart = token.subscriptStartIndex; + if ( + chainStart != null && + this.tokens.tokens[chainStart].isOptionalChainStart && + // Super subscripts can't be optional (since super is never null/undefined), and the syntax + // relies on the subscript being intact, so leave this token alone. + this.tokens.tokenAtRelativeIndex(-1).type !== _types.TokenType._super + ) { + const param = this.nameManager.claimFreeName("_"); + let arrowStartSnippet; + if ( + chainStart > 0 && + this.tokens.matches1AtIndex(chainStart - 1, _types.TokenType._delete) && + this.isLastSubscriptInChain() + ) { + // Delete operations are special: we already removed the delete keyword, and to still + // perform a delete, we need to insert a delete in the very last part of the chain, which + // in correct code will always be a property access. + arrowStartSnippet = `${param} => delete ${param}`; + } else { + arrowStartSnippet = `${param} => ${param}`; + } + if (this.tokens.tokens[chainStart].isAsyncOperation) { + arrowStartSnippet = `async ${arrowStartSnippet}`; + } + if ( + this.tokens.matches2(_types.TokenType.questionDot, _types.TokenType.parenL) || + this.tokens.matches2(_types.TokenType.questionDot, _types.TokenType.lessThan) + ) { + if (this.justSkippedSuper()) { + this.tokens.appendCode(".bind(this)"); + } + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${arrowStartSnippet}`); + } else if (this.tokens.matches2(_types.TokenType.questionDot, _types.TokenType.bracketL)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}`); + } else if (this.tokens.matches1(_types.TokenType.questionDot)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}.`); + } else if (this.tokens.matches1(_types.TokenType.dot)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}.`); + } else if (this.tokens.matches1(_types.TokenType.bracketL)) { + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}[`); + } else if (this.tokens.matches1(_types.TokenType.parenL)) { + if (this.justSkippedSuper()) { + this.tokens.appendCode(".bind(this)"); + } + this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${arrowStartSnippet}(`); + } else { + throw new Error("Unexpected subscript operator in optional chain."); + } + return true; + } + return false; + } + + /** + * Determine if the current token is the last of its chain, so that we know whether it's eligible + * to have a delete op inserted. + * + * We can do this by walking forward until we determine one way or another. Each + * isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in + * a nesting way, so we can track depth and walk to the end of the chain (the point where the + * depth goes negative) and see if any other subscript token is after us in the chain. + */ + isLastSubscriptInChain() { + let depth = 0; + for (let i = this.tokens.currentIndex() + 1; ; i++) { + if (i >= this.tokens.tokens.length) { + throw new Error("Reached the end of the code while finding the end of the access chain."); + } + if (this.tokens.tokens[i].isOptionalChainStart) { + depth++; + } else if (this.tokens.tokens[i].isOptionalChainEnd) { + depth--; + } + if (depth < 0) { + return true; + } + + // This subscript token is a later one in the same chain. + if (depth === 0 && this.tokens.tokens[i].subscriptStartIndex != null) { + return false; + } + } + } + + /** + * Determine if we are the open-paren in an expression like super.a()?.b. + * + * We can do this by walking backward to find the previous subscript. If that subscript was + * preceded by a super, then we must be the subscript after it, so if this is a call expression, + * we'll need to attach the right context. + */ + justSkippedSuper() { + let depth = 0; + let index = this.tokens.currentIndex() - 1; + while (true) { + if (index < 0) { + throw new Error( + "Reached the start of the code while finding the start of the access chain.", + ); + } + if (this.tokens.tokens[index].isOptionalChainStart) { + depth--; + } else if (this.tokens.tokens[index].isOptionalChainEnd) { + depth++; + } + if (depth < 0) { + return false; + } + + // This subscript token is a later one in the same chain. + if (depth === 0 && this.tokens.tokens[index].subscriptStartIndex != null) { + return this.tokens.tokens[index - 1].type === _types.TokenType._super; + } + index--; + } + } +} exports.default = OptionalChainingNullishTransformer; diff --git a/node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js b/node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js new file mode 100644 index 0000000..faf6f65 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js @@ -0,0 +1,160 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _tokenizer = require('../parser/tokenizer'); +var _types = require('../parser/tokenizer/types'); + + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + +/** + * Implementation of babel-plugin-transform-react-display-name, which adds a + * display name to usages of React.createClass and createReactClass. + */ + class ReactDisplayNameTransformer extends _Transformer2.default { + constructor( + rootTransformer, + tokens, + importProcessor, + options, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.options = options;; + } + + process() { + const startIndex = this.tokens.currentIndex(); + if (this.tokens.identifierName() === "createReactClass") { + const newName = + this.importProcessor && this.importProcessor.getIdentifierReplacement("createReactClass"); + if (newName) { + this.tokens.replaceToken(`(0, ${newName})`); + } else { + this.tokens.copyToken(); + } + this.tryProcessCreateClassCall(startIndex); + return true; + } + if ( + this.tokens.matches3(_types.TokenType.name, _types.TokenType.dot, _types.TokenType.name) && + this.tokens.identifierName() === "React" && + this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 2) === "createClass" + ) { + const newName = this.importProcessor + ? this.importProcessor.getIdentifierReplacement("React") || "React" + : "React"; + if (newName) { + this.tokens.replaceToken(newName); + this.tokens.copyToken(); + this.tokens.copyToken(); + } else { + this.tokens.copyToken(); + this.tokens.copyToken(); + this.tokens.copyToken(); + } + this.tryProcessCreateClassCall(startIndex); + return true; + } + return false; + } + + /** + * This is called with the token position at the open-paren. + */ + tryProcessCreateClassCall(startIndex) { + const displayName = this.findDisplayName(startIndex); + if (!displayName) { + return; + } + + if (this.classNeedsDisplayName()) { + this.tokens.copyExpectedToken(_types.TokenType.parenL); + this.tokens.copyExpectedToken(_types.TokenType.braceL); + this.tokens.appendCode(`displayName: '${displayName}',`); + this.rootTransformer.processBalancedCode(); + this.tokens.copyExpectedToken(_types.TokenType.braceR); + this.tokens.copyExpectedToken(_types.TokenType.parenR); + } + } + + findDisplayName(startIndex) { + if (startIndex < 2) { + return null; + } + if (this.tokens.matches2AtIndex(startIndex - 2, _types.TokenType.name, _types.TokenType.eq)) { + // This is an assignment (or declaration) and the LHS is either an identifier or a member + // expression ending in an identifier, so use that identifier name. + return this.tokens.identifierNameAtIndex(startIndex - 2); + } + if ( + startIndex >= 2 && + this.tokens.tokens[startIndex - 2].identifierRole === _tokenizer.IdentifierRole.ObjectKey + ) { + // This is an object literal value. + return this.tokens.identifierNameAtIndex(startIndex - 2); + } + if (this.tokens.matches2AtIndex(startIndex - 2, _types.TokenType._export, _types.TokenType._default)) { + return this.getDisplayNameFromFilename(); + } + return null; + } + + getDisplayNameFromFilename() { + const filePath = this.options.filePath || "unknown"; + const pathSegments = filePath.split("/"); + const filename = pathSegments[pathSegments.length - 1]; + const dotIndex = filename.lastIndexOf("."); + const baseFilename = dotIndex === -1 ? filename : filename.slice(0, dotIndex); + if (baseFilename === "index" && pathSegments[pathSegments.length - 2]) { + return pathSegments[pathSegments.length - 2]; + } else { + return baseFilename; + } + } + + /** + * We only want to add a display name when this is a function call containing + * one argument, which is an object literal without `displayName` as an + * existing key. + */ + classNeedsDisplayName() { + let index = this.tokens.currentIndex(); + if (!this.tokens.matches2(_types.TokenType.parenL, _types.TokenType.braceL)) { + return false; + } + // The block starts on the {, and we expect any displayName key to be in + // that context. We need to ignore other other contexts to avoid matching + // nested displayName keys. + const objectStartIndex = index + 1; + const objectContextId = this.tokens.tokens[objectStartIndex].contextId; + if (objectContextId == null) { + throw new Error("Expected non-null context ID on object open-brace."); + } + + for (; index < this.tokens.tokens.length; index++) { + const token = this.tokens.tokens[index]; + if (token.type === _types.TokenType.braceR && token.contextId === objectContextId) { + index++; + break; + } + + if ( + this.tokens.identifierNameAtIndex(index) === "displayName" && + this.tokens.tokens[index].identifierRole === _tokenizer.IdentifierRole.ObjectKey && + token.contextId === objectContextId + ) { + // We found a displayName key, so bail out. + return false; + } + } + + if (index === this.tokens.tokens.length) { + throw new Error("Unexpected end of input when processing React class."); + } + + // If we got this far, we know we have createClass with an object with no + // display name, so we want to proceed as long as that was the only argument. + return ( + this.tokens.matches1AtIndex(index, _types.TokenType.parenR) || + this.tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.parenR) + ); + } +} exports.default = ReactDisplayNameTransformer; diff --git a/node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js b/node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js new file mode 100644 index 0000000..3657c49 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js @@ -0,0 +1,69 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _tokenizer = require('../parser/tokenizer'); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + + class ReactHotLoaderTransformer extends _Transformer2.default { + __init() {this.extractedDefaultExportName = null} + + constructor( tokens, filePath) { + super();this.tokens = tokens;this.filePath = filePath;ReactHotLoaderTransformer.prototype.__init.call(this);; + } + + setExtractedDefaultExportName(extractedDefaultExportName) { + this.extractedDefaultExportName = extractedDefaultExportName; + } + + getPrefixCode() { + return ` + (function () { + var enterModule = require('react-hot-loader').enterModule; + enterModule && enterModule(module); + })();` + .replace(/\s+/g, " ") + .trim(); + } + + getSuffixCode() { + const topLevelNames = new Set(); + for (const token of this.tokens.tokens) { + if ( + !token.isType && + _tokenizer.isTopLevelDeclaration.call(void 0, token) && + token.identifierRole !== _tokenizer.IdentifierRole.ImportDeclaration + ) { + topLevelNames.add(this.tokens.identifierNameForToken(token)); + } + } + const namesToRegister = Array.from(topLevelNames).map((name) => ({ + variableName: name, + uniqueLocalName: name, + })); + if (this.extractedDefaultExportName) { + namesToRegister.push({ + variableName: this.extractedDefaultExportName, + uniqueLocalName: "default", + }); + } + return ` +;(function () { + var reactHotLoader = require('react-hot-loader').default; + var leaveModule = require('react-hot-loader').leaveModule; + if (!reactHotLoader) { + return; + } +${namesToRegister + .map( + ({variableName, uniqueLocalName}) => + ` reactHotLoader.register(${variableName}, "${uniqueLocalName}", ${JSON.stringify( + this.filePath || "", + )});`, + ) + .join("\n")} + leaveModule(module); +})();`; + } + + process() { + return false; + } +} exports.default = ReactHotLoaderTransformer; diff --git a/node_modules/sucrase/dist/transformers/RootTransformer.js b/node_modules/sucrase/dist/transformers/RootTransformer.js new file mode 100644 index 0000000..70b33c8 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/RootTransformer.js @@ -0,0 +1,462 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + +var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + +var _getClassInfo = require('../util/getClassInfo'); var _getClassInfo2 = _interopRequireDefault(_getClassInfo); +var _CJSImportTransformer = require('./CJSImportTransformer'); var _CJSImportTransformer2 = _interopRequireDefault(_CJSImportTransformer); +var _ESMImportTransformer = require('./ESMImportTransformer'); var _ESMImportTransformer2 = _interopRequireDefault(_ESMImportTransformer); +var _FlowTransformer = require('./FlowTransformer'); var _FlowTransformer2 = _interopRequireDefault(_FlowTransformer); +var _JestHoistTransformer = require('./JestHoistTransformer'); var _JestHoistTransformer2 = _interopRequireDefault(_JestHoistTransformer); +var _JSXTransformer = require('./JSXTransformer'); var _JSXTransformer2 = _interopRequireDefault(_JSXTransformer); +var _NumericSeparatorTransformer = require('./NumericSeparatorTransformer'); var _NumericSeparatorTransformer2 = _interopRequireDefault(_NumericSeparatorTransformer); +var _OptionalCatchBindingTransformer = require('./OptionalCatchBindingTransformer'); var _OptionalCatchBindingTransformer2 = _interopRequireDefault(_OptionalCatchBindingTransformer); +var _OptionalChainingNullishTransformer = require('./OptionalChainingNullishTransformer'); var _OptionalChainingNullishTransformer2 = _interopRequireDefault(_OptionalChainingNullishTransformer); +var _ReactDisplayNameTransformer = require('./ReactDisplayNameTransformer'); var _ReactDisplayNameTransformer2 = _interopRequireDefault(_ReactDisplayNameTransformer); +var _ReactHotLoaderTransformer = require('./ReactHotLoaderTransformer'); var _ReactHotLoaderTransformer2 = _interopRequireDefault(_ReactHotLoaderTransformer); + +var _TypeScriptTransformer = require('./TypeScriptTransformer'); var _TypeScriptTransformer2 = _interopRequireDefault(_TypeScriptTransformer); + + + + + + + + + class RootTransformer { + __init() {this.transformers = []} + + + __init2() {this.generatedVariables = []} + + + + + + constructor( + sucraseContext, + transforms, + enableLegacyBabel5ModuleInterop, + options, + ) {;RootTransformer.prototype.__init.call(this);RootTransformer.prototype.__init2.call(this); + this.nameManager = sucraseContext.nameManager; + this.helperManager = sucraseContext.helperManager; + const {tokenProcessor, importProcessor} = sucraseContext; + this.tokens = tokenProcessor; + this.isImportsTransformEnabled = transforms.includes("imports"); + this.isReactHotLoaderTransformEnabled = transforms.includes("react-hot-loader"); + this.disableESTransforms = Boolean(options.disableESTransforms); + + if (!options.disableESTransforms) { + this.transformers.push( + new (0, _OptionalChainingNullishTransformer2.default)(tokenProcessor, this.nameManager), + ); + this.transformers.push(new (0, _NumericSeparatorTransformer2.default)(tokenProcessor)); + this.transformers.push(new (0, _OptionalCatchBindingTransformer2.default)(tokenProcessor, this.nameManager)); + } + + if (transforms.includes("jsx")) { + if (options.jsxRuntime !== "preserve") { + this.transformers.push( + new (0, _JSXTransformer2.default)(this, tokenProcessor, importProcessor, this.nameManager, options), + ); + } + this.transformers.push( + new (0, _ReactDisplayNameTransformer2.default)(this, tokenProcessor, importProcessor, options), + ); + } + + let reactHotLoaderTransformer = null; + if (transforms.includes("react-hot-loader")) { + if (!options.filePath) { + throw new Error("filePath is required when using the react-hot-loader transform."); + } + reactHotLoaderTransformer = new (0, _ReactHotLoaderTransformer2.default)(tokenProcessor, options.filePath); + this.transformers.push(reactHotLoaderTransformer); + } + + // Note that we always want to enable the imports transformer, even when the import transform + // itself isn't enabled, since we need to do type-only import pruning for both Flow and + // TypeScript. + if (transforms.includes("imports")) { + if (importProcessor === null) { + throw new Error("Expected non-null importProcessor with imports transform enabled."); + } + this.transformers.push( + new (0, _CJSImportTransformer2.default)( + this, + tokenProcessor, + importProcessor, + this.nameManager, + this.helperManager, + reactHotLoaderTransformer, + enableLegacyBabel5ModuleInterop, + Boolean(options.enableLegacyTypeScriptModuleInterop), + transforms.includes("typescript"), + transforms.includes("flow"), + Boolean(options.preserveDynamicImport), + Boolean(options.keepUnusedImports), + ), + ); + } else { + this.transformers.push( + new (0, _ESMImportTransformer2.default)( + tokenProcessor, + this.nameManager, + this.helperManager, + reactHotLoaderTransformer, + transforms.includes("typescript"), + transforms.includes("flow"), + Boolean(options.keepUnusedImports), + options, + ), + ); + } + + if (transforms.includes("flow")) { + this.transformers.push( + new (0, _FlowTransformer2.default)(this, tokenProcessor, transforms.includes("imports")), + ); + } + if (transforms.includes("typescript")) { + this.transformers.push( + new (0, _TypeScriptTransformer2.default)(this, tokenProcessor, transforms.includes("imports")), + ); + } + if (transforms.includes("jest")) { + this.transformers.push( + new (0, _JestHoistTransformer2.default)(this, tokenProcessor, this.nameManager, importProcessor), + ); + } + } + + transform() { + this.tokens.reset(); + this.processBalancedCode(); + const shouldAddUseStrict = this.isImportsTransformEnabled; + // "use strict" always needs to be first, so override the normal transformer order. + let prefix = shouldAddUseStrict ? '"use strict";' : ""; + for (const transformer of this.transformers) { + prefix += transformer.getPrefixCode(); + } + prefix += this.helperManager.emitHelpers(); + prefix += this.generatedVariables.map((v) => ` var ${v};`).join(""); + for (const transformer of this.transformers) { + prefix += transformer.getHoistedCode(); + } + let suffix = ""; + for (const transformer of this.transformers) { + suffix += transformer.getSuffixCode(); + } + const result = this.tokens.finish(); + let {code} = result; + if (code.startsWith("#!")) { + let newlineIndex = code.indexOf("\n"); + if (newlineIndex === -1) { + newlineIndex = code.length; + code += "\n"; + } + return { + code: code.slice(0, newlineIndex + 1) + prefix + code.slice(newlineIndex + 1) + suffix, + // The hashbang line has no tokens, so shifting the tokens to account + // for prefix can happen normally. + mappings: this.shiftMappings(result.mappings, prefix.length), + }; + } else { + return { + code: prefix + code + suffix, + mappings: this.shiftMappings(result.mappings, prefix.length), + }; + } + } + + processBalancedCode() { + let braceDepth = 0; + let parenDepth = 0; + while (!this.tokens.isAtEnd()) { + if (this.tokens.matches1(_types.TokenType.braceL) || this.tokens.matches1(_types.TokenType.dollarBraceL)) { + braceDepth++; + } else if (this.tokens.matches1(_types.TokenType.braceR)) { + if (braceDepth === 0) { + return; + } + braceDepth--; + } + if (this.tokens.matches1(_types.TokenType.parenL)) { + parenDepth++; + } else if (this.tokens.matches1(_types.TokenType.parenR)) { + if (parenDepth === 0) { + return; + } + parenDepth--; + } + this.processToken(); + } + } + + processToken() { + if (this.tokens.matches1(_types.TokenType._class)) { + this.processClass(); + return; + } + for (const transformer of this.transformers) { + const wasProcessed = transformer.process(); + if (wasProcessed) { + return; + } + } + this.tokens.copyToken(); + } + + /** + * Skip past a class with a name and return that name. + */ + processNamedClass() { + if (!this.tokens.matches2(_types.TokenType._class, _types.TokenType.name)) { + throw new Error("Expected identifier for exported class name."); + } + const name = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); + this.processClass(); + return name; + } + + processClass() { + const classInfo = _getClassInfo2.default.call(void 0, this, this.tokens, this.nameManager, this.disableESTransforms); + + // Both static and instance initializers need a class name to use to invoke the initializer, so + // assign to one if necessary. + const needsCommaExpression = + (classInfo.headerInfo.isExpression || !classInfo.headerInfo.className) && + classInfo.staticInitializerNames.length + classInfo.instanceInitializerNames.length > 0; + + let className = classInfo.headerInfo.className; + if (needsCommaExpression) { + className = this.nameManager.claimFreeName("_class"); + this.generatedVariables.push(className); + this.tokens.appendCode(` (${className} =`); + } + + const classToken = this.tokens.currentToken(); + const contextId = classToken.contextId; + if (contextId == null) { + throw new Error("Expected class to have a context ID."); + } + this.tokens.copyExpectedToken(_types.TokenType._class); + while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.braceL, contextId)) { + this.processToken(); + } + + this.processClassBody(classInfo, className); + + const staticInitializerStatements = classInfo.staticInitializerNames.map( + (name) => `${className}.${name}()`, + ); + if (needsCommaExpression) { + this.tokens.appendCode( + `, ${staticInitializerStatements.map((s) => `${s}, `).join("")}${className})`, + ); + } else if (classInfo.staticInitializerNames.length > 0) { + this.tokens.appendCode(` ${staticInitializerStatements.map((s) => `${s};`).join(" ")}`); + } + } + + /** + * We want to just handle class fields in all contexts, since TypeScript supports them. Later, + * when some JS implementations support class fields, this should be made optional. + */ + processClassBody(classInfo, className) { + const { + headerInfo, + constructorInsertPos, + constructorInitializerStatements, + fields, + instanceInitializerNames, + rangesToRemove, + } = classInfo; + let fieldIndex = 0; + let rangeToRemoveIndex = 0; + const classContextId = this.tokens.currentToken().contextId; + if (classContextId == null) { + throw new Error("Expected non-null context ID on class."); + } + this.tokens.copyExpectedToken(_types.TokenType.braceL); + if (this.isReactHotLoaderTransformEnabled) { + this.tokens.appendCode( + "__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}", + ); + } + + const needsConstructorInit = + constructorInitializerStatements.length + instanceInitializerNames.length > 0; + + if (constructorInsertPos === null && needsConstructorInit) { + const constructorInitializersCode = this.makeConstructorInitCode( + constructorInitializerStatements, + instanceInitializerNames, + className, + ); + if (headerInfo.hasSuperclass) { + const argsName = this.nameManager.claimFreeName("args"); + this.tokens.appendCode( + `constructor(...${argsName}) { super(...${argsName}); ${constructorInitializersCode}; }`, + ); + } else { + this.tokens.appendCode(`constructor() { ${constructorInitializersCode}; }`); + } + } + + while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.braceR, classContextId)) { + if (fieldIndex < fields.length && this.tokens.currentIndex() === fields[fieldIndex].start) { + let needsCloseBrace = false; + if (this.tokens.matches1(_types.TokenType.bracketL)) { + this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this`); + } else if (this.tokens.matches1(_types.TokenType.string) || this.tokens.matches1(_types.TokenType.num)) { + this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this[`); + needsCloseBrace = true; + } else { + this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this.`); + } + while (this.tokens.currentIndex() < fields[fieldIndex].end) { + if (needsCloseBrace && this.tokens.currentIndex() === fields[fieldIndex].equalsIndex) { + this.tokens.appendCode("]"); + } + this.processToken(); + } + this.tokens.appendCode("}"); + fieldIndex++; + } else if ( + rangeToRemoveIndex < rangesToRemove.length && + this.tokens.currentIndex() >= rangesToRemove[rangeToRemoveIndex].start + ) { + if (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { + this.tokens.removeInitialToken(); + } + while (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { + this.tokens.removeToken(); + } + rangeToRemoveIndex++; + } else if (this.tokens.currentIndex() === constructorInsertPos) { + this.tokens.copyToken(); + if (needsConstructorInit) { + this.tokens.appendCode( + `;${this.makeConstructorInitCode( + constructorInitializerStatements, + instanceInitializerNames, + className, + )};`, + ); + } + this.processToken(); + } else { + this.processToken(); + } + } + this.tokens.copyExpectedToken(_types.TokenType.braceR); + } + + makeConstructorInitCode( + constructorInitializerStatements, + instanceInitializerNames, + className, + ) { + return [ + ...constructorInitializerStatements, + ...instanceInitializerNames.map((name) => `${className}.prototype.${name}.call(this)`), + ].join(";"); + } + + /** + * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with + * arrow function return types since they can confuse the parser. In that case, we want to move + * the close-paren to the same line as the arrow. + * + * See https://github.com/alangpierce/sucrase/issues/391 for more details. + */ + processPossibleArrowParamEnd() { + if (this.tokens.matches2(_types.TokenType.parenR, _types.TokenType.colon) && this.tokens.tokenAtRelativeIndex(1).isType) { + let nextNonTypeIndex = this.tokens.currentIndex() + 1; + // Look ahead to see if this is an arrow function or something else. + while (this.tokens.tokens[nextNonTypeIndex].isType) { + nextNonTypeIndex++; + } + if (this.tokens.matches1AtIndex(nextNonTypeIndex, _types.TokenType.arrow)) { + this.tokens.removeInitialToken(); + while (this.tokens.currentIndex() < nextNonTypeIndex) { + this.tokens.removeToken(); + } + this.tokens.replaceTokenTrimmingLeftWhitespace(") =>"); + return true; + } + } + return false; + } + + /** + * An async arrow function might be of the form: + * + * async < + * T + * >() => {} + * + * in which case, removing the type parameters will cause a syntax error. Detect this case and + * move the open-paren earlier. + */ + processPossibleAsyncArrowWithTypeParams() { + if ( + !this.tokens.matchesContextual(_keywords.ContextualKeyword._async) && + !this.tokens.matches1(_types.TokenType._async) + ) { + return false; + } + const nextToken = this.tokens.tokenAtRelativeIndex(1); + if (nextToken.type !== _types.TokenType.lessThan || !nextToken.isType) { + return false; + } + + let nextNonTypeIndex = this.tokens.currentIndex() + 1; + // Look ahead to see if this is an arrow function or something else. + while (this.tokens.tokens[nextNonTypeIndex].isType) { + nextNonTypeIndex++; + } + if (this.tokens.matches1AtIndex(nextNonTypeIndex, _types.TokenType.parenL)) { + this.tokens.replaceToken("async ("); + this.tokens.removeInitialToken(); + while (this.tokens.currentIndex() < nextNonTypeIndex) { + this.tokens.removeToken(); + } + this.tokens.removeToken(); + // We ate a ( token, so we need to process the tokens in between and then the ) token so that + // we remain balanced. + this.processBalancedCode(); + this.processToken(); + return true; + } + return false; + } + + processPossibleTypeRange() { + if (this.tokens.currentToken().isType) { + this.tokens.removeInitialToken(); + while (this.tokens.currentToken().isType) { + this.tokens.removeToken(); + } + return true; + } + return false; + } + + shiftMappings( + mappings, + prefixLength, + ) { + for (let i = 0; i < mappings.length; i++) { + const mapping = mappings[i]; + if (mapping !== undefined) { + mappings[i] = mapping + prefixLength; + } + } + return mappings; + } +} exports.default = RootTransformer; diff --git a/node_modules/sucrase/dist/transformers/Transformer.js b/node_modules/sucrase/dist/transformers/Transformer.js new file mode 100644 index 0000000..991d363 --- /dev/null +++ b/node_modules/sucrase/dist/transformers/Transformer.js @@ -0,0 +1,16 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); class Transformer { + // Return true if anything was processed, false otherwise. + + + getPrefixCode() { + return ""; + } + + getHoistedCode() { + return ""; + } + + getSuffixCode() { + return ""; + } +} exports.default = Transformer; diff --git a/node_modules/sucrase/dist/transformers/TypeScriptTransformer.js b/node_modules/sucrase/dist/transformers/TypeScriptTransformer.js new file mode 100644 index 0000000..9fe5c6e --- /dev/null +++ b/node_modules/sucrase/dist/transformers/TypeScriptTransformer.js @@ -0,0 +1,279 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _types = require('../parser/tokenizer/types'); + +var _isIdentifier = require('../util/isIdentifier'); var _isIdentifier2 = _interopRequireDefault(_isIdentifier); + +var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); + + class TypeScriptTransformer extends _Transformer2.default { + constructor( + rootTransformer, + tokens, + isImportsTransformEnabled, + ) { + super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; + } + + process() { + if ( + this.rootTransformer.processPossibleArrowParamEnd() || + this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || + this.rootTransformer.processPossibleTypeRange() + ) { + return true; + } + if ( + this.tokens.matches1(_types.TokenType._public) || + this.tokens.matches1(_types.TokenType._protected) || + this.tokens.matches1(_types.TokenType._private) || + this.tokens.matches1(_types.TokenType._abstract) || + this.tokens.matches1(_types.TokenType._readonly) || + this.tokens.matches1(_types.TokenType._override) || + this.tokens.matches1(_types.TokenType.nonNullAssertion) + ) { + this.tokens.removeInitialToken(); + return true; + } + if (this.tokens.matches1(_types.TokenType._enum) || this.tokens.matches2(_types.TokenType._const, _types.TokenType._enum)) { + this.processEnum(); + return true; + } + if ( + this.tokens.matches2(_types.TokenType._export, _types.TokenType._enum) || + this.tokens.matches3(_types.TokenType._export, _types.TokenType._const, _types.TokenType._enum) + ) { + this.processEnum(true); + return true; + } + return false; + } + + processEnum(isExport = false) { + // We might have "export const enum", so just remove all relevant tokens. + this.tokens.removeInitialToken(); + while (this.tokens.matches1(_types.TokenType._const) || this.tokens.matches1(_types.TokenType._enum)) { + this.tokens.removeToken(); + } + const enumName = this.tokens.identifierName(); + this.tokens.removeToken(); + if (isExport && !this.isImportsTransformEnabled) { + this.tokens.appendCode("export "); + } + this.tokens.appendCode(`var ${enumName}; (function (${enumName})`); + this.tokens.copyExpectedToken(_types.TokenType.braceL); + this.processEnumBody(enumName); + this.tokens.copyExpectedToken(_types.TokenType.braceR); + if (isExport && this.isImportsTransformEnabled) { + this.tokens.appendCode(`)(${enumName} || (exports.${enumName} = ${enumName} = {}));`); + } else { + this.tokens.appendCode(`)(${enumName} || (${enumName} = {}));`); + } + } + + /** + * Transform an enum into equivalent JS. This has complexity in a few places: + * - TS allows string enums, numeric enums, and a mix of the two styles within an enum. + * - Enum keys are allowed to be referenced in later enum values. + * - Enum keys are allowed to be strings. + * - When enum values are omitted, they should follow an auto-increment behavior. + */ + processEnumBody(enumName) { + // Code that can be used to reference the previous enum member, or null if this is the first + // enum member. + let previousValueCode = null; + while (true) { + if (this.tokens.matches1(_types.TokenType.braceR)) { + break; + } + const {nameStringCode, variableName} = this.extractEnumKeyInfo(this.tokens.currentToken()); + this.tokens.removeInitialToken(); + + if ( + this.tokens.matches3(_types.TokenType.eq, _types.TokenType.string, _types.TokenType.comma) || + this.tokens.matches3(_types.TokenType.eq, _types.TokenType.string, _types.TokenType.braceR) + ) { + this.processStringLiteralEnumMember(enumName, nameStringCode, variableName); + } else if (this.tokens.matches1(_types.TokenType.eq)) { + this.processExplicitValueEnumMember(enumName, nameStringCode, variableName); + } else { + this.processImplicitValueEnumMember( + enumName, + nameStringCode, + variableName, + previousValueCode, + ); + } + if (this.tokens.matches1(_types.TokenType.comma)) { + this.tokens.removeToken(); + } + + if (variableName != null) { + previousValueCode = variableName; + } else { + previousValueCode = `${enumName}[${nameStringCode}]`; + } + } + } + + /** + * Detect name information about this enum key, which will be used to determine which code to emit + * and whether we should declare a variable as part of this declaration. + * + * Some cases to keep in mind: + * - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement + * this by declaring a variable `X` so that later expressions can use it. + * - In addition to the usual identifier key syntax, enum keys are allowed to be string literals, + * e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed. + * - Even if the enum key is defined as a string literal, it may still be referenced by identifier + * later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string + * literal is identifier-like and emit a variable if so, even if the declaration did not use an + * identifier. + * - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later + * and would be a syntax error if we emitted a variable, so we need to skip the variable + * declaration in those cases. + * + * The variableName return value captures these nuances: if non-null, we can and must emit a + * variable declaration, and if null, we can't and shouldn't. + */ + extractEnumKeyInfo(nameToken) { + if (nameToken.type === _types.TokenType.name) { + const name = this.tokens.identifierNameForToken(nameToken); + return { + nameStringCode: `"${name}"`, + variableName: _isIdentifier2.default.call(void 0, name) ? name : null, + }; + } else if (nameToken.type === _types.TokenType.string) { + const name = this.tokens.stringValueForToken(nameToken); + return { + nameStringCode: this.tokens.code.slice(nameToken.start, nameToken.end), + variableName: _isIdentifier2.default.call(void 0, name) ? name : null, + }; + } else { + throw new Error("Expected name or string at beginning of enum element."); + } + } + + /** + * Handle an enum member where the RHS is just a string literal (not omitted, not a number, and + * not a complex expression). This is the typical form for TS string enums, and in this case, we + * do *not* create a reverse mapping. + * + * This is called after deleting the key token, when the token processor is at the equals sign. + * + * Example 1: + * someKey = "some value" + * -> + * const someKey = "some value"; MyEnum["someKey"] = someKey; + * + * Example 2: + * "some key" = "some value" + * -> + * MyEnum["some key"] = "some value"; + */ + processStringLiteralEnumMember( + enumName, + nameStringCode, + variableName, + ) { + if (variableName != null) { + this.tokens.appendCode(`const ${variableName}`); + // = + this.tokens.copyToken(); + // value string + this.tokens.copyToken(); + this.tokens.appendCode(`; ${enumName}[${nameStringCode}] = ${variableName};`); + } else { + this.tokens.appendCode(`${enumName}[${nameStringCode}]`); + // = + this.tokens.copyToken(); + // value string + this.tokens.copyToken(); + this.tokens.appendCode(";"); + } + } + + /** + * Handle an enum member initialized with an expression on the right-hand side (other than a + * string literal). In these cases, we should transform the expression and emit code that sets up + * a reverse mapping. + * + * The TypeScript implementation of this operation distinguishes between expressions that can be + * "constant folded" at compile time (i.e. consist of number literals and simple math operations + * on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved + * numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at + * compile time would add significant complexity to Sucrase, so Sucrase instead leaves the + * expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement + * auto-incrementing. + * + * This is called after deleting the key token, when the token processor is at the equals sign. + * + * Example 1: + * someKey = 1 + 1 + * -> + * const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey"; + * + * Example 2: + * "some key" = 1 + 1 + * -> + * MyEnum[MyEnum["some key"] = 1 + 1] = "some key"; + */ + processExplicitValueEnumMember( + enumName, + nameStringCode, + variableName, + ) { + const rhsEndIndex = this.tokens.currentToken().rhsEndIndex; + if (rhsEndIndex == null) { + throw new Error("Expected rhsEndIndex on enum assign."); + } + + if (variableName != null) { + this.tokens.appendCode(`const ${variableName}`); + this.tokens.copyToken(); + while (this.tokens.currentIndex() < rhsEndIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode( + `; ${enumName}[${enumName}[${nameStringCode}] = ${variableName}] = ${nameStringCode};`, + ); + } else { + this.tokens.appendCode(`${enumName}[${enumName}[${nameStringCode}]`); + this.tokens.copyToken(); + while (this.tokens.currentIndex() < rhsEndIndex) { + this.rootTransformer.processToken(); + } + this.tokens.appendCode(`] = ${nameStringCode};`); + } + } + + /** + * Handle an enum member with no right-hand side expression. In this case, the value is the + * previous value plus 1, or 0 if there was no previous value. We should also always emit a + * reverse mapping. + * + * Example 1: + * someKey2 + * -> + * const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2"; + * + * Example 2: + * "some key 2" + * -> + * MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2"; + */ + processImplicitValueEnumMember( + enumName, + nameStringCode, + variableName, + previousValueCode, + ) { + let valueCode = previousValueCode != null ? `${previousValueCode} + 1` : "0"; + if (variableName != null) { + this.tokens.appendCode(`const ${variableName} = ${valueCode}; `); + valueCode = variableName; + } + this.tokens.appendCode( + `${enumName}[${enumName}[${nameStringCode}] = ${valueCode}] = ${nameStringCode};`, + ); + } +} exports.default = TypeScriptTransformer; diff --git a/node_modules/sucrase/dist/types/CJSImportProcessor.d.ts b/node_modules/sucrase/dist/types/CJSImportProcessor.d.ts new file mode 100644 index 0000000..265db0e --- /dev/null +++ b/node_modules/sucrase/dist/types/CJSImportProcessor.d.ts @@ -0,0 +1,67 @@ +import type { HelperManager } from "./HelperManager"; +import type { Options } from "./index"; +import type NameManager from "./NameManager"; +import type TokenProcessor from "./TokenProcessor"; +/** + * Class responsible for preprocessing and bookkeeping import and export declarations within the + * file. + * + * TypeScript uses a simpler mechanism that does not use functions like interopRequireDefault and + * interopRequireWildcard, so we also allow that mode for compatibility. + */ +export default class CJSImportProcessor { + readonly nameManager: NameManager; + readonly tokens: TokenProcessor; + readonly enableLegacyTypeScriptModuleInterop: boolean; + readonly options: Options; + readonly isTypeScriptTransformEnabled: boolean; + readonly keepUnusedImports: boolean; + readonly helperManager: HelperManager; + private nonTypeIdentifiers; + private importInfoByPath; + private importsToReplace; + private identifierReplacements; + private exportBindingsByLocalName; + constructor(nameManager: NameManager, tokens: TokenProcessor, enableLegacyTypeScriptModuleInterop: boolean, options: Options, isTypeScriptTransformEnabled: boolean, keepUnusedImports: boolean, helperManager: HelperManager); + preprocessTokens(): void; + /** + * In TypeScript, import statements that only import types should be removed. + * This includes `import {} from 'foo';`, but not `import 'foo';`. + */ + pruneTypeOnlyImports(): void; + shouldAutomaticallyElideImportedName(name: string): boolean; + private generateImportReplacements; + getFreeIdentifierForPath(path: string): string; + private preprocessImportAtIndex; + private preprocessExportAtIndex; + private preprocessVarExportAtIndex; + /** + * Walk this export statement just in case it's an export...from statement. + * If it is, combine it into the import info for that path. Otherwise, just + * bail out; it'll be handled later. + */ + private preprocessNamedExportAtIndex; + private preprocessExportStarAtIndex; + private getNamedImports; + /** + * Get a mutable import info object for this path, creating one if it doesn't + * exist yet. + */ + private getImportInfo; + private addExportBinding; + /** + * Return the code to use for the import for this path, or the empty string if + * the code has already been "claimed" by a previous import. + */ + claimImportCode(importPath: string): string; + getIdentifierReplacement(identifierName: string): string | null; + /** + * Return a string like `exports.foo = exports.bar`. + */ + resolveExportBinding(assignedName: string): string | null; + /** + * Return all imported/exported names where we might be interested in whether usages of those + * names are shadowed. + */ + getGlobalNames(): Set; +} diff --git a/node_modules/sucrase/dist/types/HelperManager.d.ts b/node_modules/sucrase/dist/types/HelperManager.d.ts new file mode 100644 index 0000000..8ec724d --- /dev/null +++ b/node_modules/sucrase/dist/types/HelperManager.d.ts @@ -0,0 +1,15 @@ +import type NameManager from "./NameManager"; +declare const HELPERS: { + [name: string]: string; +}; +export declare class HelperManager { + readonly nameManager: NameManager; + helperNames: { + [baseName in keyof typeof HELPERS]?: string; + }; + createRequireName: string | null; + constructor(nameManager: NameManager); + getHelperName(baseName: keyof typeof HELPERS): string; + emitHelpers(): string; +} +export {}; diff --git a/node_modules/sucrase/dist/types/NameManager.d.ts b/node_modules/sucrase/dist/types/NameManager.d.ts new file mode 100644 index 0000000..7485bf0 --- /dev/null +++ b/node_modules/sucrase/dist/types/NameManager.d.ts @@ -0,0 +1,7 @@ +import type { Token } from "./parser/tokenizer"; +export default class NameManager { + private readonly usedNames; + constructor(code: string, tokens: Array); + claimFreeName(name: string): string; + findFreeName(name: string): string; +} diff --git a/node_modules/sucrase/dist/types/Options-gen-types.d.ts b/node_modules/sucrase/dist/types/Options-gen-types.d.ts new file mode 100644 index 0000000..22996e8 --- /dev/null +++ b/node_modules/sucrase/dist/types/Options-gen-types.d.ts @@ -0,0 +1,9 @@ +/** + * This module was automatically generated by `ts-interface-builder` + */ +import * as t from "ts-interface-checker"; +export declare const Transform: t.TUnion; +export declare const SourceMapOptions: t.TIface; +export declare const Options: t.TIface; +declare const exportedTypeSuite: t.ITypeSuite; +export default exportedTypeSuite; diff --git a/node_modules/sucrase/dist/types/Options.d.ts b/node_modules/sucrase/dist/types/Options.d.ts new file mode 100644 index 0000000..c182ed9 --- /dev/null +++ b/node_modules/sucrase/dist/types/Options.d.ts @@ -0,0 +1,90 @@ +export type Transform = "jsx" | "typescript" | "flow" | "imports" | "react-hot-loader" | "jest"; +export interface SourceMapOptions { + /** + * The name to use in the "file" field of the source map. This should be the name of the compiled + * file. + */ + compiledFilename: string; +} +export interface Options { + /** + * Unordered array of transform names describing both the allowed syntax + * (where applicable) and the transformation behavior. + */ + transforms: Array; + /** + * Opts out of all ES syntax transformations: optional chaining, nullish + * coalescing, class fields, numeric separators, optional catch binding. + */ + disableESTransforms?: boolean; + /** + * Transformation mode for the JSX transform. + * - "classic" refers to the original behavior using `React.createElement`. + * - "automatic" refers to the transform behavior released with React 17, + * where the `jsx` function (or a variation) is automatically imported. + * - "preserve" leaves the JSX as-is. + * + * Default value: "classic". + */ + jsxRuntime?: "classic" | "automatic" | "preserve"; + /** + * Compile code for production use. Currently only applies to the JSX + * transform. + */ + production?: boolean; + /** + * If specified, import path prefix to use in place of "react" when compiling + * JSX with the automatic runtime. + */ + jsxImportSource?: string; + /** + * If specified, function name to use in place of React.createClass when + * compiling JSX with the classic runtime. + */ + jsxPragma?: string; + /** + * If specified, function name to use in place of React.Fragment when + * compiling JSX with the classic runtime. + */ + jsxFragmentPragma?: string; + /** + * If specified, disable automatic removal of type-only import and export + * statements and names. Only statements and names that explicitly use the + * `type` keyword are removed. + */ + keepUnusedImports?: boolean; + /** + * If specified, the imports transform does not attempt to change dynamic + * import() expressions into require() calls. + */ + preserveDynamicImport?: boolean; + /** + * Only relevant when targeting ESM (i.e. when the imports transform is *not* + * specified). This flag changes the behavior of TS require imports: + * + * import Foo = require("foo"); + * + * to import createRequire, create a require function, and use that function. + * This is the TS behavior with module: nodenext and makes it easier for the + * same code to target ESM and CJS. + */ + injectCreateRequireForImportRequire?: boolean; + /** + * If true, replicate the import behavior of TypeScript's esModuleInterop: false. + */ + enableLegacyTypeScriptModuleInterop?: boolean; + /** + * If true, replicate the import behavior Babel 5 and babel-plugin-add-module-exports. + */ + enableLegacyBabel5ModuleInterop?: boolean; + /** + * If specified, we also return a RawSourceMap object alongside the code. + * filePath must be specified if this option is enabled. + */ + sourceMapOptions?: SourceMapOptions; + /** + * File path to use in error messages, React display names, and source maps. + */ + filePath?: string; +} +export declare function validateOptions(options: Options): void; diff --git a/node_modules/sucrase/dist/types/TokenProcessor.d.ts b/node_modules/sucrase/dist/types/TokenProcessor.d.ts new file mode 100644 index 0000000..9492aed --- /dev/null +++ b/node_modules/sucrase/dist/types/TokenProcessor.d.ts @@ -0,0 +1,87 @@ +import type { HelperManager } from "./HelperManager"; +import type { Token } from "./parser/tokenizer"; +import type { ContextualKeyword } from "./parser/tokenizer/keywords"; +import { type TokenType } from "./parser/tokenizer/types"; +export interface TokenProcessorSnapshot { + resultCode: string; + tokenIndex: number; +} +export interface TokenProcessorResult { + code: string; + mappings: Array; +} +export default class TokenProcessor { + readonly code: string; + readonly tokens: Array; + readonly isFlowEnabled: boolean; + readonly disableESTransforms: boolean; + readonly helperManager: HelperManager; + private resultCode; + private resultMappings; + private tokenIndex; + constructor(code: string, tokens: Array, isFlowEnabled: boolean, disableESTransforms: boolean, helperManager: HelperManager); + /** + * Snapshot the token state in a way that can be restored later, useful for + * things like lookahead. + * + * resultMappings do not need to be copied since in all use cases, they will + * be overwritten anyway after restore. + */ + snapshot(): TokenProcessorSnapshot; + restoreToSnapshot(snapshot: TokenProcessorSnapshot): void; + /** + * Remove and return the code generated since the snapshot, leaving the + * current token position in-place. Unlike most TokenProcessor operations, + * this operation can result in input/output line number mismatches because + * the removed code may contain newlines, so this operation should be used + * sparingly. + */ + dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot: TokenProcessorSnapshot): string; + reset(): void; + matchesContextualAtIndex(index: number, contextualKeyword: ContextualKeyword): boolean; + identifierNameAtIndex(index: number): string; + identifierNameAtRelativeIndex(relativeIndex: number): string; + identifierName(): string; + identifierNameForToken(token: Token): string; + rawCodeForToken(token: Token): string; + stringValueAtIndex(index: number): string; + stringValue(): string; + stringValueForToken(token: Token): string; + matches1AtIndex(index: number, t1: TokenType): boolean; + matches2AtIndex(index: number, t1: TokenType, t2: TokenType): boolean; + matches3AtIndex(index: number, t1: TokenType, t2: TokenType, t3: TokenType): boolean; + matches1(t1: TokenType): boolean; + matches2(t1: TokenType, t2: TokenType): boolean; + matches3(t1: TokenType, t2: TokenType, t3: TokenType): boolean; + matches4(t1: TokenType, t2: TokenType, t3: TokenType, t4: TokenType): boolean; + matches5(t1: TokenType, t2: TokenType, t3: TokenType, t4: TokenType, t5: TokenType): boolean; + matchesContextual(contextualKeyword: ContextualKeyword): boolean; + matchesContextIdAndLabel(type: TokenType, contextId: number): boolean; + previousWhitespaceAndComments(): string; + replaceToken(newCode: string): void; + replaceTokenTrimmingLeftWhitespace(newCode: string): void; + removeInitialToken(): void; + removeToken(): void; + /** + * Remove all code until the next }, accounting for balanced braces. + */ + removeBalancedCode(): void; + copyExpectedToken(tokenType: TokenType): void; + copyToken(): void; + copyTokenWithPrefix(prefix: string): void; + private appendTokenPrefix; + private appendTokenSuffix; + appendCode(code: string): void; + currentToken(): Token; + currentTokenCode(): string; + tokenAtRelativeIndex(relativeIndex: number): Token; + currentIndex(): number; + /** + * Move to the next token. Only suitable in preprocessing steps. When + * generating new code, you should use copyToken or removeToken. + */ + nextToken(): void; + previousToken(): void; + finish(): TokenProcessorResult; + isAtEnd(): boolean; +} diff --git a/node_modules/sucrase/dist/types/cli.d.ts b/node_modules/sucrase/dist/types/cli.d.ts new file mode 100644 index 0000000..238c75f --- /dev/null +++ b/node_modules/sucrase/dist/types/cli.d.ts @@ -0,0 +1 @@ +export default function run(): void; diff --git a/node_modules/sucrase/dist/types/computeSourceMap.d.ts b/node_modules/sucrase/dist/types/computeSourceMap.d.ts new file mode 100644 index 0000000..1277847 --- /dev/null +++ b/node_modules/sucrase/dist/types/computeSourceMap.d.ts @@ -0,0 +1,17 @@ +import type { SourceMapOptions } from "./index"; +import type { Token } from "./parser/tokenizer"; +import type { RootTransformerResult } from "./transformers/RootTransformer"; +export interface RawSourceMap { + version: number; + file: string; + sources: Array; + sourceRoot?: string; + sourcesContent?: Array; + mappings: string; + names: Array; +} +/** + * Generate a source map indicating that each line maps directly to the original line, + * with the tokens in their new positions. + */ +export default function computeSourceMap({ code: generatedCode, mappings: rawMappings }: RootTransformerResult, filePath: string, options: SourceMapOptions, source: string, tokens: Array): RawSourceMap; diff --git a/node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts b/node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts new file mode 100644 index 0000000..a9222d8 --- /dev/null +++ b/node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts @@ -0,0 +1,12 @@ +import type { Scope } from "./parser/tokenizer/state"; +import type TokenProcessor from "./TokenProcessor"; +/** + * Traverse the given tokens and modify them if necessary to indicate that some names shadow global + * variables. + */ +export default function identifyShadowedGlobals(tokens: TokenProcessor, scopes: Array, globalNames: Set): void; +/** + * We can do a fast up-front check to see if there are any declarations to global names. If not, + * then there's no point in computing scope assignments. + */ +export declare function hasShadowedGlobals(tokens: TokenProcessor, globalNames: Set): boolean; diff --git a/node_modules/sucrase/dist/types/index.d.ts b/node_modules/sucrase/dist/types/index.d.ts new file mode 100644 index 0000000..bfc4a9c --- /dev/null +++ b/node_modules/sucrase/dist/types/index.d.ts @@ -0,0 +1,26 @@ +import CJSImportProcessor from "./CJSImportProcessor"; +import { type RawSourceMap } from "./computeSourceMap"; +import { HelperManager } from "./HelperManager"; +import NameManager from "./NameManager"; +import type { Options, SourceMapOptions, Transform } from "./Options"; +import type { Scope } from "./parser/tokenizer/state"; +import TokenProcessor from "./TokenProcessor"; +export interface TransformResult { + code: string; + sourceMap?: RawSourceMap; +} +export interface SucraseContext { + tokenProcessor: TokenProcessor; + scopes: Array; + nameManager: NameManager; + importProcessor: CJSImportProcessor | null; + helperManager: HelperManager; +} +export type { Options, SourceMapOptions, Transform }; +export declare function getVersion(): string; +export declare function transform(code: string, options: Options): TransformResult; +/** + * Return a string representation of the sucrase tokens, mostly useful for + * diagnostic purposes. + */ +export declare function getFormattedTokens(code: string, options: Options): string; diff --git a/node_modules/sucrase/dist/types/parser/index.d.ts b/node_modules/sucrase/dist/types/parser/index.d.ts new file mode 100644 index 0000000..8d082c0 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/index.d.ts @@ -0,0 +1,8 @@ +import type { Token } from "./tokenizer/index"; +import type { Scope } from "./tokenizer/state"; +export declare class File { + tokens: Array; + scopes: Array; + constructor(tokens: Array, scopes: Array); +} +export declare function parse(input: string, isJSXEnabled: boolean, isTypeScriptEnabled: boolean, isFlowEnabled: boolean): File; diff --git a/node_modules/sucrase/dist/types/parser/plugins/flow.d.ts b/node_modules/sucrase/dist/types/parser/plugins/flow.d.ts new file mode 100644 index 0000000..fe83776 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/plugins/flow.d.ts @@ -0,0 +1,27 @@ +import { ContextualKeyword } from "../tokenizer/keywords"; +import { type StopState } from "../traverser/expression"; +export declare function flowParseTypeParameterDeclaration(): void; +export declare function flowParseTypeAnnotation(): void; +export declare function flowParseVariance(): void; +export declare function flowParseFunctionBodyAndFinish(funcContextId: number): void; +export declare function flowParseSubscript(startTokenIndex: number, noCalls: boolean, stopState: StopState): void; +export declare function flowStartParseNewArguments(): void; +export declare function flowTryParseStatement(): boolean; +export declare function flowTryParseExportDefaultExpression(): boolean; +export declare function flowParseIdentifierStatement(contextualKeyword: ContextualKeyword): void; +export declare function flowShouldParseExportDeclaration(): boolean; +export declare function flowShouldDisallowExportDefaultSpecifier(): boolean; +export declare function flowParseExportDeclaration(): void; +export declare function flowShouldParseExportStar(): boolean; +export declare function flowParseExportStar(): void; +export declare function flowAfterParseClassSuper(hasSuper: boolean): void; +export declare function flowStartParseObjPropValue(): void; +export declare function flowParseAssignableListItemTypes(): void; +export declare function flowStartParseImportSpecifiers(): void; +export declare function flowParseImportSpecifier(): void; +export declare function flowStartParseFunctionParams(): void; +export declare function flowAfterParseVarHead(): void; +export declare function flowStartParseAsyncArrowFromCallExpression(): void; +export declare function flowParseMaybeAssign(noIn: boolean, isWithinParens: boolean): boolean; +export declare function flowParseArrow(): boolean; +export declare function flowParseSubscripts(startTokenIndex: number, noCalls?: boolean): void; diff --git a/node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts b/node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts new file mode 100644 index 0000000..2600d0f --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts @@ -0,0 +1,2 @@ +export declare function jsxParseElement(): void; +export declare function nextJSXTagToken(): void; diff --git a/node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts b/node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts new file mode 100644 index 0000000..1190776 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts @@ -0,0 +1,2 @@ +declare const _default: Map; +export default _default; diff --git a/node_modules/sucrase/dist/types/parser/plugins/types.d.ts b/node_modules/sucrase/dist/types/parser/plugins/types.d.ts new file mode 100644 index 0000000..fce6440 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/plugins/types.d.ts @@ -0,0 +1,5 @@ +/** + * Common parser code for TypeScript and Flow. + */ +export declare function typedParseConditional(noIn: boolean): void; +export declare function typedParseParenItem(): void; diff --git a/node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts b/node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts new file mode 100644 index 0000000..adf9a13 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts @@ -0,0 +1,49 @@ +import { ContextualKeyword } from "../tokenizer/keywords"; +import { type StopState } from "../traverser/expression"; +export declare function tsParseModifiers(allowedModifiers: Array): void; +/** Parses a modifier matching one the given modifier names. */ +export declare function tsParseModifier(allowedModifiers: Array): ContextualKeyword | null; +export declare function tsTryParseTypeParameters(): void; +export declare function tsTryParseTypeAnnotation(): void; +export declare function tsParseTypeAnnotation(): void; +export declare function tsParseType(): void; +export declare function tsParseNonConditionalType(): void; +export declare function tsParseTypeAssertion(): void; +export declare function tsTryParseJSXTypeArgument(): void; +export declare function tsParseImportEqualsDeclaration(): void; +export declare function tsIsDeclarationStart(): boolean; +export declare function tsParseFunctionBodyAndFinish(functionStart: number, funcContextId: number): void; +export declare function tsParseSubscript(startTokenIndex: number, noCalls: boolean, stopState: StopState): void; +export declare function tsTryParseExport(): boolean; +/** + * Parse a TS import specifier, which may be prefixed with "type" and may be of + * the form `foo as bar`. + * + * The number of identifier-like tokens we see happens to be enough to uniquely + * identify the form, so simply count the number of identifiers rather than + * matching the words `type` or `as`. This is particularly important because + * `type` and `as` could each actually be plain identifiers rather than + * keywords. + */ +export declare function tsParseImportSpecifier(): void; +/** + * Just like named import specifiers, export specifiers can have from 1 to 4 + * tokens, inclusive, and the number of tokens determines the role of each token. + */ +export declare function tsParseExportSpecifier(): void; +export declare function tsTryParseExportDefaultExpression(): boolean; +export declare function tsTryParseStatementContent(): boolean; +export declare function tsTryParseClassMemberWithIsStatic(isStatic: boolean): boolean; +export declare function tsParseIdentifierStatement(contextualKeyword: ContextualKeyword): void; +export declare function tsParseExportDeclaration(): void; +export declare function tsAfterParseClassSuper(hasSuper: boolean): void; +export declare function tsStartParseObjPropValue(): void; +export declare function tsStartParseFunctionParams(): void; +export declare function tsAfterParseVarHead(): void; +export declare function tsStartParseAsyncArrowFromCallExpression(): void; +export declare function tsParseMaybeAssign(noIn: boolean, isWithinParens: boolean): boolean; +export declare function tsParseMaybeAssignWithJSX(noIn: boolean, isWithinParens: boolean): boolean; +export declare function tsParseMaybeAssignWithoutJSX(noIn: boolean, isWithinParens: boolean): boolean; +export declare function tsParseArrow(): boolean; +export declare function tsParseAssignableListItemTypes(): void; +export declare function tsParseMaybeDecoratorArguments(): void; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts new file mode 100644 index 0000000..45cd799 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts @@ -0,0 +1,93 @@ +import { ContextualKeyword } from "./keywords"; +import { type TokenType } from "./types"; +export declare enum IdentifierRole { + Access = 0, + ExportAccess = 1, + TopLevelDeclaration = 2, + FunctionScopedDeclaration = 3, + BlockScopedDeclaration = 4, + ObjectShorthandTopLevelDeclaration = 5, + ObjectShorthandFunctionScopedDeclaration = 6, + ObjectShorthandBlockScopedDeclaration = 7, + ObjectShorthand = 8, + ImportDeclaration = 9, + ObjectKey = 10, + ImportAccess = 11 +} +/** + * Extra information on jsxTagStart tokens, used to determine which of the three + * jsx functions are called in the automatic transform. + */ +export declare enum JSXRole { + NoChildren = 0, + OneChild = 1, + StaticChildren = 2, + KeyAfterPropSpread = 3 +} +export declare function isDeclaration(token: Token): boolean; +export declare function isNonTopLevelDeclaration(token: Token): boolean; +export declare function isTopLevelDeclaration(token: Token): boolean; +export declare function isBlockScopedDeclaration(token: Token): boolean; +export declare function isFunctionScopedDeclaration(token: Token): boolean; +export declare function isObjectShorthandDeclaration(token: Token): boolean; +export declare class Token { + constructor(); + type: TokenType; + contextualKeyword: ContextualKeyword; + start: number; + end: number; + scopeDepth: number; + isType: boolean; + identifierRole: IdentifierRole | null; + jsxRole: JSXRole | null; + shadowsGlobal: boolean; + isAsyncOperation: boolean; + contextId: number | null; + rhsEndIndex: number | null; + isExpression: boolean; + numNullishCoalesceStarts: number; + numNullishCoalesceEnds: number; + isOptionalChainStart: boolean; + isOptionalChainEnd: boolean; + subscriptStartIndex: number | null; + nullishStartIndex: number | null; +} +export declare function next(): void; +export declare function nextTemplateToken(): void; +export declare function retokenizeSlashAsRegex(): void; +export declare function pushTypeContext(existingTokensInType: number): boolean; +export declare function popTypeContext(oldIsType: boolean): void; +export declare function eat(type: TokenType): boolean; +export declare function eatTypeToken(tokenType: TokenType): void; +export declare function match(type: TokenType): boolean; +export declare function lookaheadType(): TokenType; +export declare class TypeAndKeyword { + type: TokenType; + contextualKeyword: ContextualKeyword; + constructor(type: TokenType, contextualKeyword: ContextualKeyword); +} +export declare function lookaheadTypeAndKeyword(): TypeAndKeyword; +export declare function nextTokenStart(): number; +export declare function nextTokenStartSince(pos: number): number; +export declare function lookaheadCharCode(): number; +export declare function nextToken(): void; +export declare function skipLineComment(startSkip: number): void; +export declare function skipSpace(): void; +export declare function finishToken(type: TokenType, contextualKeyword?: ContextualKeyword): void; +/** + * Reinterpret a possible > token when transitioning from a type to a non-type + * context. + * + * This comes up in two situations where >= needs to be treated as one token: + * - After an `as` expression, like in the code `a as T >= 1`. + * - In a type argument in an expression context, e.g. `f(a < b, c >= d)`, we + * need to see the token as >= so that we get an error and backtrack to + * normal expression parsing. + * + * Other situations require >= to be seen as two tokens, e.g. + * `const x: Array=[];`, so it's important to treat > as its own token in + * typical type parsing situations. + */ +export declare function rescan_gt(): void; +export declare function getTokenFromCode(code: number): void; +export declare function skipWord(): void; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts new file mode 100644 index 0000000..e0e7cd0 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts @@ -0,0 +1,43 @@ +export declare enum ContextualKeyword { + NONE = 0, + _abstract = 1, + _accessor = 2, + _as = 3, + _assert = 4, + _asserts = 5, + _async = 6, + _await = 7, + _checks = 8, + _constructor = 9, + _declare = 10, + _enum = 11, + _exports = 12, + _from = 13, + _get = 14, + _global = 15, + _implements = 16, + _infer = 17, + _interface = 18, + _is = 19, + _keyof = 20, + _mixins = 21, + _module = 22, + _namespace = 23, + _of = 24, + _opaque = 25, + _out = 26, + _override = 27, + _private = 28, + _protected = 29, + _proto = 30, + _public = 31, + _readonly = 32, + _require = 33, + _satisfies = 34, + _set = 35, + _static = 36, + _symbol = 37, + _type = 38, + _unique = 39, + _using = 40 +} diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts new file mode 100644 index 0000000..6fdfe90 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts @@ -0,0 +1,7 @@ +/** + * Read an identifier, producing either a name token or matching on one of the existing keywords. + * For performance, we pre-generate big decision tree that we traverse. Each node represents a + * prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if + * not), and the other 26 values are the transitions to other nodes, or -1 to stop. + */ +export default function readWord(): void; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts new file mode 100644 index 0000000..f6fb9b2 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts @@ -0,0 +1 @@ +export declare const READ_WORD_TREE: Int32Array; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts new file mode 100644 index 0000000..e010c18 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts @@ -0,0 +1,50 @@ +import type { Token } from "./index"; +import { ContextualKeyword } from "./keywords"; +import { type TokenType } from "./types"; +export declare class Scope { + startTokenIndex: number; + endTokenIndex: number; + isFunctionScope: boolean; + constructor(startTokenIndex: number, endTokenIndex: number, isFunctionScope: boolean); +} +export declare class StateSnapshot { + readonly potentialArrowAt: number; + readonly noAnonFunctionType: boolean; + readonly inDisallowConditionalTypesContext: boolean; + readonly tokensLength: number; + readonly scopesLength: number; + readonly pos: number; + readonly type: TokenType; + readonly contextualKeyword: ContextualKeyword; + readonly start: number; + readonly end: number; + readonly isType: boolean; + readonly scopeDepth: number; + readonly error: Error | null; + constructor(potentialArrowAt: number, noAnonFunctionType: boolean, inDisallowConditionalTypesContext: boolean, tokensLength: number, scopesLength: number, pos: number, type: TokenType, contextualKeyword: ContextualKeyword, start: number, end: number, isType: boolean, scopeDepth: number, error: Error | null); +} +export default class State { + potentialArrowAt: number; + noAnonFunctionType: boolean; + inDisallowConditionalTypesContext: boolean; + tokens: Array; + scopes: Array; + pos: number; + type: TokenType; + contextualKeyword: ContextualKeyword; + start: number; + end: number; + isType: boolean; + scopeDepth: number; + /** + * If the parser is in an error state, then the token is always tt.eof and all functions can + * keep executing but should be written so they don't get into an infinite loop in this situation. + * + * This approach, combined with the ability to snapshot and restore state, allows us to implement + * backtracking without exceptions and without needing to explicitly propagate error states + * everywhere. + */ + error: Error | null; + snapshot(): StateSnapshot; + restoreFromSnapshot(snapshot: StateSnapshot): void; +} diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts new file mode 100644 index 0000000..d778d5d --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts @@ -0,0 +1,126 @@ +/** + * Enum of all token types, with bit fields to signify meaningful properties. + */ +export declare enum TokenType { + PRECEDENCE_MASK = 15, + IS_KEYWORD = 16, + IS_ASSIGN = 32, + IS_RIGHT_ASSOCIATIVE = 64, + IS_PREFIX = 128, + IS_POSTFIX = 256, + IS_EXPRESSION_START = 512, + num = 512, + bigint = 1536, + decimal = 2560, + regexp = 3584, + string = 4608, + name = 5632, + eof = 6144, + bracketL = 7680, + bracketR = 8192, + braceL = 9728, + braceBarL = 10752, + braceR = 11264, + braceBarR = 12288, + parenL = 13824, + parenR = 14336, + comma = 15360, + semi = 16384, + colon = 17408, + doubleColon = 18432, + dot = 19456, + question = 20480, + questionDot = 21504, + arrow = 22528, + template = 23552, + ellipsis = 24576, + backQuote = 25600, + dollarBraceL = 27136, + at = 27648, + hash = 29184, + eq = 29728, + assign = 30752, + preIncDec = 32640, + postIncDec = 33664, + bang = 34432, + tilde = 35456, + pipeline = 35841, + nullishCoalescing = 36866, + logicalOR = 37890, + logicalAND = 38915, + bitwiseOR = 39940, + bitwiseXOR = 40965, + bitwiseAND = 41990, + equality = 43015, + lessThan = 44040, + greaterThan = 45064, + relationalOrEqual = 46088, + bitShiftL = 47113, + bitShiftR = 48137, + plus = 49802, + minus = 50826, + modulo = 51723, + star = 52235, + slash = 53259, + exponent = 54348, + jsxName = 55296, + jsxText = 56320, + jsxEmptyText = 57344, + jsxTagStart = 58880, + jsxTagEnd = 59392, + typeParameterStart = 60928, + nonNullAssertion = 61440, + _break = 62480, + _case = 63504, + _catch = 64528, + _continue = 65552, + _debugger = 66576, + _default = 67600, + _do = 68624, + _else = 69648, + _finally = 70672, + _for = 71696, + _function = 73232, + _if = 73744, + _return = 74768, + _switch = 75792, + _throw = 77456, + _try = 77840, + _var = 78864, + _let = 79888, + _const = 80912, + _while = 81936, + _with = 82960, + _new = 84496, + _this = 85520, + _super = 86544, + _class = 87568, + _extends = 88080, + _export = 89104, + _import = 90640, + _yield = 91664, + _null = 92688, + _true = 93712, + _false = 94736, + _in = 95256, + _instanceof = 96280, + _typeof = 97936, + _void = 98960, + _delete = 99984, + _async = 100880, + _get = 101904, + _set = 102928, + _declare = 103952, + _readonly = 104976, + _abstract = 106000, + _static = 107024, + _public = 107536, + _private = 108560, + _protected = 109584, + _override = 110608, + _as = 112144, + _enum = 113168, + _type = 114192, + _implements = 115216 +} +export declare function formatTokenType(tokenType: TokenType): string; diff --git a/node_modules/sucrase/dist/types/parser/traverser/base.d.ts b/node_modules/sucrase/dist/types/parser/traverser/base.d.ts new file mode 100644 index 0000000..e15e892 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/traverser/base.d.ts @@ -0,0 +1,16 @@ +import State from "../tokenizer/state"; +export declare let isJSXEnabled: boolean; +export declare let isTypeScriptEnabled: boolean; +export declare let isFlowEnabled: boolean; +export declare let state: State; +export declare let input: string; +export declare let nextContextId: number; +export declare function getNextContextId(): number; +export declare function augmentError(error: any): any; +export declare class Loc { + line: number; + column: number; + constructor(line: number, column: number); +} +export declare function locationForIndex(pos: number): Loc; +export declare function initParser(inputCode: string, isJSXEnabledArg: boolean, isTypeScriptEnabledArg: boolean, isFlowEnabledArg: boolean): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/expression.d.ts b/node_modules/sucrase/dist/types/parser/traverser/expression.d.ts new file mode 100644 index 0000000..52e29fb --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/traverser/expression.d.ts @@ -0,0 +1,34 @@ +export declare class StopState { + stop: boolean; + constructor(stop: boolean); +} +export declare function parseExpression(noIn?: boolean): void; +/** + * noIn is used when parsing a for loop so that we don't interpret a following "in" as the binary + * operatior. + * isWithinParens is used to indicate that we're parsing something that might be a comma expression + * or might be an arrow function or might be a Flow type assertion (which requires explicit parens). + * In these cases, we should allow : and ?: after the initial "left" part. + */ +export declare function parseMaybeAssign(noIn?: boolean, isWithinParens?: boolean): boolean; +export declare function baseParseMaybeAssign(noIn: boolean, isWithinParens: boolean): boolean; +export declare function baseParseConditional(noIn: boolean): void; +export declare function parseMaybeUnary(): boolean; +export declare function parseExprSubscripts(): boolean; +export declare function baseParseSubscripts(startTokenIndex: number, noCalls?: boolean): void; +/** Set 'state.stop = true' to indicate that we should stop parsing subscripts. */ +export declare function baseParseSubscript(startTokenIndex: number, noCalls: boolean, stopState: StopState): void; +export declare function atPossibleAsync(): boolean; +export declare function parseCallExpressionArguments(): void; +export declare function parseExprAtom(): boolean; +export declare function parseLiteral(): void; +export declare function parseParenExpression(): void; +export declare function parseArrow(): boolean; +export declare function parseTemplate(): void; +export declare function parseObj(isPattern: boolean, isBlockScope: boolean): void; +export declare function parsePropertyName(objectContextId: number): void; +export declare function parseMethod(functionStart: number, isConstructor: boolean): void; +export declare function parseArrowExpression(startTokenIndex: number): void; +export declare function parseFunctionBodyAndFinish(functionStart: number, funcContextId?: number): void; +export declare function parseFunctionBody(allowExpression: boolean, funcContextId?: number): void; +export declare function parseIdentifier(): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/index.d.ts b/node_modules/sucrase/dist/types/parser/traverser/index.d.ts new file mode 100644 index 0000000..9f9127d --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/traverser/index.d.ts @@ -0,0 +1,2 @@ +import type { File } from "../index"; +export declare function parseFile(): File; diff --git a/node_modules/sucrase/dist/types/parser/traverser/lval.d.ts b/node_modules/sucrase/dist/types/parser/traverser/lval.d.ts new file mode 100644 index 0000000..eb17756 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/traverser/lval.d.ts @@ -0,0 +1,9 @@ +import { TokenType } from "../tokenizer/types"; +export declare function parseSpread(): void; +export declare function parseRest(isBlockScope: boolean): void; +export declare function parseBindingIdentifier(isBlockScope: boolean): void; +export declare function parseImportedIdentifier(): void; +export declare function markPriorBindingIdentifier(isBlockScope: boolean): void; +export declare function parseBindingAtom(isBlockScope: boolean): void; +export declare function parseBindingList(close: TokenType, isBlockScope: boolean, allowEmpty?: boolean, allowModifiers?: boolean, contextId?: number): void; +export declare function parseMaybeDefault(isBlockScope: boolean, leftAlreadyParsed?: boolean): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/statement.d.ts b/node_modules/sucrase/dist/types/parser/traverser/statement.d.ts new file mode 100644 index 0000000..508b20a --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/traverser/statement.d.ts @@ -0,0 +1,20 @@ +import { File } from "../index"; +import { type TokenType } from "../tokenizer/types"; +export declare function parseTopLevel(): File; +export declare function parseStatement(declaration: boolean): void; +export declare function parseDecorators(): void; +export declare function baseParseMaybeDecoratorArguments(): void; +export declare function parseVarStatement(isBlockScope: boolean): void; +export declare function parseBlock(isFunctionScope?: boolean, contextId?: number): void; +export declare function parseBlockBody(end: TokenType): void; +export declare function parseFunction(functionStart: number, isStatement: boolean, optionalId?: boolean): void; +export declare function parseFunctionParams(allowModifiers?: boolean, funcContextId?: number): void; +export declare function parseClass(isStatement: boolean, optionalId?: boolean): void; +export declare function parseClassPropertyName(classContextId: number): void; +export declare function parsePostMemberNameModifiers(): void; +export declare function parseClassProperty(): void; +export declare function parseExport(): void; +export declare function parseExportFrom(): void; +export declare function baseParseExportStar(): void; +export declare function parseExportSpecifiers(): void; +export declare function parseImport(): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/util.d.ts b/node_modules/sucrase/dist/types/parser/traverser/util.d.ts new file mode 100644 index 0000000..6ec2a55 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/traverser/util.d.ts @@ -0,0 +1,17 @@ +import type { ContextualKeyword } from "../tokenizer/keywords"; +import { type TokenType } from "../tokenizer/types"; +export declare function isContextual(contextualKeyword: ContextualKeyword): boolean; +export declare function isLookaheadContextual(contextualKeyword: ContextualKeyword): boolean; +export declare function eatContextual(contextualKeyword: ContextualKeyword): boolean; +export declare function expectContextual(contextualKeyword: ContextualKeyword): void; +export declare function canInsertSemicolon(): boolean; +export declare function hasPrecedingLineBreak(): boolean; +export declare function hasFollowingLineBreak(): boolean; +export declare function isLineTerminator(): boolean; +export declare function semicolon(): void; +export declare function expect(type: TokenType): void; +/** + * Transition the parser to an error state. All code needs to be written to naturally unwind in this + * state, which allows us to backtrack without exceptions and without error plumbing everywhere. + */ +export declare function unexpected(message?: string, pos?: number): void; diff --git a/node_modules/sucrase/dist/types/parser/util/charcodes.d.ts b/node_modules/sucrase/dist/types/parser/util/charcodes.d.ts new file mode 100644 index 0000000..19bba1f --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/util/charcodes.d.ts @@ -0,0 +1,107 @@ +export declare enum charCodes { + backSpace = 8, + lineFeed = 10, + tab = 9, + carriageReturn = 13, + shiftOut = 14, + space = 32, + exclamationMark = 33, + quotationMark = 34, + numberSign = 35, + dollarSign = 36, + percentSign = 37, + ampersand = 38, + apostrophe = 39, + leftParenthesis = 40, + rightParenthesis = 41, + asterisk = 42, + plusSign = 43, + comma = 44, + dash = 45, + dot = 46, + slash = 47, + digit0 = 48, + digit1 = 49, + digit2 = 50, + digit3 = 51, + digit4 = 52, + digit5 = 53, + digit6 = 54, + digit7 = 55, + digit8 = 56, + digit9 = 57, + colon = 58, + semicolon = 59, + lessThan = 60, + equalsTo = 61, + greaterThan = 62, + questionMark = 63, + atSign = 64, + uppercaseA = 65, + uppercaseB = 66, + uppercaseC = 67, + uppercaseD = 68, + uppercaseE = 69, + uppercaseF = 70, + uppercaseG = 71, + uppercaseH = 72, + uppercaseI = 73, + uppercaseJ = 74, + uppercaseK = 75, + uppercaseL = 76, + uppercaseM = 77, + uppercaseN = 78, + uppercaseO = 79, + uppercaseP = 80, + uppercaseQ = 81, + uppercaseR = 82, + uppercaseS = 83, + uppercaseT = 84, + uppercaseU = 85, + uppercaseV = 86, + uppercaseW = 87, + uppercaseX = 88, + uppercaseY = 89, + uppercaseZ = 90, + leftSquareBracket = 91, + backslash = 92, + rightSquareBracket = 93, + caret = 94, + underscore = 95, + graveAccent = 96, + lowercaseA = 97, + lowercaseB = 98, + lowercaseC = 99, + lowercaseD = 100, + lowercaseE = 101, + lowercaseF = 102, + lowercaseG = 103, + lowercaseH = 104, + lowercaseI = 105, + lowercaseJ = 106, + lowercaseK = 107, + lowercaseL = 108, + lowercaseM = 109, + lowercaseN = 110, + lowercaseO = 111, + lowercaseP = 112, + lowercaseQ = 113, + lowercaseR = 114, + lowercaseS = 115, + lowercaseT = 116, + lowercaseU = 117, + lowercaseV = 118, + lowercaseW = 119, + lowercaseX = 120, + lowercaseY = 121, + lowercaseZ = 122, + leftCurlyBrace = 123, + verticalBar = 124, + rightCurlyBrace = 125, + tilde = 126, + nonBreakingSpace = 160, + oghamSpaceMark = 5760, + lineSeparator = 8232, + paragraphSeparator = 8233 +} +export declare function isDigit(code: number): boolean; diff --git a/node_modules/sucrase/dist/types/parser/util/identifier.d.ts b/node_modules/sucrase/dist/types/parser/util/identifier.d.ts new file mode 100644 index 0000000..5c2eaeb --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/util/identifier.d.ts @@ -0,0 +1,2 @@ +export declare const IS_IDENTIFIER_CHAR: Uint8Array; +export declare const IS_IDENTIFIER_START: Uint8Array; diff --git a/node_modules/sucrase/dist/types/parser/util/whitespace.d.ts b/node_modules/sucrase/dist/types/parser/util/whitespace.d.ts new file mode 100644 index 0000000..dca5425 --- /dev/null +++ b/node_modules/sucrase/dist/types/parser/util/whitespace.d.ts @@ -0,0 +1,3 @@ +export declare const WHITESPACE_CHARS: Array; +export declare const skipWhiteSpace: RegExp; +export declare const IS_WHITESPACE: Uint8Array; diff --git a/node_modules/sucrase/dist/types/register.d.ts b/node_modules/sucrase/dist/types/register.d.ts new file mode 100644 index 0000000..8a7ebd5 --- /dev/null +++ b/node_modules/sucrase/dist/types/register.d.ts @@ -0,0 +1,14 @@ +import { type Options } from "./index"; +export interface HookOptions { + matcher?: (code: string) => boolean; + ignoreNodeModules?: boolean; +} +export type RevertFunction = () => void; +export declare function addHook(extension: string, sucraseOptions: Options, hookOptions?: HookOptions): RevertFunction; +export declare function registerJS(hookOptions?: HookOptions): RevertFunction; +export declare function registerJSX(hookOptions?: HookOptions): RevertFunction; +export declare function registerTS(hookOptions?: HookOptions): RevertFunction; +export declare function registerTSX(hookOptions?: HookOptions): RevertFunction; +export declare function registerTSLegacyModuleInterop(hookOptions?: HookOptions): RevertFunction; +export declare function registerTSXLegacyModuleInterop(hookOptions?: HookOptions): RevertFunction; +export declare function registerAll(hookOptions?: HookOptions): RevertFunction; diff --git a/node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts new file mode 100644 index 0000000..6a65621 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts @@ -0,0 +1,149 @@ +import type CJSImportProcessor from "../CJSImportProcessor"; +import type { HelperManager } from "../HelperManager"; +import type NameManager from "../NameManager"; +import type TokenProcessor from "../TokenProcessor"; +import type ReactHotLoaderTransformer from "./ReactHotLoaderTransformer"; +import type RootTransformer from "./RootTransformer"; +import Transformer from "./Transformer"; +/** + * Class for editing import statements when we are transforming to commonjs. + */ +export default class CJSImportTransformer extends Transformer { + readonly rootTransformer: RootTransformer; + readonly tokens: TokenProcessor; + readonly importProcessor: CJSImportProcessor; + readonly nameManager: NameManager; + readonly helperManager: HelperManager; + readonly reactHotLoaderTransformer: ReactHotLoaderTransformer | null; + readonly enableLegacyBabel5ModuleInterop: boolean; + readonly enableLegacyTypeScriptModuleInterop: boolean; + readonly isTypeScriptTransformEnabled: boolean; + readonly isFlowTransformEnabled: boolean; + readonly preserveDynamicImport: boolean; + readonly keepUnusedImports: boolean; + private hadExport; + private hadNamedExport; + private hadDefaultExport; + private declarationInfo; + constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor, nameManager: NameManager, helperManager: HelperManager, reactHotLoaderTransformer: ReactHotLoaderTransformer | null, enableLegacyBabel5ModuleInterop: boolean, enableLegacyTypeScriptModuleInterop: boolean, isTypeScriptTransformEnabled: boolean, isFlowTransformEnabled: boolean, preserveDynamicImport: boolean, keepUnusedImports: boolean); + getPrefixCode(): string; + getSuffixCode(): string; + process(): boolean; + private processImportEquals; + /** + * Transform this: + * import foo, {bar} from 'baz'; + * into + * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); + * + * The import code was already generated in the import preprocessing step, so + * we just need to look it up. + */ + private processImport; + /** + * Erase this import (since any CJS output would be completely different), and + * return true if this import is should be elided due to being a type-only + * import. Such imports will not be emitted at all to avoid side effects. + * + * Import elision only happens with the TypeScript or Flow transforms enabled. + * + * TODO: This function has some awkward overlap with + * CJSImportProcessor.pruneTypeOnlyImports , and the two should be unified. + * That function handles TypeScript implicit import name elision, and removes + * an import if all typical imported names (without `type`) are removed due + * to being type-only imports. This function handles Flow import removal and + * properly distinguishes `import 'foo'` from `import {} from 'foo'` for TS + * purposes. + * + * The position should end at the import string. + */ + private removeImportAndDetectIfShouldElide; + private removeRemainingImport; + private processIdentifier; + processObjectShorthand(): boolean; + processExport(): boolean; + private processAssignment; + /** + * Process something like `a += 3`, where `a` might be an exported value. + */ + private processComplexAssignment; + /** + * Process something like `++a`, where `a` might be an exported value. + */ + private processPreIncDec; + /** + * Process something like `a++`, where `a` might be an exported value. + * This starts at the `a`, not at the `++`. + */ + private processPostIncDec; + private processExportDefault; + private copyDecorators; + /** + * Transform a declaration like `export var`, `export let`, or `export const`. + */ + private processExportVar; + /** + * Determine if the export is of the form: + * export var/let/const [varName] = [expr]; + * In other words, determine if function name inference might apply. + */ + private isSimpleExportVar; + /** + * Transform an `export var` declaration initializing a single variable. + * + * For example, this: + * export const f = () => {}; + * becomes this: + * const f = () => {}; exports.f = f; + * + * The variable is unused (e.g. exports.f has the true value of the export). + * We need to produce an assignment of this form so that the function will + * have an inferred name of "f", which wouldn't happen in the more general + * case below. + */ + private processSimpleExportVar; + /** + * Transform normal declaration exports, including handling destructuring. + * For example, this: + * export const {x: [a = 2, b], c} = d; + * becomes this: + * ({x: [exports.a = 2, exports.b], c: exports.c} = d;) + */ + private processComplexExportVar; + /** + * Transform this: + * export function foo() {} + * into this: + * function foo() {} exports.foo = foo; + */ + private processExportFunction; + /** + * Skip past a function with a name and return that name. + */ + private processNamedFunction; + /** + * Transform this: + * export class A {} + * into this: + * class A {} exports.A = A; + */ + private processExportClass; + /** + * Transform this: + * export {a, b as c}; + * into this: + * exports.a = a; exports.c = b; + * + * OR + * + * Transform this: + * export {a, b as c} from './foo'; + * into the pre-generated Object.defineProperty code from the ImportProcessor. + * + * For the first case, if the TypeScript transform is enabled, we need to skip + * exports that are only defined as types. + */ + private processExportBindings; + private processExportStar; + private shouldElideExportedIdentifier; +} diff --git a/node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts new file mode 100644 index 0000000..5caf082 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts @@ -0,0 +1,52 @@ +import type { HelperManager } from "../HelperManager"; +import type { Options } from "../index"; +import type NameManager from "../NameManager"; +import type TokenProcessor from "../TokenProcessor"; +import type ReactHotLoaderTransformer from "./ReactHotLoaderTransformer"; +import Transformer from "./Transformer"; +/** + * Class for editing import statements when we are keeping the code as ESM. We still need to remove + * type-only imports in TypeScript and Flow. + */ +export default class ESMImportTransformer extends Transformer { + readonly tokens: TokenProcessor; + readonly nameManager: NameManager; + readonly helperManager: HelperManager; + readonly reactHotLoaderTransformer: ReactHotLoaderTransformer | null; + readonly isTypeScriptTransformEnabled: boolean; + readonly isFlowTransformEnabled: boolean; + readonly keepUnusedImports: boolean; + private nonTypeIdentifiers; + private declarationInfo; + private injectCreateRequireForImportRequire; + constructor(tokens: TokenProcessor, nameManager: NameManager, helperManager: HelperManager, reactHotLoaderTransformer: ReactHotLoaderTransformer | null, isTypeScriptTransformEnabled: boolean, isFlowTransformEnabled: boolean, keepUnusedImports: boolean, options: Options); + process(): boolean; + private processImportEquals; + private processImport; + /** + * Remove type bindings from this import, leaving the rest of the import intact. + * + * Return true if this import was ONLY types, and thus is eligible for removal. This will bail out + * of the replacement operation, so we can return early here. + */ + private removeImportTypeBindings; + private shouldAutomaticallyElideImportedName; + private processExportDefault; + /** + * Handle a statement with one of these forms: + * export {a, type b}; + * export {c, type d} from 'foo'; + * + * In both cases, any explicit type exports should be removed. In the first + * case, we also need to handle implicit export elision for names declared as + * types. In the second case, we must NOT do implicit named export elision, + * but we must remove the runtime import if all exports are type exports. + */ + private processNamedExports; + /** + * ESM elides all imports with the rule that we only elide if we see that it's + * a type and never see it as a value. This is in contrast to CJS, which + * elides imports that are completely unknown. + */ + private shouldElideExportedName; +} diff --git a/node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts new file mode 100644 index 0000000..8a85ac4 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts @@ -0,0 +1,79 @@ +import type TokenProcessor from "../TokenProcessor"; +import type RootTransformer from "./RootTransformer"; +import Transformer from "./Transformer"; +export default class FlowTransformer extends Transformer { + readonly rootTransformer: RootTransformer; + readonly tokens: TokenProcessor; + readonly isImportsTransformEnabled: boolean; + constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, isImportsTransformEnabled: boolean); + process(): boolean; + /** + * Handle a declaration like: + * export enum E ... + * + * With this imports transform, this becomes: + * const E = [[enum]]; exports.E = E; + * + * otherwise, it becomes: + * export const E = [[enum]]; + */ + processNamedExportEnum(): void; + /** + * Handle a declaration like: + * export default enum E + * + * With the imports transform, this becomes: + * const E = [[enum]]; exports.default = E; + * + * otherwise, it becomes: + * const E = [[enum]]; export default E; + */ + processDefaultExportEnum(): void; + /** + * Transpile flow enums to invoke the "flow-enums-runtime" library. + * + * Currently, the transpiled code always uses `require("flow-enums-runtime")`, + * but if future flexibility is needed, we could expose a config option for + * this string (similar to configurable JSX). Even when targeting ESM, the + * default behavior of babel-plugin-transform-flow-enums is to use require + * rather than injecting an import. + * + * Flow enums are quite a bit simpler than TS enums and have some convenient + * constraints: + * - Element initializers must be either always present or always absent. That + * means that we can use fixed lookahead on the first element (if any) and + * assume that all elements are like that. + * - The right-hand side of an element initializer must be a literal value, + * not a complex expression and not referencing other elements. That means + * we can simply copy a single token. + * + * Enums can be broken up into three basic cases: + * + * Mirrored enums: + * enum E {A, B} + * -> + * const E = require("flow-enums-runtime").Mirrored(["A", "B"]); + * + * Initializer enums: + * enum E {A = 1, B = 2} + * -> + * const E = require("flow-enums-runtime")({A: 1, B: 2}); + * + * Symbol enums: + * enum E of symbol {A, B} + * -> + * const E = require("flow-enums-runtime")({A: Symbol("A"), B: Symbol("B")}); + * + * We can statically detect which of the three cases this is by looking at the + * "of" declaration (if any) and seeing if the first element has an initializer. + * Since the other transform details are so similar between the three cases, we + * use a single implementation and vary the transform within processEnumElement + * based on case. + */ + processEnum(): void; + /** + * Process an individual enum element, producing either an array element or an + * object element based on what type of enum this is. + */ + processEnumElement(isSymbolEnum: boolean, hasInitializers: boolean): void; +} diff --git a/node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts new file mode 100644 index 0000000..ca7228b --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts @@ -0,0 +1,144 @@ +import type CJSImportProcessor from "../CJSImportProcessor"; +import type { Options } from "../index"; +import type NameManager from "../NameManager"; +import { JSXRole } from "../parser/tokenizer"; +import type TokenProcessor from "../TokenProcessor"; +import { type JSXPragmaInfo } from "../util/getJSXPragmaInfo"; +import type RootTransformer from "./RootTransformer"; +import Transformer from "./Transformer"; +export default class JSXTransformer extends Transformer { + readonly rootTransformer: RootTransformer; + readonly tokens: TokenProcessor; + readonly importProcessor: CJSImportProcessor | null; + readonly nameManager: NameManager; + readonly options: Options; + jsxPragmaInfo: JSXPragmaInfo; + jsxImportSource: string; + isAutomaticRuntime: boolean; + lastLineNumber: number; + lastIndex: number; + filenameVarName: string | null; + esmAutomaticImportNameResolutions: { + [name: string]: string; + }; + cjsAutomaticModuleNameResolutions: { + [path: string]: string; + }; + constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor | null, nameManager: NameManager, options: Options); + process(): boolean; + getPrefixCode(): string; + processJSXTag(): void; + getElementLocationCode(firstTokenStart: number): string; + /** + * Get the line number for this source position. This is calculated lazily and + * must be called in increasing order by index. + */ + getLineNumberForIndex(index: number): number; + /** + * Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is + * the primary transformation for the automatic transform. + * + * Example: + *
Hello{x}
+ * becomes + * jsxs('div', {a: 1, children: ["Hello", x]}, 2) + */ + transformTagToJSXFunc(elementLocationCode: string | null, jsxRole: JSXRole): void; + /** + * Convert the current JSX element to a createElement call. In the classic + * runtime, this is the only case. In the automatic runtime, this is called + * as a fallback in some situations. + * + * Example: + *
Hello{x}
+ * becomes + * React.createElement('div', {a: 1, key: 2}, "Hello", x) + */ + transformTagToCreateElement(elementLocationCode: string | null): void; + /** + * Get the code for the relevant function for this context: jsx, jsxs, + * or jsxDEV. The following open-paren is included as well. + * + * These functions are only used for the automatic runtime, so they are always + * auto-imported, but the auto-import will be either CJS or ESM based on the + * target module format. + */ + getJSXFuncInvocationCode(isStatic: boolean): string; + /** + * Return the code to use for the createElement function, e.g. + * `React.createElement`, including the following open-paren. + * + * This is the main function to use for the classic runtime. For the + * automatic runtime, this function is used as a fallback function to + * preserve behavior when there is a prop spread followed by an explicit + * key. In that automatic runtime case, the function should be automatically + * imported. + */ + getCreateElementInvocationCode(): string; + /** + * Return the code to use as the component when compiling a shorthand + * fragment, e.g. `React.Fragment`. + * + * This may be called from either the classic or automatic runtime, and + * the value should be auto-imported for the automatic runtime. + */ + getFragmentCode(): string; + /** + * Return code that invokes the given function. + * + * When the imports transform is enabled, use the CJSImportTransformer + * strategy of using `.call(void 0, ...` to avoid passing a `this` value in a + * situation that would otherwise look like a method call. + */ + claimAutoImportedFuncInvocation(funcName: string, importPathSuffix: string): string; + claimAutoImportedName(funcName: string, importPathSuffix: string): string; + /** + * Process the first part of a tag, before any props. + */ + processTagIntro(): void; + /** + * Starting at the beginning of the props, add the props argument to + * React.createElement, including the comma before it. + */ + processPropsObjectWithDevInfo(elementLocationCode: string | null): void; + /** + * Transform the core part of the props, assuming that a { has already been + * inserted before us and that a } will be inserted after us. + * + * If extractKeyCode is true (i.e. when using any jsx... function), any prop + * named "key" has its code captured and returned rather than being emitted to + * the output code. This shifts line numbers, and emitting the code later will + * correct line numbers again. If no key is found or if extractKeyCode is + * false, this function returns null. + */ + processProps(extractKeyCode: boolean): string | null; + processPropName(propName: string): void; + processPropValue(): void; + processStringPropValue(): void; + /** + * Starting in the middle of the props object literal, produce an additional + * prop for the children and close the object literal. + */ + processAutomaticChildrenAndEndProps(jsxRole: JSXRole): void; + /** + * Transform children into a comma-separated list, which will be either + * arguments to createElement or array elements of a children prop. + */ + processChildren(needsInitialComma: boolean): void; + /** + * Turn a JSX text element into a string literal, or nothing at all if the JSX + * text resolves to the empty string. + * + * Returns true if a string literal is emitted, false otherwise. + */ + processChildTextElement(needsComma: boolean): boolean; + getDevSource(elementLocationCode: string): string; + getFilenameVarName(): string; +} +/** + * Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart. + * + * Really only treat anything starting with a-z as tag names. `_`, `$`, `é` + * should be treated as component names + */ +export declare function startsWithLowerCase(s: string): boolean; diff --git a/node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts new file mode 100644 index 0000000..6a8b9df --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts @@ -0,0 +1,32 @@ +import type CJSImportProcessor from "../CJSImportProcessor"; +import type NameManager from "../NameManager"; +import type TokenProcessor from "../TokenProcessor"; +import type RootTransformer from "./RootTransformer"; +import Transformer from "./Transformer"; +/** + * Implementation of babel-plugin-jest-hoist, which hoists up some jest method + * calls above the imports to allow them to override other imports. + * + * To preserve line numbers, rather than directly moving the jest.mock code, we + * wrap each invocation in a function statement and then call the function from + * the top of the file. + */ +export default class JestHoistTransformer extends Transformer { + readonly rootTransformer: RootTransformer; + readonly tokens: TokenProcessor; + readonly nameManager: NameManager; + readonly importProcessor: CJSImportProcessor | null; + private readonly hoistedFunctionNames; + constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, nameManager: NameManager, importProcessor: CJSImportProcessor | null); + process(): boolean; + getHoistedCode(): string; + /** + * Extracts any methods calls on the jest-object that should be hoisted. + * + * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options, + * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted. + * + * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does. + */ + private extractHoistedCalls; +} diff --git a/node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts new file mode 100644 index 0000000..69a1cf5 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts @@ -0,0 +1,7 @@ +import type TokenProcessor from "../TokenProcessor"; +import Transformer from "./Transformer"; +export default class NumericSeparatorTransformer extends Transformer { + readonly tokens: TokenProcessor; + constructor(tokens: TokenProcessor); + process(): boolean; +} diff --git a/node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts new file mode 100644 index 0000000..d381e5a --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts @@ -0,0 +1,9 @@ +import type NameManager from "../NameManager"; +import type TokenProcessor from "../TokenProcessor"; +import Transformer from "./Transformer"; +export default class OptionalCatchBindingTransformer extends Transformer { + readonly tokens: TokenProcessor; + readonly nameManager: NameManager; + constructor(tokens: TokenProcessor, nameManager: NameManager); + process(): boolean; +} diff --git a/node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts new file mode 100644 index 0000000..d468029 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts @@ -0,0 +1,36 @@ +import type NameManager from "../NameManager"; +import type TokenProcessor from "../TokenProcessor"; +import Transformer from "./Transformer"; +/** + * Transformer supporting the optional chaining and nullish coalescing operators. + * + * Tech plan here: + * https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan + * + * The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles + * the operators themselves. + */ +export default class OptionalChainingNullishTransformer extends Transformer { + readonly tokens: TokenProcessor; + readonly nameManager: NameManager; + constructor(tokens: TokenProcessor, nameManager: NameManager); + process(): boolean; + /** + * Determine if the current token is the last of its chain, so that we know whether it's eligible + * to have a delete op inserted. + * + * We can do this by walking forward until we determine one way or another. Each + * isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in + * a nesting way, so we can track depth and walk to the end of the chain (the point where the + * depth goes negative) and see if any other subscript token is after us in the chain. + */ + isLastSubscriptInChain(): boolean; + /** + * Determine if we are the open-paren in an expression like super.a()?.b. + * + * We can do this by walking backward to find the previous subscript. If that subscript was + * preceded by a super, then we must be the subscript after it, so if this is a call expression, + * we'll need to attach the right context. + */ + justSkippedSuper(): boolean; +} diff --git a/node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts new file mode 100644 index 0000000..56ed86e --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts @@ -0,0 +1,29 @@ +import type CJSImportProcessor from "../CJSImportProcessor"; +import type { Options } from "../index"; +import type TokenProcessor from "../TokenProcessor"; +import type RootTransformer from "./RootTransformer"; +import Transformer from "./Transformer"; +/** + * Implementation of babel-plugin-transform-react-display-name, which adds a + * display name to usages of React.createClass and createReactClass. + */ +export default class ReactDisplayNameTransformer extends Transformer { + readonly rootTransformer: RootTransformer; + readonly tokens: TokenProcessor; + readonly importProcessor: CJSImportProcessor | null; + readonly options: Options; + constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor | null, options: Options); + process(): boolean; + /** + * This is called with the token position at the open-paren. + */ + private tryProcessCreateClassCall; + private findDisplayName; + private getDisplayNameFromFilename; + /** + * We only want to add a display name when this is a function call containing + * one argument, which is an object literal without `displayName` as an + * existing key. + */ + private classNeedsDisplayName; +} diff --git a/node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts new file mode 100644 index 0000000..0221216 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts @@ -0,0 +1,12 @@ +import type TokenProcessor from "../TokenProcessor"; +import Transformer from "./Transformer"; +export default class ReactHotLoaderTransformer extends Transformer { + readonly tokens: TokenProcessor; + readonly filePath: string; + private extractedDefaultExportName; + constructor(tokens: TokenProcessor, filePath: string); + setExtractedDefaultExportName(extractedDefaultExportName: string): void; + getPrefixCode(): string; + getSuffixCode(): string; + process(): boolean; +} diff --git a/node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts new file mode 100644 index 0000000..07a0173 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts @@ -0,0 +1,52 @@ +import type { Options, SucraseContext, Transform } from "../index"; +import { type ClassInfo } from "../util/getClassInfo"; +export interface RootTransformerResult { + code: string; + mappings: Array; +} +export default class RootTransformer { + private transformers; + private nameManager; + private tokens; + private generatedVariables; + private isImportsTransformEnabled; + private isReactHotLoaderTransformEnabled; + private disableESTransforms; + private helperManager; + constructor(sucraseContext: SucraseContext, transforms: Array, enableLegacyBabel5ModuleInterop: boolean, options: Options); + transform(): RootTransformerResult; + processBalancedCode(): void; + processToken(): void; + /** + * Skip past a class with a name and return that name. + */ + processNamedClass(): string; + processClass(): void; + /** + * We want to just handle class fields in all contexts, since TypeScript supports them. Later, + * when some JS implementations support class fields, this should be made optional. + */ + processClassBody(classInfo: ClassInfo, className: string | null): void; + makeConstructorInitCode(constructorInitializerStatements: Array, instanceInitializerNames: Array, className: string): string; + /** + * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with + * arrow function return types since they can confuse the parser. In that case, we want to move + * the close-paren to the same line as the arrow. + * + * See https://github.com/alangpierce/sucrase/issues/391 for more details. + */ + processPossibleArrowParamEnd(): boolean; + /** + * An async arrow function might be of the form: + * + * async < + * T + * >() => {} + * + * in which case, removing the type parameters will cause a syntax error. Detect this case and + * move the open-paren earlier. + */ + processPossibleAsyncArrowWithTypeParams(): boolean; + processPossibleTypeRange(): boolean; + shiftMappings(mappings: Array, prefixLength: number): Array; +} diff --git a/node_modules/sucrase/dist/types/transformers/Transformer.d.ts b/node_modules/sucrase/dist/types/transformers/Transformer.d.ts new file mode 100644 index 0000000..35c18b1 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/Transformer.d.ts @@ -0,0 +1,6 @@ +export default abstract class Transformer { + abstract process(): boolean; + getPrefixCode(): string; + getHoistedCode(): string; + getSuffixCode(): string; +} diff --git a/node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts new file mode 100644 index 0000000..6e9c9d3 --- /dev/null +++ b/node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts @@ -0,0 +1,104 @@ +import type { Token } from "../parser/tokenizer"; +import type TokenProcessor from "../TokenProcessor"; +import type RootTransformer from "./RootTransformer"; +import Transformer from "./Transformer"; +export default class TypeScriptTransformer extends Transformer { + readonly rootTransformer: RootTransformer; + readonly tokens: TokenProcessor; + readonly isImportsTransformEnabled: boolean; + constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, isImportsTransformEnabled: boolean); + process(): boolean; + processEnum(isExport?: boolean): void; + /** + * Transform an enum into equivalent JS. This has complexity in a few places: + * - TS allows string enums, numeric enums, and a mix of the two styles within an enum. + * - Enum keys are allowed to be referenced in later enum values. + * - Enum keys are allowed to be strings. + * - When enum values are omitted, they should follow an auto-increment behavior. + */ + processEnumBody(enumName: string): void; + /** + * Detect name information about this enum key, which will be used to determine which code to emit + * and whether we should declare a variable as part of this declaration. + * + * Some cases to keep in mind: + * - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement + * this by declaring a variable `X` so that later expressions can use it. + * - In addition to the usual identifier key syntax, enum keys are allowed to be string literals, + * e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed. + * - Even if the enum key is defined as a string literal, it may still be referenced by identifier + * later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string + * literal is identifier-like and emit a variable if so, even if the declaration did not use an + * identifier. + * - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later + * and would be a syntax error if we emitted a variable, so we need to skip the variable + * declaration in those cases. + * + * The variableName return value captures these nuances: if non-null, we can and must emit a + * variable declaration, and if null, we can't and shouldn't. + */ + extractEnumKeyInfo(nameToken: Token): { + nameStringCode: string; + variableName: string | null; + }; + /** + * Handle an enum member where the RHS is just a string literal (not omitted, not a number, and + * not a complex expression). This is the typical form for TS string enums, and in this case, we + * do *not* create a reverse mapping. + * + * This is called after deleting the key token, when the token processor is at the equals sign. + * + * Example 1: + * someKey = "some value" + * -> + * const someKey = "some value"; MyEnum["someKey"] = someKey; + * + * Example 2: + * "some key" = "some value" + * -> + * MyEnum["some key"] = "some value"; + */ + processStringLiteralEnumMember(enumName: string, nameStringCode: string, variableName: string | null): void; + /** + * Handle an enum member initialized with an expression on the right-hand side (other than a + * string literal). In these cases, we should transform the expression and emit code that sets up + * a reverse mapping. + * + * The TypeScript implementation of this operation distinguishes between expressions that can be + * "constant folded" at compile time (i.e. consist of number literals and simple math operations + * on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved + * numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at + * compile time would add significant complexity to Sucrase, so Sucrase instead leaves the + * expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement + * auto-incrementing. + * + * This is called after deleting the key token, when the token processor is at the equals sign. + * + * Example 1: + * someKey = 1 + 1 + * -> + * const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey"; + * + * Example 2: + * "some key" = 1 + 1 + * -> + * MyEnum[MyEnum["some key"] = 1 + 1] = "some key"; + */ + processExplicitValueEnumMember(enumName: string, nameStringCode: string, variableName: string | null): void; + /** + * Handle an enum member with no right-hand side expression. In this case, the value is the + * previous value plus 1, or 0 if there was no previous value. We should also always emit a + * reverse mapping. + * + * Example 1: + * someKey2 + * -> + * const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2"; + * + * Example 2: + * "some key 2" + * -> + * MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2"; + */ + processImplicitValueEnumMember(enumName: string, nameStringCode: string, variableName: string | null, previousValueCode: string | null): void; +} diff --git a/node_modules/sucrase/dist/types/util/elideImportEquals.d.ts b/node_modules/sucrase/dist/types/util/elideImportEquals.d.ts new file mode 100644 index 0000000..d04bb71 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/elideImportEquals.d.ts @@ -0,0 +1,2 @@ +import type TokenProcessor from "../TokenProcessor"; +export default function elideImportEquals(tokens: TokenProcessor): void; diff --git a/node_modules/sucrase/dist/types/util/formatTokens.d.ts b/node_modules/sucrase/dist/types/util/formatTokens.d.ts new file mode 100644 index 0000000..fe5fb1e --- /dev/null +++ b/node_modules/sucrase/dist/types/util/formatTokens.d.ts @@ -0,0 +1,2 @@ +import type { Token } from "../parser/tokenizer"; +export default function formatTokens(code: string, tokens: Array): string; diff --git a/node_modules/sucrase/dist/types/util/getClassInfo.d.ts b/node_modules/sucrase/dist/types/util/getClassInfo.d.ts new file mode 100644 index 0000000..f4309cb --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getClassInfo.d.ts @@ -0,0 +1,34 @@ +import type NameManager from "../NameManager"; +import type TokenProcessor from "../TokenProcessor"; +import type RootTransformer from "../transformers/RootTransformer"; +export interface ClassHeaderInfo { + isExpression: boolean; + className: string | null; + hasSuperclass: boolean; +} +export interface TokenRange { + start: number; + end: number; +} +export interface FieldInfo extends TokenRange { + equalsIndex: number; + initializerName: string; +} +/** + * Information about a class returned to inform the implementation of class fields and constructor + * initializers. + */ +export interface ClassInfo { + headerInfo: ClassHeaderInfo; + constructorInitializerStatements: Array; + instanceInitializerNames: Array; + staticInitializerNames: Array; + constructorInsertPos: number | null; + fields: Array; + rangesToRemove: Array; +} +/** + * Get information about the class fields for this class, given a token processor pointing to the + * open-brace at the start of the class. + */ +export default function getClassInfo(rootTransformer: RootTransformer, tokens: TokenProcessor, nameManager: NameManager, disableESTransforms: boolean): ClassInfo; diff --git a/node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts b/node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts new file mode 100644 index 0000000..04122ba --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts @@ -0,0 +1,18 @@ +import type TokenProcessor from "../TokenProcessor"; +export interface DeclarationInfo { + typeDeclarations: Set; + valueDeclarations: Set; +} +export declare const EMPTY_DECLARATION_INFO: DeclarationInfo; +/** + * Get all top-level identifiers that should be preserved when exported in TypeScript. + * + * Examples: + * - If an identifier is declared as `const x`, then `export {x}` should be preserved. + * - If it's declared as `type x`, then `export {x}` should be removed. + * - If it's declared as both `const x` and `type x`, then the export should be preserved. + * - Classes and enums should be preserved (even though they also introduce types). + * - Imported identifiers should be preserved since we don't have enough information to + * rule them out. --isolatedModules disallows re-exports, which catches errors here. + */ +export default function getDeclarationInfo(tokens: TokenProcessor): DeclarationInfo; diff --git a/node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts b/node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts new file mode 100644 index 0000000..9e0d5a2 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts @@ -0,0 +1,5 @@ +import type { Token } from "../parser/tokenizer"; +/** + * Get all identifier names in the code, in order, including duplicates. + */ +export default function getIdentifierNames(code: string, tokens: Array): Array; diff --git a/node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts b/node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts new file mode 100644 index 0000000..44d53fc --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts @@ -0,0 +1,36 @@ +import type TokenProcessor from "../TokenProcessor"; +export type ImportExportSpecifierInfo = { + isType: false; + leftName: string; + rightName: string; + endIndex: number; +} | { + isType: true; + leftName: null; + rightName: null; + endIndex: number; +}; +/** + * Determine information about this named import or named export specifier. + * + * This syntax is the `a` from statements like these: + * import {A} from "./foo"; + * export {A}; + * export {A} from "./foo"; + * + * As it turns out, we can exactly characterize the syntax meaning by simply + * counting the number of tokens, which can be from 1 to 4: + * {A} + * {type A} + * {A as B} + * {type A as B} + * + * In the type case, we never actually need the names in practice, so don't get + * them. + * + * TODO: There's some redundancy with the type detection here and the isType + * flag that's already present on tokens in TS mode. This function could + * potentially be simplified and/or pushed to the call sites to avoid the object + * allocation. + */ +export default function getImportExportSpecifierInfo(tokens: TokenProcessor, index?: number): ImportExportSpecifierInfo; diff --git a/node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts b/node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts new file mode 100644 index 0000000..fec9a48 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts @@ -0,0 +1,8 @@ +import type { Options } from "../index"; +export interface JSXPragmaInfo { + base: string; + suffix: string; + fragmentBase: string; + fragmentSuffix: string; +} +export default function getJSXPragmaInfo(options: Options): JSXPragmaInfo; diff --git a/node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts b/node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts new file mode 100644 index 0000000..3e40768 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts @@ -0,0 +1,3 @@ +import type { Options } from "../index"; +import type TokenProcessor from "../TokenProcessor"; +export declare function getNonTypeIdentifiers(tokens: TokenProcessor, options: Options): Set; diff --git a/node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts b/node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts new file mode 100644 index 0000000..bc236e4 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts @@ -0,0 +1,9 @@ +import type TokenProcessor from "../TokenProcessor"; +/** + * Special case code to scan for imported names in ESM TypeScript. We need to do this so we can + * properly get globals so we can compute shadowed globals. + * + * This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS + * replacement and flow type imports. + */ +export default function getTSImportedNames(tokens: TokenProcessor): Set; diff --git a/node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts b/node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts new file mode 100644 index 0000000..3ad0036 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts @@ -0,0 +1,11 @@ +import type TokenProcessor from "../TokenProcessor"; +/** + * Determine whether this optional chain or nullish coalescing operation has any await statements in + * it. If so, we'll need to transpile to an async operation. + * + * We compute this by walking the length of the operation and returning true if we see an await + * keyword used as a real await (rather than an object key or property access). Nested optional + * chain/nullish operations need to be tracked but don't silence await, but a nested async function + * (or any other nested scope) will make the await not count. + */ +export default function isAsyncOperation(tokens: TokenProcessor): boolean; diff --git a/node_modules/sucrase/dist/types/util/isExportFrom.d.ts b/node_modules/sucrase/dist/types/util/isExportFrom.d.ts new file mode 100644 index 0000000..abf0b4d --- /dev/null +++ b/node_modules/sucrase/dist/types/util/isExportFrom.d.ts @@ -0,0 +1,6 @@ +import type TokenProcessor from "../TokenProcessor"; +/** + * Starting at `export {`, look ahead and return `true` if this is an + * `export {...} from` statement and `false` if this is a plain multi-export. + */ +export default function isExportFrom(tokens: TokenProcessor): boolean; diff --git a/node_modules/sucrase/dist/types/util/isIdentifier.d.ts b/node_modules/sucrase/dist/types/util/isIdentifier.d.ts new file mode 100644 index 0000000..b39af27 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/isIdentifier.d.ts @@ -0,0 +1,8 @@ +/** + * Determine if the given name is a legal variable name. + * + * This is needed when transforming TypeScript enums; if an enum key is a valid + * variable name, it might be referenced later in the enum, so we need to + * declare a variable. + */ +export default function isIdentifier(name: string): boolean; diff --git a/node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts b/node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts new file mode 100644 index 0000000..0d7ca6e --- /dev/null +++ b/node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts @@ -0,0 +1,6 @@ +import type TokenProcessor from "../TokenProcessor"; +/** + * Starting at a potential `with` or (legacy) `assert` token, remove the import + * attributes if they exist. + */ +export declare function removeMaybeImportAttributes(tokens: TokenProcessor): void; diff --git a/node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts b/node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts new file mode 100644 index 0000000..f774c14 --- /dev/null +++ b/node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts @@ -0,0 +1,6 @@ +import type TokenProcessor from "../TokenProcessor"; +import type { DeclarationInfo } from "./getDeclarationInfo"; +/** + * Common method sharing code between CJS and ESM cases, since they're the same here. + */ +export default function shouldElideDefaultExport(isTypeScriptTransformEnabled: boolean, keepUnusedImports: boolean, tokens: TokenProcessor, declarationInfo: DeclarationInfo): boolean; diff --git a/node_modules/sucrase/dist/util/elideImportEquals.js b/node_modules/sucrase/dist/util/elideImportEquals.js new file mode 100644 index 0000000..c6ef30f --- /dev/null +++ b/node_modules/sucrase/dist/util/elideImportEquals.js @@ -0,0 +1,29 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types'); + + + function elideImportEquals(tokens) { + // import + tokens.removeInitialToken(); + // name + tokens.removeToken(); + // = + tokens.removeToken(); + // name or require + tokens.removeToken(); + // Handle either `import A = require('A')` or `import A = B.C.D`. + if (tokens.matches1(_types.TokenType.parenL)) { + // ( + tokens.removeToken(); + // path string + tokens.removeToken(); + // ) + tokens.removeToken(); + } else { + while (tokens.matches1(_types.TokenType.dot)) { + // . + tokens.removeToken(); + // name + tokens.removeToken(); + } + } +} exports.default = elideImportEquals; diff --git a/node_modules/sucrase/dist/util/formatTokens.js b/node_modules/sucrase/dist/util/formatTokens.js new file mode 100644 index 0000000..c663633 --- /dev/null +++ b/node_modules/sucrase/dist/util/formatTokens.js @@ -0,0 +1,74 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _linesandcolumns = require('lines-and-columns'); var _linesandcolumns2 = _interopRequireDefault(_linesandcolumns); + + +var _types = require('../parser/tokenizer/types'); + + function formatTokens(code, tokens) { + if (tokens.length === 0) { + return ""; + } + + const tokenKeys = Object.keys(tokens[0]).filter( + (k) => k !== "type" && k !== "value" && k !== "start" && k !== "end" && k !== "loc", + ); + const typeKeys = Object.keys(tokens[0].type).filter((k) => k !== "label" && k !== "keyword"); + + const headings = ["Location", "Label", "Raw", ...tokenKeys, ...typeKeys]; + + const lines = new (0, _linesandcolumns2.default)(code); + const rows = [headings, ...tokens.map(getTokenComponents)]; + const padding = headings.map(() => 0); + for (const components of rows) { + for (let i = 0; i < components.length; i++) { + padding[i] = Math.max(padding[i], components[i].length); + } + } + return rows + .map((components) => components.map((component, i) => component.padEnd(padding[i])).join(" ")) + .join("\n"); + + function getTokenComponents(token) { + const raw = code.slice(token.start, token.end); + return [ + formatRange(token.start, token.end), + _types.formatTokenType.call(void 0, token.type), + truncate(String(raw), 14), + // @ts-ignore: Intentional dynamic access by key. + ...tokenKeys.map((key) => formatValue(token[key], key)), + // @ts-ignore: Intentional dynamic access by key. + ...typeKeys.map((key) => formatValue(token.type[key], key)), + ]; + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function formatValue(value, key) { + if (value === true) { + return key; + } else if (value === false || value === null) { + return ""; + } else { + return String(value); + } + } + + function formatRange(start, end) { + return `${formatPos(start)}-${formatPos(end)}`; + } + + function formatPos(pos) { + const location = lines.locationForIndex(pos); + if (!location) { + return "Unknown"; + } else { + return `${location.line + 1}:${location.column + 1}`; + } + } +} exports.default = formatTokens; + +function truncate(s, length) { + if (s.length > length) { + return `${s.slice(0, length - 3)}...`; + } else { + return s; + } +} diff --git a/node_modules/sucrase/dist/util/getClassInfo.js b/node_modules/sucrase/dist/util/getClassInfo.js new file mode 100644 index 0000000..510a771 --- /dev/null +++ b/node_modules/sucrase/dist/util/getClassInfo.js @@ -0,0 +1,352 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + +var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/** + * Get information about the class fields for this class, given a token processor pointing to the + * open-brace at the start of the class. + */ + function getClassInfo( + rootTransformer, + tokens, + nameManager, + disableESTransforms, +) { + const snapshot = tokens.snapshot(); + + const headerInfo = processClassHeader(tokens); + + let constructorInitializerStatements = []; + const instanceInitializerNames = []; + const staticInitializerNames = []; + let constructorInsertPos = null; + const fields = []; + const rangesToRemove = []; + + const classContextId = tokens.currentToken().contextId; + if (classContextId == null) { + throw new Error("Expected non-null class context ID on class open-brace."); + } + + tokens.nextToken(); + while (!tokens.matchesContextIdAndLabel(_types.TokenType.braceR, classContextId)) { + if (tokens.matchesContextual(_keywords.ContextualKeyword._constructor) && !tokens.currentToken().isType) { + ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); + } else if (tokens.matches1(_types.TokenType.semi)) { + if (!disableESTransforms) { + rangesToRemove.push({start: tokens.currentIndex(), end: tokens.currentIndex() + 1}); + } + tokens.nextToken(); + } else if (tokens.currentToken().isType) { + tokens.nextToken(); + } else { + // Either a method or a field. Skip to the identifier part. + const statementStartIndex = tokens.currentIndex(); + let isStatic = false; + let isESPrivate = false; + let isDeclareOrAbstract = false; + while (isAccessModifier(tokens.currentToken())) { + if (tokens.matches1(_types.TokenType._static)) { + isStatic = true; + } + if (tokens.matches1(_types.TokenType.hash)) { + isESPrivate = true; + } + if (tokens.matches1(_types.TokenType._declare) || tokens.matches1(_types.TokenType._abstract)) { + isDeclareOrAbstract = true; + } + tokens.nextToken(); + } + if (isStatic && tokens.matches1(_types.TokenType.braceL)) { + // This is a static block, so don't process it in any special way. + skipToNextClassElement(tokens, classContextId); + continue; + } + if (isESPrivate) { + // Sucrase doesn't attempt to transpile private fields; just leave them as-is. + skipToNextClassElement(tokens, classContextId); + continue; + } + if ( + tokens.matchesContextual(_keywords.ContextualKeyword._constructor) && + !tokens.currentToken().isType + ) { + ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); + continue; + } + + const nameStartIndex = tokens.currentIndex(); + skipFieldName(tokens); + if (tokens.matches1(_types.TokenType.lessThan) || tokens.matches1(_types.TokenType.parenL)) { + // This is a method, so nothing to process. + skipToNextClassElement(tokens, classContextId); + continue; + } + // There might be a type annotation that we need to skip. + while (tokens.currentToken().isType) { + tokens.nextToken(); + } + if (tokens.matches1(_types.TokenType.eq)) { + const equalsIndex = tokens.currentIndex(); + // This is an initializer, so we need to wrap in an initializer method. + const valueEnd = tokens.currentToken().rhsEndIndex; + if (valueEnd == null) { + throw new Error("Expected rhsEndIndex on class field assignment."); + } + tokens.nextToken(); + while (tokens.currentIndex() < valueEnd) { + rootTransformer.processToken(); + } + let initializerName; + if (isStatic) { + initializerName = nameManager.claimFreeName("__initStatic"); + staticInitializerNames.push(initializerName); + } else { + initializerName = nameManager.claimFreeName("__init"); + instanceInitializerNames.push(initializerName); + } + // Fields start at the name, so `static x = 1;` has a field range of `x = 1;`. + fields.push({ + initializerName, + equalsIndex, + start: nameStartIndex, + end: tokens.currentIndex(), + }); + } else if (!disableESTransforms || isDeclareOrAbstract) { + // This is a regular field declaration, like `x;`. With the class transform enabled, we just + // remove the line so that no output is produced. With the class transform disabled, we + // usually want to preserve the declaration (but still strip types), but if the `declare` + // or `abstract` keyword is specified, we should remove the line to avoid initializing the + // value to undefined. + rangesToRemove.push({start: statementStartIndex, end: tokens.currentIndex()}); + } + } + } + + tokens.restoreToSnapshot(snapshot); + if (disableESTransforms) { + // With ES transforms disabled, we don't want to transform regular class + // field declarations, and we don't need to do any additional tricks to + // reference the constructor for static init, but we still need to transform + // TypeScript field initializers defined as constructor parameters and we + // still need to remove `declare` fields. For now, we run the same code + // path but omit any field information, as if the class had no field + // declarations. In the future, when we fully drop the class fields + // transform, we can simplify this code significantly. + return { + headerInfo, + constructorInitializerStatements, + instanceInitializerNames: [], + staticInitializerNames: [], + constructorInsertPos, + fields: [], + rangesToRemove, + }; + } else { + return { + headerInfo, + constructorInitializerStatements, + instanceInitializerNames, + staticInitializerNames, + constructorInsertPos, + fields, + rangesToRemove, + }; + } +} exports.default = getClassInfo; + +/** + * Move the token processor to the next method/field in the class. + * + * To do that, we seek forward to the next start of a class name (either an open + * bracket or an identifier, or the closing curly brace), then seek backward to + * include any access modifiers. + */ +function skipToNextClassElement(tokens, classContextId) { + tokens.nextToken(); + while (tokens.currentToken().contextId !== classContextId) { + tokens.nextToken(); + } + while (isAccessModifier(tokens.tokenAtRelativeIndex(-1))) { + tokens.previousToken(); + } +} + +function processClassHeader(tokens) { + const classToken = tokens.currentToken(); + const contextId = classToken.contextId; + if (contextId == null) { + throw new Error("Expected context ID on class token."); + } + const isExpression = classToken.isExpression; + if (isExpression == null) { + throw new Error("Expected isExpression on class token."); + } + let className = null; + let hasSuperclass = false; + tokens.nextToken(); + if (tokens.matches1(_types.TokenType.name)) { + className = tokens.identifierName(); + } + while (!tokens.matchesContextIdAndLabel(_types.TokenType.braceL, contextId)) { + // If this has a superclass, there will always be an `extends` token. If it doesn't have a + // superclass, only type parameters and `implements` clauses can show up here, all of which + // consist only of type tokens. A declaration like `class A {` should *not* count + // as having a superclass. + if (tokens.matches1(_types.TokenType._extends) && !tokens.currentToken().isType) { + hasSuperclass = true; + } + tokens.nextToken(); + } + return {isExpression, className, hasSuperclass}; +} + +/** + * Extract useful information out of a constructor, starting at the "constructor" name. + */ +function processConstructor(tokens) + + + { + const constructorInitializerStatements = []; + + tokens.nextToken(); + const constructorContextId = tokens.currentToken().contextId; + if (constructorContextId == null) { + throw new Error("Expected context ID on open-paren starting constructor params."); + } + // Advance through parameters looking for access modifiers. + while (!tokens.matchesContextIdAndLabel(_types.TokenType.parenR, constructorContextId)) { + if (tokens.currentToken().contextId === constructorContextId) { + // Current token is an open paren or comma just before a param, so check + // that param for access modifiers. + tokens.nextToken(); + if (isAccessModifier(tokens.currentToken())) { + tokens.nextToken(); + while (isAccessModifier(tokens.currentToken())) { + tokens.nextToken(); + } + const token = tokens.currentToken(); + if (token.type !== _types.TokenType.name) { + throw new Error("Expected identifier after access modifiers in constructor arg."); + } + const name = tokens.identifierNameForToken(token); + constructorInitializerStatements.push(`this.${name} = ${name}`); + } + } else { + tokens.nextToken(); + } + } + // ) + tokens.nextToken(); + // Constructor type annotations are invalid, but skip them anyway since + // they're easy to skip. + while (tokens.currentToken().isType) { + tokens.nextToken(); + } + let constructorInsertPos = tokens.currentIndex(); + + // Advance through body looking for a super call. + let foundSuperCall = false; + while (!tokens.matchesContextIdAndLabel(_types.TokenType.braceR, constructorContextId)) { + if (!foundSuperCall && tokens.matches2(_types.TokenType._super, _types.TokenType.parenL)) { + tokens.nextToken(); + const superCallContextId = tokens.currentToken().contextId; + if (superCallContextId == null) { + throw new Error("Expected a context ID on the super call"); + } + while (!tokens.matchesContextIdAndLabel(_types.TokenType.parenR, superCallContextId)) { + tokens.nextToken(); + } + constructorInsertPos = tokens.currentIndex(); + foundSuperCall = true; + } + tokens.nextToken(); + } + // } + tokens.nextToken(); + + return {constructorInitializerStatements, constructorInsertPos}; +} + +/** + * Determine if this is any token that can go before the name in a method/field. + */ +function isAccessModifier(token) { + return [ + _types.TokenType._async, + _types.TokenType._get, + _types.TokenType._set, + _types.TokenType.plus, + _types.TokenType.minus, + _types.TokenType._readonly, + _types.TokenType._static, + _types.TokenType._public, + _types.TokenType._private, + _types.TokenType._protected, + _types.TokenType._override, + _types.TokenType._abstract, + _types.TokenType.star, + _types.TokenType._declare, + _types.TokenType.hash, + ].includes(token.type); +} + +/** + * The next token or set of tokens is either an identifier or an expression in square brackets, for + * a method or field name. + */ +function skipFieldName(tokens) { + if (tokens.matches1(_types.TokenType.bracketL)) { + const startToken = tokens.currentToken(); + const classContextId = startToken.contextId; + if (classContextId == null) { + throw new Error("Expected class context ID on computed name open bracket."); + } + while (!tokens.matchesContextIdAndLabel(_types.TokenType.bracketR, classContextId)) { + tokens.nextToken(); + } + tokens.nextToken(); + } else { + tokens.nextToken(); + } +} diff --git a/node_modules/sucrase/dist/util/getDeclarationInfo.js b/node_modules/sucrase/dist/util/getDeclarationInfo.js new file mode 100644 index 0000000..465fc06 --- /dev/null +++ b/node_modules/sucrase/dist/util/getDeclarationInfo.js @@ -0,0 +1,40 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _tokenizer = require('../parser/tokenizer'); +var _types = require('../parser/tokenizer/types'); + + + + + + + + const EMPTY_DECLARATION_INFO = { + typeDeclarations: new Set(), + valueDeclarations: new Set(), +}; exports.EMPTY_DECLARATION_INFO = EMPTY_DECLARATION_INFO; + +/** + * Get all top-level identifiers that should be preserved when exported in TypeScript. + * + * Examples: + * - If an identifier is declared as `const x`, then `export {x}` should be preserved. + * - If it's declared as `type x`, then `export {x}` should be removed. + * - If it's declared as both `const x` and `type x`, then the export should be preserved. + * - Classes and enums should be preserved (even though they also introduce types). + * - Imported identifiers should be preserved since we don't have enough information to + * rule them out. --isolatedModules disallows re-exports, which catches errors here. + */ + function getDeclarationInfo(tokens) { + const typeDeclarations = new Set(); + const valueDeclarations = new Set(); + for (let i = 0; i < tokens.tokens.length; i++) { + const token = tokens.tokens[i]; + if (token.type === _types.TokenType.name && _tokenizer.isTopLevelDeclaration.call(void 0, token)) { + if (token.isType) { + typeDeclarations.add(tokens.identifierNameForToken(token)); + } else { + valueDeclarations.add(tokens.identifierNameForToken(token)); + } + } + } + return {typeDeclarations, valueDeclarations}; +} exports.default = getDeclarationInfo; diff --git a/node_modules/sucrase/dist/util/getIdentifierNames.js b/node_modules/sucrase/dist/util/getIdentifierNames.js new file mode 100644 index 0000000..c0195ca --- /dev/null +++ b/node_modules/sucrase/dist/util/getIdentifierNames.js @@ -0,0 +1,15 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); +var _types = require('../parser/tokenizer/types'); + +/** + * Get all identifier names in the code, in order, including duplicates. + */ + function getIdentifierNames(code, tokens) { + const names = []; + for (const token of tokens) { + if (token.type === _types.TokenType.name) { + names.push(code.slice(token.start, token.end)); + } + } + return names; +} exports.default = getIdentifierNames; diff --git a/node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js b/node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js new file mode 100644 index 0000000..45edb74 --- /dev/null +++ b/node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js @@ -0,0 +1,92 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types'); + + + + + + + + + + + + + + + + +/** + * Determine information about this named import or named export specifier. + * + * This syntax is the `a` from statements like these: + * import {A} from "./foo"; + * export {A}; + * export {A} from "./foo"; + * + * As it turns out, we can exactly characterize the syntax meaning by simply + * counting the number of tokens, which can be from 1 to 4: + * {A} + * {type A} + * {A as B} + * {type A as B} + * + * In the type case, we never actually need the names in practice, so don't get + * them. + * + * TODO: There's some redundancy with the type detection here and the isType + * flag that's already present on tokens in TS mode. This function could + * potentially be simplified and/or pushed to the call sites to avoid the object + * allocation. + */ + function getImportExportSpecifierInfo( + tokens, + index = tokens.currentIndex(), +) { + let endIndex = index + 1; + if (isSpecifierEnd(tokens, endIndex)) { + // import {A} + const name = tokens.identifierNameAtIndex(index); + return { + isType: false, + leftName: name, + rightName: name, + endIndex, + }; + } + endIndex++; + if (isSpecifierEnd(tokens, endIndex)) { + // import {type A} + return { + isType: true, + leftName: null, + rightName: null, + endIndex, + }; + } + endIndex++; + if (isSpecifierEnd(tokens, endIndex)) { + // import {A as B} + return { + isType: false, + leftName: tokens.identifierNameAtIndex(index), + rightName: tokens.identifierNameAtIndex(index + 2), + endIndex, + }; + } + endIndex++; + if (isSpecifierEnd(tokens, endIndex)) { + // import {type A as B} + return { + isType: true, + leftName: null, + rightName: null, + endIndex, + }; + } + throw new Error(`Unexpected import/export specifier at ${index}`); +} exports.default = getImportExportSpecifierInfo; + +function isSpecifierEnd(tokens, index) { + const token = tokens.tokens[index]; + return token.type === _types.TokenType.braceR || token.type === _types.TokenType.comma; +} diff --git a/node_modules/sucrase/dist/util/getJSXPragmaInfo.js b/node_modules/sucrase/dist/util/getJSXPragmaInfo.js new file mode 100644 index 0000000..67513db --- /dev/null +++ b/node_modules/sucrase/dist/util/getJSXPragmaInfo.js @@ -0,0 +1,22 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); + + + + + + + + + function getJSXPragmaInfo(options) { + const [base, suffix] = splitPragma(options.jsxPragma || "React.createElement"); + const [fragmentBase, fragmentSuffix] = splitPragma(options.jsxFragmentPragma || "React.Fragment"); + return {base, suffix, fragmentBase, fragmentSuffix}; +} exports.default = getJSXPragmaInfo; + +function splitPragma(pragma) { + let dotIndex = pragma.indexOf("."); + if (dotIndex === -1) { + dotIndex = pragma.length; + } + return [pragma.slice(0, dotIndex), pragma.slice(dotIndex)]; +} diff --git a/node_modules/sucrase/dist/util/getNonTypeIdentifiers.js b/node_modules/sucrase/dist/util/getNonTypeIdentifiers.js new file mode 100644 index 0000000..86d9daf --- /dev/null +++ b/node_modules/sucrase/dist/util/getNonTypeIdentifiers.js @@ -0,0 +1,43 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _tokenizer = require('../parser/tokenizer'); +var _types = require('../parser/tokenizer/types'); + +var _JSXTransformer = require('../transformers/JSXTransformer'); +var _getJSXPragmaInfo = require('./getJSXPragmaInfo'); var _getJSXPragmaInfo2 = _interopRequireDefault(_getJSXPragmaInfo); + + function getNonTypeIdentifiers(tokens, options) { + const jsxPragmaInfo = _getJSXPragmaInfo2.default.call(void 0, options); + const nonTypeIdentifiers = new Set(); + for (let i = 0; i < tokens.tokens.length; i++) { + const token = tokens.tokens[i]; + if ( + token.type === _types.TokenType.name && + !token.isType && + (token.identifierRole === _tokenizer.IdentifierRole.Access || + token.identifierRole === _tokenizer.IdentifierRole.ObjectShorthand || + token.identifierRole === _tokenizer.IdentifierRole.ExportAccess) && + !token.shadowsGlobal + ) { + nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); + } + if (token.type === _types.TokenType.jsxTagStart) { + nonTypeIdentifiers.add(jsxPragmaInfo.base); + } + if ( + token.type === _types.TokenType.jsxTagStart && + i + 1 < tokens.tokens.length && + tokens.tokens[i + 1].type === _types.TokenType.jsxTagEnd + ) { + nonTypeIdentifiers.add(jsxPragmaInfo.base); + nonTypeIdentifiers.add(jsxPragmaInfo.fragmentBase); + } + if (token.type === _types.TokenType.jsxName && token.identifierRole === _tokenizer.IdentifierRole.Access) { + const identifierName = tokens.identifierNameForToken(token); + // Lower-case single-component tag names like "div" don't count. + if (!_JSXTransformer.startsWithLowerCase.call(void 0, identifierName) || tokens.tokens[i + 1].type === _types.TokenType.dot) { + nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); + } + } + } + return nonTypeIdentifiers; +} exports.getNonTypeIdentifiers = getNonTypeIdentifiers; diff --git a/node_modules/sucrase/dist/util/getTSImportedNames.js b/node_modules/sucrase/dist/util/getTSImportedNames.js new file mode 100644 index 0000000..5c5362c --- /dev/null +++ b/node_modules/sucrase/dist/util/getTSImportedNames.js @@ -0,0 +1,84 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _types = require('../parser/tokenizer/types'); + +var _getImportExportSpecifierInfo = require('./getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo); + +/** + * Special case code to scan for imported names in ESM TypeScript. We need to do this so we can + * properly get globals so we can compute shadowed globals. + * + * This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS + * replacement and flow type imports. + */ + function getTSImportedNames(tokens) { + const importedNames = new Set(); + for (let i = 0; i < tokens.tokens.length; i++) { + if ( + tokens.matches1AtIndex(i, _types.TokenType._import) && + !tokens.matches3AtIndex(i, _types.TokenType._import, _types.TokenType.name, _types.TokenType.eq) + ) { + collectNamesForImport(tokens, i, importedNames); + } + } + return importedNames; +} exports.default = getTSImportedNames; + +function collectNamesForImport( + tokens, + index, + importedNames, +) { + index++; + + if (tokens.matches1AtIndex(index, _types.TokenType.parenL)) { + // Dynamic import, so nothing to do + return; + } + + if (tokens.matches1AtIndex(index, _types.TokenType.name)) { + importedNames.add(tokens.identifierNameAtIndex(index)); + index++; + if (tokens.matches1AtIndex(index, _types.TokenType.comma)) { + index++; + } + } + + if (tokens.matches1AtIndex(index, _types.TokenType.star)) { + // * as + index += 2; + importedNames.add(tokens.identifierNameAtIndex(index)); + index++; + } + + if (tokens.matches1AtIndex(index, _types.TokenType.braceL)) { + index++; + collectNamesForNamedImport(tokens, index, importedNames); + } +} + +function collectNamesForNamedImport( + tokens, + index, + importedNames, +) { + while (true) { + if (tokens.matches1AtIndex(index, _types.TokenType.braceR)) { + return; + } + + const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, tokens, index); + index = specifierInfo.endIndex; + if (!specifierInfo.isType) { + importedNames.add(specifierInfo.rightName); + } + + if (tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.braceR)) { + return; + } else if (tokens.matches1AtIndex(index, _types.TokenType.braceR)) { + return; + } else if (tokens.matches1AtIndex(index, _types.TokenType.comma)) { + index++; + } else { + throw new Error(`Unexpected token: ${JSON.stringify(tokens.tokens[index])}`); + } + } +} diff --git a/node_modules/sucrase/dist/util/isAsyncOperation.js b/node_modules/sucrase/dist/util/isAsyncOperation.js new file mode 100644 index 0000000..c02023a --- /dev/null +++ b/node_modules/sucrase/dist/util/isAsyncOperation.js @@ -0,0 +1,38 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords'); + + +/** + * Determine whether this optional chain or nullish coalescing operation has any await statements in + * it. If so, we'll need to transpile to an async operation. + * + * We compute this by walking the length of the operation and returning true if we see an await + * keyword used as a real await (rather than an object key or property access). Nested optional + * chain/nullish operations need to be tracked but don't silence await, but a nested async function + * (or any other nested scope) will make the await not count. + */ + function isAsyncOperation(tokens) { + let index = tokens.currentIndex(); + let depth = 0; + const startToken = tokens.currentToken(); + do { + const token = tokens.tokens[index]; + if (token.isOptionalChainStart) { + depth++; + } + if (token.isOptionalChainEnd) { + depth--; + } + depth += token.numNullishCoalesceStarts; + depth -= token.numNullishCoalesceEnds; + + if ( + token.contextualKeyword === _keywords.ContextualKeyword._await && + token.identifierRole == null && + token.scopeDepth === startToken.scopeDepth + ) { + return true; + } + index += 1; + } while (depth > 0 && index < tokens.tokens.length); + return false; +} exports.default = isAsyncOperation; diff --git a/node_modules/sucrase/dist/util/isExportFrom.js b/node_modules/sucrase/dist/util/isExportFrom.js new file mode 100644 index 0000000..830a0fe --- /dev/null +++ b/node_modules/sucrase/dist/util/isExportFrom.js @@ -0,0 +1,18 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + + +/** + * Starting at `export {`, look ahead and return `true` if this is an + * `export {...} from` statement and `false` if this is a plain multi-export. + */ + function isExportFrom(tokens) { + let closeBraceIndex = tokens.currentIndex(); + while (!tokens.matches1AtIndex(closeBraceIndex, _types.TokenType.braceR)) { + closeBraceIndex++; + } + return ( + tokens.matchesContextualAtIndex(closeBraceIndex + 1, _keywords.ContextualKeyword._from) && + tokens.matches1AtIndex(closeBraceIndex + 2, _types.TokenType.string) + ); +} exports.default = isExportFrom; diff --git a/node_modules/sucrase/dist/util/isIdentifier.js b/node_modules/sucrase/dist/util/isIdentifier.js new file mode 100644 index 0000000..8be8cf4 --- /dev/null +++ b/node_modules/sucrase/dist/util/isIdentifier.js @@ -0,0 +1,81 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _identifier = require('../parser/util/identifier'); + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar +// Hard-code a list of reserved words rather than trying to use keywords or contextual keywords +// from the parser, since currently there are various exceptions, like `package` being reserved +// but unused and various contextual keywords being reserved. Note that we assume that all code +// compiled by Sucrase is in a module, so strict mode words and await are all considered reserved +// here. +const RESERVED_WORDS = new Set([ + // Reserved keywords as of ECMAScript 2015 + "break", + "case", + "catch", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "export", + "extends", + "finally", + "for", + "function", + "if", + "import", + "in", + "instanceof", + "new", + "return", + "super", + "switch", + "this", + "throw", + "try", + "typeof", + "var", + "void", + "while", + "with", + "yield", + // Future reserved keywords + "enum", + "implements", + "interface", + "let", + "package", + "private", + "protected", + "public", + "static", + "await", + // Literals that cannot be used as identifiers + "false", + "null", + "true", +]); + +/** + * Determine if the given name is a legal variable name. + * + * This is needed when transforming TypeScript enums; if an enum key is a valid + * variable name, it might be referenced later in the enum, so we need to + * declare a variable. + */ + function isIdentifier(name) { + if (name.length === 0) { + return false; + } + if (!_identifier.IS_IDENTIFIER_START[name.charCodeAt(0)]) { + return false; + } + for (let i = 1; i < name.length; i++) { + if (!_identifier.IS_IDENTIFIER_CHAR[name.charCodeAt(i)]) { + return false; + } + } + return !RESERVED_WORDS.has(name); +} exports.default = isIdentifier; diff --git a/node_modules/sucrase/dist/util/removeMaybeImportAttributes.js b/node_modules/sucrase/dist/util/removeMaybeImportAttributes.js new file mode 100644 index 0000000..fd0b142 --- /dev/null +++ b/node_modules/sucrase/dist/util/removeMaybeImportAttributes.js @@ -0,0 +1,22 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords'); +var _types = require('../parser/tokenizer/types'); + + +/** + * Starting at a potential `with` or (legacy) `assert` token, remove the import + * attributes if they exist. + */ + function removeMaybeImportAttributes(tokens) { + if ( + tokens.matches2(_types.TokenType._with, _types.TokenType.braceL) || + (tokens.matches2(_types.TokenType.name, _types.TokenType.braceL) && tokens.matchesContextual(_keywords.ContextualKeyword._assert)) + ) { + // assert + tokens.removeToken(); + // { + tokens.removeToken(); + tokens.removeBalancedCode(); + // } + tokens.removeToken(); + } +} exports.removeMaybeImportAttributes = removeMaybeImportAttributes; diff --git a/node_modules/sucrase/dist/util/shouldElideDefaultExport.js b/node_modules/sucrase/dist/util/shouldElideDefaultExport.js new file mode 100644 index 0000000..3525feb --- /dev/null +++ b/node_modules/sucrase/dist/util/shouldElideDefaultExport.js @@ -0,0 +1,38 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types'); + + + +/** + * Common method sharing code between CJS and ESM cases, since they're the same here. + */ + function shouldElideDefaultExport( + isTypeScriptTransformEnabled, + keepUnusedImports, + tokens, + declarationInfo, +) { + if (!isTypeScriptTransformEnabled || keepUnusedImports) { + return false; + } + const exportToken = tokens.currentToken(); + if (exportToken.rhsEndIndex == null) { + throw new Error("Expected non-null rhsEndIndex on export token."); + } + // The export must be of the form `export default a` or `export default a;`. + const numTokens = exportToken.rhsEndIndex - tokens.currentIndex(); + if ( + numTokens !== 3 && + !(numTokens === 4 && tokens.matches1AtIndex(exportToken.rhsEndIndex - 1, _types.TokenType.semi)) + ) { + return false; + } + const identifierToken = tokens.tokenAtRelativeIndex(2); + if (identifierToken.type !== _types.TokenType.name) { + return false; + } + const exportedName = tokens.identifierNameForToken(identifierToken); + return ( + declarationInfo.typeDeclarations.has(exportedName) && + !declarationInfo.valueDeclarations.has(exportedName) + ); +} exports.default = shouldElideDefaultExport; diff --git a/node_modules/sucrase/package.json b/node_modules/sucrase/package.json new file mode 100644 index 0000000..508f80e --- /dev/null +++ b/node_modules/sucrase/package.json @@ -0,0 +1,89 @@ +{ + "name": "sucrase", + "version": "3.34.0", + "description": "Super-fast alternative to Babel for when you can target modern JS runtimes", + "author": "Alan Pierce ", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "bin": { + "sucrase": "./bin/sucrase", + "sucrase-node": "./bin/sucrase-node" + }, + "scripts": { + "build": "sucrase-node script/build.ts", + "fast-build": "sucrase-node script/build.ts --fast", + "clean": "rm -rf ./build ./dist ./dist-self-build ./dist-types ./example-runner/example-repos ./spec-compliance-tests/test262/test262-checkout ./spec-compliance-tests/babel-tests/babel-tests-checkout", + "generate": "sucrase-node generator/generate.ts", + "benchmark": "cd benchmark && yarn && sucrase-node ./benchmark.ts", + "benchmark-compare": "sucrase-node ./benchmark/compare-performance.ts", + "microbenchmark": "sucrase-node benchmark/microbenchmark.ts", + "lint": "sucrase-node script/lint.ts", + "lint-fix": "sucrase-node script/lint.ts --fix", + "profile": "node --inspect-brk ./node_modules/.bin/sucrase-node ./benchmark/profile", + "profile-project": "node --inspect-brk ./node_modules/.bin/sucrase-node ./benchmark/benchmark-project.ts --profile", + "prepublishOnly": "yarn clean && yarn build", + "release": "sucrase-node script/release.ts", + "run-examples": "sucrase-node example-runner/example-runner.ts", + "test": "yarn lint && yarn test-only", + "test-only": "mocha './test/**/*.ts'", + "integration-test": "cd integration-test && yarn && yarn link @sucrase/jest-plugin && mocha --timeout 10000 ./integration-tests.ts", + "test262": "sucrase-node spec-compliance-tests/test262/run-test262.ts", + "check-babel-tests": "sucrase-node spec-compliance-tests/babel-tests/check-babel-tests.ts", + "test-with-coverage": "nyc mocha './test/**/*.ts'", + "report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov" + }, + "repository": { + "type": "git", + "url": "https://github.com/alangpierce/sucrase.git" + }, + "keywords": [ + "babel", + "jsx", + "typescript", + "flow" + ], + "bugs": { + "url": "https://github.com/alangpierce/sucrase/issues" + }, + "devDependencies": { + "@babel/core": "^7.22.5", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/glob": "^7", + "@types/mocha": "^9.1.1", + "@types/mz": "^2.7.4", + "@types/node": "^20.3.2", + "@typescript-eslint/eslint-plugin": "^5.60.1", + "@typescript-eslint/parser": "^5.60.1", + "chalk": "^4", + "codecov": "^3.8.3", + "eslint": "^8.43.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "~2.26", + "eslint-plugin-prettier": "^4.2.1", + "mocha": "^10.2.0", + "nyc": "^15.1.0", + "prettier": "^2.8.8", + "sucrase": "^3.33.0", + "test262-harness": "^10.0.0", + "ts-interface-builder": "^0.3.3", + "typescript": "~5.0" + }, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "engines": { + "node": ">=8" + }, + "resolutions": { + "**/eshost/socket.io": "4.7.0" + } +} diff --git a/node_modules/sucrase/register/index.js b/node_modules/sucrase/register/index.js new file mode 100644 index 0000000..f6eb814 --- /dev/null +++ b/node_modules/sucrase/register/index.js @@ -0,0 +1 @@ +require("../dist/register").registerAll(); diff --git a/node_modules/sucrase/register/js.js b/node_modules/sucrase/register/js.js new file mode 100644 index 0000000..4891896 --- /dev/null +++ b/node_modules/sucrase/register/js.js @@ -0,0 +1 @@ +require("../dist/register").registerJS(); diff --git a/node_modules/sucrase/register/jsx.js b/node_modules/sucrase/register/jsx.js new file mode 100644 index 0000000..4bd476e --- /dev/null +++ b/node_modules/sucrase/register/jsx.js @@ -0,0 +1 @@ +require("../dist/register").registerJSX(); diff --git a/node_modules/sucrase/register/ts-legacy-module-interop.js b/node_modules/sucrase/register/ts-legacy-module-interop.js new file mode 100644 index 0000000..1ec5a6d --- /dev/null +++ b/node_modules/sucrase/register/ts-legacy-module-interop.js @@ -0,0 +1 @@ +require("../dist/register").registerTSLegacyModuleInterop(); diff --git a/node_modules/sucrase/register/ts.js b/node_modules/sucrase/register/ts.js new file mode 100644 index 0000000..23b8c88 --- /dev/null +++ b/node_modules/sucrase/register/ts.js @@ -0,0 +1 @@ +require("../dist/register").registerTS(); diff --git a/node_modules/sucrase/register/tsx-legacy-module-interop.js b/node_modules/sucrase/register/tsx-legacy-module-interop.js new file mode 100644 index 0000000..a883680 --- /dev/null +++ b/node_modules/sucrase/register/tsx-legacy-module-interop.js @@ -0,0 +1 @@ +require("../dist/register").registerTSXLegacyModuleInterop(); diff --git a/node_modules/sucrase/register/tsx.js b/node_modules/sucrase/register/tsx.js new file mode 100644 index 0000000..deb8b34 --- /dev/null +++ b/node_modules/sucrase/register/tsx.js @@ -0,0 +1 @@ +require("../dist/register").registerTSX(); diff --git a/node_modules/sucrase/ts-node-plugin/index.js b/node_modules/sucrase/ts-node-plugin/index.js new file mode 100644 index 0000000..b523fb3 --- /dev/null +++ b/node_modules/sucrase/ts-node-plugin/index.js @@ -0,0 +1,83 @@ +const {transform} = require("../dist"); + +// Enum constants taken from the TypeScript codebase. +const ModuleKindCommonJS = 1; + +const JsxEmitReactJSX = 4; +const JsxEmitReactJSXDev = 5; + +/** + * ts-node transpiler plugin + * + * This plugin hooks into ts-node so that Sucrase can handle all TS-to-JS + * conversion while ts-node handles the ESM loader, require hook, REPL + * integration, etc. ts-node automatically discovers the relevant tsconfig file, + * so the main logic in this integration is translating tsconfig options to the + * corresponding Sucrase options. + * + * Any tsconfig options relevant to Sucrase are translated, but some config + * options outside the scope of Sucrase are ignored. For example, we assume the + * isolatedModules option, and we ignore target because Sucrase doesn't provide + * JS syntax downleveling (at least not in a way that is useful for Node). + * + * One notable caveat is that importsNotUsedAsValues and preserveValueImports + * are ignored right now, since they are deprecated and don't have exact Sucrase + * equivalents. To preserve imports and exports, use verbatimModuleSyntax. + */ +function create(createOptions) { + const {nodeModuleEmitKind} = createOptions; + const { + module, + jsx, + jsxFactory, + jsxFragmentFactory, + jsxImportSource, + esModuleInterop, + verbatimModuleSyntax, + } = createOptions.service.config.options; + + return { + transpile(input, transpileOptions) { + const {fileName} = transpileOptions; + const transforms = []; + // Detect JS rather than TS so we bias toward including the typescript + // transform, since almost always it doesn't hurt to include. + const isJS = + fileName.endsWith(".js") || + fileName.endsWith(".jsx") || + fileName.endsWith(".mjs") || + fileName.endsWith(".cjs"); + if (!isJS) { + transforms.push("typescript"); + } + if (module === ModuleKindCommonJS || nodeModuleEmitKind === "nodecjs") { + transforms.push("imports"); + } + if (fileName.endsWith(".tsx") || fileName.endsWith(".jsx")) { + transforms.push("jsx"); + } + + const {code, sourceMap} = transform(input, { + transforms, + disableESTransforms: true, + jsxRuntime: jsx === JsxEmitReactJSX || jsx === JsxEmitReactJSXDev ? "automatic" : "classic", + production: jsx === JsxEmitReactJSX, + jsxImportSource, + jsxPragma: jsxFactory, + jsxFragmentPragma: jsxFragmentFactory, + keepUnusedImports: verbatimModuleSyntax, + preserveDynamicImport: nodeModuleEmitKind === "nodecjs", + injectCreateRequireForImportRequire: nodeModuleEmitKind === "nodeesm", + enableLegacyTypeScriptModuleInterop: !esModuleInterop, + sourceMapOptions: {compiledFilename: fileName}, + filePath: fileName, + }); + return { + outputText: code, + sourceMapText: JSON.stringify(sourceMap), + }; + }, + }; +} + +exports.create = create; diff --git a/node_modules/supports-preserve-symlinks-flag/.eslintrc b/node_modules/supports-preserve-symlinks-flag/.eslintrc new file mode 100644 index 0000000..346ffec --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/.eslintrc @@ -0,0 +1,14 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "browser": true, + "node": true, + }, + + "rules": { + "id-length": "off", + }, +} diff --git a/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml b/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml new file mode 100644 index 0000000..e8d64f3 --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/supports-preserve-symlink-flag +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/supports-preserve-symlinks-flag/.nycrc b/node_modules/supports-preserve-symlinks-flag/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md b/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md new file mode 100644 index 0000000..61f607f --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v1.0.0 - 2022-01-02 + +### Commits + +- Tests [`e2f59ad`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/e2f59ad74e2ae0f5f4899fcde6a6f693ab7cc074) +- Initial commit [`dc222aa`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/dc222aad3c0b940d8d3af1ca9937d108bd2dc4b9) +- [meta] do not publish workflow files [`5ef77f7`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/5ef77f7cb6946d16ee38672be9ec0f1bbdf63262) +- npm init [`992b068`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/992b068503a461f7e8676f40ca2aab255fd8d6ff) +- read me [`6c9afa9`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/6c9afa9fabc8eaf0814aaed6dd01e6df0931b76d) +- Initial implementation [`2f98925`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/2f9892546396d4ab0ad9f1ff83e76c3f01234ae8) +- [meta] add `auto-changelog` [`6c476ae`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/6c476ae1ed7ce68b0480344f090ac2844f35509d) +- [Dev Deps] add `eslint`, `@ljharb/eslint-config` [`d0fffc8`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/d0fffc886d25fba119355520750a909d64da0087) +- Only apps should have lockfiles [`ab318ed`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/ab318ed7ae62f6c2c0e80a50398d40912afd8f69) +- [meta] add `safe-publish-latest` [`2bb23b3`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/2bb23b3ebab02dc4135c4cdf0217db82835b9fca) +- [meta] add `sideEffects` flag [`600223b`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/600223ba24f30779f209d9097721eff35ed62741) diff --git a/node_modules/supports-preserve-symlinks-flag/LICENSE b/node_modules/supports-preserve-symlinks-flag/LICENSE new file mode 100644 index 0000000..2e7b9a3 --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Inspect JS + +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/supports-preserve-symlinks-flag/README.md b/node_modules/supports-preserve-symlinks-flag/README.md new file mode 100644 index 0000000..eb05b12 --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/README.md @@ -0,0 +1,42 @@ +# node-supports-preserve-symlinks-flag [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Determine if the current node version supports the `--preserve-symlinks` flag. + +## Example + +```js +var supportsPreserveSymlinks = require('node-supports-preserve-symlinks-flag'); +var assert = require('assert'); + +assert.equal(supportsPreserveSymlinks, null); // in a browser +assert.equal(supportsPreserveSymlinks, false); // in node < v6.2 +assert.equal(supportsPreserveSymlinks, true); // in node v6.2+ +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/node-supports-preserve-symlinks-flag +[npm-version-svg]: https://versionbadg.es/inspect-js/node-supports-preserve-symlinks-flag.svg +[deps-svg]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag.svg +[deps-url]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag +[dev-deps-svg]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/node-supports-preserve-symlinks-flag#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/node-supports-preserve-symlinks-flag.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/node-supports-preserve-symlinks-flag.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/node-supports-preserve-symlinks-flag.svg +[downloads-url]: https://npm-stat.com/charts.html?package=node-supports-preserve-symlinks-flag +[codecov-image]: https://codecov.io/gh/inspect-js/node-supports-preserve-symlinks-flag/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/node-supports-preserve-symlinks-flag/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/node-supports-preserve-symlinks-flag +[actions-url]: https://github.com/inspect-js/node-supports-preserve-symlinks-flag/actions diff --git a/node_modules/supports-preserve-symlinks-flag/browser.js b/node_modules/supports-preserve-symlinks-flag/browser.js new file mode 100644 index 0000000..087be1f --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/browser.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = null; diff --git a/node_modules/supports-preserve-symlinks-flag/index.js b/node_modules/supports-preserve-symlinks-flag/index.js new file mode 100644 index 0000000..86fd5d3 --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/index.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = ( +// node 12+ + process.allowedNodeEnvironmentFlags && process.allowedNodeEnvironmentFlags.has('--preserve-symlinks') +) || ( +// node v6.2 - v11 + String(module.constructor._findPath).indexOf('preserveSymlinks') >= 0 // eslint-disable-line no-underscore-dangle +); diff --git a/node_modules/supports-preserve-symlinks-flag/package.json b/node_modules/supports-preserve-symlinks-flag/package.json new file mode 100644 index 0000000..56edadc --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/package.json @@ -0,0 +1,70 @@ +{ + "name": "supports-preserve-symlinks-flag", + "version": "1.0.0", + "description": "Determine if the current node version supports the `--preserve-symlinks` flag.", + "main": "./index.js", + "browser": "./browser.js", + "exports": { + ".": [ + { + "browser": "./browser.js", + "default": "./index.js" + }, + "./index.js" + ], + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "lint": "eslint --ext=js,mjs .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/node-supports-preserve-symlinks-flag.git" + }, + "keywords": [ + "node", + "flag", + "symlink", + "symlinks", + "preserve-symlinks" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/node-supports-preserve-symlinks-flag/issues" + }, + "homepage": "https://github.com/inspect-js/node-supports-preserve-symlinks-flag#readme", + "devDependencies": { + "@ljharb/eslint-config": "^20.1.0", + "aud": "^1.1.5", + "auto-changelog": "^2.3.0", + "eslint": "^8.6.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "semver": "^6.3.0", + "tape": "^5.4.0" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + } +} diff --git a/node_modules/supports-preserve-symlinks-flag/test/index.js b/node_modules/supports-preserve-symlinks-flag/test/index.js new file mode 100644 index 0000000..9938d67 --- /dev/null +++ b/node_modules/supports-preserve-symlinks-flag/test/index.js @@ -0,0 +1,29 @@ +'use strict'; + +var test = require('tape'); +var semver = require('semver'); + +var supportsPreserveSymlinks = require('../'); +var browser = require('../browser'); + +test('supportsPreserveSymlinks', function (t) { + t.equal(typeof supportsPreserveSymlinks, 'boolean', 'is a boolean'); + + t.equal(browser, null, 'browser file is `null`'); + t.equal( + supportsPreserveSymlinks, + null, + 'in a browser, is null', + { skip: typeof window === 'undefined' } + ); + + var expected = semver.satisfies(process.version, '>= 6.2'); + t.equal( + supportsPreserveSymlinks, + expected, + 'is true in node v6.2+, false otherwise (actual: ' + supportsPreserveSymlinks + ', expected ' + expected + ')', + { skip: typeof window !== 'undefined' } + ); + + t.end(); +}); diff --git a/node_modules/tailwindcss/CHANGELOG.md b/node_modules/tailwindcss/CHANGELOG.md new file mode 100644 index 0000000..1cf0e2a --- /dev/null +++ b/node_modules/tailwindcss/CHANGELOG.md @@ -0,0 +1,2474 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +- Nothing yet! + +## [3.3.3] - 2023-07-13 + +### Fixed + +- Fix issue where some pseudo-element variants generated the wrong selector ([#10943](https://github.com/tailwindlabs/tailwindcss/pull/10943), [#10962](https://github.com/tailwindlabs/tailwindcss/pull/10962), [#11111](https://github.com/tailwindlabs/tailwindcss/pull/11111)) +- Make font settings propagate into buttons, inputs, etc. ([#10940](https://github.com/tailwindlabs/tailwindcss/pull/10940)) +- Fix parsing of `theme()` inside `calc()` when there are no spaces around operators ([#11157](https://github.com/tailwindlabs/tailwindcss/pull/11157)) +- Ensure `repeating-conic-gradient` is detected as an image ([#11180](https://github.com/tailwindlabs/tailwindcss/pull/11180)) +- Move unknown pseudo-elements outside of `:is` by default ([#11345](https://github.com/tailwindlabs/tailwindcss/pull/11345)) +- Escape animation names when prefixes contain special characters ([#11470](https://github.com/tailwindlabs/tailwindcss/pull/11470)) +- Don't prefix arbitrary classes in `group` and `peer` variants ([#11454](https://github.com/tailwindlabs/tailwindcss/pull/11454)) +- Sort classes using position of first matching rule ([#11504](https://github.com/tailwindlabs/tailwindcss/pull/11504)) +- Allow variant to be an at-rule without a prelude ([#11589](https://github.com/tailwindlabs/tailwindcss/pull/11589)) +- Make PostCSS plugin async to improve performance ([#11548](https://github.com/tailwindlabs/tailwindcss/pull/11548)) +- Don’t error when a config file is missing ([f97759f](https://github.com/tailwindlabs/tailwindcss/commit/f97759f808d15ace66647b1405744fcf95a392e5)) + +### Added + +- Add `aria-busy` utility ([#10966](https://github.com/tailwindlabs/tailwindcss/pull/10966)) + +### Changed + +- Reset padding for `` elements in preflight ([#11069](https://github.com/tailwindlabs/tailwindcss/pull/11069)) + +## [3.3.2] - 2023-04-25 + +### Fixed + +- Don’t move unknown pseudo-elements to the end of selectors ([#10943](https://github.com/tailwindlabs/tailwindcss/pull/10943), [#10962](https://github.com/tailwindlabs/tailwindcss/pull/10962)) +- Inherit gradient stop positions when using variants ([#11002](https://github.com/tailwindlabs/tailwindcss/pull/11002)) +- Honor default `to` position of gradient when using implicit transparent colors ([#11002](https://github.com/tailwindlabs/tailwindcss/pull/11002)) +- Ensure `@tailwindcss/oxide` doesn't leak in the stable engine ([#10988](https://github.com/tailwindlabs/tailwindcss/pull/10988)) +- Ensure multiple `theme(spacing[5])` calls with bracket notation in arbitrary properties work ([#11039](https://github.com/tailwindlabs/tailwindcss/pull/11039)) +- Normalize arbitrary modifiers ([#11057](https://github.com/tailwindlabs/tailwindcss/pull/11057)) + +### Changed + +- Drop support for Node.js v12 ([#11089](https://github.com/tailwindlabs/tailwindcss/pull/11089)) + +## [3.3.1] - 2023-03-30 + +### Fixed + +- Fix edge case bug when loading a TypeScript config file with webpack ([#10898](https://github.com/tailwindlabs/tailwindcss/pull/10898)) +- Fix variant, `@apply`, and `important` selectors when using `:is()` or `:has()` with pseudo-elements ([#10903](https://github.com/tailwindlabs/tailwindcss/pull/10903)) +- Fix `safelist` config types ([#10901](https://github.com/tailwindlabs/tailwindcss/pull/10901)) +- Fix build errors caused by `@tailwindcss/line-clamp` warning ([#10915](https://github.com/tailwindlabs/tailwindcss/pull/10915), [#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) +- Fix "process is not defined" error ([#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919)) + +## [3.3.0] - 2023-03-27 + +### Added + +- Support ESM and TypeScript config files ([#10785](https://github.com/tailwindlabs/tailwindcss/pull/10785)) +- Extend default color palette with new 950 shades ([#10879](https://github.com/tailwindlabs/tailwindcss/pull/10879)) +- Add `line-height` modifier support to `font-size` utilities ([#9875](https://github.com/tailwindlabs/tailwindcss/pull/9875)) +- Add support for using variables as arbitrary values without `var(...)` ([#9880](https://github.com/tailwindlabs/tailwindcss/pull/9880), [#9962](https://github.com/tailwindlabs/tailwindcss/pull/9962)) +- Add logical properties support for inline direction ([#10166](https://github.com/tailwindlabs/tailwindcss/pull/10166)) +- Add `hyphens` utilities ([#10071](https://github.com/tailwindlabs/tailwindcss/pull/10071)) +- Add `from-{position}`, `via-{position}` and `to-{position}` utilities ([#10886](https://github.com/tailwindlabs/tailwindcss/pull/10886)) +- Add `list-style-image` utilities ([#10817](https://github.com/tailwindlabs/tailwindcss/pull/10817)) +- Add `caption-side` utilities ([#10470](https://github.com/tailwindlabs/tailwindcss/pull/10470)) +- Add `line-clamp` utilities from `@tailwindcss/line-clamp` to core ([#10768](https://github.com/tailwindlabs/tailwindcss/pull/10768), [#10876](https://github.com/tailwindlabs/tailwindcss/pull/10876), [#10862](https://github.com/tailwindlabs/tailwindcss/pull/10862)) +- Add `delay-0` and `duration-0` utilities ([#10294](https://github.com/tailwindlabs/tailwindcss/pull/10294)) +- Add `justify-normal` and `justify-stretch` utilities ([#10560](https://github.com/tailwindlabs/tailwindcss/pull/10560)) +- Add `content-normal` and `content-stretch` utilities ([#10645](https://github.com/tailwindlabs/tailwindcss/pull/10645)) +- Add `whitespace-break-spaces` utility ([#10729](https://github.com/tailwindlabs/tailwindcss/pull/10729)) +- Add support for configuring default `font-variation-settings` for a `font-family` ([#10034](https://github.com/tailwindlabs/tailwindcss/pull/10034), [#10515](https://github.com/tailwindlabs/tailwindcss/pull/10515)) + +### Fixed + +- Disallow using multiple selectors in arbitrary variants ([#10655](https://github.com/tailwindlabs/tailwindcss/pull/10655)) +- Sort class lists deterministically for Prettier plugin ([#10672](https://github.com/tailwindlabs/tailwindcss/pull/10672)) +- Ensure CLI builds have a non-zero exit code on failure ([#10703](https://github.com/tailwindlabs/tailwindcss/pull/10703)) +- Ensure module dependencies for value `null`, is an empty `Set` ([#10877](https://github.com/tailwindlabs/tailwindcss/pull/10877)) +- Fix format assumption when resolving module dependencies ([#10878](https://github.com/tailwindlabs/tailwindcss/pull/10878)) + +### Changed + +- Mark `rtl` and `ltr` variants as stable and remove warnings ([#10764](https://github.com/tailwindlabs/tailwindcss/pull/10764)) +- Use `inset` instead of `top`, `right`, `bottom`, and `left` properties ([#10765](https://github.com/tailwindlabs/tailwindcss/pull/10765)) +- Make `dark` and `rtl`/`ltr` variants insensitive to DOM order ([#10766](https://github.com/tailwindlabs/tailwindcss/pull/10766)) +- Use `:is` to make important selector option insensitive to DOM order ([#10835](https://github.com/tailwindlabs/tailwindcss/pull/10835)) + +## [3.2.7] - 2023-02-16 + +### Fixed + +- Fix use of `:where(.btn)` when matching `!btn` ([#10601](https://github.com/tailwindlabs/tailwindcss/pull/10601)) +- Revert including `outline-color` in `transition` and `transition-colors` by default ([#10604](https://github.com/tailwindlabs/tailwindcss/pull/10604)) + +## [3.2.6] - 2023-02-08 + +### Fixed + +- Fix installation failing with yarn and pnpm by dropping `oxide-api-shim` ([add1636](https://github.com/tailwindlabs/tailwindcss/commit/add16364b4b1100e1af23ad1ca6900a0b53cbba0)) + +## [3.2.5] - 2023-02-08 + +### Added + +- Add standalone CLI build for 64-bit Windows on ARM (`node16-win-arm64`) ([#10001](https://github.com/tailwindlabs/tailwindcss/pull/10001)) + +### Fixed + +- Cleanup unused `variantOrder` ([#9829](https://github.com/tailwindlabs/tailwindcss/pull/9829)) +- Fix `foo-[abc]/[def]` not being handled correctly ([#9866](https://github.com/tailwindlabs/tailwindcss/pull/9866)) +- Add container queries plugin to standalone CLI ([#9865](https://github.com/tailwindlabs/tailwindcss/pull/9865)) +- Support renaming of output files by PostCSS plugins in CLI ([#9944](https://github.com/tailwindlabs/tailwindcss/pull/9944)) +- Improve return value of `resolveConfig`, unwrap `ResolvableTo` ([#9972](https://github.com/tailwindlabs/tailwindcss/pull/9972)) +- Clip unbalanced brackets in arbitrary values ([#9973](https://github.com/tailwindlabs/tailwindcss/pull/9973)) +- Don’t reorder webkit scrollbar pseudo elements ([#9991](https://github.com/tailwindlabs/tailwindcss/pull/9991)) +- Deterministic sorting of arbitrary variants ([#10016](https://github.com/tailwindlabs/tailwindcss/pull/10016)) +- Add `data` key to theme types ([#10023](https://github.com/tailwindlabs/tailwindcss/pull/10023)) +- Prevent invalid arbitrary variant selectors from failing the build ([#10059](https://github.com/tailwindlabs/tailwindcss/pull/10059)) +- Properly handle subtraction followed by a variable ([#10074](https://github.com/tailwindlabs/tailwindcss/pull/10074)) +- Fix missing `string[]` in the `theme.dropShadow` types ([#10072](https://github.com/tailwindlabs/tailwindcss/pull/10072)) +- Update list of length units ([#10100](https://github.com/tailwindlabs/tailwindcss/pull/10100)) +- Fix not matching arbitrary properties when closely followed by square brackets ([#10212](https://github.com/tailwindlabs/tailwindcss/pull/10212)) +- Allow direct nesting in `root` or `@layer` nodes ([#10229](https://github.com/tailwindlabs/tailwindcss/pull/10229)) +- Don't prefix classes in arbitrary variants ([#10214](https://github.com/tailwindlabs/tailwindcss/pull/10214)) +- Fix perf regression when checking for changed content ([#10234](https://github.com/tailwindlabs/tailwindcss/pull/10234)) +- Fix missing `blocklist` member in the `Config` type ([#10239](https://github.com/tailwindlabs/tailwindcss/pull/10239)) +- Escape group names in selectors ([#10276](https://github.com/tailwindlabs/tailwindcss/pull/10276)) +- Consider earlier variants before sorting functions ([#10288](https://github.com/tailwindlabs/tailwindcss/pull/10288)) +- Allow variants with slashes ([#10336](https://github.com/tailwindlabs/tailwindcss/pull/10336)) +- Ensure generated CSS is always sorted in the same order for a given set of templates ([#10382](https://github.com/tailwindlabs/tailwindcss/pull/10382)) +- Handle variants when the same class appears multiple times in a selector ([#10397](https://github.com/tailwindlabs/tailwindcss/pull/10397)) +- Handle group/peer variants with quoted strings ([#10400](https://github.com/tailwindlabs/tailwindcss/pull/10400)) +- Parse alpha value from rgba/hsla colors when using variables ([#10429](https://github.com/tailwindlabs/tailwindcss/pull/10429)) +- Sort by `layer` inside `variants` layer ([#10505](https://github.com/tailwindlabs/tailwindcss/pull/10505)) +- Add `--watch=always` option to prevent exit when stdin closes ([#9966](https://github.com/tailwindlabs/tailwindcss/pull/9966)) + +### Changed + +- Alphabetize `theme` keys in default config ([#9953](https://github.com/tailwindlabs/tailwindcss/pull/9953)) +- Update esbuild to v17 ([#10368](https://github.com/tailwindlabs/tailwindcss/pull/10368)) +- Include `outline-color` in `transition` and `transition-colors` utilities ([#10385](https://github.com/tailwindlabs/tailwindcss/pull/10385)) + +## [3.2.4] - 2022-11-11 + +### Added + +- Add `blocklist` option to prevent generating unwanted CSS ([#9812](https://github.com/tailwindlabs/tailwindcss/pull/9812)) + +### Fixed + +- Fix watching of files on Linux when renames are involved ([#9796](https://github.com/tailwindlabs/tailwindcss/pull/9796)) +- Make sure errors are always displayed when watching for changes ([#9810](https://github.com/tailwindlabs/tailwindcss/pull/9810)) + +## [3.2.3] - 2022-11-09 + +### Fixed + +- Fixed use of `raw` content in the CLI ([#9773](https://github.com/tailwindlabs/tailwindcss/pull/9773)) +- Pick up changes from files that are both context and content deps ([#9787](https://github.com/tailwindlabs/tailwindcss/pull/9787)) +- Sort pseudo-elements ONLY after classes when using variants and `@apply` ([#9765](https://github.com/tailwindlabs/tailwindcss/pull/9765)) +- Support important utilities in the safelist (pattern must include a `!`) ([#9791](https://github.com/tailwindlabs/tailwindcss/pull/9791)) + +## [3.2.2] - 2022-11-04 + +### Fixed + +- Escape special characters in resolved content base paths ([#9650](https://github.com/tailwindlabs/tailwindcss/pull/9650)) +- Don't reuse container for array returning variant functions ([#9644](https://github.com/tailwindlabs/tailwindcss/pull/9644)) +- Exclude non-relevant selectors when generating rules with the important modifier ([#9677](https://github.com/tailwindlabs/tailwindcss/issues/9677)) +- Fix merging of arrays during config resolution ([#9706](https://github.com/tailwindlabs/tailwindcss/issues/9706)) +- Ensure configured `font-feature-settings` are included in Preflight ([#9707](https://github.com/tailwindlabs/tailwindcss/pull/9707)) +- Fix fractional values not being parsed properly inside arbitrary properties ([#9705](https://github.com/tailwindlabs/tailwindcss/pull/9705)) +- Fix incorrect selectors when using `@apply` in selectors with combinators and pseudos ([#9722](https://github.com/tailwindlabs/tailwindcss/pull/9722)) +- Fix cannot read properties of undefined (reading 'modifier') ([#9656](https://github.com/tailwindlabs/tailwindcss/pull/9656), [aa979d6](https://github.com/tailwindlabs/tailwindcss/commit/aa979d645f8bf4108c5fc938d7c0ba085b654c31)) + +## [3.2.1] - 2022-10-21 + +### Fixed + +- Fix missing `supports` in types ([#9616](https://github.com/tailwindlabs/tailwindcss/pull/9616)) +- Fix missing PostCSS dependencies in the CLI ([#9617](https://github.com/tailwindlabs/tailwindcss/pull/9617)) +- Ensure `micromatch` is a proper CLI dependency ([#9620](https://github.com/tailwindlabs/tailwindcss/pull/9620)) +- Ensure modifier values exist when using a `modifiers` object for `matchVariant` ([ba6551d](https://github.com/tailwindlabs/tailwindcss/commit/ba6551db0f2726461371b4f3c6cd4c7090888504)) + +## [3.2.0] - 2022-10-19 + +### Added + +- Add new `@config` directive ([#9405](https://github.com/tailwindlabs/tailwindcss/pull/9405)) +- Add new `relative: true` option to resolve content paths relative to the config file ([#9396](https://github.com/tailwindlabs/tailwindcss/pull/9396)) +- Add new `supports-*` variant ([#9453](https://github.com/tailwindlabs/tailwindcss/pull/9453)) +- Add new `min-*` and `max-*` variants ([#9558](https://github.com/tailwindlabs/tailwindcss/pull/9558)) +- Add new `aria-*` variants ([#9557](https://github.com/tailwindlabs/tailwindcss/pull/9557), [#9588](https://github.com/tailwindlabs/tailwindcss/pull/9588)) +- Add new `data-*` variants ([#9559](https://github.com/tailwindlabs/tailwindcss/pull/9559), [#9588](https://github.com/tailwindlabs/tailwindcss/pull/9588)) +- Add new `break-keep` utility for `word-break: keep-all` ([#9393](https://github.com/tailwindlabs/tailwindcss/pull/9393)) +- Add new `collapse` utility for `visibility: collapse` ([#9181](https://github.com/tailwindlabs/tailwindcss/pull/9181)) +- Add new `fill-none` utility for `fill: none` ([#9403](https://github.com/tailwindlabs/tailwindcss/pull/9403)) +- Add new `stroke-none` utility for `stroke: none` ([#9403](https://github.com/tailwindlabs/tailwindcss/pull/9403)) +- Add new `place-content-baseline` utility for `place-content: baseline` ([#9498](https://github.com/tailwindlabs/tailwindcss/pull/9498)) +- Add new `place-items-baseline` utility for `place-items: baseline` ([#9507](https://github.com/tailwindlabs/tailwindcss/pull/9507)) +- Add new `content-baseline` utility for `align-content: baseline` ([#9507](https://github.com/tailwindlabs/tailwindcss/pull/9507)) +- Add support for configuring default `font-feature-settings` for a font family ([#9039](https://github.com/tailwindlabs/tailwindcss/pull/9039)) +- Add standalone CLI build for 32-bit Linux on ARM (`node16-linux-armv7`) ([#9084](https://github.com/tailwindlabs/tailwindcss/pull/9084)) +- Add future flag to disable color opacity utility plugins ([#9088](https://github.com/tailwindlabs/tailwindcss/pull/9088)) +- Add negative value support for `outline-offset` ([#9136](https://github.com/tailwindlabs/tailwindcss/pull/9136)) +- Add support for modifiers to `matchUtilities` ([#9541](https://github.com/tailwindlabs/tailwindcss/pull/9541)) +- Allow negating utilities using `min`/`max`/`clamp` ([#9237](https://github.com/tailwindlabs/tailwindcss/pull/9237)) +- Implement fallback plugins when there is ambiguity between plugins when using arbitrary values ([#9376](https://github.com/tailwindlabs/tailwindcss/pull/9376)) +- Support `sort` function in `matchVariant` ([#9423](https://github.com/tailwindlabs/tailwindcss/pull/9423)) +- Upgrade to `postcss-nested` v6.0 ([#9546](https://github.com/tailwindlabs/tailwindcss/pull/9546)) + +### Fixed + +- Use absolute paths when resolving changed files for resilience against working directory changes ([#9032](https://github.com/tailwindlabs/tailwindcss/pull/9032)) +- Fix ring color utility generation when using `respectDefaultRingColorOpacity` ([#9070](https://github.com/tailwindlabs/tailwindcss/pull/9070)) +- Sort tags before classes when `@apply`-ing a selector with joined classes ([#9107](https://github.com/tailwindlabs/tailwindcss/pull/9107)) +- Remove invalid `outline-hidden` utility ([#9147](https://github.com/tailwindlabs/tailwindcss/pull/9147)) +- Honor the `hidden` attribute on elements in preflight ([#9174](https://github.com/tailwindlabs/tailwindcss/pull/9174)) +- Don't stop watching atomically renamed files ([#9173](https://github.com/tailwindlabs/tailwindcss/pull/9173), [#9215](https://github.com/tailwindlabs/tailwindcss/pull/9215)) +- Fix duplicate utilities issue causing memory leaks ([#9208](https://github.com/tailwindlabs/tailwindcss/pull/9208)) +- Fix `fontFamily` config TypeScript types ([#9214](https://github.com/tailwindlabs/tailwindcss/pull/9214)) +- Handle variants on complex selector utilities ([#9262](https://github.com/tailwindlabs/tailwindcss/pull/9262)) +- Fix shared config mutation issue ([#9294](https://github.com/tailwindlabs/tailwindcss/pull/9294)) +- Fix ordering of parallel variants ([#9282](https://github.com/tailwindlabs/tailwindcss/pull/9282)) +- Handle variants in utility selectors using `:where()` and `:has()` ([#9309](https://github.com/tailwindlabs/tailwindcss/pull/9309)) +- Improve data type analysis for arbitrary values ([#9320](https://github.com/tailwindlabs/tailwindcss/pull/9320)) +- Don't emit generated utilities with invalid uses of theme functions ([#9319](https://github.com/tailwindlabs/tailwindcss/pull/9319)) +- Revert change that only listened for stdin close on TTYs ([#9331](https://github.com/tailwindlabs/tailwindcss/pull/9331)) +- Ignore unset values (like `null` or `undefined`) when resolving the classList for intellisense ([#9385](https://github.com/tailwindlabs/tailwindcss/pull/9385)) +- Improve type checking for formal syntax ([#9349](https://github.com/tailwindlabs/tailwindcss/pull/9349), [#9448](https://github.com/tailwindlabs/tailwindcss/pull/9448)) +- Fix incorrect required `content` key in custom plugin configs ([#9502](https://github.com/tailwindlabs/tailwindcss/pull/9502), [#9545](https://github.com/tailwindlabs/tailwindcss/pull/9545)) +- Fix content path detection on Windows ([#9569](https://github.com/tailwindlabs/tailwindcss/pull/9569)) +- Ensure `--content` is used in the CLI when passed ([#9587](https://github.com/tailwindlabs/tailwindcss/pull/9587)) + +## [3.1.8] - 2022-08-05 + +### Fixed + +- Don’t prefix classes within reused arbitrary variants ([#8992](https://github.com/tailwindlabs/tailwindcss/pull/8992)) +- Fix usage of alpha values inside single-named colors that are functions ([#9008](https://github.com/tailwindlabs/tailwindcss/pull/9008)) +- Fix `@apply` of user utilities when negative and non-negative versions both exist ([#9027](https://github.com/tailwindlabs/tailwindcss/pull/9027)) + +## [3.1.7] - 2022-07-29 + +### Fixed + +- Don't rewrite source maps for `@layer` rules ([#8971](https://github.com/tailwindlabs/tailwindcss/pull/8971)) + +### Added + +- Added types for `resolveConfig` ([#8924](https://github.com/tailwindlabs/tailwindcss/pull/8924)) + +## [3.1.6] - 2022-07-11 + +### Fixed + +- Fix usage on Node 12.x ([b4e637e](https://github.com/tailwindlabs/tailwindcss/commit/b4e637e2e096a9d6f2210efba9541f6fd4f28e56)) +- Handle theme keys with slashes when using `theme()` in CSS ([#8831](https://github.com/tailwindlabs/tailwindcss/pull/8831)) + +## [3.1.5] - 2022-07-07 + +### Added + +- Support configuring a default `font-weight` for each font size utility ([#8763](https://github.com/tailwindlabs/tailwindcss/pull/8763)) +- Add support for alpha values in safe list ([#8774](https://github.com/tailwindlabs/tailwindcss/pull/8774)) + +### Fixed + +- Improve types to support fallback values in the CSS-in-JS syntax used in plugin APIs ([#8762](https://github.com/tailwindlabs/tailwindcss/pull/8762)) +- Support including `tailwindcss` and `autoprefixer` in `postcss.config.js` in standalone CLI ([#8769](https://github.com/tailwindlabs/tailwindcss/pull/8769)) +- Fix using special-characters as prefixes ([#8772](https://github.com/tailwindlabs/tailwindcss/pull/8772)) +- Don’t prefix classes used within arbitrary variants ([#8773](https://github.com/tailwindlabs/tailwindcss/pull/8773)) +- Add more explicit types for the default theme ([#8780](https://github.com/tailwindlabs/tailwindcss/pull/8780)) + +## [3.1.4] - 2022-06-21 + +### Fixed + +- Provide default to `` when using `theme()` ([#8652](https://github.com/tailwindlabs/tailwindcss/pull/8652)) +- Detect arbitrary variants with quotes ([#8687](https://github.com/tailwindlabs/tailwindcss/pull/8687)) +- Don’t add spaces around raw `/` that are preceded by numbers ([#8688](https://github.com/tailwindlabs/tailwindcss/pull/8688)) + +## [3.1.3] - 2022-06-14 + +### Fixed + +- Fix extraction of multi-word utilities with arbitrary values and quotes ([#8604](https://github.com/tailwindlabs/tailwindcss/pull/8604)) +- Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587)) +- Ignore PostCSS nodes returned by `addVariant` ([#8608](https://github.com/tailwindlabs/tailwindcss/pull/8608)) +- Fix missing spaces around arithmetic operators ([#8615](https://github.com/tailwindlabs/tailwindcss/pull/8615)) +- Detect alpha value in CSS `theme()` function when using quotes ([#8625](https://github.com/tailwindlabs/tailwindcss/pull/8625)) +- Fix "Maximum call stack size exceeded" bug ([#8636](https://github.com/tailwindlabs/tailwindcss/pull/8636)) +- Allow functions returning parallel variants to mutate the container ([#8622](https://github.com/tailwindlabs/tailwindcss/pull/8622)) +- Remove text opacity CSS variables from `::marker` ([#8622](https://github.com/tailwindlabs/tailwindcss/pull/8622)) + +## [3.1.2] - 2022-06-10 + +### Fixed + +- Ensure `\` is a valid arbitrary variant token ([#8576](https://github.com/tailwindlabs/tailwindcss/pull/8576)) +- Enable `postcss-import` in the CLI by default in watch mode ([#8574](https://github.com/tailwindlabs/tailwindcss/pull/8574), [#8580](https://github.com/tailwindlabs/tailwindcss/pull/8580)) + +## [3.1.1] - 2022-06-09 + +### Fixed + +- Fix candidate extractor regression ([#8558](https://github.com/tailwindlabs/tailwindcss/pull/8558)) +- Split `::backdrop` into separate defaults group ([#8567](https://github.com/tailwindlabs/tailwindcss/pull/8567)) +- Fix postcss plugin type ([#8564](https://github.com/tailwindlabs/tailwindcss/pull/8564)) +- Fix class detection in markdown code fences and slim templates ([#8569](https://github.com/tailwindlabs/tailwindcss/pull/8569)) + +## [3.1.0] - 2022-06-08 + +### Fixed + +- Types: allow for arbitrary theme values (for 3rd party plugins) ([#7926](https://github.com/tailwindlabs/tailwindcss/pull/7926)) +- Don’t split vars with numbers in them inside arbitrary values ([#8091](https://github.com/tailwindlabs/tailwindcss/pull/8091)) +- Require matching prefix when detecting negatives ([#8121](https://github.com/tailwindlabs/tailwindcss/pull/8121)) +- Handle duplicate At Rules without children ([#8122](https://github.com/tailwindlabs/tailwindcss/pull/8122)) +- Allow arbitrary values with commas in `@apply` ([#8125](https://github.com/tailwindlabs/tailwindcss/pull/8125)) +- Fix intellisense for plugins with multiple `@apply` rules ([#8213](https://github.com/tailwindlabs/tailwindcss/pull/8213)) +- Improve type detection for arbitrary color values ([#8201](https://github.com/tailwindlabs/tailwindcss/pull/8201)) +- Support PostCSS config options in config file in CLI ([#8226](https://github.com/tailwindlabs/tailwindcss/pull/8226)) +- Remove default `[hidden]` style in preflight ([#8248](https://github.com/tailwindlabs/tailwindcss/pull/8248)) +- Only check selectors containing base apply candidates for circular dependencies ([#8222](https://github.com/tailwindlabs/tailwindcss/pull/8222)) +- Rewrite default class extractor ([#8204](https://github.com/tailwindlabs/tailwindcss/pull/8204)) +- Move `important` selector to the front when `@apply`-ing selector-modifying variants in custom utilities ([#8313](https://github.com/tailwindlabs/tailwindcss/pull/8313)) +- Error when registering an invalid custom variant ([#8345](https://github.com/tailwindlabs/tailwindcss/pull/8345)) +- Create tailwind.config.cjs file in ESM package when running init ([#8363](https://github.com/tailwindlabs/tailwindcss/pull/8363)) +- Fix `matchVariant` that use at-rules and placeholders ([#8392](https://github.com/tailwindlabs/tailwindcss/pull/8392)) +- Improve types of the `tailwindcss/plugin` ([#8400](https://github.com/tailwindlabs/tailwindcss/pull/8400)) +- Allow returning parallel variants from `addVariant` or `matchVariant` callback functions ([#8455](https://github.com/tailwindlabs/tailwindcss/pull/8455)) +- Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270)) +- Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587)) +- Don't inherit `to` value from parent gradients ([#8489](https://github.com/tailwindlabs/tailwindcss/pull/8489)) +- Remove process dependency from log functions ([#8530](https://github.com/tailwindlabs/tailwindcss/pull/8530)) +- Ensure we can use `@import 'tailwindcss/...'` without node_modules ([#8537](https://github.com/tailwindlabs/tailwindcss/pull/8537)) + +### Changed + +- Only apply hover styles when supported (future) ([#8394](https://github.com/tailwindlabs/tailwindcss/pull/8394)) +- Respect default ring color opacity (future) ([#8448](https://github.com/tailwindlabs/tailwindcss/pull/8448), [3f4005e](https://github.com/tailwindlabs/tailwindcss/commit/3f4005e833445f7549219eb5ae89728cbb3a2630)) + +### Added + +- Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291)) +- Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656)) +- Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800)) +- Add `--poll` option to the CLI ([#7725](https://github.com/tailwindlabs/tailwindcss/pull/7725)) +- Add new `border-spacing` utilities ([#7102](https://github.com/tailwindlabs/tailwindcss/pull/7102)) +- Add `enabled` variant ([#7905](https://github.com/tailwindlabs/tailwindcss/pull/7905)) +- Add TypeScript types for the `tailwind.config.js` file ([#7891](https://github.com/tailwindlabs/tailwindcss/pull/7891)) +- Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924), [#8526](https://github.com/tailwindlabs/tailwindcss/pull/8526)) +- Add `grid-flow-dense` utility ([#8193](https://github.com/tailwindlabs/tailwindcss/pull/8193)) +- Add `mix-blend-plus-lighter` utility ([#8288](https://github.com/tailwindlabs/tailwindcss/pull/8288)) +- Add arbitrary variants ([#8299](https://github.com/tailwindlabs/tailwindcss/pull/8299)) +- Add experimental `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310), [34fd0fb8](https://github.com/tailwindlabs/tailwindcss/commit/34fd0fb82aa574cddc5c7aa3ad7d1af5e3735e5d)) +- Add `prefers-contrast` media query variants ([#8410](https://github.com/tailwindlabs/tailwindcss/pull/8410)) +- Add opacity support when referencing colors with `theme` function ([#8416](https://github.com/tailwindlabs/tailwindcss/pull/8416)) +- Add `postcss-import` support to the CLI ([#8437](https://github.com/tailwindlabs/tailwindcss/pull/8437)) +- Add `optional` variant ([#8486](https://github.com/tailwindlabs/tailwindcss/pull/8486)) +- Add `` placeholder support for custom colors ([#8501](https://github.com/tailwindlabs/tailwindcss/pull/8501)) + +## [3.0.24] - 2022-04-12 + +### Fixed + +- Prevent nesting plugin from breaking other plugins ([#7563](https://github.com/tailwindlabs/tailwindcss/pull/7563)) +- Recursively collapse adjacent rules ([#7565](https://github.com/tailwindlabs/tailwindcss/pull/7565)) +- Preserve source maps for generated CSS ([#7588](https://github.com/tailwindlabs/tailwindcss/pull/7588)) +- Split box shadows on top-level commas only ([#7479](https://github.com/tailwindlabs/tailwindcss/pull/7479)) +- Use local user CSS cache for `@apply` ([#7524](https://github.com/tailwindlabs/tailwindcss/pull/7524)) +- Invalidate context when main CSS changes ([#7626](https://github.com/tailwindlabs/tailwindcss/pull/7626)) +- Only add `!` to selector class matching template candidate when using important modifier with multi-class selectors ([#7664](https://github.com/tailwindlabs/tailwindcss/pull/7664)) +- Correctly parse and prefix animation names with dots ([#7163](https://github.com/tailwindlabs/tailwindcss/pull/7163)) +- Fix extraction from template literal/function with array ([#7481](https://github.com/tailwindlabs/tailwindcss/pull/7481)) +- Don't output unparsable arbitrary values ([#7789](https://github.com/tailwindlabs/tailwindcss/pull/7789)) +- Fix generation of `div:not(.foo)` if `.foo` is never defined ([#7815](https://github.com/tailwindlabs/tailwindcss/pull/7815)) +- Allow for custom properties in `rgb`, `rgba`, `hsl` and `hsla` colors ([#7933](https://github.com/tailwindlabs/tailwindcss/pull/7933)) +- Remove autoprefixer as explicit peer-dependency to avoid invalid warnings in situations where it isn't actually needed ([#7949](https://github.com/tailwindlabs/tailwindcss/pull/7949)) +- Ensure the `percentage` data type is validated correctly ([#8015](https://github.com/tailwindlabs/tailwindcss/pull/8015)) +- Make sure `font-weight` is inherited by form controls in all browsers ([#8078](https://github.com/tailwindlabs/tailwindcss/pull/8078)) + +### Changed + +- Replace `chalk` with `picocolors` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6039)) +- Replace `cosmiconfig` with `lilconfig` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6038)) +- Update `cssnano` to avoid removing empty variables when minifying ([#7818](https://github.com/tailwindlabs/tailwindcss/pull/7818)) + +## [3.0.23] - 2022-02-16 + +### Fixed + +- Remove opacity variables from `:visited` pseudo class ([#7458](https://github.com/tailwindlabs/tailwindcss/pull/7458)) +- Support arbitrary values + calc + theme with quotes ([#7462](https://github.com/tailwindlabs/tailwindcss/pull/7462)) +- Don't duplicate layer output when scanning content with variants + wildcards ([#7478](https://github.com/tailwindlabs/tailwindcss/pull/7478)) +- Implement `getClassOrder` instead of `sortClassList` ([#7459](https://github.com/tailwindlabs/tailwindcss/pull/7459)) + +## [3.0.22] - 2022-02-11 + +### Fixed + +- Temporarily move `postcss` to dependencies ([#7424](https://github.com/tailwindlabs/tailwindcss/pull/7424)) + +## [3.0.21] - 2022-02-10 + +### Fixed + +- Move prettier plugin to dev dependencies ([#7418](https://github.com/tailwindlabs/tailwindcss/pull/7418)) + +## [3.0.20] - 2022-02-10 + +### Added + +- Expose `context.sortClassList(classes)` ([#7412](https://github.com/tailwindlabs/tailwindcss/pull/7412)) + +## [3.0.19] - 2022-02-07 + +### Fixed + +- Fix preflight border color fallback ([#7288](https://github.com/tailwindlabs/tailwindcss/pull/7288)) +- Correctly parse shadow lengths without a leading zero ([#7289](https://github.com/tailwindlabs/tailwindcss/pull/7289)) +- Don't crash when scanning extremely long class candidates ([#7331](https://github.com/tailwindlabs/tailwindcss/pull/7331)) +- Use less hacky fix for URLs detected as custom properties ([#7275](https://github.com/tailwindlabs/tailwindcss/pull/7275)) +- Correctly generate negative utilities when dash is before the prefix ([#7295](https://github.com/tailwindlabs/tailwindcss/pull/7295)) +- Detect prefixed negative utilities in the safelist ([#7295](https://github.com/tailwindlabs/tailwindcss/pull/7295)) + +## [3.0.18] - 2022-01-28 + +### Fixed + +- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](https://github.com/tailwindlabs/tailwindcss/pull/7232)) +- Quick fix for incorrect arbitrary properties when using URLs ([#7252](https://github.com/tailwindlabs/tailwindcss/pull/7252)) + +## [3.0.17] - 2022-01-26 + +### Fixed + +- Remove false positive warning in CLI when using the `--content` option ([#7220](https://github.com/tailwindlabs/tailwindcss/pull/7220)) + +## [3.0.16] - 2022-01-24 + +### Fixed + +- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](https://github.com/tailwindlabs/tailwindcss/pull/7080)) +- Improve various warnings ([#7118](https://github.com/tailwindlabs/tailwindcss/pull/7118)) +- Fix grammatical mistake ([cca5a38](https://github.com/tailwindlabs/tailwindcss/commit/cca5a3804e1d3ee0214491921e1aec35bf62a813)) + +## [3.0.15] - 2022-01-15 + +### Fixed + +- Temporarily remove optional chaining in nesting plugin ([#7077](https://github.com/tailwindlabs/tailwindcss/pull/7077)) + +## [3.0.14] - 2022-01-14 + +### Added + +- Show warnings for invalid content config ([#7065](https://github.com/tailwindlabs/tailwindcss/pull/7065)) + +### Fixed + +- Only emit utility/component variants when those layers exist ([#7066](https://github.com/tailwindlabs/tailwindcss/pull/7066)) +- Ensure nesting plugins can receive options ([#7016](https://github.com/tailwindlabs/tailwindcss/pull/7016)) + +## [3.0.13] - 2022-01-11 + +### Fixed + +- Fix consecutive builds with at apply producing different CSS ([#6999](https://github.com/tailwindlabs/tailwindcss/pull/6999)) + +## [3.0.12] - 2022-01-07 + +### Fixed + +- Allow use of falsy values in theme config ([#6917](https://github.com/tailwindlabs/tailwindcss/pull/6917)) +- Ensure we can apply classes that are grouped with non-class selectors ([#6922](https://github.com/tailwindlabs/tailwindcss/pull/6922)) +- Improve standalone CLI compatibility on Linux by switching to the `linuxstatic` build target ([#6914](https://github.com/tailwindlabs/tailwindcss/pull/6914)) +- Ensure `@apply` works consistently with or without `@layer` ([#6938](https://github.com/tailwindlabs/tailwindcss/pull/6938)) +- Only emit defaults when using base layer ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926)) +- Emit plugin defaults regardless of usage ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926)) +- Move default border color back to preflight ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926)) +- Change `experimental.optimizeUniversalDefaults` to only work with `@tailwind base` ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926)) + +## [3.0.11] - 2022-01-05 + +### Fixed + +- Preserve casing of CSS variables added by plugins ([#6888](https://github.com/tailwindlabs/tailwindcss/pull/6888)) +- Ignore content paths that are passed in but don't actually exist ([#6901](https://github.com/tailwindlabs/tailwindcss/pull/6901)) +- Revert change that applies Tailwind's defaults in isolated environments like CSS modules ([9fdc391](https://github.com/tailwindlabs/tailwindcss/commit/9fdc391d4ff93e7e350f5ce439060176b1f0162f)) + +## [3.0.10] - 2022-01-04 + +### Fixed + +- Fix `@apply` in files without `@tailwind` directives ([#6580](https://github.com/tailwindlabs/tailwindcss/pull/6580), [#6875](https://github.com/tailwindlabs/tailwindcss/pull/6875)) +- CLI: avoid unnecessary writes to output files ([#6550](https://github.com/tailwindlabs/tailwindcss/pull/6550)) + +### Added + +- Allow piping data into the CLI ([#6876](https://github.com/tailwindlabs/tailwindcss/pull/6876)) + +## [3.0.9] - 2022-01-03 + +### Fixed + +- Improve `DEBUG` flag ([#6797](https://github.com/tailwindlabs/tailwindcss/pull/6797), [#6804](https://github.com/tailwindlabs/tailwindcss/pull/6804)) +- Ensure we can use `<` and `>` characters in modifiers ([#6851](https://github.com/tailwindlabs/tailwindcss/pull/6851)) +- Validate `theme()` works in arbitrary values ([#6852](https://github.com/tailwindlabs/tailwindcss/pull/6852)) +- Properly detect `theme()` value usage in arbitrary properties ([#6854](https://github.com/tailwindlabs/tailwindcss/pull/6854)) +- Improve collapsing of duplicate declarations ([#6856](https://github.com/tailwindlabs/tailwindcss/pull/6856)) +- Remove support for `TAILWIND_MODE=watch` ([#6858](https://github.com/tailwindlabs/tailwindcss/pull/6858)) + +## [3.0.8] - 2021-12-28 + +### Fixed + +- Reduce specificity of `abbr` rule in preflight ([#6671](https://github.com/tailwindlabs/tailwindcss/pull/6671)) +- Support HSL with hue units in arbitrary values ([#6726](https://github.com/tailwindlabs/tailwindcss/pull/6726)) +- Add `node16-linux-arm64` target for standalone CLI ([#6693](https://github.com/tailwindlabs/tailwindcss/pull/6693)) + +## [3.0.7] - 2021-12-17 + +### Fixed + +- Don't mutate custom color palette when overriding per-plugin colors ([#6546](https://github.com/tailwindlabs/tailwindcss/pull/6546)) +- Improve circular dependency detection when using `@apply` ([#6588](https://github.com/tailwindlabs/tailwindcss/pull/6588)) +- Only generate variants for non-`user` layers ([#6589](https://github.com/tailwindlabs/tailwindcss/pull/6589)) +- Properly extract classes with arbitrary values in arrays and classes followed by escaped quotes ([#6590](https://github.com/tailwindlabs/tailwindcss/pull/6590)) +- Improve jsx interpolation candidate matching ([#6593](https://github.com/tailwindlabs/tailwindcss/pull/6593)) +- Ensure `@apply` of a rule inside an AtRule works ([#6594](https://github.com/tailwindlabs/tailwindcss/pull/6594)) + +## [3.0.6] - 2021-12-16 + +### Fixed + +- Support square bracket notation in paths ([#6519](https://github.com/tailwindlabs/tailwindcss/pull/6519)) +- Ensure all plugins are executed for a given candidate ([#6540](https://github.com/tailwindlabs/tailwindcss/pull/6540)) + +## [3.0.5] - 2021-12-15 + +### Fixed + +- Revert: add `li` to list-style reset ([9777562d](https://github.com/tailwindlabs/tailwindcss/commit/9777562da37ee631bbf77374c0d14825f09ef9af)) + +## [3.0.4] - 2021-12-15 + +### Fixed + +- Insert always-on defaults layer in correct spot ([#6526](https://github.com/tailwindlabs/tailwindcss/pull/6526)) + +## [3.0.3] - 2021-12-15 + +### Added + +- Warn about invalid globs in `content` ([#6449](https://github.com/tailwindlabs/tailwindcss/pull/6449)) +- Add standalone tailwindcss CLI ([#6506](https://github.com/tailwindlabs/tailwindcss/pull/6506)) +- Add `li` to list-style reset ([00f60e6](https://github.com/tailwindlabs/tailwindcss/commit/00f60e61013c6e4e3419e4b699371a13eb30b75d)) + +### Fixed + +- Don't output unparsable values ([#6469](https://github.com/tailwindlabs/tailwindcss/pull/6469)) +- Fix text decoration utilities from overriding the new text decoration color/style/thickness utilities when used with a modifier ([#6378](https://github.com/tailwindlabs/tailwindcss/pull/6378)) +- Move defaults to their own always-on layer ([#6500](https://github.com/tailwindlabs/tailwindcss/pull/6500)) +- Support negative values in safelist patterns ([#6480](https://github.com/tailwindlabs/tailwindcss/pull/6480)) + +## [3.0.2] - 2021-12-13 + +### Fixed + +- Temporarily disable optimize universal defaults, fixes issue with transforms/filters/rings not being `@apply`-able in CSS modules/Svelte components/Vue components ([#6461](https://github.com/tailwindlabs/tailwindcss/pull/6461)) + +## [3.0.1] - 2021-12-10 + +### Fixed + +- Ensure complex variants with multiple classes work ([#6311](https://github.com/tailwindlabs/tailwindcss/pull/6311)) +- Re-add `default` interop to public available functions ([#6348](https://github.com/tailwindlabs/tailwindcss/pull/6348)) +- Detect circular dependencies when using `@apply` ([#6365](https://github.com/tailwindlabs/tailwindcss/pull/6365)) +- Fix defaults optimization when vendor prefixes are involved ([#6369](https://github.com/tailwindlabs/tailwindcss/pull/6369)) + +## [3.0.0] - 2021-12-09 + +### Fixed + +- Enforce the order of some variants (like `before` and `after`) ([#6018](https://github.com/tailwindlabs/tailwindcss/pull/6018)) + +### Added + +- Add `placeholder` variant ([#6106](https://github.com/tailwindlabs/tailwindcss/pull/6106)) +- Add composable `touch-action` utilities ([#6115](https://github.com/tailwindlabs/tailwindcss/pull/6115)) +- Add support for "arbitrary properties" ([#6161](https://github.com/tailwindlabs/tailwindcss/pull/6161)) +- Add `portrait` and `landscape` variants ([#6046](https://github.com/tailwindlabs/tailwindcss/pull/6046)) +- Add `text-decoration-style`, `text-decoration-thickness`, and `text-underline-offset` utilities ([#6004](https://github.com/tailwindlabs/tailwindcss/pull/6004)) +- Add `menu` reset to preflight ([#6213](https://github.com/tailwindlabs/tailwindcss/pull/6213)) +- Allow `0` as a valid `length` value ([#6233](https://github.com/tailwindlabs/tailwindcss/pull/6233), [#6259](https://github.com/tailwindlabs/tailwindcss/pull/6259)) +- Add CSS functions to data types ([#6258](https://github.com/tailwindlabs/tailwindcss/pull/6258)) +- Support negative values for `scale-*` utilities ([c48e629](https://github.com/tailwindlabs/tailwindcss/commit/c48e629955585ad18dadba9f470fda59cc448ab7)) +- Improve `length` data type, by validating each value individually ([#6283](https://github.com/tailwindlabs/tailwindcss/pull/6283)) + +### Changed + +- Deprecate `decoration-slice` and `decoration-break` in favor `box-decoration-slice` and `box-decoration-break` _(non-breaking)_ ([#6004](https://github.com/tailwindlabs/tailwindcss/pull/6004)) + +## [3.0.0-alpha.2] - 2021-11-08 + +### Changed + +- Don't use pointer cursor on disabled buttons by default ([#5772](https://github.com/tailwindlabs/tailwindcss/pull/5772)) +- Set default content value in preflight instead of within each before/after utility ([#5820](https://github.com/tailwindlabs/tailwindcss/pull/5820)) +- Remove `prefix` as a function ([#5829](https://github.com/tailwindlabs/tailwindcss/pull/5829)) + +### Added + +- Add `flex-basis` utilities ([#5671](https://github.com/tailwindlabs/tailwindcss/pull/5671)) +- Make negative values a first-class feature ([#5709](https://github.com/tailwindlabs/tailwindcss/pull/5709)) +- Add `fit-content` values for `min/max-width/height` utilities ([#5638](https://github.com/tailwindlabs/tailwindcss/pull/5638)) +- Add `min/max-content` values for `min/max-height` utilities ([#5729](https://github.com/tailwindlabs/tailwindcss/pull/5729)) +- Add all standard `cursor-*` values by default ([#5734](https://github.com/tailwindlabs/tailwindcss/pull/5734)) +- Add `grow-*` and `shrink-*` utilities, deprecate `flex-grow-*` and `flex-shrink-*` ([#5733](https://github.com/tailwindlabs/tailwindcss/pull/5733)) +- Add `text-decoration-color` utilities ([#5760](https://github.com/tailwindlabs/tailwindcss/pull/5760)) +- Add new declarative `addVariant` API ([#5809](https://github.com/tailwindlabs/tailwindcss/pull/5809)) +- Add first-class `print` variant for targeting printed media ([#5885](https://github.com/tailwindlabs/tailwindcss/pull/5885)) +- Add `outline-style`, `outline-color`, `outline-width` and `outline-offset` utilities ([#5887](https://github.com/tailwindlabs/tailwindcss/pull/5887)) +- Add full color palette for `fill-*` and `stroke-*` utilities (#5933[](https://github.com/tailwindlabs/tailwindcss/pull/5933)) +- Add composable API for colored box shadows ([#5979](https://github.com/tailwindlabs/tailwindcss/pull/5979)) + +### Fixed + +- Configure chokidar's `awaitWriteFinish` setting to avoid occasional stale builds on Windows ([#5774](https://github.com/tailwindlabs/tailwindcss/pull/5774)) +- Fix CLI `--content` option ([#5775](https://github.com/tailwindlabs/tailwindcss/pull/5775)) +- Fix before/after utilities overriding custom content values at larger breakpoints ([#5820](https://github.com/tailwindlabs/tailwindcss/pull/5820)) +- Cleanup duplicate properties ([#5830](https://github.com/tailwindlabs/tailwindcss/pull/5830)) +- Allow `_` inside `url()` when using arbitrary values ([#5853](https://github.com/tailwindlabs/tailwindcss/pull/5853)) +- Prevent crashes when using comments in `@layer` AtRules ([#5854](https://github.com/tailwindlabs/tailwindcss/pull/5854)) +- Handle color transformations properly with `theme(...)` for all relevant plugins ([#4533](https://github.com/tailwindlabs/tailwindcss/pull/4533), [#5871](https://github.com/tailwindlabs/tailwindcss/pull/5871)) +- Ensure `@apply`-ing a utility with multiple definitions works ([#5870](https://github.com/tailwindlabs/tailwindcss/pull/5870)) + +## [3.0.0-alpha.1] - 2021-10-01 + +### Changed + +- Remove AOT engine, make JIT the default ([#5340](https://github.com/tailwindlabs/tailwindcss/pull/5340)) +- Throw when trying to `@apply` the `group` class ([#4666](https://github.com/tailwindlabs/tailwindcss/pull/4666)) +- Remove dependency on `modern-normalize`, inline and consolidate with Preflight ([#5358](https://github.com/tailwindlabs/tailwindcss/pull/5358)) +- Enable extended color palette by default with updated color names ([#5384](https://github.com/tailwindlabs/tailwindcss/pull/5384)) +- Move `vertical-align` values to config file instead of hard-coding ([#5487](https://github.com/tailwindlabs/tailwindcss/pull/5487)) +- Rename `overflow-clip` to `text-clip` and `overflow-ellipsis` to `text-ellipsis` ([#5630](https://github.com/tailwindlabs/tailwindcss/pull/5630)) + +### Added + +- Add native `aspect-ratio` utilities ([#5359](https://github.com/tailwindlabs/tailwindcss/pull/5359)) +- Unify config callback helpers into single object ([#5382](https://github.com/tailwindlabs/tailwindcss/pull/5382)) +- Preserve original color format when adding opacity whenever possible ([#5154](https://github.com/tailwindlabs/tailwindcss/pull/5154)) +- Add `accent-color` utilities ([#5387](https://github.com/tailwindlabs/tailwindcss/pull/5387)) +- Add `scroll-behavior` utilities ([#5388](https://github.com/tailwindlabs/tailwindcss/pull/5388)) +- Add `will-change` utilities ([#5448](https://github.com/tailwindlabs/tailwindcss/pull/5448)) +- Add `text-indent` utilities ([#5449](https://github.com/tailwindlabs/tailwindcss/pull/5449)) +- Add `column` utilities ([#5457](https://github.com/tailwindlabs/tailwindcss/pull/5457)) +- Add `border-hidden` utility ([#5485](https://github.com/tailwindlabs/tailwindcss/pull/5485)) +- Add `align-sub` and `align-super` utilities by default ([#5486](https://github.com/tailwindlabs/tailwindcss/pull/5486)) +- Add `break-before`, `break-inside` and `break-after` utilities ([#5530](https://github.com/tailwindlabs/tailwindcss/pull/5530)) +- Add `file` variant for `::file-selector-button` pseudo element ([#4936](https://github.com/tailwindlabs/tailwindcss/pull/4936)) +- Add comprehensive arbitrary value support ([#5568](https://github.com/tailwindlabs/tailwindcss/pull/5568)) +- Add `touch-action` utilities ([#5603](https://github.com/tailwindlabs/tailwindcss/pull/5603)) +- Add `inherit` to default color palette ([#5597](https://github.com/tailwindlabs/tailwindcss/pull/5597)) +- Add `overflow-clip`, `overflow-x-clip` and `overflow-y-clip` utilities ([#5630](https://github.com/tailwindlabs/tailwindcss/pull/5630)) +- Add `[open]` variant ([#5627](https://github.com/tailwindlabs/tailwindcss/pull/5627)) +- Add `scroll-snap` utilities ([#5637](https://github.com/tailwindlabs/tailwindcss/pull/5637)) +- Add `border-x` and `border-y` width and color utilities ([#5639](https://github.com/tailwindlabs/tailwindcss/pull/5639)) + +### Fixed + +- Fix defining colors as functions when color opacity plugins are disabled ([#5470](https://github.com/tailwindlabs/tailwindcss/pull/5470)) +- Fix using negated `content` globs ([#5625](https://github.com/tailwindlabs/tailwindcss/pull/5625)) +- Fix using backslashes in `content` globs ([#5628](https://github.com/tailwindlabs/tailwindcss/pull/5628)) + +## [2.2.19] - 2021-10-29 + +### Fixed + +- Ensure `corePlugins` order is consistent in AOT mode ([#5928](https://github.com/tailwindlabs/tailwindcss/pull/5928)) + +## [2.2.18] - 2021-10-29 + +### Fixed + +- Bump versions for security vulnerabilities ([#5924](https://github.com/tailwindlabs/tailwindcss/pull/5924)) + +## [2.2.17] - 2021-10-13 + +### Fixed + +- Configure chokidar's `awaitWriteFinish` setting to avoid occasional stale builds on Windows ([#5758](https://github.com/tailwindlabs/tailwindcss/pull/5758)) + +## [2.2.16] - 2021-09-26 + +### Fixed + +- JIT: Properly handle animations that use CSS custom properties ([#5602](https://github.com/tailwindlabs/tailwindcss/pull/5602)) + +## [2.2.15] - 2021-09-10 + +### Fixed + +- Ensure using CLI without `-i` for input file continues to work even though deprecated ([#5464](https://github.com/tailwindlabs/tailwindcss/pull/5464)) + +## [2.2.14] - 2021-09-08 + +### Fixed + +- Only use `@defaults` in JIT, switch back to `clean-css` in case there's any meaningful differences in the output ([bf248cb](https://github.com/tailwindlabs/tailwindcss/commit/bf248cb0de889d48854fbdd26536f4a492556efd)) + +## [2.2.13] - 2021-09-08 + +### Fixed + +- Replace `clean-css` with `cssnano` for CDN builds to fix minified builds ([75cc3ca](https://github.com/tailwindlabs/tailwindcss/commit/75cc3ca305aedddc8a85f3df1a420fefad3fb5c4)) + +## [2.2.12] - 2021-09-08 + +### Fixed + +- Ensure that divide utilities inject a default border color ([#5438](https://github.com/tailwindlabs/tailwindcss/pull/5438)) + +## [2.2.11] - 2021-09-07 + +### Fixed + +- Rebundle to fix missing CLI peer dependencies + +## [2.2.10] - 2021-09-06 + +### Fixed + +- Fix build error when using `presets: []` in config file ([#4903](https://github.com/tailwindlabs/tailwindcss/pull/4903)) + +### Added + +- Reintroduce universal selector optimizations under experimental `optimizeUniversalDefaults` flag ([a9e160c](https://github.com/tailwindlabs/tailwindcss/commit/a9e160cf9acb75a2bbac34f8864568b12940f89a)) + +## [2.2.9] - 2021-08-30 + +### Fixed + +- JIT: Fix `@apply`ing utilities that contain variants + the important modifier ([#4854](https://github.com/tailwindlabs/tailwindcss/pull/4854)) +- JIT: Don't strip "null" when parsing tracked file paths ([#5008](https://github.com/tailwindlabs/tailwindcss/pull/5008)) +- Pin `clean-css` to v5.1.4 to fix empty CSS variables in CDN builds ([#5338](https://github.com/tailwindlabs/tailwindcss/pull/5338)) + +## [2.2.8] - 2021-08-27 + +### Fixed + +- Improve accessibility of default link focus styles in Firefox ([#5082](https://github.com/tailwindlabs/tailwindcss/pull/5082)) +- JIT: Fix animation variants corrupting keyframes rules ([#5223](https://github.com/tailwindlabs/tailwindcss/pull/5223)) +- JIT: Ignore escaped commas when splitting selectors to apply prefixes ([#5239](https://github.com/tailwindlabs/tailwindcss/pull/5239/)) +- Nesting: Maintain PostCSS node sources when handling `@apply` ([#5249](https://github.com/tailwindlabs/tailwindcss/pull/5249)) +- JIT: Fix support for animation lists ([#5252](https://github.com/tailwindlabs/tailwindcss/pull/5252)) +- JIT: Fix arbitrary value support for `object-position` utilities ([#5245](https://github.com/tailwindlabs/tailwindcss/pull/5245)) +- CLI: Abort watcher if stdin is closed to avoid zombie processes ([#4997](https://github.com/tailwindlabs/tailwindcss/pull/4997)) +- JIT: Ignore arbitrary values with unbalanced brackets ([#5293](https://github.com/tailwindlabs/tailwindcss/pull/5293)) + +## [2.2.7] - 2021-07-23 + +### Fixed + +- Temporarily revert runtime performance optimizations introduced in v2.2.5, use universal selector again ([#5060](https://github.com/tailwindlabs/tailwindcss/pull/5060)) + +## [2.2.6] - 2021-07-21 + +### Fixed + +- Fix issue where base styles not generated for translate transforms in JIT ([#5038](https://github.com/tailwindlabs/tailwindcss/pull/5038)) + +## [2.2.5] - 2021-07-21 + +### Added + +- Added `self-baseline` utility (I know this is a patch release, no one's going to die relax) ([#5000](https://github.com/tailwindlabs/tailwindcss/pull/5000)) + +### Changed + +- JIT: Optimize universal selector usage by inlining only the relevant selectors ([#4850](https://github.com/tailwindlabs/tailwindcss/pull/4850))) + + This provides a very significant performance boost on pages with a huge number of DOM nodes, but there's a chance it could be a breaking change in very rare edge cases we haven't thought of. Please open an issue if anything related to shadows, rings, transforms, filters, or backdrop-filters seems to be behaving differently after upgrading. + +### Fixed + +- Fix support for `step-start` and `step-end` in animation utilities ([#4795](https://github.com/tailwindlabs/tailwindcss/pull/4795))) +- JIT: Prevent presence of `!*` in templates from ruining everything ([#4816](https://github.com/tailwindlabs/tailwindcss/pull/4816))) +- JIT: Improve support for quotes in arbitrary values ([#4817](https://github.com/tailwindlabs/tailwindcss/pull/4817))) +- Fix filter/backdrop-filter/transform utilities being inserted into the wrong position if not all core plugins are enabled ([#4852](https://github.com/tailwindlabs/tailwindcss/pull/4852))) +- JIT: Fix `@layer` rules being mistakenly inserted during incremental rebuilds ([#4853](https://github.com/tailwindlabs/tailwindcss/pull/4853))) +- Improve build performance for projects with many small non-Tailwind stylesheets ([#4644](https://github.com/tailwindlabs/tailwindcss/pull/4644)) +- Ensure `[hidden]` works as expected on elements where we override the default `display` value in Preflight ([#4873](https://github.com/tailwindlabs/tailwindcss/pull/4873)) +- Fix variant configuration not being applied to `backdropOpacity` utilities ([#4892](https://github.com/tailwindlabs/tailwindcss/pull/4892)) + +## [2.2.4] - 2021-06-23 + +### Fixed + +- Remove `postinstall` script that was preventing people from installing the library ([1eacfb9](https://github.com/tailwindlabs/tailwindcss/commit/1eacfb98849c0d4737e0af3595ddec8c73addaac)) + +## [2.2.3] - 2021-06-23 + +### Added + +- Pass extended color palette to theme closures so it can be used without installing Tailwind when using `npx tailwindcss` ([359252c](https://github.com/tailwindlabs/tailwindcss/commit/359252c9b429e81217c28eb3ca7bab73d8f81e6d)) + +### Fixed + +- JIT: Explicitly error when `-` is used as a custom separator ([#4704](https://github.com/tailwindlabs/tailwindcss/pull/4704)) +- JIT: Don't add multiple `~` when stacking `peer-*` variants ([#4757](https://github.com/tailwindlabs/tailwindcss/pull/4757)) +- Remove outdated focus style fix in Preflight ([#4780](https://github.com/tailwindlabs/tailwindcss/pull/4780)) +- Enable `purge` if provided on the CLI ([#4772](https://github.com/tailwindlabs/tailwindcss/pull/4772)) +- JIT: Fix error when not using a config file with postcss-cli ([#4773](https://github.com/tailwindlabs/tailwindcss/pull/4773)) +- Fix issue with `resolveConfig` not being importable in Next.js pages ([#4725](https://github.com/tailwindlabs/tailwindcss/pull/4725)) + +## [2.2.2] - 2021-06-18 + +### Fixed + +- JIT: Reintroduce `transform`, `filter`, and `backdrop-filter` classes purely to create stacking contexts to minimize the impact of the breaking change ([#4700](https://github.com/tailwindlabs/tailwindcss/pull/4700)) + +## [2.2.1] - 2021-06-18 + +### Fixed + +- Recover from errors gracefully in CLI watch mode ([#4693](https://github.com/tailwindlabs/tailwindcss/pull/4693)) +- Fix issue with media queries not being generated properly when using PostCSS 7 ([#4695](https://github.com/tailwindlabs/tailwindcss/pull/4695)) + +## [2.2.0] - 2021-06-17 + +### Changed + +- JIT: Use "tracking" context by default instead of "watching" context for improved reliability with most bundlers ([#4514](https://github.com/tailwindlabs/tailwindcss/pull/4514)) + + Depending on which tooling you use, you may need to explicitly set `TAILWIND_MODE=watch` until your build runner has been updated to support PostCSS's `dir-dependency` message type. + +### Added + +- Add `background-origin` utilities ([#4117](https://github.com/tailwindlabs/tailwindcss/pull/4117)) +- Improve `@apply` performance in projects that process many CSS sources ([#3178](https://github.com/tailwindlabs/tailwindcss/pull/3718)) +- JIT: Don't use CSS variables for color utilities if color opacity utilities are disabled ([#3984](https://github.com/tailwindlabs/tailwindcss/pull/3984)) +- JIT: Redesign `matchUtilities` API to make it more suitable for third-party use ([#4232](https://github.com/tailwindlabs/tailwindcss/pull/4232)) +- JIT: Support applying important utility variants ([#4260](https://github.com/tailwindlabs/tailwindcss/pull/4260)) +- JIT: Support coercing arbitrary values when the type isn't detectable ([#4263](https://github.com/tailwindlabs/tailwindcss/pull/4263)) +- JIT: Support for `raw` syntax in `purge` config ([#4272](https://github.com/tailwindlabs/tailwindcss/pull/4272)) +- Add `empty` variant ([#3298](https://github.com/tailwindlabs/tailwindcss/pull/3298)) +- Update `modern-normalize` to v1.1 ([#4287](https://github.com/tailwindlabs/tailwindcss/pull/4287)) +- Implement `theme` function internally, remove `postcss-functions` dependency ([#4317](https://github.com/tailwindlabs/tailwindcss/pull/4317)) +- Add `screen` function to improve nesting plugin compatibility ([#4318](https://github.com/tailwindlabs/tailwindcss/pull/4318)) +- JIT: Add universal shorthand color opacity syntax ([#4348](https://github.com/tailwindlabs/tailwindcss/pull/4348)) +- JIT: Add `@tailwind variants` directive to replace `@tailwind screens` ([#4356](https://github.com/tailwindlabs/tailwindcss/pull/4356)) +- JIT: Add support for PostCSS `dir-dependency` messages in `TAILWIND_DISABLE_TOUCH` mode ([#4388](https://github.com/tailwindlabs/tailwindcss/pull/4388)) +- JIT: Add per-side border color utilities ([#4404](https://github.com/tailwindlabs/tailwindcss/pull/4404)) +- JIT: Add support for `before` and `after` pseudo-element variants and `content` utilities ([#4461](https://github.com/tailwindlabs/tailwindcss/pull/4461)) +- Add new `transform` and `extract` APIs to simplify PurgeCSS/JIT customization ([#4469](https://github.com/tailwindlabs/tailwindcss/pull/4469)) +- JIT: Add exhaustive pseudo-class and pseudo-element variant support ([#4482](https://github.com/tailwindlabs/tailwindcss/pull/4482)) +- JIT: Add `caret-color` utilities ([#4499](https://github.com/tailwindlabs/tailwindcss/pull/4499)) +- Rename `lightBlue` to `sky`, emit console warning when using deprecated name ([#4513](https://github.com/tailwindlabs/tailwindcss/pull/4513)) +- New CLI with improved JIT support, `--watch` mode, and more ([#4526](https://github.com/tailwindlabs/tailwindcss/pull/4526), [4558](https://github.com/tailwindlabs/tailwindcss/pull/4558)) +- JIT: Add new `peer-*` variants for styling based on sibling state ([#4556](https://github.com/tailwindlabs/tailwindcss/pull/4556)) +- Expose `safelist` as a top-level option under `purge` for both JIT and classic engines ([#4580](https://github.com/tailwindlabs/tailwindcss/pull/4580)) +- JIT: Remove need for `transform` class when using classes like `scale-*`, `rotate-*`, etc. ([#4604](https://github.com/tailwindlabs/tailwindcss/pull/4604)) +- JIT: Remove need for `filter` and `backdrop-filter` classes when using classes like `contrast-*`, `backdrop-blur-*`, etc. ([#4614](https://github.com/tailwindlabs/tailwindcss/pull/4614)) +- Support passing a custom path for your PostCSS configuration in the Tailwind CLI ([#4607](https://github.com/tailwindlabs/tailwindcss/pull/4607)) +- Add `blur-none` by default with intent to deprecate `blur-0` ([#4614](https://github.com/tailwindlabs/tailwindcss/pull/4614)) + +### Fixed + +- JIT: Improve support for Svelte class bindings ([#4187](https://github.com/tailwindlabs/tailwindcss/pull/4187)) +- JIT: Improve support for `calc` and `var` in arbitrary values ([#4147](https://github.com/tailwindlabs/tailwindcss/pull/4147)) +- Convert `hsl` colors to `hsla` when transforming for opacity support instead of `rgba` ([#3850](https://github.com/tailwindlabs/tailwindcss/pull/3850)) +- Fix `backdropBlur` variants not being generated ([#4188](https://github.com/tailwindlabs/tailwindcss/pull/4188)) +- Improve animation value parsing ([#4250](https://github.com/tailwindlabs/tailwindcss/pull/4250)) +- Ignore unknown object types when hashing config ([82f4eaa](https://github.com/tailwindlabs/tailwindcss/commit/82f4eaa6832ef8a4e3fd90869e7068efdf6e34f2)) +- Ensure variants are grouped properly for plugins with order-dependent utilities ([#4273](https://github.com/tailwindlabs/tailwindcss/pull/4273)) +- JIT: Fix temp file storage when node temp directories are kept on a different drive than the project itself ([#4044](https://github.com/tailwindlabs/tailwindcss/pull/4044)) +- Support border-opacity utilities alongside default `border` utility ([#4277](https://github.com/tailwindlabs/tailwindcss/pull/4277)) +- JIT: Fix source maps for expanded `@tailwind` directives ([2f15411](https://github.com/tailwindlabs/tailwindcss/commit/2f1541123dea29d8a2ab0f1411bf60c79eeb96b4)) +- JIT: Ignore whitespace when collapsing adjacent rules ([15642fb](https://github.com/tailwindlabs/tailwindcss/commit/15642fbcc885eba9cc50b7678a922b09c90d6b51)) +- JIT: Generate group parent classes correctly when using custom separator ([#4508](https://github.com/tailwindlabs/tailwindcss/pull/4508)) +- JIT: Fix incorrect stacking of multiple `group` variants ([#4551](https://github.com/tailwindlabs/tailwindcss/pull/4551)) +- JIT: Fix memory leak due to holding on to unused contexts ([#4571](https://github.com/tailwindlabs/tailwindcss/pull/4571)) + +### Internals + +- Add integration tests for popular build runners ([#4354](https://github.com/tailwindlabs/tailwindcss/pull/4354)) + +## [2.1.4] - 2021-06-02 + +### Fixed + +- Skip `raw` PurgeCSS sources when registering template dependencies ([#4542](https://github.com/tailwindlabs/tailwindcss/pull/4542)) + +## [2.1.3] - 2021-06-01 + +### Fixed + +- Register PurgeCSS paths as PostCSS dependencies to guarantee proper cache-busting in webpack 5 ([#4530](https://github.com/tailwindlabs/tailwindcss/pull/4530)) + +## [2.1.2] - 2021-04-23 + +### Fixed + +- Fix issue where JIT engine would generate the wrong CSS when using PostCSS 7 ([#4078](https://github.com/tailwindlabs/tailwindcss/pull/4078)) + +## [2.1.1] - 2021-04-05 + +### Fixed + +- Fix issue where JIT engine would fail to compile when a source path isn't provided by the build runner for the current input file ([#3978](https://github.com/tailwindlabs/tailwindcss/pull/3978)) + +## [2.1.0] - 2021-04-05 + +### Added + +- Add alternate JIT engine (in preview) ([#3905](https://github.com/tailwindlabs/tailwindcss/pull/3905)) +- Add new `mix-blend-mode` and `background-blend-mode` utilities ([#3920](https://github.com/tailwindlabs/tailwindcss/pull/3920)) +- Add new `box-decoration-break` utilities ([#3911](https://github.com/tailwindlabs/tailwindcss/pull/3911)) +- Add new `isolation` utilities ([#3914](https://github.com/tailwindlabs/tailwindcss/pull/3914)) +- Add `inline-table` display utility ([#3563](https://github.com/tailwindlabs/tailwindcss/pull/3563)) +- Add `list-item` display utility ([#3929](https://github.com/tailwindlabs/tailwindcss/pull/3929)) +- Add new `filter` and `backdrop-filter` utilities ([#3923](https://github.com/tailwindlabs/tailwindcss/pull/3923)) + +## [2.0.4] - 2021-03-17 + +### Fixed + +- Pass full `var(--bg-opacity)` value as `opacityValue` when defining colors as functions + +## [2.0.3] - 2021-02-07 + +### Fixed + +- Ensure sourcemap input is deterministic when using `@apply` in Vue components ([#3356](https://github.com/tailwindlabs/tailwindcss/pull/3356)) +- Ensure placeholder opacity is consistent across browsers ([#3308](https://github.com/tailwindlabs/tailwindcss/pull/3308)) +- Fix issue where `theme()` didn't work with colors defined as functions ([#2919](https://github.com/tailwindlabs/tailwindcss/pull/2919)) +- Enable `dark` variants by default for color opacity utilities ([#2975](https://github.com/tailwindlabs/tailwindcss/pull/2975)) + +### Added + +- Add support for a `tailwind.config.cjs` file in Node ESM projects ([#3181](https://github.com/tailwindlabs/tailwindcss/pull/3181)) +- Add version comment to Preflight ([#3255](https://github.com/tailwindlabs/tailwindcss/pull/3255)) +- Add `cursor-help` by default ([#3199](https://github.com/tailwindlabs/tailwindcss/pull/3199)) + +## [2.0.2] - 2020-12-11 + +### Fixed + +- Fix issue with `@apply` not working as expected with `!important` inside an at-rule ([#2824](https://github.com/tailwindlabs/tailwindcss/pull/2824)) +- Fix issue with `@apply` not working as expected with defined classes ([#2832](https://github.com/tailwindlabs/tailwindcss/pull/2832)) +- Fix memory leak, and broken `@apply` when splitting up files ([#3032](https://github.com/tailwindlabs/tailwindcss/pull/3032)) + +### Added + +- Add default values for the `ring` utility ([#2951](https://github.com/tailwindlabs/tailwindcss/pull/2951)) + +## [2.0.1] - 2020-11-18 + +- Nothing, just the only thing I could do when I found out npm won't let me publish the same version under two tags. + +## [2.0.0] - 2020-11-18 + +### Added + +- Add redesigned color palette ([#2623](https://github.com/tailwindlabs/tailwindcss/pull/2623), [700866c](https://github.com/tailwindlabs/tailwindcss/commit/700866ce5e0c0b8d140be161c4d07fc6f31242bc), [#2633](https://github.com/tailwindlabs/tailwindcss/pull/2633)) +- Add dark mode support ([#2279](https://github.com/tailwindlabs/tailwindcss/pull/2279), [#2631](https://github.com/tailwindlabs/tailwindcss/pull/2631)) +- Add `overflow-ellipsis` and `overflow-clip` utilities ([#1289](https://github.com/tailwindlabs/tailwindcss/pull/1289)) +- Add `transform-gpu` to force hardware acceleration on transforms when desired ([#1380](https://github.com/tailwindlabs/tailwindcss/pull/1380)) +- Extend default spacing scale ([#2630](https://github.com/tailwindlabs/tailwindcss/pull/2630), [7f05204](https://github.com/tailwindlabs/tailwindcss/commit/7f05204ce7a5581b6845591448265c3c21afde86)) +- Add spacing scale to `inset` plugin ([#2630](https://github.com/tailwindlabs/tailwindcss/pull/2630)) +- Add percentage sizes to `translate`, `inset`, and `height` plugins ([#2630](https://github.com/tailwindlabs/tailwindcss/pull/2630), [5259560](https://github.com/tailwindlabs/tailwindcss/commit/525956065272dc53e8f8395f55f9ad13077a38d1)) +- Extend default font size scale ([#2609](https://github.com/tailwindlabs/tailwindcss/pull/2609), [#2619](https://github.com/tailwindlabs/tailwindcss/pull/2619)) +- Support using `@apply` with complex classes, including variants like `lg:hover:bg-blue-500` ([#2159](https://github.com/tailwindlabs/tailwindcss/pull/2159)) +- Add new `2xl` breakpoint at 1536px by default ([#2609](https://github.com/tailwindlabs/tailwindcss/pull/2609)) +- Add default line-height values for font-size utilities ([#2609](https://github.com/tailwindlabs/tailwindcss/pull/2609)) +- Support defining theme values using arrays for CSS properties that support comma separated values ([e13f083c4](https://github.com/tailwindlabs/tailwindcss/commit/e13f083c4bc48bf9870d27c966136a9584943127)) +- Enable `group-hover` for color plugins, `boxShadow`, and `textDecoration` by default ([28985b6](https://github.com/tailwindlabs/tailwindcss/commit/28985b6cd592e72d4849fdb9ce97eb045744e09c), [f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) +- Enable `focus` for z-index utilities by default ([ae5b3d3](https://github.com/tailwindlabs/tailwindcss/commit/ae5b3d312d5000ae9c2065001f3df7add72dc365)) +- Support `extend` in `variants` configuration ([#2651](https://github.com/tailwindlabs/tailwindcss/pull/2651)) +- Add `max-w-prose` class by default ([#2574](https://github.com/tailwindlabs/tailwindcss/pull/2574)) +- Support flattening deeply nested color objects ([#2148](https://github.com/tailwindlabs/tailwindcss/pull/2148)) +- Support defining presets as functions ([#2680](https://github.com/tailwindlabs/tailwindcss/pull/2680)) +- Support deep merging of objects under `extend` ([#2679](https://github.com/tailwindlabs/tailwindcss/pull/2679), [#2700](https://github.com/tailwindlabs/tailwindcss/pull/2700)) +- Enable `focus-within` for all plugins that have `focus` enabled by default ([1a21f072](https://github.com/tailwindlabs/tailwindcss/commit/1a21f0721c7368d61fa3feef33d616de3f78c7d7), [f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) +- Added new `ring` utilities for creating outline/focus rings using box shadows ([#2747](https://github.com/tailwindlabs/tailwindcss/pull/2747), [879f088](https://github.com/tailwindlabs/tailwindcss/commit/879f088), [e0788ef](https://github.com/tailwindlabs/tailwindcss/commit/879f088)) +- Added `5` and `95` to opacity scale ([#2747](https://github.com/tailwindlabs/tailwindcss/pull/2747)) +- Add support for default duration and timing function values whenever enabling transitions ([#2755](https://github.com/tailwindlabs/tailwindcss/pull/2755)) + +### Changed + +- Completely redesign color palette ([#2623](https://github.com/tailwindlabs/tailwindcss/pull/2623), [700866c](https://github.com/tailwindlabs/tailwindcss/commit/700866ce5e0c0b8d140be161c4d07fc6f31242bc), [#2633](https://github.com/tailwindlabs/tailwindcss/pull/2633)) +- Drop support for Node 8 and 10 ([#2582](https://github.com/tailwindlabs/tailwindcss/pull/2582)) +- Removed `target` feature and dropped any compatibility with IE 11 ([#2571](https://github.com/tailwindlabs/tailwindcss/pull/2571)) +- Upgrade to PostCSS 8 (but include PostCSS 7 compatibility build) ([729b400](https://github.com/tailwindlabs/tailwindcss/commit/729b400a685973f46af73c8a68b364f20f7c5e1e), [1d8679d](https://github.com/tailwindlabs/tailwindcss/commit/1d8679d37e0eb1ba8281b2076bade5fc754f47dd), [c238ed1](https://github.com/tailwindlabs/tailwindcss/commit/c238ed15b5c02ff51978965511312018f2bc2cae)) +- Removed `shadow-outline`, `shadow-solid`, and `shadow-xs` by default in favor of new `ring` API ([#2747](https://github.com/tailwindlabs/tailwindcss/pull/2747)) +- Switch `normalize.css` to `modern-normalize` ([#2572](https://github.com/tailwindlabs/tailwindcss/pull/2572)) +- Rename `whitespace-no-wrap` to `whitespace-nowrap` ([#2664](https://github.com/tailwindlabs/tailwindcss/pull/2664)) +- Rename `flex-no-wrap` to `flex-nowrap` ([#2676](https://github.com/tailwindlabs/tailwindcss/pull/2676)) +- Remove `clearfix` utility, recommend `flow-root` instead ([#2766](https://github.com/tailwindlabs/tailwindcss/pull/2766)) +- Disable `hover` and `focus` for `fontWeight` utilities by default ([f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) +- Remove `grid-gap` fallbacks needed for old versions of Safari ([5ec45fa](https://github.com/tailwindlabs/tailwindcss/commit/5ec45fa)) +- Change special use of 'default' in config to 'DEFAULT' ([#2580](https://github.com/tailwindlabs/tailwindcss/pull/2580)) +- New `@apply` implementation, slight backwards incompatibilities with previous behavior ([#2159](https://github.com/tailwindlabs/tailwindcss/pull/2159)) +- Make `theme` retrieve the expected resolved value when theme value is complex ([e13f083c4](https://github.com/tailwindlabs/tailwindcss/commit/e13f083c4bc48bf9870d27c966136a9584943127)) +- Move `truncate` class to `textOverflow` core plugin ([#2562](https://github.com/tailwindlabs/tailwindcss/pull/2562)) +- Remove `scrolling-touch` and `scrolling-auto` utilities ([#2573](https://github.com/tailwindlabs/tailwindcss/pull/2573)) +- Modernize default system font stacks ([#1711](https://github.com/tailwindlabs/tailwindcss/pull/1711)) +- Upgrade to PurgeCSS 3.0 ([8e4e0a0](https://github.com/tailwindlabs/tailwindcss/commit/8e4e0a0eb8dcbf84347c7562988b4f9afd344081)) +- Change default `text-6xl` font-size to 3.75rem instead of 4rem ([#2619](https://github.com/tailwindlabs/tailwindcss/pull/2619)) +- Ignore `[hidden]` elements within `space` and `divide` utilities instead of `template` elements ([#2642](https://github.com/tailwindlabs/tailwindcss/pull/2642)) +- Automatically prefix keyframes and animation names when a prefix is configured ([#2621](https://github.com/tailwindlabs/tailwindcss/pull/2621), [#2641](https://github.com/tailwindlabs/tailwindcss/pull/2641)) +- Merge `extend` objects deeply by default ([#2679](https://github.com/tailwindlabs/tailwindcss/pull/2679)) +- Respect `preserveHtmlElements` option even when using custom PurgeCSS extractor ([#2704](https://github.com/tailwindlabs/tailwindcss/pull/2704)) +- Namespace all internal custom properties under `tw-` to avoid collisions with end-user custom properties ([#2771](https://github.com/tailwindlabs/tailwindcss/pull/2771)) + +## [2.0.0-alpha.25] - 2020-11-17 + +### Fixed + +- Fix issue where `ring-offset-0` didn't work due to unitless `0` in `calc` function ([3de0c48](https://github.com/tailwindlabs/tailwindcss/commit/3de0c48)) + +## [2.0.0-alpha.24] - 2020-11-16 + +### Changed + +- Don't override ring color when overriding ring width with a variant ([e40079a](https://github.com/tailwindlabs/tailwindcss/commit/e40079a)) + +### Fixed + +- Prevent shadow/ring styles from cascading to children ([e40079a](https://github.com/tailwindlabs/tailwindcss/commit/e40079a)) +- Ensure rings have a default color even if `colors.blue.500` is not present in config ([e40079a](https://github.com/tailwindlabs/tailwindcss/commit/e40079a)) + +## [2.0.0-alpha.23] - 2020-11-16 + +### Added + +- Add scripts for generating a PostCSS 7 compatible build alongside PostCSS 8 version ([#2773](https://github.com/tailwindlabs/tailwindcss/pull/2773)) + +### Changed + +- All custom properties have been internally namespaced under `tw-` to avoid collisions with end-user custom properties ([#2771](https://github.com/tailwindlabs/tailwindcss/pull/2771)) + +## [2.0.0-alpha.22] - 2020-11-16 + +### Changed + +- ~~All custom properties have been internally namespaced under `tw-` to avoid collisions with end-user custom properties ([#2771](https://github.com/tailwindlabs/tailwindcss/pull/2771))~~ I made a git boo-boo, check alpha.23 instead + +## [2.0.0-alpha.21] - 2020-11-15 + +### Changed + +- Upgrade to PostCSS 8, Autoprefixer 10, move `postcss` and `autoprefixer` to peerDependencies ([729b400](https://github.com/tailwindlabs/tailwindcss/commit/729b400)) + +## [2.0.0-alpha.20] - 2020-11-13 + +### Changed + +- Remove `clearfix` utility, recommend `flow-root` instead ([#2766](https://github.com/tailwindlabs/tailwindcss/pull/2766)) + +## [2.0.0-alpha.19] - 2020-11-13 + +### Fixed + +- Don't crash when color palette is empty ([278c203](https://github.com/tailwindlabs/tailwindcss/commit/278c203)) + +## [2.0.0-alpha.18] - 2020-11-13 + +### Changed + +- `black` and `white` have been added to `colors.js` ([b3ed724](https://github.com/tailwindlabs/tailwindcss/commit/b3ed724)) + +### Fixed + +- Add support for colors as closures to `ringColor` and `ringOffsetColor`, previously would crash build ([62a47f9](https://github.com/tailwindlabs/tailwindcss/commit/62a47f9)) + +## [2.0.0-alpha.17] - 2020-11-13 + +### Changed + +- Remove `grid-gap` fallbacks needed for old versions of Safari ([5ec45fa](https://github.com/tailwindlabs/tailwindcss/commit/5ec45fa)) + +## [2.0.0-alpha.16] - 2020-11-12 + +### Added + +- Enable `focus`, `focus-within`, and `dark` variants (when enabled) for all ring utilities by default ([e0788ef](https://github.com/tailwindlabs/tailwindcss/commit/879f088)) + +## [2.0.0-alpha.15] - 2020-11-11 + +### Added + +- Added `ring-inset` utility for rendering rings as inset shadows ([879f088](https://github.com/tailwindlabs/tailwindcss/commit/879f088)) + +### Changed + +- `ringWidth` utilities always reset ring styles to ensure no accidental variable inheritance through the cascade ([879f088](https://github.com/tailwindlabs/tailwindcss/commit/879f088)) + +## [2.0.0-alpha.14] - 2020-11-11 + +### Added + +- Enable `focus-within` for `outline` utilities by default ([f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) +- Enable `focus-within` for `ringWidth` utilities by default ([f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) +- Enable `group-hover` for `boxShadow` utilities by default ([f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) +- Enable `group-hover` and `focus-within` for `textDecoration` utilities by default ([f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) + +### Changed + +- Disable `hover` and `focus` for `fontWeight` utilities by default ([f6923b1](https://github.com/tailwindlabs/tailwindcss/commit/f6923b1)) + +## [2.0.0-alpha.13] - 2020-11-11 + +### Added + +- Add support for default duration and timing function values whenever enabling transitions ([#2755](https://github.com/tailwindlabs/tailwindcss/pull/2755)) + +## [2.0.0-alpha.12] - 2020-11-10 + +### Fixed + +- Prevent `boxShadow` utilities from overriding ring shadows added by components like in the custom forms plugin ([c3dd3b6](https://github.com/tailwindlabs/tailwindcss/commit/c3dd3b68454ad418833a9edf7f3409cad66fb5b0)) + +## [2.0.0-alpha.11] - 2020-11-09 + +### Fixed + +- Convert `none` to `0 0 #0000` when used for shadows to ensure compatibility with `ring` utilities ([4eecc27](https://github.com/tailwindlabs/tailwindcss/commit/4eecc2751ca0c461e8da5bd5772ae650197a2e5d)) + +## [2.0.0-alpha.10] - 2020-11-09 + +### Added + +- Added new `ring` utilities ([#2747](https://github.com/tailwindlabs/tailwindcss/pull/2747)) +- Added `5` and `95` to opacity scale ([#2747](https://github.com/tailwindlabs/tailwindcss/pull/2747)) + +### Changed + +- Removed `shadow-outline`, `shadow-solid`, and `shadow-xs` in favor of new `ring` API ([#2747](https://github.com/tailwindlabs/tailwindcss/pull/2747)) + +## [2.0.0-alpha.9] - 2020-11-07 + +### Added + +- Added `shadow-solid` utility, a 2px solid shadow that uses the current text color ([369cfae](https://github.com/tailwindlabs/tailwindcss/commit/369cfae2905a577033529c46a5e8ca58c69f5623)) +- Enable `focus-within` where useful by default ([1a21f072](https://github.com/tailwindlabs/tailwindcss/commit/1a21f0721c7368d61fa3feef33d616de3f78c7d7)) + +### Changed + +- Update `shadow-outline` to use the new blue ([b078238](https://github.com/tailwindlabs/tailwindcss/commit/b0782385c9832d35a10929b38b4fcaf27e055d6b)) + +## [2.0.0-alpha.8] - 2020-11-06 + +### Added + +- Add `11` to spacing scale ([7f05204](https://github.com/tailwindlabs/tailwindcss/commit/7f05204ce7a5581b6845591448265c3c21afde86)) +- Add percentage-based height values ([5259560](https://github.com/tailwindlabs/tailwindcss/commit/525956065272dc53e8f8395f55f9ad13077a38d1)) +- Add indigo to the color palette by default ([700866c](https://github.com/tailwindlabs/tailwindcss/commit/700866ce5e0c0b8d140be161c4d07fc6f31242bc)) + +### Changed + +- Use `coolGray` as the default gray ([700866c](https://github.com/tailwindlabs/tailwindcss/commit/700866ce5e0c0b8d140be161c4d07fc6f31242bc)) + +## [2.0.0-alpha.7] - 2020-11-05 + +### Changed + +- Revert upgrading to PostCSS 8 lol + +## [2.0.0-alpha.6] - 2020-11-04 + +### Changed + +- Respect `preserveHtmlElements` option even when using custom PurgeCSS extractor ([#2704](https://github.com/tailwindlabs/tailwindcss/pull/2704)) +- Set font-family and line-height to `inherit` on `body` to behave more like v1.x ([#2729](https://github.com/tailwindlabs/tailwindcss/pull/2729)) + +## [2.0.0-alpha.5] - 2020-10-30 + +### Changed + +- Upgrade to PostCSS 8 ([59aa484](https://github.com/tailwindlabs/tailwindcss/commit/59aa484dfea0607d96bff6ef41b1150c78576c37)) + +## [2.0.0-alpha.4] - 2020-10-29 + +### Added + +- Support deep merging of arrays of objects under `extend` ([#2700](https://github.com/tailwindlabs/tailwindcss/pull/2700)) + +## [2.0.0-alpha.3] - 2020-10-27 + +### Added + +- Support flattening deeply nested color objects ([#2148](https://github.com/tailwindlabs/tailwindcss/pull/2148)) +- Support defining presets as functions ([#2680](https://github.com/tailwindlabs/tailwindcss/pull/2680)) + +### Changed + +- Merge `extend` objects deeply by default ([#2679](https://github.com/tailwindlabs/tailwindcss/pull/2679)) +- Rename `flex-no-wrap` to `flex-nowrap` ([#2676](https://github.com/tailwindlabs/tailwindcss/pull/2676)) + +## [2.0.0-alpha.2] - 2020-10-25 + +### Added + +- Support `extend` in `variants` configuration ([#2651](https://github.com/tailwindlabs/tailwindcss/pull/2651)) +- Add `max-w-prose` class by default ([#2574](https://github.com/tailwindlabs/tailwindcss/pull/2574)) + +### Changed + +- Revert use of logical properties for `space` and `divide` utilities ([#2644](https://github.com/tailwindlabs/tailwindcss/pull/2644)) +- `space` and `divide` utilities ignore elements with `[hidden]` now instead of only ignoring `template` elements ([#2642](https://github.com/tailwindlabs/tailwindcss/pull/2642)) +- Set default font on `body`, not just `html` ([#2643](https://github.com/tailwindlabs/tailwindcss/pull/2643)) +- Automatically prefix keyframes and animation names when a prefix is configured ([#2621](https://github.com/tailwindlabs/tailwindcss/pull/2621), [#2641](https://github.com/tailwindlabs/tailwindcss/pull/2641)) +- Rename `whitespace-no-wrap` to `whitespace-nowrap` ([#2664](https://github.com/tailwindlabs/tailwindcss/pull/2664)) + +## [1.9.6] - 2020-10-23 + +### Changed + +- The `presets` feature had unexpected behavior where a preset config without its own `presets` key would not extend the default config. ([#2662](https://github.com/tailwindlabs/tailwindcss/pull/2662)) + + If you were depending on this unexpected behavior, just add `presets: []` to your own preset to exclude the default configuration. + +## [2.0.0-alpha.1] - 2020-10-20 + +### Added + +- Added dark mode support ([#2279](https://github.com/tailwindlabs/tailwindcss/pull/2279), [#2631](https://github.com/tailwindlabs/tailwindcss/pull/2631)) +- Added `overflow-ellipsis` and `overflow-clip` utilities ([#1289](https://github.com/tailwindlabs/tailwindcss/pull/1289)) +- Add `transform-gpu` to force hardware acceleration on transforms when beneficial ([#1380](https://github.com/tailwindlabs/tailwindcss/pull/1380)) +- Extended spacing scale ([#2630](https://github.com/tailwindlabs/tailwindcss/pull/2630)) +- Add spacing scale to `inset` plugin ([#2630](https://github.com/tailwindlabs/tailwindcss/pull/2630)) +- Enable useful relative sizes for more plugins ([#2630](https://github.com/tailwindlabs/tailwindcss/pull/2630)) +- Extend font size scale ([#2609](https://github.com/tailwindlabs/tailwindcss/pull/2609), [#2619](https://github.com/tailwindlabs/tailwindcss/pull/2619)) +- Support using `@apply` with complex classes ([#2159](https://github.com/tailwindlabs/tailwindcss/pull/2159)) +- Add new `2xl` breakpoint ([#2609](https://github.com/tailwindlabs/tailwindcss/pull/2609)) +- Add default line-height values for font-size utilities ([#2609](https://github.com/tailwindlabs/tailwindcss/pull/2609)) +- Support defining theme values using arrays wherever it makes sense (box-shadow, transition-property, etc.) ([e13f083c4](https://github.com/tailwindlabs/tailwindcss/commit/e13f083c4bc48bf9870d27c966136a9584943127)) +- Enable `group-hover` for color utilities by default ([28985b6](https://github.com/tailwindlabs/tailwindcss/commit/28985b6cd592e72d4849fdb9ce97eb045744e09c)) +- Enable `focus` for z-index utilities by default ([ae5b3d3](https://github.com/tailwindlabs/tailwindcss/commit/ae5b3d312d5000ae9c2065001f3df7add72dc365)) + +### Changed + +- New `@apply` implementation, slight backwards incompatibilities with previous behavior ([#2159](https://github.com/tailwindlabs/tailwindcss/pull/2159)) +- Move `truncate` class to `textOverflow` core plugin ([#2562](https://github.com/tailwindlabs/tailwindcss/pull/2562)) +- Removed `target` feature and dropped any compatibility with IE 11 ([#2571](https://github.com/tailwindlabs/tailwindcss/pull/2571)) +- Switch `normalize.css` to `modern-normalize` ([#2572](https://github.com/tailwindlabs/tailwindcss/pull/2572)) +- Remove `scrolling-touch` and `scrolling-auto` utilities ([#2573](https://github.com/tailwindlabs/tailwindcss/pull/2573)) +- Change special use of 'default' in config to 'DEFAULT' ([#2580](https://github.com/tailwindlabs/tailwindcss/pull/2580)) +- Drop support for Node 8 and 10 ([#2582](https://github.com/tailwindlabs/tailwindcss/pull/2582)) +- Modernize default system font stacks ([#1711](https://github.com/tailwindlabs/tailwindcss/pull/1711)) +- Upgrade to PurgeCSS 3.0 +- ~~Upgrade to PostCSS 8.0~~ Reverted for now +- Use logical properties for `space` and `divide` utilities ([#1883](https://github.com/tailwindlabs/tailwindcss/pull/1883)) +- Make `theme` retrieve the expected resolved value when theme value is complex ([e13f083c4](https://github.com/tailwindlabs/tailwindcss/commit/e13f083c4bc48bf9870d27c966136a9584943127)) +- Adjust default font-size scale to include 60px instead of 64px ([#2619](https://github.com/tailwindlabs/tailwindcss/pull/2619)) +- Update default colors in Preflight to match new color palette ([#2633](https://github.com/tailwindlabs/tailwindcss/pull/2633)) + +## [1.9.5] - 2020-10-19 + +### Fixed + +- Fix issue where using `theme` with default line-heights did not resolve correctly + +## [1.9.4] - 2020-10-17 + +### Fixed + +- Fix issue changing plugins defined using the `withOptions` API would not trigger rebuilds in watch processes + +## [1.9.3] - 2020-10-16 + +### Fixed + +- Fix issue where `tailwindcss init --full` scaffolded a corrupt config file (https://github.com/tailwindlabs/tailwindcss/issues/2556) + +### Changed + +- Remove console warnings about upcoming breaking changes + +## [1.9.2] - 2020-10-14 + +### Fixed + +- Merge plugins when merging config with preset ([#2561](https://github.com/tailwindlabs/tailwindcss/pulls/#2561) +- Use `word-wrap` and `overflow-wrap` together, not one or the other since `word-wrap` is IE-only + +## [1.9.1] - 2020-10-14 + +### Fixed + +- Don't import `corePlugins` in `resolveConfig` to avoid bundling browser-incompatible code ([#2548](https://github.com/tailwindlabs/tailwindcss/pull/2548)) + +## [1.9.0] - 2020-10-12 + +### Added + +- Add new `presets` config option ([#2474](https://github.com/tailwindlabs/tailwindcss/pull/2474)) +- Scaffold new `tailwind.config.js` files with available `future` flags commented out ([#2379](https://github.com/tailwindlabs/tailwindcss/pull/2379)) +- Add `col-span-full` and `row-span-full` ([#2471](https://github.com/tailwindlabs/tailwindcss/pull/2471)) +- Make `outline` configurable, `outline-none` more accessible by default, and add `outline-black` and `outline-white` ([#2460](https://github.com/tailwindlabs/tailwindcss/pull/2460)) +- Add additional small `rotate` and `skew` values ([#2528](https://github.com/tailwindlabs/tailwindcss/pull/2528)) +- Add `xl`, `2xl`, and `3xl` border radius values ([#2529](https://github.com/tailwindlabs/tailwindcss/pull/2529)) +- Add new utilities for `grid-auto-columns` and `grid-auto-rows` ([#2531](https://github.com/tailwindlabs/tailwindcss/pull/2531)) +- Promote `defaultLineHeights` and `standardFontWeights` from experimental to future + +### Fixed + +- Don't escape keyframe values ([#2432](https://github.com/tailwindlabs/tailwindcss/pull/2432)) +- Use `word-wrap` instead of `overflow-wrap` in `ie11` target mode ([#2391](https://github.com/tailwindlabs/tailwindcss/pull/2391)) + +### Experimental + +- Add experimental `2xl` breakpoint ([#2468](https://github.com/tailwindlabs/tailwindcss/pull/2468)) +- Rename `{u}-max-content` and `{u}-min-content` utilities to `{u}-max` and `{u}-min` in experimental extended spacing scale ([#2532](https://github.com/tailwindlabs/tailwindcss/pull/2532)) +- Support disabling dark mode variants globally ([#2530](https://github.com/tailwindlabs/tailwindcss/pull/2530)) + +## [1.8.13] - 2020-10-09 + +### Fixed + +- Support defining colors as closures even when opacity variables are not supported ([#2536](https://github.com/tailwindlabs/tailwindcss/pull/2515)) + +## [1.8.12] - 2020-10-07 + +### Fixed + +- Reset color opacity variable in utilities generated using closure colors ([#2515](https://github.com/tailwindlabs/tailwindcss/pull/2515)) + +## [1.8.11] - 2020-10-06 + +- Make `tailwindcss.plugin` work in ESM environments for reasons + +## [1.8.10] - 2020-09-14 + +### Fixed + +- Prevent new `dark` experiment from causing third-party `dark` variants to inherit stacking behavior ([#2382](https://github.com/tailwindlabs/tailwindcss/pull/2382)) + +## [1.8.9] - 2020-09-13 + +### Fixed + +- Add negative spacing values to inset plugin in the `extendedSpacingScale` experiment ([#2358](https://github.com/tailwindlabs/tailwindcss/pull/2358)) +- Fix issue where `!important` was stripped from declarations within rules that used `@apply` with `applyComplexClasses` ([#2376](https://github.com/tailwindlabs/tailwindcss/pull/2376)) + +### Changed + +- Add `future` section to config stubs ([#2372](https://github.com/tailwindlabs/tailwindcss/pull/2372), [3090b98](https://github.com/tailwindlabs/tailwindcss/commit/3090b98ece766b1046abe5bbaa94204e811f7fac)) + +## [1.8.8] - 2020-09-11 + +### Fixed + +- Register dark mode plugin outside of `resolveConfig` code path ([#2368](https://github.com/tailwindlabs/tailwindcss/pull/2368)) + +## [1.8.7] - 2020-09-10 + +### Fixed + +- Fix issue where classes in escaped strings (like `class=\"block\"`) weren't extracted properly for purging ([#2364](https://github.com/tailwindlabs/tailwindcss/pull/2364)) + +## [1.8.6] - 2020-09-09 + +### Fixed + +- Fix issue where container padding not applied when using object syntax ([#2353](https://github.com/tailwindlabs/tailwindcss/pull/2353)) + +## [1.8.5] - 2020-09-07 + +### Fixed + +- Fix issue where `resolveConfig` didn't take into account configs added by feature flags ([#2347](https://github.com/tailwindlabs/tailwindcss/pull/2347)) + +## [1.8.4] - 2020-09-06 + +### Fixed + +- Fix [issue](https://github.com/tailwindlabs/tailwindcss/issues/2258) where inserting extra PurgeCSS control comments could break integrated PurgeCSS support +- Fix issue where dark variant in 'class' mode was incompatible with 'group-hover' variant ([#2337](https://github.com/tailwindlabs/tailwindcss/pull/2337)) +- Support basic nesting structure with `@apply` when using the `applyComplexClasses` experiment ([#2271](https://github.com/tailwindlabs/tailwindcss/pull/2271)) + +### Changed + +- Rename `font-hairline` and `font-thin` to `font-thin` and `font-extralight` behind `standardFontWeights` flag (experimental until v1.9.0) ([#2333](https://github.com/tailwindlabs/tailwindcss/pull/2333)) + +## [1.8.3] - 2020-09-05 + +### Fixed + +- Fix issue where `font-variant-numeric` utilities would break in combination with most CSS minifier configurations ([f3660ce](https://github.com/tailwindlabs/tailwindcss/commit/f3660ceed391cfc9390ca4ea1a729a955e64b895)) +- Only warn about `conservative` purge mode being deprecated once per process ([58781b5](https://github.com/tailwindlabs/tailwindcss/commit/58781b517daffbaf80fc5c0791d311f53b2d67d8)) + +## [1.8.2] - 2020-09-04 + +### Fixed + +- Fix bug where dark mode variants would cause an error if you had a `plugins` array in your config ([#2322](https://github.com/tailwindlabs/tailwindcss/pull/2322)) + +## [1.8.1] - 2020-09-04 + +### Fixed + +- Fix bug in the new font-variant-numeric utilities which broke the whole rule ([#2318](https://github.com/tailwindlabs/tailwindcss/pull/2318)) +- Fix bug while purging ([#2320](https://github.com/tailwindlabs/tailwindcss/pull/2320)) + +## [1.8.0] - 2020-09-04 + +### Added + +- Dark mode variant (experimental) ([#2279](https://github.com/tailwindlabs/tailwindcss/pull/2279)) +- New `preserveHtmlElements` option for `purge` ([#2283](https://github.com/tailwindlabs/tailwindcss/pull/2283)) +- New `layers` mode for `purge` ([#2288](https://github.com/tailwindlabs/tailwindcss/pull/2288)) +- New `font-variant-numeric` utilities ([#2305](https://github.com/tailwindlabs/tailwindcss/pull/2305)) +- New `place-items`, `place-content`, `place-self`, `justify-items`, and `justify-self` utilities ([#2306](https://github.com/tailwindlabs/tailwindcss/pull/2306)) +- Support configuring variants as functions ([#2309](https://github.com/tailwindlabs/tailwindcss/pull/2309)) + +### Changed + +- CSS within `@layer` at-rules are now grouped with the corresponding `@tailwind` at-rule ([#2312](https://github.com/tailwindlabs/tailwindcss/pull/2312)) + +### Deprecated + +- `conservative` purge mode, deprecated in favor of `layers` + +## [1.7.6] - 2020-08-29 + +### Fixed + +- Fix bug where the new experimental `@apply` implementation broke when applying a variant class with the important option globally enabled + +## [1.7.5] - 2020-08-28 + +### Changed + +- Update lodash to latest to silence security warnings + +## [1.7.4] - 2020-08-26 + +### Added + +- Add new -p flag to CLI to quickly scaffold a `postcss.config.js` file + +### Changed + +- Make `@apply` insensitive to whitespace in the new `applyComplexClasses` experiment + +### Fixed + +- Fix bug where the new `applyComplexClasses` experiment didn't behave as expected with rules with multiple selectors, like `.foo, .bar { color: red }` + +## [1.7.3] - 2020-08-20 + +### Changed + +- Log feature flag notices to stderr instead of stdout to preserve compatibility with pipe-based build systems +- Add missing bg-none utility for disabling background images + +### Fixed + +- Fix bug that prevented defining colors as closures when the `gradientColorStops` plugin was enabled + +## [1.7.2] - 2020-08-19 + +### Added + +- Reuse generated CSS as much as possible in long-running processes instead of needlessly recalculating + +## [1.7.1] - 2020-08-28 + +### Changed + +- Don't issue duplicate flag notices in long-running build processes + +## [1.7.0] - 2020-08-28 + +### Added + +- Gradients +- New background-clip utilities +- New `contents` display utility +- Default letter-spacing per font-size +- Divide border styles +- Access entire config object from plugins +- Define colors as closures +- Use `@apply` with variants and other complex classes (experimental) +- New additional color-palette (experimental) +- Extended spacing scale (experimental) +- Default line-heights per font-size by default (experimental) +- Extended font size scale (experimental) + +### Deprecated + +- Deprecated gap utilities + +## [1.6.3] - 2020-08-18 + +### Fixed + +- Fixes issue where motion-safe and motion-reduce variants didn't stack correctly with group-hover variants + +## [1.6.2] - 2020-08-03 + +### Fixed + +- Fixes issue where `@keyframes` respecting the important option would break animations in Chrome + +## [1.6.1] - 2020-08-02 + +### Fixed + +- Fixes an issue where animation keyframes weren't included in the build without @tailwind base (#2108) + +## [1.6.0] - 2020-07-28 + +### Added + +- Animation support +- New `prefers-reduced-motion` variants +- New `overscroll-behaviour` utilities +- Generate CSS without an input file + +## [1.5.2] - 2020-07-21 + +### Fixed + +- Fixes issue where you could no longer use `@apply` with unprefixed class names if you had configured a prefix + +## [1.5.1] - 2020-07-15 + +### Fixed + +- Fixes accidental breaking change where adding component variants using the old manual syntax (as recommended in the docs) stopped working + +## [1.5.0] - 2020-07-15 + +### Added + +- Component `variants` support +- Responsive `container` variants +- New `focus-visible` variant +- New `checked` variant + +## v0.0.0-658250a96 - 2020-07-12 [YANKED] + +No release notes + +## [1.4.6] - 2020-05-08 + +### Changed + +- Explicitly error when using a class as the important config option instead of just generating the wrong CSS + +## [1.4.5] - 2020-05-06 + +### Fixed + +- Fix bug where the `divideColor` plugin was using the wrong '' in IE11 target mode + +## [1.4.4] - 2020-05-01 + +### Fixed + +- Fix bug where target: 'browserslist' didn't work, only `target: ['browserslist', {...}]` did + +## [1.4.3] - 2020-05-01 + +### Changed + +- Don't generate unnecessary CSS in color plugins when color opacity utilities are disabled + +## [1.4.2] - 2020-05-01 + +### Fixed + +- Fix issue where `purge: { enabled: false }` was ignored, add `purge: false` shorthand + +## [1.4.1] - 2020-04-30 + +### Changed + +- Improve built-in PurgeCSS extractor to better support Haml and Slim templates + +## [1.4.0] - 2020-04-29 + +### Added + +- New color opacity utilities +- Built-in PurgeCSS +- IE 11 target mode (experimental) + +## [1.3.5] - 2020-04-23 + +### Removed + +- Drop `fs-extra` dependency to `^8.0.0` to preserve Node 8 compatibility until Tailwind 2.0 + +### Fixed + +- Fix missing unit in calc bug in space plugin (`space-x-0` didn't work for example) + +## [1.3.4] - 2020-04-21 + +### Fixed + +- Fix bug where `divide-{x/y}-0` utilities didn't work due to missing unit in `calc` call + +## [1.3.3] - 2020-04-21 + +### Added + +- Add forgotten responsive variants for `space`, `divideWidth`, and `divideColor` utilities + +## [1.3.1] - 2020-04-21 + +### Fixed + +- Fix bug where the `space-x` utilities were not being applied correctly due to referencing `--space-y-reverse` instead of `--space-x-reverse` + +## [1.3.0] - 2020-04-21 + +### Added + +- New `space` and `divide` layout utilities +- New `transition-delay` utilities +- New `group-focus` variant +- Support for specifying a default line-height for each font-size utility +- Support for breakpoint-specific padding for `container` class +- Added `current` to the default color palette +- New `inline-grid` utility +- New `flow-root` display utility +- New `clear-none` utility + +## [1.2.0] - 2020-02-05 + +### Added + +- CSS Transition support +- CSS Transform support +- CSS Grid support +- Added `max-w-{screen}` utilities +- Added `max-w-none` utility +- Added `rounded-md` utility +- Added `shadow-sm` utility +- Added `shadow-xs` utility +- Added `stroke-width` utilities +- Added fixed line-height utilities +- Added additional display utilities for table elements +- Added box-sizing utilities +- Added clear utilities +- Config file dependencies are now watchable +- Added new `plugin` and `plugin.withOptions` APIs + +### Changed + +- Allow plugins to extend the user's config + +## [1.2.0-canary.8] - 2020-02-05 + +### Added + +- Add additional fixed-size line-height utilities + +## [1.2.0-canary.7] - 2020-02-04 + +### Removed + +- Remove Inter from font-sans, plan to add later under new class + +## [1.2.0-canary.6] - 2020-02-03 + +### Added + +- Add system-ui to default font stack +- Add shadow-xs, increase shadow-sm alpha to 0.05 +- Support import syntax even without postcss-import +- Alias tailwind bin to tailwindcss +- Add fill/stroke to transition-colors +- Add transition-shadow, add box-shadow to default transition +- Combine gap/columnGap/rowGap +- Add grid row utilities +- Add skew utilities + +### Changed + +- Use font-sans as default font + +## [1.2.0-canary.5] - 2020-01-08 + +### Added + +- Adds missing dependency `resolve` which is required for making config dependencies watchable + +## [1.2.0-canary.4] - 2020-01-08 + +### Added + +- CSS Transition support +- CSS Transform support +- CSS Grid support +- New `max-w-{screen}` utilities +- Added `max-w-none` utility +- Added "Inter" to the default sans-serif font stack +- Add `rounded-md` utility +- Add `shadow-sm` utility +- Added stroke-width utilities +- Added additional display utilities for table elements +- Added box-sizing utilities +- Added clear utilities +- Config file dependencies are now watchable +- Allow plugins to extend the user's config +- Add new `plugin` and `plugin.withOptions` APIs + +## [v1.2.0-canary.3] - 2020-01-08 [YANKED] + +No release notes + +## [1.1.4] - 2019-11-25 + +### Changed + +- Note: Although this is a bugfix it could affect your site if you were working around the bug in your own code by not prefixing the `.group` class. I'm sorry 😞 + +### Fixed + +- Fixes a bug where the `.group` class was not receiving the user's configured prefix when using the `prefix` option + +## [1.2.0-canary.1] - 2019-10-22 + +### Changed + +- Don't watch `node_modules` files for changes + +### Fixed + +- Fixes significant build performance regression in `v1.2.0-canary.0` + +## [1.1.3] - 2019-10-22 + +### Fixed + +- Fixes an issue where in some cases function properties in the user's `theme` config didn't receive the second utils argument + +## [1.2.0-canary.0] - 2019-10-14 + +### Added + +- Automatically watch all config file dependencies (plugins, design tokens imported from other files, etc.) for changes when build watcher is running +- Add `justify-evenly` utility + +### Changed + +- Allow plugins to add their own config file to be resolved with the user's custom config + +## [1.1.2] - 2019-08-14 + +### Fixed + +- Fixes a bug with horizontal rules where they were displayed with a 2px border instead of a 1px border +- Fixes a bug with horizontal rules where they were rendered with default top/bottom margin + +## [1.1.1] - 2019-08-09 + +### Fixed + +- Fixes issue where values like `auto` would fail to make it through the default negative margin config + +## [1.1.0] - 2019-08-06 + +### Added + +- Added utilities for screenreader visibility +- Added utilities for placeholder color +- First, last, even, and odd child variants +- Disabled variant +- Visited variant +- Increase utility specificity using a scope instead of !important +- Add hover/focus variants for opacity by default +- Added `border-double` utility +- Support negative prefix for boxShadow and letterSpacing plugins +- Support passing config path via object + +### Fixed + +- Placeholders no longer have a default opacity +- Make horizontal rules visible by default +- Generate correct negative margins when using calc + +## [1.0.6] - 2019-08-01 + +### Fixed + +- Fixes issue where modifiers would mutate nested rules + +## [1.0.5] - 2019-07-11 + +### Added + +- Support built-in variants for utilities that include pseudo-elements + +### Changed + +- Update several dependencies, including postcss-js which fixes an issue with using `!important` directly in Tailwind utility plugins + +## [1.0.4] - 2019-06-11 + +### Changed + +- Increase precision of percentage width values to avoid 1px rounding issues in grid layouts + +## [1.0.3] - 2019-06-01 + +### Changed + +- Throws an error when someone tries to use `@tailwind preflight` instead of `@tailwind base`, this is the source of many support requests + +## [1.0.2] - 2019-05-27 + +### Fixed + +- Fixes a bug where `@screen` rules weren't bubbled properly when nested in plugins + +## [1.0.1] - 2019-05-13 + +### Fixed + +- Fixes a bug where global variants weren't properly merged + +## [1.0.0] - 2019-05-13 + +No release notes + +## [1.0.0-beta.10] - 2019-05-12 + +### Changed + +- Use `9999` and `-9999` for `order-last` and `order-first` utilities respectively + +## [1.0.0-beta.9] - 2019-05-12 + +### Added + +- Add `bg-repeat-round` and `bg-repeat-space` utilities +- Add `select-all` and `select-auto` utilities + +### Changed + +- Make all utilities responsive by default + +## [1.0.0-beta.8] - 2019-04-28 + +### Added + +- Adds `responsive` variants for the new order utilities by default, should have been there all along + +## [1.0.0-beta.7] - 2019-04-27 + +### Fixed + +- Fixes a bug where you couldn't extend the margin config + +## [1.0.0-beta.6] - 2019-04-27 + +### Added + +- Added support for negative inset (`-top-6`, `-right-4`) and z-index (`-z-10`) utilities, using the same negative key syntax supported by the margin plugin +- Add missing fractions as well as x/12 fractions to width scale +- Add `order` utilities +- Add `cursor-text` class by default + +### Changed + +- Make it possible to access your fully merged config file in JS + +### Removed + +- Removed `negativeMargin` plugin, now the regular `margin` plugin supports generating negative classes (like `-mx-6`) by using negative keys in the config, like `-6` + +## [1.0.0-beta.5] - 2019-04-18 + +### Changed + +- Make it possible to disable all core plugins using `corePlugins: false` +- Make it possible to configure a single list of variants that applies to all utility plugins +- Make it possible to safelist which core plugins should be enabled + +### Fixed + +- Fix a bug where stroke and fill plugins didn't properly handle the next object syntax for color definitions +- Fix a bug where you couldn't have comments near `@apply` directives + +## [1.0.0-beta.4] - 2019-03-29 + +### Added + +- Add the `container` key to the scaffolded config file when generated with `--full` + +### Changed + +- Bumps node dependency to 8.9.0 so we can keep our default config file clean, 6.9.0 is EOL next month anyways + +### Removed + +- Removes `SFMono-Regular` from the beginning of the default monospace font stack, it has no italic support and Menlo looks better anyways + +### Fixed + +- Fixes an issue where the user's config object was being mutated during processing (only affects @bradlc 😅) +- Fixes an issue where you couldn't use a closure to define theme sections under `extend` + +## [1.0.0-beta.3] - 2019-03-18 + +### Added + +- Support lazy evaluation in `theme.extend` + +### Changed + +- Use lighter default border color +- Revert #745 and use `bolder` for strong tags by default instead of `fontWeight.bold` + +## [1.0.0-beta.2] - 2019-03-17 + +### Changed + +- Closures in the `theme` section of the config file are now passed a `theme` function instead of an object + +### Fixed + +- Fix issue where `@screen` didn't work at all 🙃 + +## [1.0.0-beta.1] - 2019-03-17 + +### Added + +- New config file structure +- New expanded default color palette +- New default `maxWidth` scale +- Added utilities for `list-style-type` and `list-style-position` +- Added `break-all` utility + +### Changed + +- `object-position` utilities are now customizable under `theme.objectPosition` +- `cursor` utilities are now customizable under `theme.cursors` +- `flex-grow/shrink` utilities are now customizable under `theme.flexGrow/flexShrink` +- Default variant output position can be customized +- Extended default line-height scale +- Extended default letter-spacing scale + +## [0.7.4] - 2019-01-23 + +### Changed + +- Update our PostCSS related dependencies + +### Fixed + +- Fix bug where class names containing a `.`character had the responsive prefix added in the wrong place + +## [0.7.3] - 2018-12-03 + +### Changed + +- Update Normalize to v8.0.1 + +## [0.7.2] - 2018-11-05 + +### Added + +- Add `--no-autoprefixer` option to CLI `build` command + +## [0.7.1] - 2018-11-05 + +### Changed + +- Update autoprefixer dependency + +## [0.7.0] - 2018-10-31 + +### Added + +- Registering new variants from plugins +- Variant order can be customized per module +- Added focus-within variant +- Fancy CLI updates +- Option to generate config without comments +- Make configured prefix optional when using @apply +- Improve Flexbox behavior in IE 10/11 + +### Changed + +- Variant order in modules is now significant +- Normalize.css updated to v8.0.0 +- Removed CSS fix for Chrome 62 button border radius change + +## [0.6.6] - 2018-09-21 + +### Changed + +- Promote `shadowLookup` from experiment to official feature + +## [0.6.5] - 2018-08-18 + +### Fixed + +- Fixes an issue where units were stripped from zero value properties + +## [0.6.4] - 2018-07-16 + +### Fixed + +- Fixes an issue where changes to your configuration file were ignored when using `webpack --watch` + +## [0.6.3] - 2018-07-11 + +### Fixed + +- Fixes an issue where `@tailwind utilities` generated no output + +## [0.6.2] - 2018-03-11 + +### Added + +- Added table layout utilities for styling tables +- Configuration can now be passed as an object +- Registering new variants from plugins (experimental) +- Allow `@apply`-ing classes that aren't defined but would be generated (experimental) + +### Changed + +- Default config file changes + +## [0.6.1] - 2018-06-22 + +### Fixed + +- Fix incorrect box-shadow syntax for the `.shadow-outline` utility 🤦‍♂️ + +## [0.6.0] - 2018-06-21 + +### Added + +- Added border collapse utilities for styling tables +- Added more axis-specific overflow utilities +- Added `.outline-none` utility for suppressing focus styles +- Added `.shadow-outline` utility as an alternative to default browser focus styles +- Extended default padding, margin, negative margin, width, and height scales +- Enable focus and hover variants for more modules by default + +### Changed + +- Removed default `outline: none !important` styles from focusable but keyboard-inaccessible elements +- Moved screen prefix for responsive `group-hover` variants +- Default config file changes + +## [0.5.3] - 2018-05-07 + +### Changed + +- Improve sourcemaps for replaced styles like `preflight` + +### Fixed + +- Fix bug where informational messages were being logged to stdout during build, preventing the ability to use Tailwind's output in Unix pipelines + +## [0.5.2] - 2018-03-29 + +### Fixed + +- Fixes an issue with a dependency that had a security vulnerability + +## [0.5.1] - 2018-03-13 + +### Removed + +- Reverts a change that renamed the `.roman` class to `.not-italic` due to the fact that it breaks compatibility with cssnext: [postcss/postcss-selector-not#10](https://github.com/postcss/postcss-selector-not/issues/10). We'll stick with `.roman` for now with a plan to switch to `.not-italic` in another breaking version should that issue get resolved in postcss-selector-not. + +## [0.5.0] - 2018-03-13 + +### Added + +- Plugin system +- Added `.sticky position` utility +- Added `.cursor-wait` and `.cursor-move` utilities +- Added `.bg-auto` background size utility +- Background sizes are now customizable +- Support for active variants +- Better postcss-import support +- Configuration options for the `.container` component + +### Changed + +- The `.container` component is now a built-in plugin +- State variant precedence changes +- New config file keys +- `.overflow-x/y-scroll` now set `overflow: scroll` instead of `overflow: auto` +- `.roman` renamed to `.not-italic` + +## [0.4.3] - 2018-03-13 + +### Changed + +- Use `global.Object` to avoid issues with polyfills when importing the Tailwind config into other JS + +## [0.4.2] - 2018-03-01 + +### Added + +- Add support for using a function to define class prefixes in addition to a simple string + +### Changed + +- Improve the performance of @apply by using a lookup table instead of searching + +### Fixed + +- Fix an issue where borders couldn't be applied to `img` tags without specifying a border style + +## [0.4.1] - 2018-01-22 + +### Changed + +- Make default sans-serif font stack more future proof and safe to use with CSS `font` shorthand +- Replace stylefmt with Perfectionist to avoid weird stylelint conflicts + +## [0.4.0] - 2017-12-15 + +### Added + +- `@apply`'d classes can now be made `!important` explicitly + +### Changed + +- `@apply` now strips `!important` from any mixed in classes +- Default color palette tweaks + +## [0.3.0] - 2017-12-01 + +### Added + +- Enable/disable modules and control which variants are generated for each +- Focus variants +- Group hover variants +- New `@variants` at-rule +- Customize the separator character +- Missing config keys now fallback to their default values +- New utilities + +### Changed + +- Lists now have no margins by default +- `.pin` no longer sets width and height to 100% +- SVG `fill` no longer defaults to currentColor + +## [0.2.2] - 2017-11-19 + +### Fixed + +- Fix issue with dist files not being published due to bug in latest npm + +## [0.2.1] - 2017-11-18 + +### Fixed + +- Fix overly specific border-radius reset for Chrome 62 button styles + +## [0.2.0] - 2017-11-17 + +### Added + +- Add a custom prefix to all utilities +- Optionally make all utilities `!important` +- Round element corners independently +- Cascading border colors and styles + +### Changed + +- `auto` is no longer a hard-coded margin value +- The `defaultConfig` function is now a separate module +- Rounded utilities now combine position and radius size +- Border width utilities no longer affect border color/style +- `@apply` is now very strict about what classes can be applied +- Add `options` key to your config +- Spacing, radius, and border width utility declaration order changes + +## [0.1.6] - 2017-11-09 + +### Fixed + +- Fix CDN files not being published to npm + +## [0.1.5] - 2017-11-08 + +### Changed + +- Apply the same default placeholder styling that's applied to inputs to textareas + +### Fixed + +- Fix CLI tool not loading config files properly + +## [0.1.4] - 2017-11-06 + +### Added + +- Autoprefix dist assets for quick hacking and prototyping +- Add `my-auto`, `mt-auto`, and `mb-auto` margin utilities +- Add `sans-serif` to end of default `sans` font stack + +### Changed + +- If using Webpack, it will now watch your config file changes +- When running `tailwind init [filename]`, automatically append `.js` to filename if not present +- Support default fallback value in `config(...)` function, ie. `config('colors.blue', #0000ff)` +- Don't output empty media queries if Tailwind processes a file that doesn't use Tailwind + +### Fixed + +- Move list utilities earlier in stylesheet to allow overriding with spacing utilities + +## [0.1.3] - 2017-11-02 + +### Added + +- Add new `.scrolling-touch` and `.scrolling-auto` utilities for controlling inertial scroll behavior on WebKit touch devices +- Generate separate dist files for preflight, utilities, and tailwind for CDN usage + +## [0.1.2] - 2017-11-01 + +### Changed + +- Target Node 6.9.0 explicitly (instead of 8.6 implicitly) to support more users + +### Fixed + +- Fix issue with config option not being respected in `tailwind build` + +## [0.1.1] - 2017-11-01 + +### Fixed + +- Fix `tailwind build` CLI command not writing output files + +## [0.1.0] - 2017-11-01 + +### Added + +- Everything! + +[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.3...HEAD +[3.3.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.2...v3.3.3 +[3.3.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.1...v3.3.2 +[3.3.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.0...v3.3.1 +[3.3.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.7...v3.3.0 +[3.2.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.6...v3.2.7 +[3.2.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.5...v3.2.6 +[3.2.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.4...v3.2.5 +[3.2.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.3...v3.2.4 +[3.2.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.2...v3.2.3 +[3.2.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.1...v3.2.2 +[3.2.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.0...v3.2.1 +[3.2.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.8...v3.2.0 +[3.1.8]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.7...v3.1.8 +[3.1.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.6...v3.1.7 +[3.1.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.5...v3.1.6 +[3.1.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.4...v3.1.5 +[3.1.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.3...v3.1.4 +[3.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.2...v3.1.3 +[3.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.1...v3.1.2 +[3.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.0...v3.1.1 +[3.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...v3.1.0 +[3.0.24]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.23...v3.0.24 +[3.0.23]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.22...v3.0.23 +[3.0.22]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.21...v3.0.22 +[3.0.21]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.20...v3.0.21 +[3.0.20]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.19...v3.0.20 +[3.0.19]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.18...v3.0.19 +[3.0.18]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.17...v3.0.18 +[3.0.17]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.16...v3.0.17 +[3.0.16]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.15...v3.0.16 +[3.0.15]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.14...v3.0.15 +[3.0.14]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.13...v3.0.14 +[3.0.13]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...v3.0.13 +[3.0.12]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.11...v3.0.12 +[3.0.11]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.10...v3.0.11 +[3.0.10]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.9...v3.0.10 +[3.0.9]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.8...v3.0.9 +[3.0.8]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.7...v3.0.8 +[3.0.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.6...v3.0.7 +[3.0.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.5...v3.0.6 +[3.0.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.4...v3.0.5 +[3.0.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.3...v3.0.4 +[3.0.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.2...v3.0.3 +[3.0.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.1...v3.0.2 +[3.0.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.2...v3.0.0 +[3.0.0-alpha.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.1...v3.0.0-alpha.2 +[3.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.19...v3.0.0-alpha.1 +[2.2.19]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.18...v2.2.19 +[2.2.18]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.17...v2.2.18 +[2.2.17]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.16...v2.2.17 +[2.2.16]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.15...v2.2.16 +[2.2.15]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15 +[2.2.14]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.13...v2.2.14 +[2.2.13]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.12...v2.2.13 +[2.2.12]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.11...v2.2.12 +[2.2.11]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.10...v2.2.11 +[2.2.10]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.9...v2.2.10 +[2.2.9]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.8...v2.2.9 +[2.2.8]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.7...v2.2.8 +[2.2.7]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.6...v2.2.7 +[2.2.6]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.5...v2.2.6 +[2.2.5]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.4...v2.2.5 +[2.2.4]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.3...v2.2.4 +[2.2.3]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.2...v2.2.3 +[2.2.2]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.1...v2.2.2 +[2.2.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/tailwindlabs/tailwindcss/compare/v2.1.4...v2.2.0 +[2.1.4]: https://github.com/tailwindlabs/tailwindcss/compare/v2.1.3...v2.1.4 +[2.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v2.1.2...v2.1.3 +[2.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.4...v2.1.0 +[2.0.4]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.6...v2.0.0 +[2.0.0-alpha.25]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.24...v2.0.0-alpha.25 +[2.0.0-alpha.24]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.23...v2.0.0-alpha.24 +[2.0.0-alpha.23]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.22...v2.0.0-alpha.23 +[2.0.0-alpha.22]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.21...v2.0.0-alpha.22 +[2.0.0-alpha.21]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.20...v2.0.0-alpha.21 +[2.0.0-alpha.20]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.19...v2.0.0-alpha.20 +[2.0.0-alpha.19]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.18...v2.0.0-alpha.19 +[2.0.0-alpha.18]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.17...v2.0.0-alpha.18 +[2.0.0-alpha.17]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.16...v2.0.0-alpha.17 +[2.0.0-alpha.16]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.15...v2.0.0-alpha.16 +[2.0.0-alpha.15]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.14...v2.0.0-alpha.15 +[2.0.0-alpha.14]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.13...v2.0.0-alpha.14 +[2.0.0-alpha.13]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.12...v2.0.0-alpha.13 +[2.0.0-alpha.12]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.11...v2.0.0-alpha.12 +[2.0.0-alpha.11]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.10...v2.0.0-alpha.11 +[2.0.0-alpha.10]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.9...v2.0.0-alpha.10 +[2.0.0-alpha.9]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.8...v2.0.0-alpha.9 +[2.0.0-alpha.8]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.7...v2.0.0-alpha.8 +[2.0.0-alpha.7]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.6...v2.0.0-alpha.7 +[2.0.0-alpha.6]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.5...v2.0.0-alpha.6 +[2.0.0-alpha.5]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.4...v2.0.0-alpha.5 +[2.0.0-alpha.4]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.3...v2.0.0-alpha.4 +[2.0.0-alpha.3]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.2...v2.0.0-alpha.3 +[2.0.0-alpha.2]: https://github.com/tailwindlabs/tailwindcss/compare/v2.0.0-alpha.1...v2.0.0-alpha.2 +[1.9.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.5...v1.9.6 +[2.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.5...v2.0.0-alpha.1 +[1.9.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.4...v1.9.5 +[1.9.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.3...v1.9.4 +[1.9.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.2...v1.9.3 +[1.9.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.1...v1.9.2 +[1.9.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.13...v1.9.0 +[1.8.13]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.12...v1.8.13 +[1.8.12]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.11...v1.8.12 +[1.8.11]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.10...v1.8.11 +[1.8.10]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.9...v1.8.10 +[1.8.9]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.8...v1.8.9 +[1.8.8]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.7...v1.8.8 +[1.8.7]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.6...v1.8.7 +[1.8.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.5...v1.8.6 +[1.8.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.4...v1.8.5 +[1.8.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.3...v1.8.4 +[1.8.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.2...v1.8.3 +[1.8.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.1...v1.8.2 +[1.8.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.6...v1.8.0 +[1.7.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.5...v1.7.6 +[1.7.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.4...v1.7.5 +[1.7.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.3...v1.7.4 +[1.7.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.2...v1.7.3 +[1.7.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.1...v1.7.2 +[1.7.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.6.3...v1.7.0 +[1.6.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.6.2...v1.6.3 +[1.6.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.6.1...v1.6.2 +[1.6.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.5.2...v1.6.0 +[1.5.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.6...v1.5.0 +[1.4.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.5...v1.4.6 +[1.4.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.4...v1.4.5 +[1.4.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.3...v1.4.4 +[1.4.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.2...v1.4.3 +[1.4.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.1...v1.4.2 +[1.4.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.3.5...v1.4.0 +[1.3.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.3.4...v1.3.5 +[1.3.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.3.3...v1.3.4 +[1.3.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.3.1...v1.3.3 +[1.3.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.1.4...v1.2.0 +[1.2.0-canary.8]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0-canary.7...v1.2.0-canary.8 +[1.2.0-canary.7]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0-canary.6...v1.2.0-canary.7 +[1.2.0-canary.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0-canary.5...v1.2.0-canary.6 +[1.2.0-canary.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0-canary.4...v1.2.0-canary.5 +[1.2.0-canary.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0-canary.3...v1.2.0-canary.4 +[1.1.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.1.3...v1.1.4 +[1.2.0-canary.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.2.0-canary.0...v1.2.0-canary.1 +[1.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.1.2...v1.1.3 +[1.2.0-canary.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.1.2...v1.2.0-canary.0 +[1.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.6...v1.1.0 +[1.0.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.5...v1.0.6 +[1.0.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.4...v1.0.5 +[1.0.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.10...v1.0.0 +[1.0.0-beta.10]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.9...v1.0.0-beta.10 +[1.0.0-beta.9]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.8...v1.0.0-beta.9 +[1.0.0-beta.8]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.7...v1.0.0-beta.8 +[1.0.0-beta.7]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.6...v1.0.0-beta.7 +[1.0.0-beta.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.5...v1.0.0-beta.6 +[1.0.0-beta.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.4...v1.0.0-beta.5 +[1.0.0-beta.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.3...v1.0.0-beta.4 +[1.0.0-beta.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.2...v1.0.0-beta.3 +[1.0.0-beta.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.0.0-beta.1...v1.0.0-beta.2 +[1.0.0-beta.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.7.4...v1.0.0-beta.1 +[0.7.4]: https://github.com/tailwindlabs/tailwindcss/compare/v0.7.3...v0.7.4 +[0.7.3]: https://github.com/tailwindlabs/tailwindcss/compare/v0.7.2...v0.7.3 +[0.7.2]: https://github.com/tailwindlabs/tailwindcss/compare/v0.7.1...v0.7.2 +[0.7.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.7.0...v0.7.1 +[0.7.0]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.6...v0.7.0 +[0.6.6]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.5...v0.6.6 +[0.6.5]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.4...v0.6.5 +[0.6.4]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.3...v0.6.4 +[0.6.3]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.2...v0.6.3 +[0.6.2]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.1...v0.6.2 +[0.6.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.6.0...v0.6.1 +[0.6.0]: https://github.com/tailwindlabs/tailwindcss/compare/v0.5.3...v0.6.0 +[0.5.3]: https://github.com/tailwindlabs/tailwindcss/compare/v0.5.2...v0.5.3 +[0.5.2]: https://github.com/tailwindlabs/tailwindcss/compare/v0.5.1...v0.5.2 +[0.5.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/tailwindlabs/tailwindcss/compare/v0.4.3...v0.5.0 +[0.4.3]: https://github.com/tailwindlabs/tailwindcss/compare/v0.4.2...v0.4.3 +[0.4.2]: https://github.com/tailwindlabs/tailwindcss/compare/v0.4.1...v0.4.2 +[0.4.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.4.0...v0.4.1 +[0.4.0]: https://github.com/tailwindlabs/tailwindcss/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/tailwindlabs/tailwindcss/compare/v0.2.2...v0.3.0 +[0.2.2]: https://github.com/tailwindlabs/tailwindcss/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.6...v0.2.0 +[0.1.6]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v0.1.0...v0.1.1 +[0.1.0]: https://github.com/tailwindlabs/tailwindcss/releases/tag/v0.1.0 diff --git a/node_modules/tailwindcss/LICENSE b/node_modules/tailwindcss/LICENSE new file mode 100644 index 0000000..d6a8229 --- /dev/null +++ b/node_modules/tailwindcss/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs, Inc. + +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/tailwindcss/README.md b/node_modules/tailwindcss/README.md new file mode 100644 index 0000000..1766378 --- /dev/null +++ b/node_modules/tailwindcss/README.md @@ -0,0 +1,41 @@ +

+ + + + + Tailwind CSS + + +

+ +

+ A utility-first CSS framework for rapidly building custom user interfaces. +

+ + +

+ Build Status + Total Downloads + Latest Release + License +

+ +------ + +## Documentation + +For full documentation, visit [tailwindcss.com](https://tailwindcss.com/). + +## Community + +For help, discussion about best practices, or any other conversation that would benefit from being searchable: + +[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) + +For casual chit-chat with others using the framework: + +[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) + +## Contributing + +If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/master/.github/CONTRIBUTING.md) **before submitting a pull request**. diff --git a/node_modules/tailwindcss/base.css b/node_modules/tailwindcss/base.css new file mode 100644 index 0000000..2f02db5 --- /dev/null +++ b/node_modules/tailwindcss/base.css @@ -0,0 +1 @@ +@tailwind base; diff --git a/node_modules/tailwindcss/colors.d.ts b/node_modules/tailwindcss/colors.d.ts new file mode 100644 index 0000000..d85ab86 --- /dev/null +++ b/node_modules/tailwindcss/colors.d.ts @@ -0,0 +1,3 @@ +import type { DefaultColors } from './types/generated/colors' +declare const colors: DefaultColors +export = colors diff --git a/node_modules/tailwindcss/colors.js b/node_modules/tailwindcss/colors.js new file mode 100644 index 0000000..c6f9149 --- /dev/null +++ b/node_modules/tailwindcss/colors.js @@ -0,0 +1,2 @@ +let colors = require('./lib/public/colors') +module.exports = (colors.__esModule ? colors : { default: colors }).default diff --git a/node_modules/tailwindcss/components.css b/node_modules/tailwindcss/components.css new file mode 100644 index 0000000..020aaba --- /dev/null +++ b/node_modules/tailwindcss/components.css @@ -0,0 +1 @@ +@tailwind components; diff --git a/node_modules/tailwindcss/defaultConfig.d.ts b/node_modules/tailwindcss/defaultConfig.d.ts new file mode 100644 index 0000000..2c2bccf --- /dev/null +++ b/node_modules/tailwindcss/defaultConfig.d.ts @@ -0,0 +1,3 @@ +import type { Config } from './types/config' +declare const config: Config +export = config diff --git a/node_modules/tailwindcss/defaultConfig.js b/node_modules/tailwindcss/defaultConfig.js new file mode 100644 index 0000000..7b63587 --- /dev/null +++ b/node_modules/tailwindcss/defaultConfig.js @@ -0,0 +1,2 @@ +let defaultConfig = require('./lib/public/default-config') +module.exports = (defaultConfig.__esModule ? defaultConfig : { default: defaultConfig }).default diff --git a/node_modules/tailwindcss/defaultTheme.d.ts b/node_modules/tailwindcss/defaultTheme.d.ts new file mode 100644 index 0000000..2bc9dc7 --- /dev/null +++ b/node_modules/tailwindcss/defaultTheme.d.ts @@ -0,0 +1,4 @@ +import type { Config } from './types/config' +import { DefaultTheme } from './types/generated/default-theme' +declare const theme: Config['theme'] & DefaultTheme +export = theme diff --git a/node_modules/tailwindcss/defaultTheme.js b/node_modules/tailwindcss/defaultTheme.js new file mode 100644 index 0000000..991526d --- /dev/null +++ b/node_modules/tailwindcss/defaultTheme.js @@ -0,0 +1,2 @@ +let defaultTheme = require('./lib/public/default-theme') +module.exports = (defaultTheme.__esModule ? defaultTheme : { default: defaultTheme }).default diff --git a/node_modules/tailwindcss/lib/cli-peer-dependencies.js b/node_modules/tailwindcss/lib/cli-peer-dependencies.js new file mode 100644 index 0000000..4b64be2 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli-peer-dependencies.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + lazyPostcss: function() { + return lazyPostcss; + }, + lazyPostcssImport: function() { + return lazyPostcssImport; + }, + lazyAutoprefixer: function() { + return lazyAutoprefixer; + }, + lazyCssnano: function() { + return lazyCssnano; + } +}); +function lazyPostcss() { + return require("postcss"); +} +function lazyPostcssImport() { + return require("postcss-import"); +} +function lazyAutoprefixer() { + return require("autoprefixer"); +} +function lazyCssnano() { + return require("cssnano"); +} diff --git a/node_modules/tailwindcss/lib/cli.js b/node_modules/tailwindcss/lib/cli.js new file mode 100644 index 0000000..c7043a3 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +"use strict"; +if (false) { + module.exports = require("./oxide/cli"); +} else { + module.exports = require("./cli/index"); +} diff --git a/node_modules/tailwindcss/lib/cli/build/deps.js b/node_modules/tailwindcss/lib/cli/build/deps.js new file mode 100644 index 0000000..1aa8116 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/build/deps.js @@ -0,0 +1,62 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + loadPostcss: function() { + return loadPostcss; + }, + loadPostcssImport: function() { + return loadPostcssImport; + }, + loadCssNano: function() { + return loadCssNano; + }, + loadAutoprefixer: function() { + return loadAutoprefixer; + } +}); +const _index = require("../../../peers/index.js"); +function loadPostcss() { + // Try to load a local `postcss` version first + try { + return require("postcss"); + } catch {} + return (0, _index.lazyPostcss)(); +} +function loadPostcssImport() { + // Try to load a local `postcss-import` version first + try { + return require("postcss-import"); + } catch {} + return (0, _index.lazyPostcssImport)(); +} +function loadCssNano() { + let options = { + preset: [ + "default", + { + cssDeclarationSorter: false + } + ] + }; + // Try to load a local `cssnano` version first + try { + return require("cssnano"); + } catch {} + return (0, _index.lazyCssnano)()(options); +} +function loadAutoprefixer() { + // Try to load a local `autoprefixer` version first + try { + return require("autoprefixer"); + } catch {} + return (0, _index.lazyAutoprefixer)(); +} diff --git a/node_modules/tailwindcss/lib/cli/build/index.js b/node_modules/tailwindcss/lib/cli/build/index.js new file mode 100644 index 0000000..60304f6 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/build/index.js @@ -0,0 +1,54 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "build", { + enumerable: true, + get: function() { + return build; + } +}); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +const _resolveConfigPath = require("../../util/resolveConfigPath.js"); +const _plugin = require("./plugin.js"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +async function build(args) { + let input = args["--input"]; + let shouldWatch = args["--watch"]; + // TODO: Deprecate this in future versions + if (!input && args["_"][1]) { + console.error("[deprecation] Running tailwindcss without -i, please provide an input file."); + input = args["--input"] = args["_"][1]; + } + if (input && input !== "-" && !_fs.default.existsSync(input = _path.default.resolve(input))) { + console.error(`Specified input file ${args["--input"]} does not exist.`); + process.exit(9); + } + if (args["--config"] && !_fs.default.existsSync(args["--config"] = _path.default.resolve(args["--config"]))) { + console.error(`Specified config file ${args["--config"]} does not exist.`); + process.exit(9); + } + // TODO: Reference the @config path here if exists + let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPath.resolveDefaultConfigPath)(); + let processor = await (0, _plugin.createProcessor)(args, configPath); + if (shouldWatch) { + // Abort the watcher if stdin is closed to avoid zombie processes + // You can disable this behavior with --watch=always + if (args["--watch"] !== "always") { + process.stdin.on("end", ()=>process.exit(0)); + } + process.stdin.resume(); + await processor.watch(); + } else { + await processor.build().catch((e)=>{ + console.error(e); + process.exit(1); + }); + } +} diff --git a/node_modules/tailwindcss/lib/cli/build/plugin.js b/node_modules/tailwindcss/lib/cli/build/plugin.js new file mode 100644 index 0000000..22a539f --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/build/plugin.js @@ -0,0 +1,378 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "createProcessor", { + enumerable: true, + get: function() { + return createProcessor; + } +}); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _postcssloadconfig = /*#__PURE__*/ _interop_require_default(require("postcss-load-config")); +const _lilconfig = require("lilconfig"); +const _plugins = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/plugins" // Little bit scary, looking at private/internal API +)); +const _options = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/options" // Little bit scary, looking at private/internal API +)); +const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("../../processTailwindFeatures")); +const _deps = require("./deps"); +const _utils = require("./utils"); +const _sharedState = require("../../lib/sharedState"); +const _resolveConfig = /*#__PURE__*/ _interop_require_default(require("../../../resolveConfig.js")); +const _content = require("../../lib/content.js"); +const _watching = require("./watching.js"); +const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob")); +const _findAtConfigPath = require("../../lib/findAtConfigPath.js"); +const _log = /*#__PURE__*/ _interop_require_default(require("../../util/log")); +const _loadconfig = require("../../lib/load-config"); +const _getModuleDependencies = /*#__PURE__*/ _interop_require_default(require("../../lib/getModuleDependencies")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +/** + * + * @param {string} [customPostCssPath ] + * @returns + */ async function loadPostCssPlugins(customPostCssPath) { + let config = customPostCssPath ? await (async ()=>{ + let file = _path.default.resolve(customPostCssPath); + // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js + // @ts-ignore + let { config ={} } = await (0, _lilconfig.lilconfig)("postcss").load(file); + if (typeof config === "function") { + config = config(); + } else { + config = Object.assign({}, config); + } + if (!config.plugins) { + config.plugins = []; + } + return { + file, + plugins: (0, _plugins.default)(config, file), + options: (0, _options.default)(config, file) + }; + })() : await (0, _postcssloadconfig.default)(); + let configPlugins = config.plugins; + let configPluginTailwindIdx = configPlugins.findIndex((plugin)=>{ + if (typeof plugin === "function" && plugin.name === "tailwindcss") { + return true; + } + if (typeof plugin === "object" && plugin !== null && plugin.postcssPlugin === "tailwindcss") { + return true; + } + return false; + }); + let beforePlugins = configPluginTailwindIdx === -1 ? [] : configPlugins.slice(0, configPluginTailwindIdx); + let afterPlugins = configPluginTailwindIdx === -1 ? configPlugins : configPlugins.slice(configPluginTailwindIdx + 1); + return [ + beforePlugins, + afterPlugins, + config.options + ]; +} +function loadBuiltinPostcssPlugins() { + let postcss = (0, _deps.loadPostcss)(); + let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: "; + return [ + [ + (root)=>{ + root.walkAtRules("import", (rule)=>{ + if (rule.params.slice(1).startsWith("tailwindcss/")) { + rule.after(postcss.comment({ + text: IMPORT_COMMENT + rule.params + })); + rule.remove(); + } + }); + }, + (0, _deps.loadPostcssImport)(), + (root)=>{ + root.walkComments((rule)=>{ + if (rule.text.startsWith(IMPORT_COMMENT)) { + rule.after(postcss.atRule({ + name: "import", + params: rule.text.replace(IMPORT_COMMENT, "") + })); + rule.remove(); + } + }); + } + ], + [], + {} + ]; +} +let state = { + /** @type {any} */ context: null, + /** @type {ReturnType | null} */ watcher: null, + /** @type {{content: string, extension: string}[]} */ changedContent: [], + /** @type {ReturnType | null} */ configBag: null, + contextDependencies: new Set(), + /** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [], + refreshContentPaths () { + var _this_context; + this.contentPaths = (0, _content.parseCandidateFiles)(this.context, (_this_context = this.context) === null || _this_context === void 0 ? void 0 : _this_context.tailwindConfig); + }, + get config () { + return this.context.tailwindConfig; + }, + get contentPatterns () { + return { + all: this.contentPaths.map((contentPath)=>contentPath.pattern), + dynamic: this.contentPaths.filter((contentPath)=>contentPath.glob !== undefined).map((contentPath)=>contentPath.pattern) + }; + }, + loadConfig (configPath, content) { + if (this.watcher && configPath) { + this.refreshConfigDependencies(); + } + let config = (0, _loadconfig.loadConfig)(configPath); + let dependencies = (0, _getModuleDependencies.default)(configPath); + this.configBag = { + config, + dependencies, + dispose () { + for (let file of dependencies){ + delete require.cache[require.resolve(file)]; + } + } + }; + // @ts-ignore + this.configBag.config = (0, _resolveConfig.default)(this.configBag.config, { + content: { + files: [] + } + }); + // Override content files if `--content` has been passed explicitly + if ((content === null || content === void 0 ? void 0 : content.length) > 0) { + this.configBag.config.content.files = content; + } + return this.configBag.config; + }, + refreshConfigDependencies () { + var _this_configBag; + _sharedState.env.DEBUG && console.time("Module dependencies"); + (_this_configBag = this.configBag) === null || _this_configBag === void 0 ? void 0 : _this_configBag.dispose(); + _sharedState.env.DEBUG && console.timeEnd("Module dependencies"); + }, + readContentPaths () { + let content = []; + // Resolve globs from the content config + // TODO: When we make the postcss plugin async-capable this can become async + let files = _fastglob.default.sync(this.contentPatterns.all); + for (let file of files){ + if (false) { + content.push({ + file, + extension: _path.default.extname(file).slice(1) + }); + } else { + content.push({ + content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"), + extension: _path.default.extname(file).slice(1) + }); + } + } + // Resolve raw content in the tailwind config + let rawContent = this.config.content.files.filter((file)=>{ + return file !== null && typeof file === "object"; + }); + for (let { raw: htmlContent , extension ="html" } of rawContent){ + content.push({ + content: htmlContent, + extension + }); + } + return content; + }, + getContext ({ createContext , cliConfigPath , root , result , content }) { + if (this.context) { + this.context.changedContent = this.changedContent.splice(0); + return this.context; + } + _sharedState.env.DEBUG && console.time("Searching for config"); + var _findAtConfigPath1; + let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath; + _sharedState.env.DEBUG && console.timeEnd("Searching for config"); + _sharedState.env.DEBUG && console.time("Loading config"); + let config = this.loadConfig(configPath, content); + _sharedState.env.DEBUG && console.timeEnd("Loading config"); + _sharedState.env.DEBUG && console.time("Creating context"); + this.context = createContext(config, []); + Object.assign(this.context, { + userConfigPath: configPath + }); + _sharedState.env.DEBUG && console.timeEnd("Creating context"); + _sharedState.env.DEBUG && console.time("Resolving content paths"); + this.refreshContentPaths(); + _sharedState.env.DEBUG && console.timeEnd("Resolving content paths"); + if (this.watcher) { + _sharedState.env.DEBUG && console.time("Watch new files"); + this.watcher.refreshWatchedFiles(); + _sharedState.env.DEBUG && console.timeEnd("Watch new files"); + } + for (let file of this.readContentPaths()){ + this.context.changedContent.push(file); + } + return this.context; + } +}; +async function createProcessor(args, cliConfigPath) { + var _args_content; + let postcss = (0, _deps.loadPostcss)(); + let input = args["--input"]; + let output = args["--output"]; + let includePostCss = args["--postcss"]; + let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined; + let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins(customPostCssPath) : loadBuiltinPostcssPlugins(); + if (args["--purge"]) { + _log.default.warn("purge-flag-deprecated", [ + "The `--purge` flag has been deprecated.", + "Please use `--content` instead." + ]); + if (!args["--content"]) { + args["--content"] = args["--purge"]; + } + } + var _args_content_split; + let content = (_args_content_split = (_args_content = args["--content"]) === null || _args_content === void 0 ? void 0 : _args_content.split(/(?{ + return { + postcssPlugin: "tailwindcss", + async Once (root, { result }) { + _sharedState.env.DEBUG && console.time("Compiling CSS"); + await (0, _processTailwindFeatures.default)(({ createContext })=>{ + console.error(); + console.error("Rebuilding..."); + return ()=>{ + return state.getContext({ + createContext, + cliConfigPath, + root, + result, + content + }); + }; + })(root, result); + _sharedState.env.DEBUG && console.timeEnd("Compiling CSS"); + } + }; + }; + tailwindPlugin.postcss = true; + let plugins = [ + ...beforePlugins, + tailwindPlugin, + !args["--minify"] && _utils.formatNodes, + ...afterPlugins, + !args["--no-autoprefixer"] && (0, _deps.loadAutoprefixer)(), + args["--minify"] && (0, _deps.loadCssNano)() + ].filter(Boolean); + /** @type {import('postcss').Processor} */ // @ts-ignore + let processor = postcss(plugins); + async function readInput() { + // Piping in data, let's drain the stdin + if (input === "-") { + return (0, _utils.drainStdin)(); + } + // Input file has been provided + if (input) { + return _fs.default.promises.readFile(_path.default.resolve(input), "utf8"); + } + // No input file provided, fallback to default atrules + return "@tailwind base; @tailwind components; @tailwind utilities"; + } + async function build() { + let start = process.hrtime.bigint(); + return readInput().then((css)=>processor.process(css, { + ...postcssOptions, + from: input, + to: output + })).then((result)=>{ + if (!state.watcher) { + return result; + } + _sharedState.env.DEBUG && console.time("Recording PostCSS dependencies"); + for (let message of result.messages){ + if (message.type === "dependency") { + state.contextDependencies.add(message.file); + } + } + _sharedState.env.DEBUG && console.timeEnd("Recording PostCSS dependencies"); + // TODO: This needs to be in a different spot + _sharedState.env.DEBUG && console.time("Watch new files"); + state.watcher.refreshWatchedFiles(); + _sharedState.env.DEBUG && console.timeEnd("Watch new files"); + return result; + }).then((result)=>{ + if (!output) { + process.stdout.write(result.css); + return; + } + return Promise.all([ + (0, _utils.outputFile)(result.opts.to, result.css), + result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString()) + ]); + }).then(()=>{ + let end = process.hrtime.bigint(); + console.error(); + console.error("Done in", (end - start) / BigInt(1e6) + "ms."); + }).then(()=>{}, (err)=>{ + // TODO: If an initial build fails we can't easily pick up any PostCSS dependencies + // that were collected before the error occurred + // The result is not stored on the error so we have to store it externally + // and pull the messages off of it here somehow + // This results in a less than ideal DX because the watcher will not pick up + // changes to imported CSS if one of them caused an error during the initial build + // If you fix it and then save the main CSS file so there's no error + // The watcher will start watching the imported CSS files and will be + // resilient to future errors. + if (state.watcher) { + console.error(err); + } else { + return Promise.reject(err); + } + }); + } + /** + * @param {{file: string, content(): Promise, extension: string}[]} changes + */ async function parseChanges(changes) { + return Promise.all(changes.map(async (change)=>({ + content: await change.content(), + extension: change.extension + }))); + } + if (input !== undefined && input !== "-") { + state.contextDependencies.add(_path.default.resolve(input)); + } + return { + build, + watch: async ()=>{ + state.watcher = (0, _watching.createWatcher)(args, { + state, + /** + * @param {{file: string, content(): Promise, extension: string}[]} changes + */ async rebuild (changes) { + let needsNewContext = changes.some((change)=>{ + var _state_configBag; + return ((_state_configBag = state.configBag) === null || _state_configBag === void 0 ? void 0 : _state_configBag.dependencies.has(change.file)) || state.contextDependencies.has(change.file); + }); + if (needsNewContext) { + state.context = null; + } else { + for (let change of (await parseChanges(changes))){ + state.changedContent.push(change); + } + } + return build(); + } + }); + await build(); + } + }; +} diff --git a/node_modules/tailwindcss/lib/cli/build/utils.js b/node_modules/tailwindcss/lib/cli/build/utils.js new file mode 100644 index 0000000..3bed060 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/build/utils.js @@ -0,0 +1,88 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + indentRecursive: function() { + return indentRecursive; + }, + formatNodes: function() { + return formatNodes; + }, + readFileWithRetries: function() { + return readFileWithRetries; + }, + drainStdin: function() { + return drainStdin; + }, + outputFile: function() { + return outputFile; + } +}); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function indentRecursive(node, indent = 0) { + node.each && node.each((child, i)=>{ + if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) { + child.raws.before = `\n${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`; + } + child.raws.after = `\n${" ".repeat(indent)}`; + indentRecursive(child, indent + 1); + }); +} +function formatNodes(root) { + indentRecursive(root); + if (root.first) { + root.first.raws.before = ""; + } +} +async function readFileWithRetries(path, tries = 5) { + for(let n = 0; n <= tries; n++){ + try { + return await _fs.default.promises.readFile(path, "utf8"); + } catch (err) { + if (n !== tries) { + if (err.code === "ENOENT" || err.code === "EBUSY") { + await new Promise((resolve)=>setTimeout(resolve, 10)); + continue; + } + } + throw err; + } + } +} +function drainStdin() { + return new Promise((resolve, reject)=>{ + let result = ""; + process.stdin.on("data", (chunk)=>{ + result += chunk; + }); + process.stdin.on("end", ()=>resolve(result)); + process.stdin.on("error", (err)=>reject(err)); + }); +} +async function outputFile(file, newContents) { + try { + let currentContents = await _fs.default.promises.readFile(file, "utf8"); + if (currentContents === newContents) { + return; // Skip writing the file + } + } catch {} + // Write the file + await _fs.default.promises.mkdir(_path.default.dirname(file), { + recursive: true + }); + await _fs.default.promises.writeFile(file, newContents, "utf8"); +} diff --git a/node_modules/tailwindcss/lib/cli/build/watching.js b/node_modules/tailwindcss/lib/cli/build/watching.js new file mode 100644 index 0000000..0c2ef76 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/build/watching.js @@ -0,0 +1,182 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "createWatcher", { + enumerable: true, + get: function() { + return createWatcher; + } +}); +const _chokidar = /*#__PURE__*/ _interop_require_default(require("chokidar")); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _micromatch = /*#__PURE__*/ _interop_require_default(require("micromatch")); +const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path")); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +const _utils = require("./utils.js"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function createWatcher(args, { state , rebuild }) { + let shouldPoll = args["--poll"]; + let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32"; + // Polling interval in milliseconds + // Used only when polling or coalescing add/change events on Windows + let pollInterval = 10; + let watcher = _chokidar.default.watch([], { + // Force checking for atomic writes in all situations + // This causes chokidar to wait up to 100ms for a file to re-added after it's been unlinked + // This only works when watching directories though + atomic: true, + usePolling: shouldPoll, + interval: shouldPoll ? pollInterval : undefined, + ignoreInitial: true, + awaitWriteFinish: shouldCoalesceWriteEvents ? { + stabilityThreshold: 50, + pollInterval: pollInterval + } : false + }); + // A queue of rebuilds, file reads, etc… to run + let chain = Promise.resolve(); + /** + * A list of files that have been changed since the last rebuild + * + * @type {{file: string, content: () => Promise, extension: string}[]} + */ let changedContent = []; + /** + * A list of files for which a rebuild has already been queued. + * This is used to prevent duplicate rebuilds when multiple events are fired for the same file. + * The rebuilt file is cleared from this list when it's associated rebuild has _started_ + * This is because if the file is changed during a rebuild it won't trigger a new rebuild which it should + **/ let pendingRebuilds = new Set(); + let _timer; + let _reject; + /** + * Rebuilds the changed files and resolves when the rebuild is + * complete regardless of whether it was successful or not + */ async function rebuildAndContinue() { + let changes = changedContent.splice(0); + // There are no changes to rebuild so we can just do nothing + if (changes.length === 0) { + return Promise.resolve(); + } + // Clear all pending rebuilds for the about-to-be-built files + changes.forEach((change)=>pendingRebuilds.delete(change.file)); + // Resolve the promise even when the rebuild fails + return rebuild(changes).then(()=>{}, (e)=>{ + console.error(e.toString()); + }); + } + /** + * + * @param {*} file + * @param {(() => Promise) | null} content + * @param {boolean} skipPendingCheck + * @returns {Promise} + */ function recordChangedFile(file, content = null, skipPendingCheck = false) { + file = _path.default.resolve(file); + // Applications like Vim/Neovim fire both rename and change events in succession for atomic writes + // In that case rebuild has already been queued by rename, so can be skipped in change + if (pendingRebuilds.has(file) && !skipPendingCheck) { + return Promise.resolve(); + } + // Mark that a rebuild of this file is going to happen + // It MUST happen synchronously before the rebuild is queued for this to be effective + pendingRebuilds.add(file); + changedContent.push({ + file, + content: content !== null && content !== void 0 ? content : ()=>_fs.default.promises.readFile(file, "utf8"), + extension: _path.default.extname(file).slice(1) + }); + if (_timer) { + clearTimeout(_timer); + _reject(); + } + // If a rebuild is already in progress we don't want to start another one until the 10ms timer has expired + chain = chain.then(()=>new Promise((resolve, reject)=>{ + _timer = setTimeout(resolve, 10); + _reject = reject; + })); + // Resolves once this file has been rebuilt (or the rebuild for this file has failed) + // This queues as many rebuilds as there are changed files + // But those rebuilds happen after some delay + // And will immediately resolve if there are no changes + chain = chain.then(rebuildAndContinue, rebuildAndContinue); + return chain; + } + watcher.on("change", (file)=>recordChangedFile(file)); + watcher.on("add", (file)=>recordChangedFile(file)); + // Restore watching any files that are "removed" + // This can happen when a file is pseudo-atomically replaced (a copy is created, overwritten, the old one is unlinked, and the new one is renamed) + // TODO: An an optimization we should allow removal when the config changes + watcher.on("unlink", (file)=>{ + file = (0, _normalizepath.default)(file); + // Only re-add the file if it's not covered by a dynamic pattern + if (!_micromatch.default.some([ + file + ], state.contentPatterns.dynamic)) { + watcher.add(file); + } + }); + // Some applications such as Visual Studio (but not VS Code) + // will only fire a rename event for atomic writes and not a change event + // This is very likely a chokidar bug but it's one we need to work around + // We treat this as a change event and rebuild the CSS + watcher.on("raw", (evt, filePath, meta)=>{ + if (evt !== "rename") { + return; + } + let watchedPath = meta.watchedPath; + // Watched path might be the file itself + // Or the directory it is in + filePath = watchedPath.endsWith(filePath) ? watchedPath : _path.default.join(watchedPath, filePath); + // Skip this event since the files it is for does not match any of the registered content globs + if (!_micromatch.default.some([ + filePath + ], state.contentPatterns.all)) { + return; + } + // Skip since we've already queued a rebuild for this file that hasn't happened yet + if (pendingRebuilds.has(filePath)) { + return; + } + // We'll go ahead and add the file to the pending rebuilds list here + // It'll be removed when the rebuild starts unless the read fails + // which will be taken care of as well + pendingRebuilds.add(filePath); + async function enqueue() { + try { + // We need to read the file as early as possible outside of the chain + // because it may be gone by the time we get to it. doing the read + // immediately increases the chance that the file is still there + let content = await (0, _utils.readFileWithRetries)(_path.default.resolve(filePath)); + if (content === undefined) { + return; + } + // This will push the rebuild onto the chain + // We MUST skip the rebuild check here otherwise the rebuild will never happen on Linux + // This is because the order of events and timing is different on Linux + // @ts-ignore: TypeScript isn't picking up that content is a string here + await recordChangedFile(filePath, ()=>content, true); + } catch { + // If reading the file fails, it's was probably a deleted temporary file + // So we can ignore it and no rebuild is needed + } + } + enqueue().then(()=>{ + // If the file read fails we still need to make sure the file isn't stuck in the pending rebuilds list + pendingRebuilds.delete(filePath); + }); + }); + return { + fswatcher: watcher, + refreshWatchedFiles () { + watcher.add(Array.from(state.contextDependencies)); + watcher.add(Array.from(state.configBag.dependencies)); + watcher.add(state.contentPatterns.all); + } + }; +} diff --git a/node_modules/tailwindcss/lib/cli/help/index.js b/node_modules/tailwindcss/lib/cli/help/index.js new file mode 100644 index 0000000..030997f --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/help/index.js @@ -0,0 +1,73 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "help", { + enumerable: true, + get: function() { + return help; + } +}); +const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../package.json")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function help({ message , usage , commands , options }) { + let indent = 2; + // Render header + console.log(); + console.log(`${_packagejson.default.name} v${_packagejson.default.version}`); + // Render message + if (message) { + console.log(); + for (let msg of message.split("\n")){ + console.log(msg); + } + } + // Render usage + if (usage && usage.length > 0) { + console.log(); + console.log("Usage:"); + for (let example of usage){ + console.log(" ".repeat(indent), example); + } + } + // Render commands + if (commands && commands.length > 0) { + console.log(); + console.log("Commands:"); + for (let command of commands){ + console.log(" ".repeat(indent), command); + } + } + // Render options + if (options) { + let groupedOptions = {}; + for (let [key, value] of Object.entries(options)){ + if (typeof value === "object") { + groupedOptions[key] = { + ...value, + flags: [ + key + ] + }; + } else { + groupedOptions[value].flags.push(key); + } + } + console.log(); + console.log("Options:"); + for (let { flags , description , deprecated } of Object.values(groupedOptions)){ + if (deprecated) continue; + if (flags.length === 1) { + console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description); + } else { + console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description); + } + } + } + console.log(); +} diff --git a/node_modules/tailwindcss/lib/cli/index.js b/node_modules/tailwindcss/lib/cli/index.js new file mode 100644 index 0000000..e6e2e27 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/index.js @@ -0,0 +1,230 @@ +#!/usr/bin/env node +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +const _arg = /*#__PURE__*/ _interop_require_default(require("arg")); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _build = require("./build"); +const _help = require("./help"); +const _init = require("./init"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function oneOf(...options) { + return Object.assign((value = true)=>{ + for (let option of options){ + let parsed = option(value); + if (parsed === value) { + return parsed; + } + } + throw new Error("..."); + }, { + manualParsing: true + }); +} +let commands = { + init: { + run: _init.init, + args: { + "--esm": { + type: Boolean, + description: `Initialize configuration file as ESM` + }, + "--ts": { + type: Boolean, + description: `Initialize configuration file as TypeScript` + }, + "--postcss": { + type: Boolean, + description: `Initialize a \`postcss.config.js\` file` + }, + "--full": { + type: Boolean, + description: `Include the default values for all options in the generated configuration file` + }, + "-f": "--full", + "-p": "--postcss" + } + }, + build: { + run: _build.build, + args: { + "--input": { + type: String, + description: "Input file" + }, + "--output": { + type: String, + description: "Output file" + }, + "--watch": { + type: oneOf(String, Boolean), + description: "Watch for changes and rebuild as needed" + }, + "--poll": { + type: Boolean, + description: "Use polling instead of filesystem events when watching" + }, + "--content": { + type: String, + description: "Content paths to use for removing unused classes" + }, + "--purge": { + type: String, + deprecated: true + }, + "--postcss": { + type: oneOf(String, Boolean), + description: "Load custom PostCSS configuration" + }, + "--minify": { + type: Boolean, + description: "Minify the output" + }, + "--config": { + type: String, + description: "Path to a custom config file" + }, + "--no-autoprefixer": { + type: Boolean, + description: "Disable autoprefixer" + }, + "-c": "--config", + "-i": "--input", + "-o": "--output", + "-m": "--minify", + "-w": "--watch", + "-p": "--poll" + } + } +}; +let sharedFlags = { + "--help": { + type: Boolean, + description: "Display usage information" + }, + "-h": "--help" +}; +if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) { + (0, _help.help)({ + usage: [ + "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]", + "tailwindcss init [--full] [--postcss] [options...]" + ], + commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`), + options: { + ...commands.build.args, + ...sharedFlags + } + }); + process.exit(0); +} +let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build"; +if (commands[command] === undefined) { + if (_fs.default.existsSync(_path.default.resolve(command))) { + // TODO: Deprecate this in future versions + // Check if non-existing command, might be a file. + command = "build"; + } else { + (0, _help.help)({ + message: `Invalid command: ${command}`, + usage: [ + "tailwindcss [options]" + ], + commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`), + options: sharedFlags + }); + process.exit(1); + } +} +// Execute command +let { args: flags , run } = commands[command]; +let args = (()=>{ + try { + let result = (0, _arg.default)(Object.fromEntries(Object.entries({ + ...flags, + ...sharedFlags + }).filter(([_key, value])=>{ + var _value_type; + return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing); + }).map(([key, value])=>[ + key, + typeof value === "object" ? value.type : value + ])), { + permissive: true + }); + // Manual parsing of flags to allow for special flags like oneOf(Boolean, String) + for(let i = result["_"].length - 1; i >= 0; --i){ + let flag = result["_"][i]; + if (!flag.startsWith("-")) continue; + let [flagName, flagValue] = flag.split("="); + let handler = flags[flagName]; + // Resolve flagName & handler + while(typeof handler === "string"){ + flagName = handler; + handler = flags[handler]; + } + if (!handler) continue; + let args = []; + let offset = i + 1; + // --flag value syntax was used so we need to pull `value` from `args` + if (flagValue === undefined) { + // Parse args for current flag + while(result["_"][offset] && !result["_"][offset].startsWith("-")){ + args.push(result["_"][offset++]); + } + // Cleanup manually parsed flags + args + result["_"].splice(i, 1 + args.length); + // No args were provided, use default value defined in handler + // One arg was provided, use that directly + // Multiple args were provided so pass them all in an array + flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args; + } else { + // Remove the whole flag from the args array + result["_"].splice(i, 1); + } + // Set the resolved value in the `result` object + result[flagName] = handler.type(flagValue, flagName); + } + // Ensure that the `command` is always the first argument in the `args`. + // This is important so that we don't have to check if a default command + // (build) was used or not from within each plugin. + // + // E.g.: tailwindcss input.css -> _: ['build', 'input.css'] + // E.g.: tailwindcss build input.css -> _: ['build', 'input.css'] + if (result["_"][0] !== command) { + result["_"].unshift(command); + } + return result; + } catch (err) { + if (err.code === "ARG_UNKNOWN_OPTION") { + (0, _help.help)({ + message: err.message, + usage: [ + "tailwindcss [options]" + ], + options: sharedFlags + }); + process.exit(1); + } + throw err; + } +})(); +if (args["--help"]) { + (0, _help.help)({ + options: { + ...flags, + ...sharedFlags + }, + usage: [ + `tailwindcss ${command} [options]` + ] + }); + process.exit(0); +} +run(args); diff --git a/node_modules/tailwindcss/lib/cli/init/index.js b/node_modules/tailwindcss/lib/cli/init/index.js new file mode 100644 index 0000000..47caf30 --- /dev/null +++ b/node_modules/tailwindcss/lib/cli/init/index.js @@ -0,0 +1,63 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "init", { + enumerable: true, + get: function() { + return init; + } +}); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function isESM() { + const pkgPath = _path.default.resolve("./package.json"); + try { + let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8")); + return pkg.type && pkg.type === "module"; + } catch (err) { + return false; + } +} +function init(args) { + let messages = []; + let isProjectESM = args["--ts"] || args["--esm"] || isESM(); + let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs"; + let extension = args["--ts"] ? "ts" : "js"; + var _args___; + let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`); + if (_fs.default.existsSync(tailwindConfigLocation)) { + messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`); + } else { + let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../stubs/config.simple.js"), "utf8"); + let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../stubs/tailwind.config.${syntax}`), "utf8"); + // Change colors import + stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors"); + // Replace contents of {ts,js,cjs} file with the stub {simple,full}. + stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n"; + _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8"); + messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`); + } + if (args["--postcss"]) { + let postcssConfigLocation = _path.default.resolve("./postcss.config.js"); + if (_fs.default.existsSync(postcssConfigLocation)) { + messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`); + } else { + let stubFile = _fs.default.readFileSync(isProjectESM ? _path.default.resolve(__dirname, "../../../stubs/postcss.config.js") : _path.default.resolve(__dirname, "../../../stubs/postcss.config.cjs"), "utf8"); + _fs.default.writeFileSync(postcssConfigLocation, stubFile, "utf8"); + messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`); + } + } + if (messages.length > 0) { + console.log(); + for (let message of messages){ + console.log(message); + } + } +} diff --git a/node_modules/tailwindcss/lib/corePluginList.js b/node_modules/tailwindcss/lib/corePluginList.js new file mode 100644 index 0000000..b94745c --- /dev/null +++ b/node_modules/tailwindcss/lib/corePluginList.js @@ -0,0 +1,187 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +const _default = [ + "preflight", + "container", + "accessibility", + "pointerEvents", + "visibility", + "position", + "inset", + "isolation", + "zIndex", + "order", + "gridColumn", + "gridColumnStart", + "gridColumnEnd", + "gridRow", + "gridRowStart", + "gridRowEnd", + "float", + "clear", + "margin", + "boxSizing", + "lineClamp", + "display", + "aspectRatio", + "height", + "maxHeight", + "minHeight", + "width", + "minWidth", + "maxWidth", + "flex", + "flexShrink", + "flexGrow", + "flexBasis", + "tableLayout", + "captionSide", + "borderCollapse", + "borderSpacing", + "transformOrigin", + "translate", + "rotate", + "skew", + "scale", + "transform", + "animation", + "cursor", + "touchAction", + "userSelect", + "resize", + "scrollSnapType", + "scrollSnapAlign", + "scrollSnapStop", + "scrollMargin", + "scrollPadding", + "listStylePosition", + "listStyleType", + "listStyleImage", + "appearance", + "columns", + "breakBefore", + "breakInside", + "breakAfter", + "gridAutoColumns", + "gridAutoFlow", + "gridAutoRows", + "gridTemplateColumns", + "gridTemplateRows", + "flexDirection", + "flexWrap", + "placeContent", + "placeItems", + "alignContent", + "alignItems", + "justifyContent", + "justifyItems", + "gap", + "space", + "divideWidth", + "divideStyle", + "divideColor", + "divideOpacity", + "placeSelf", + "alignSelf", + "justifySelf", + "overflow", + "overscrollBehavior", + "scrollBehavior", + "textOverflow", + "hyphens", + "whitespace", + "wordBreak", + "borderRadius", + "borderWidth", + "borderStyle", + "borderColor", + "borderOpacity", + "backgroundColor", + "backgroundOpacity", + "backgroundImage", + "gradientColorStops", + "boxDecorationBreak", + "backgroundSize", + "backgroundAttachment", + "backgroundClip", + "backgroundPosition", + "backgroundRepeat", + "backgroundOrigin", + "fill", + "stroke", + "strokeWidth", + "objectFit", + "objectPosition", + "padding", + "textAlign", + "textIndent", + "verticalAlign", + "fontFamily", + "fontSize", + "fontWeight", + "textTransform", + "fontStyle", + "fontVariantNumeric", + "lineHeight", + "letterSpacing", + "textColor", + "textOpacity", + "textDecoration", + "textDecorationColor", + "textDecorationStyle", + "textDecorationThickness", + "textUnderlineOffset", + "fontSmoothing", + "placeholderColor", + "placeholderOpacity", + "caretColor", + "accentColor", + "opacity", + "backgroundBlendMode", + "mixBlendMode", + "boxShadow", + "boxShadowColor", + "outlineStyle", + "outlineWidth", + "outlineOffset", + "outlineColor", + "ringWidth", + "ringColor", + "ringOpacity", + "ringOffsetWidth", + "ringOffsetColor", + "blur", + "brightness", + "contrast", + "dropShadow", + "grayscale", + "hueRotate", + "invert", + "saturate", + "sepia", + "filter", + "backdropBlur", + "backdropBrightness", + "backdropContrast", + "backdropGrayscale", + "backdropHueRotate", + "backdropInvert", + "backdropOpacity", + "backdropSaturate", + "backdropSepia", + "backdropFilter", + "transitionProperty", + "transitionDelay", + "transitionDuration", + "transitionTimingFunction", + "willChange", + "content" +]; diff --git a/node_modules/tailwindcss/lib/corePlugins.js b/node_modules/tailwindcss/lib/corePlugins.js new file mode 100644 index 0000000..d70686c --- /dev/null +++ b/node_modules/tailwindcss/lib/corePlugins.js @@ -0,0 +1,4177 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + variantPlugins: function() { + return variantPlugins; + }, + corePlugins: function() { + return corePlugins; + } +}); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _path = /*#__PURE__*/ _interop_require_wildcard(require("path")); +const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss")); +const _createUtilityPlugin = /*#__PURE__*/ _interop_require_default(require("./util/createUtilityPlugin")); +const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("./util/buildMediaQuery")); +const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./util/escapeClassName")); +const _parseAnimationValue = /*#__PURE__*/ _interop_require_default(require("./util/parseAnimationValue")); +const _flattenColorPalette = /*#__PURE__*/ _interop_require_default(require("./util/flattenColorPalette")); +const _withAlphaVariable = /*#__PURE__*/ _interop_require_wildcard(require("./util/withAlphaVariable")); +const _toColorValue = /*#__PURE__*/ _interop_require_default(require("./util/toColorValue")); +const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./util/isPlainObject")); +const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./util/transformThemeValue")); +const _packagejson = require("../package.json"); +const _log = /*#__PURE__*/ _interop_require_default(require("./util/log")); +const _normalizeScreens = require("./util/normalizeScreens"); +const _parseBoxShadowValue = require("./util/parseBoxShadowValue"); +const _removeAlphaVariables = require("./util/removeAlphaVariables"); +const _featureFlags = require("./featureFlags"); +const _dataTypes = require("./util/dataTypes"); +const _setupContextUtils = require("./lib/setupContextUtils"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +let variantPlugins = { + pseudoElementVariants: ({ addVariant })=>{ + addVariant("first-letter", "&::first-letter"); + addVariant("first-line", "&::first-line"); + addVariant("marker", [ + ({ container })=>{ + (0, _removeAlphaVariables.removeAlphaVariables)(container, [ + "--tw-text-opacity" + ]); + return "& *::marker"; + }, + ({ container })=>{ + (0, _removeAlphaVariables.removeAlphaVariables)(container, [ + "--tw-text-opacity" + ]); + return "&::marker"; + } + ]); + addVariant("selection", [ + "& *::selection", + "&::selection" + ]); + addVariant("file", "&::file-selector-button"); + addVariant("placeholder", "&::placeholder"); + addVariant("backdrop", "&::backdrop"); + addVariant("before", ({ container })=>{ + container.walkRules((rule)=>{ + let foundContent = false; + rule.walkDecls("content", ()=>{ + foundContent = true; + }); + if (!foundContent) { + rule.prepend(_postcss.default.decl({ + prop: "content", + value: "var(--tw-content)" + })); + } + }); + return "&::before"; + }); + addVariant("after", ({ container })=>{ + container.walkRules((rule)=>{ + let foundContent = false; + rule.walkDecls("content", ()=>{ + foundContent = true; + }); + if (!foundContent) { + rule.prepend(_postcss.default.decl({ + prop: "content", + value: "var(--tw-content)" + })); + } + }); + return "&::after"; + }); + }, + pseudoClassVariants: ({ addVariant , matchVariant , config , prefix })=>{ + let pseudoVariants = [ + // Positional + [ + "first", + "&:first-child" + ], + [ + "last", + "&:last-child" + ], + [ + "only", + "&:only-child" + ], + [ + "odd", + "&:nth-child(odd)" + ], + [ + "even", + "&:nth-child(even)" + ], + "first-of-type", + "last-of-type", + "only-of-type", + // State + [ + "visited", + ({ container })=>{ + (0, _removeAlphaVariables.removeAlphaVariables)(container, [ + "--tw-text-opacity", + "--tw-border-opacity", + "--tw-bg-opacity" + ]); + return "&:visited"; + } + ], + "target", + [ + "open", + "&[open]" + ], + // Forms + "default", + "checked", + "indeterminate", + "placeholder-shown", + "autofill", + "optional", + "required", + "valid", + "invalid", + "in-range", + "out-of-range", + "read-only", + // Content + "empty", + // Interactive + "focus-within", + [ + "hover", + !(0, _featureFlags.flagEnabled)(config(), "hoverOnlyWhenSupported") ? "&:hover" : "@media (hover: hover) and (pointer: fine) { &:hover }" + ], + "focus", + "focus-visible", + "active", + "enabled", + "disabled" + ].map((variant)=>Array.isArray(variant) ? variant : [ + variant, + `&:${variant}` + ]); + for (let [variantName, state] of pseudoVariants){ + addVariant(variantName, (ctx)=>{ + let result = typeof state === "function" ? state(ctx) : state; + return result; + }); + } + let variants = { + group: (_, { modifier })=>modifier ? [ + `:merge(${prefix(".group")}\\/${(0, _escapeClassName.default)(modifier)})`, + " &" + ] : [ + `:merge(${prefix(".group")})`, + " &" + ], + peer: (_, { modifier })=>modifier ? [ + `:merge(${prefix(".peer")}\\/${(0, _escapeClassName.default)(modifier)})`, + " ~ &" + ] : [ + `:merge(${prefix(".peer")})`, + " ~ &" + ] + }; + for (let [name, fn] of Object.entries(variants)){ + matchVariant(name, (value = "", extra)=>{ + let result = (0, _dataTypes.normalize)(typeof value === "function" ? value(extra) : value); + if (!result.includes("&")) result = "&" + result; + let [a, b] = fn("", extra); + let start = null; + let end = null; + let quotes = 0; + for(let i = 0; i < result.length; ++i){ + let c = result[i]; + if (c === "&") { + start = i; + } else if (c === "'" || c === '"') { + quotes += 1; + } else if (start !== null && c === " " && !quotes) { + end = i; + } + } + if (start !== null && end === null) { + end = result.length; + } + // Basically this but can handle quotes: + // result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b) + return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end); + }, { + values: Object.fromEntries(pseudoVariants), + [_setupContextUtils.INTERNAL_FEATURES]: { + respectPrefix: false + } + }); + } + }, + directionVariants: ({ addVariant })=>{ + addVariant("ltr", ':is([dir="ltr"] &)'); + addVariant("rtl", ':is([dir="rtl"] &)'); + }, + reducedMotionVariants: ({ addVariant })=>{ + addVariant("motion-safe", "@media (prefers-reduced-motion: no-preference)"); + addVariant("motion-reduce", "@media (prefers-reduced-motion: reduce)"); + }, + darkVariants: ({ config , addVariant })=>{ + let [mode, className = ".dark"] = [].concat(config("darkMode", "media")); + if (mode === false) { + mode = "media"; + _log.default.warn("darkmode-false", [ + "The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.", + "Change `darkMode` to `media` or remove it entirely.", + "https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration" + ]); + } + if (mode === "class") { + addVariant("dark", `:is(${className} &)`); + } else if (mode === "media") { + addVariant("dark", "@media (prefers-color-scheme: dark)"); + } + }, + printVariant: ({ addVariant })=>{ + addVariant("print", "@media print"); + }, + screenVariants: ({ theme , addVariant , matchVariant })=>{ + var _theme; + let rawScreens = (_theme = theme("screens")) !== null && _theme !== void 0 ? _theme : {}; + let areSimpleScreens = Object.values(rawScreens).every((v)=>typeof v === "string"); + let screens = (0, _normalizeScreens.normalizeScreens)(theme("screens")); + /** @type {Set} */ let unitCache = new Set([]); + /** @param {string} value */ function units(value) { + var _value_match; + var _value_match_; + return (_value_match_ = (_value_match = value.match(/(\D+)$/)) === null || _value_match === void 0 ? void 0 : _value_match[1]) !== null && _value_match_ !== void 0 ? _value_match_ : "(none)"; + } + /** @param {string} value */ function recordUnits(value) { + if (value !== undefined) { + unitCache.add(units(value)); + } + } + /** @param {string} value */ function canUseUnits(value) { + recordUnits(value); + // If the cache was empty it'll become 1 because we've just added the current unit + // If the cache was not empty and the units are the same the size doesn't change + // Otherwise, if the units are different from what is already known the size will always be > 1 + return unitCache.size === 1; + } + for (const screen of screens){ + for (const value of screen.values){ + recordUnits(value.min); + recordUnits(value.max); + } + } + let screensUseConsistentUnits = unitCache.size <= 1; + /** + * @typedef {import('./util/normalizeScreens').Screen} Screen + */ /** + * @param {'min' | 'max'} type + * @returns {Record} + */ function buildScreenValues(type) { + return Object.fromEntries(screens.filter((screen)=>(0, _normalizeScreens.isScreenSortable)(screen).result).map((screen)=>{ + let { min , max } = screen.values[0]; + if (type === "min" && min !== undefined) { + return screen; + } else if (type === "min" && max !== undefined) { + return { + ...screen, + not: !screen.not + }; + } else if (type === "max" && max !== undefined) { + return screen; + } else if (type === "max" && min !== undefined) { + return { + ...screen, + not: !screen.not + }; + } + }).map((screen)=>[ + screen.name, + screen + ])); + } + /** + * @param {'min' | 'max'} type + * @returns {(a: { value: string | Screen }, z: { value: string | Screen }) => number} + */ function buildSort(type) { + return (a, z)=>(0, _normalizeScreens.compareScreens)(type, a.value, z.value); + } + let maxSort = buildSort("max"); + let minSort = buildSort("min"); + /** @param {'min'|'max'} type */ function buildScreenVariant(type) { + return (value)=>{ + if (!areSimpleScreens) { + _log.default.warn("complex-screen-config", [ + "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects." + ]); + return []; + } else if (!screensUseConsistentUnits) { + _log.default.warn("mixed-screen-units", [ + "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units." + ]); + return []; + } else if (typeof value === "string" && !canUseUnits(value)) { + _log.default.warn("minmax-have-mixed-units", [ + "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units." + ]); + return []; + } + return [ + `@media ${(0, _buildMediaQuery.default)((0, _normalizeScreens.toScreen)(value, type))}` + ]; + }; + } + matchVariant("max", buildScreenVariant("max"), { + sort: maxSort, + values: areSimpleScreens ? buildScreenValues("max") : {} + }); + // screens and min-* are sorted together when they can be + let id = "min-screens"; + for (let screen of screens){ + addVariant(screen.name, `@media ${(0, _buildMediaQuery.default)(screen)}`, { + id, + sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined, + value: screen + }); + } + matchVariant("min", buildScreenVariant("min"), { + id, + sort: minSort + }); + }, + supportsVariants: ({ matchVariant , theme })=>{ + var _theme; + matchVariant("supports", (value = "")=>{ + let check = (0, _dataTypes.normalize)(value); + let isRaw = /^\w*\s*\(/.test(check); + // Chrome has a bug where `(condtion1)or(condition2)` is not valid + // But `(condition1) or (condition2)` is supported. + check = isRaw ? check.replace(/\b(and|or|not)\b/g, " $1 ") : check; + if (isRaw) { + return `@supports ${check}`; + } + if (!check.includes(":")) { + check = `${check}: var(--tw)`; + } + if (!(check.startsWith("(") && check.endsWith(")"))) { + check = `(${check})`; + } + return `@supports ${check}`; + }, { + values: (_theme = theme("supports")) !== null && _theme !== void 0 ? _theme : {} + }); + }, + ariaVariants: ({ matchVariant , theme })=>{ + var _theme; + matchVariant("aria", (value)=>`&[aria-${(0, _dataTypes.normalize)(value)}]`, { + values: (_theme = theme("aria")) !== null && _theme !== void 0 ? _theme : {} + }); + var _theme1; + matchVariant("group-aria", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier})[aria-${(0, _dataTypes.normalize)(value)}] &` : `:merge(.group)[aria-${(0, _dataTypes.normalize)(value)}] &`, { + values: (_theme1 = theme("aria")) !== null && _theme1 !== void 0 ? _theme1 : {} + }); + var _theme2; + matchVariant("peer-aria", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier})[aria-${(0, _dataTypes.normalize)(value)}] ~ &` : `:merge(.peer)[aria-${(0, _dataTypes.normalize)(value)}] ~ &`, { + values: (_theme2 = theme("aria")) !== null && _theme2 !== void 0 ? _theme2 : {} + }); + }, + dataVariants: ({ matchVariant , theme })=>{ + var _theme; + matchVariant("data", (value)=>`&[data-${(0, _dataTypes.normalize)(value)}]`, { + values: (_theme = theme("data")) !== null && _theme !== void 0 ? _theme : {} + }); + var _theme1; + matchVariant("group-data", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier})[data-${(0, _dataTypes.normalize)(value)}] &` : `:merge(.group)[data-${(0, _dataTypes.normalize)(value)}] &`, { + values: (_theme1 = theme("data")) !== null && _theme1 !== void 0 ? _theme1 : {} + }); + var _theme2; + matchVariant("peer-data", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier})[data-${(0, _dataTypes.normalize)(value)}] ~ &` : `:merge(.peer)[data-${(0, _dataTypes.normalize)(value)}] ~ &`, { + values: (_theme2 = theme("data")) !== null && _theme2 !== void 0 ? _theme2 : {} + }); + }, + orientationVariants: ({ addVariant })=>{ + addVariant("portrait", "@media (orientation: portrait)"); + addVariant("landscape", "@media (orientation: landscape)"); + }, + prefersContrastVariants: ({ addVariant })=>{ + addVariant("contrast-more", "@media (prefers-contrast: more)"); + addVariant("contrast-less", "@media (prefers-contrast: less)"); + } +}; +let cssTransformValue = [ + "translate(var(--tw-translate-x), var(--tw-translate-y))", + "rotate(var(--tw-rotate))", + "skewX(var(--tw-skew-x))", + "skewY(var(--tw-skew-y))", + "scaleX(var(--tw-scale-x))", + "scaleY(var(--tw-scale-y))" +].join(" "); +let cssFilterValue = [ + "var(--tw-blur)", + "var(--tw-brightness)", + "var(--tw-contrast)", + "var(--tw-grayscale)", + "var(--tw-hue-rotate)", + "var(--tw-invert)", + "var(--tw-saturate)", + "var(--tw-sepia)", + "var(--tw-drop-shadow)" +].join(" "); +let cssBackdropFilterValue = [ + "var(--tw-backdrop-blur)", + "var(--tw-backdrop-brightness)", + "var(--tw-backdrop-contrast)", + "var(--tw-backdrop-grayscale)", + "var(--tw-backdrop-hue-rotate)", + "var(--tw-backdrop-invert)", + "var(--tw-backdrop-opacity)", + "var(--tw-backdrop-saturate)", + "var(--tw-backdrop-sepia)" +].join(" "); +let corePlugins = { + preflight: ({ addBase })=>{ + let preflightStyles = _postcss.default.parse(_fs.default.readFileSync(_path.join(__dirname, "./css/preflight.css"), "utf8")); + addBase([ + _postcss.default.comment({ + text: `! tailwindcss v${_packagejson.version} | MIT License | https://tailwindcss.com` + }), + ...preflightStyles.nodes + ]); + }, + container: (()=>{ + function extractMinWidths(breakpoints = []) { + return breakpoints.flatMap((breakpoint)=>breakpoint.values.map((breakpoint)=>breakpoint.min)).filter((v)=>v !== undefined); + } + function mapMinWidthsToPadding(minWidths, screens, paddings) { + if (typeof paddings === "undefined") { + return []; + } + if (!(typeof paddings === "object" && paddings !== null)) { + return [ + { + screen: "DEFAULT", + minWidth: 0, + padding: paddings + } + ]; + } + let mapping = []; + if (paddings.DEFAULT) { + mapping.push({ + screen: "DEFAULT", + minWidth: 0, + padding: paddings.DEFAULT + }); + } + for (let minWidth of minWidths){ + for (let screen of screens){ + for (let { min } of screen.values){ + if (min === minWidth) { + mapping.push({ + minWidth, + padding: paddings[screen.name] + }); + } + } + } + } + return mapping; + } + return function({ addComponents , theme }) { + let screens = (0, _normalizeScreens.normalizeScreens)(theme("container.screens", theme("screens"))); + let minWidths = extractMinWidths(screens); + let paddings = mapMinWidthsToPadding(minWidths, screens, theme("container.padding")); + let generatePaddingFor = (minWidth)=>{ + let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth); + if (!paddingConfig) { + return {}; + } + return { + paddingRight: paddingConfig.padding, + paddingLeft: paddingConfig.padding + }; + }; + let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)))).map((minWidth)=>({ + [`@media (min-width: ${minWidth})`]: { + ".container": { + "max-width": minWidth, + ...generatePaddingFor(minWidth) + } + } + })); + addComponents([ + { + ".container": Object.assign({ + width: "100%" + }, theme("container.center", false) ? { + marginRight: "auto", + marginLeft: "auto" + } : {}, generatePaddingFor(0)) + }, + ...atRules + ]); + }; + })(), + accessibility: ({ addUtilities })=>{ + addUtilities({ + ".sr-only": { + position: "absolute", + width: "1px", + height: "1px", + padding: "0", + margin: "-1px", + overflow: "hidden", + clip: "rect(0, 0, 0, 0)", + whiteSpace: "nowrap", + borderWidth: "0" + }, + ".not-sr-only": { + position: "static", + width: "auto", + height: "auto", + padding: "0", + margin: "0", + overflow: "visible", + clip: "auto", + whiteSpace: "normal" + } + }); + }, + pointerEvents: ({ addUtilities })=>{ + addUtilities({ + ".pointer-events-none": { + "pointer-events": "none" + }, + ".pointer-events-auto": { + "pointer-events": "auto" + } + }); + }, + visibility: ({ addUtilities })=>{ + addUtilities({ + ".visible": { + visibility: "visible" + }, + ".invisible": { + visibility: "hidden" + }, + ".collapse": { + visibility: "collapse" + } + }); + }, + position: ({ addUtilities })=>{ + addUtilities({ + ".static": { + position: "static" + }, + ".fixed": { + position: "fixed" + }, + ".absolute": { + position: "absolute" + }, + ".relative": { + position: "relative" + }, + ".sticky": { + position: "sticky" + } + }); + }, + inset: (0, _createUtilityPlugin.default)("inset", [ + [ + "inset", + [ + "inset" + ] + ], + [ + [ + "inset-x", + [ + "left", + "right" + ] + ], + [ + "inset-y", + [ + "top", + "bottom" + ] + ] + ], + [ + [ + "start", + [ + "inset-inline-start" + ] + ], + [ + "end", + [ + "inset-inline-end" + ] + ], + [ + "top", + [ + "top" + ] + ], + [ + "right", + [ + "right" + ] + ], + [ + "bottom", + [ + "bottom" + ] + ], + [ + "left", + [ + "left" + ] + ] + ] + ], { + supportsNegativeValues: true + }), + isolation: ({ addUtilities })=>{ + addUtilities({ + ".isolate": { + isolation: "isolate" + }, + ".isolation-auto": { + isolation: "auto" + } + }); + }, + zIndex: (0, _createUtilityPlugin.default)("zIndex", [ + [ + "z", + [ + "zIndex" + ] + ] + ], { + supportsNegativeValues: true + }), + order: (0, _createUtilityPlugin.default)("order", undefined, { + supportsNegativeValues: true + }), + gridColumn: (0, _createUtilityPlugin.default)("gridColumn", [ + [ + "col", + [ + "gridColumn" + ] + ] + ]), + gridColumnStart: (0, _createUtilityPlugin.default)("gridColumnStart", [ + [ + "col-start", + [ + "gridColumnStart" + ] + ] + ]), + gridColumnEnd: (0, _createUtilityPlugin.default)("gridColumnEnd", [ + [ + "col-end", + [ + "gridColumnEnd" + ] + ] + ]), + gridRow: (0, _createUtilityPlugin.default)("gridRow", [ + [ + "row", + [ + "gridRow" + ] + ] + ]), + gridRowStart: (0, _createUtilityPlugin.default)("gridRowStart", [ + [ + "row-start", + [ + "gridRowStart" + ] + ] + ]), + gridRowEnd: (0, _createUtilityPlugin.default)("gridRowEnd", [ + [ + "row-end", + [ + "gridRowEnd" + ] + ] + ]), + float: ({ addUtilities })=>{ + addUtilities({ + ".float-right": { + float: "right" + }, + ".float-left": { + float: "left" + }, + ".float-none": { + float: "none" + } + }); + }, + clear: ({ addUtilities })=>{ + addUtilities({ + ".clear-left": { + clear: "left" + }, + ".clear-right": { + clear: "right" + }, + ".clear-both": { + clear: "both" + }, + ".clear-none": { + clear: "none" + } + }); + }, + margin: (0, _createUtilityPlugin.default)("margin", [ + [ + "m", + [ + "margin" + ] + ], + [ + [ + "mx", + [ + "margin-left", + "margin-right" + ] + ], + [ + "my", + [ + "margin-top", + "margin-bottom" + ] + ] + ], + [ + [ + "ms", + [ + "margin-inline-start" + ] + ], + [ + "me", + [ + "margin-inline-end" + ] + ], + [ + "mt", + [ + "margin-top" + ] + ], + [ + "mr", + [ + "margin-right" + ] + ], + [ + "mb", + [ + "margin-bottom" + ] + ], + [ + "ml", + [ + "margin-left" + ] + ] + ] + ], { + supportsNegativeValues: true + }), + boxSizing: ({ addUtilities })=>{ + addUtilities({ + ".box-border": { + "box-sizing": "border-box" + }, + ".box-content": { + "box-sizing": "content-box" + } + }); + }, + lineClamp: ({ matchUtilities , addUtilities , theme })=>{ + matchUtilities({ + "line-clamp": (value)=>({ + overflow: "hidden", + display: "-webkit-box", + "-webkit-box-orient": "vertical", + "-webkit-line-clamp": `${value}` + }) + }, { + values: theme("lineClamp") + }); + addUtilities({ + ".line-clamp-none": { + overflow: "visible", + display: "block", + "-webkit-box-orient": "horizontal", + "-webkit-line-clamp": "none" + } + }); + }, + display: ({ addUtilities })=>{ + addUtilities({ + ".block": { + display: "block" + }, + ".inline-block": { + display: "inline-block" + }, + ".inline": { + display: "inline" + }, + ".flex": { + display: "flex" + }, + ".inline-flex": { + display: "inline-flex" + }, + ".table": { + display: "table" + }, + ".inline-table": { + display: "inline-table" + }, + ".table-caption": { + display: "table-caption" + }, + ".table-cell": { + display: "table-cell" + }, + ".table-column": { + display: "table-column" + }, + ".table-column-group": { + display: "table-column-group" + }, + ".table-footer-group": { + display: "table-footer-group" + }, + ".table-header-group": { + display: "table-header-group" + }, + ".table-row-group": { + display: "table-row-group" + }, + ".table-row": { + display: "table-row" + }, + ".flow-root": { + display: "flow-root" + }, + ".grid": { + display: "grid" + }, + ".inline-grid": { + display: "inline-grid" + }, + ".contents": { + display: "contents" + }, + ".list-item": { + display: "list-item" + }, + ".hidden": { + display: "none" + } + }); + }, + aspectRatio: (0, _createUtilityPlugin.default)("aspectRatio", [ + [ + "aspect", + [ + "aspect-ratio" + ] + ] + ]), + height: (0, _createUtilityPlugin.default)("height", [ + [ + "h", + [ + "height" + ] + ] + ]), + maxHeight: (0, _createUtilityPlugin.default)("maxHeight", [ + [ + "max-h", + [ + "maxHeight" + ] + ] + ]), + minHeight: (0, _createUtilityPlugin.default)("minHeight", [ + [ + "min-h", + [ + "minHeight" + ] + ] + ]), + width: (0, _createUtilityPlugin.default)("width", [ + [ + "w", + [ + "width" + ] + ] + ]), + minWidth: (0, _createUtilityPlugin.default)("minWidth", [ + [ + "min-w", + [ + "minWidth" + ] + ] + ]), + maxWidth: (0, _createUtilityPlugin.default)("maxWidth", [ + [ + "max-w", + [ + "maxWidth" + ] + ] + ]), + flex: (0, _createUtilityPlugin.default)("flex"), + flexShrink: (0, _createUtilityPlugin.default)("flexShrink", [ + [ + "flex-shrink", + [ + "flex-shrink" + ] + ], + [ + "shrink", + [ + "flex-shrink" + ] + ] + ]), + flexGrow: (0, _createUtilityPlugin.default)("flexGrow", [ + [ + "flex-grow", + [ + "flex-grow" + ] + ], + [ + "grow", + [ + "flex-grow" + ] + ] + ]), + flexBasis: (0, _createUtilityPlugin.default)("flexBasis", [ + [ + "basis", + [ + "flex-basis" + ] + ] + ]), + tableLayout: ({ addUtilities })=>{ + addUtilities({ + ".table-auto": { + "table-layout": "auto" + }, + ".table-fixed": { + "table-layout": "fixed" + } + }); + }, + captionSide: ({ addUtilities })=>{ + addUtilities({ + ".caption-top": { + "caption-side": "top" + }, + ".caption-bottom": { + "caption-side": "bottom" + } + }); + }, + borderCollapse: ({ addUtilities })=>{ + addUtilities({ + ".border-collapse": { + "border-collapse": "collapse" + }, + ".border-separate": { + "border-collapse": "separate" + } + }); + }, + borderSpacing: ({ addDefaults , matchUtilities , theme })=>{ + addDefaults("border-spacing", { + "--tw-border-spacing-x": 0, + "--tw-border-spacing-y": 0 + }); + matchUtilities({ + "border-spacing": (value)=>{ + return { + "--tw-border-spacing-x": value, + "--tw-border-spacing-y": value, + "@defaults border-spacing": {}, + "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" + }; + }, + "border-spacing-x": (value)=>{ + return { + "--tw-border-spacing-x": value, + "@defaults border-spacing": {}, + "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" + }; + }, + "border-spacing-y": (value)=>{ + return { + "--tw-border-spacing-y": value, + "@defaults border-spacing": {}, + "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" + }; + } + }, { + values: theme("borderSpacing") + }); + }, + transformOrigin: (0, _createUtilityPlugin.default)("transformOrigin", [ + [ + "origin", + [ + "transformOrigin" + ] + ] + ]), + translate: (0, _createUtilityPlugin.default)("translate", [ + [ + [ + "translate-x", + [ + [ + "@defaults transform", + {} + ], + "--tw-translate-x", + [ + "transform", + cssTransformValue + ] + ] + ], + [ + "translate-y", + [ + [ + "@defaults transform", + {} + ], + "--tw-translate-y", + [ + "transform", + cssTransformValue + ] + ] + ] + ] + ], { + supportsNegativeValues: true + }), + rotate: (0, _createUtilityPlugin.default)("rotate", [ + [ + "rotate", + [ + [ + "@defaults transform", + {} + ], + "--tw-rotate", + [ + "transform", + cssTransformValue + ] + ] + ] + ], { + supportsNegativeValues: true + }), + skew: (0, _createUtilityPlugin.default)("skew", [ + [ + [ + "skew-x", + [ + [ + "@defaults transform", + {} + ], + "--tw-skew-x", + [ + "transform", + cssTransformValue + ] + ] + ], + [ + "skew-y", + [ + [ + "@defaults transform", + {} + ], + "--tw-skew-y", + [ + "transform", + cssTransformValue + ] + ] + ] + ] + ], { + supportsNegativeValues: true + }), + scale: (0, _createUtilityPlugin.default)("scale", [ + [ + "scale", + [ + [ + "@defaults transform", + {} + ], + "--tw-scale-x", + "--tw-scale-y", + [ + "transform", + cssTransformValue + ] + ] + ], + [ + [ + "scale-x", + [ + [ + "@defaults transform", + {} + ], + "--tw-scale-x", + [ + "transform", + cssTransformValue + ] + ] + ], + [ + "scale-y", + [ + [ + "@defaults transform", + {} + ], + "--tw-scale-y", + [ + "transform", + cssTransformValue + ] + ] + ] + ] + ], { + supportsNegativeValues: true + }), + transform: ({ addDefaults , addUtilities })=>{ + addDefaults("transform", { + "--tw-translate-x": "0", + "--tw-translate-y": "0", + "--tw-rotate": "0", + "--tw-skew-x": "0", + "--tw-skew-y": "0", + "--tw-scale-x": "1", + "--tw-scale-y": "1" + }); + addUtilities({ + ".transform": { + "@defaults transform": {}, + transform: cssTransformValue + }, + ".transform-cpu": { + transform: cssTransformValue + }, + ".transform-gpu": { + transform: cssTransformValue.replace("translate(var(--tw-translate-x), var(--tw-translate-y))", "translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)") + }, + ".transform-none": { + transform: "none" + } + }); + }, + animation: ({ matchUtilities , theme , config })=>{ + let prefixName = (name)=>(0, _escapeClassName.default)(config("prefix") + name); + var _theme; + let keyframes = Object.fromEntries(Object.entries((_theme = theme("keyframes")) !== null && _theme !== void 0 ? _theme : {}).map(([key, value])=>{ + return [ + key, + { + [`@keyframes ${prefixName(key)}`]: value + } + ]; + })); + matchUtilities({ + animate: (value)=>{ + let animations = (0, _parseAnimationValue.default)(value); + return [ + ...animations.flatMap((animation)=>keyframes[animation.name]), + { + animation: animations.map(({ name , value })=>{ + if (name === undefined || keyframes[name] === undefined) { + return value; + } + return value.replace(name, prefixName(name)); + }).join(", ") + } + ]; + } + }, { + values: theme("animation") + }); + }, + cursor: (0, _createUtilityPlugin.default)("cursor"), + touchAction: ({ addDefaults , addUtilities })=>{ + addDefaults("touch-action", { + "--tw-pan-x": " ", + "--tw-pan-y": " ", + "--tw-pinch-zoom": " " + }); + let cssTouchActionValue = "var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"; + addUtilities({ + ".touch-auto": { + "touch-action": "auto" + }, + ".touch-none": { + "touch-action": "none" + }, + ".touch-pan-x": { + "@defaults touch-action": {}, + "--tw-pan-x": "pan-x", + "touch-action": cssTouchActionValue + }, + ".touch-pan-left": { + "@defaults touch-action": {}, + "--tw-pan-x": "pan-left", + "touch-action": cssTouchActionValue + }, + ".touch-pan-right": { + "@defaults touch-action": {}, + "--tw-pan-x": "pan-right", + "touch-action": cssTouchActionValue + }, + ".touch-pan-y": { + "@defaults touch-action": {}, + "--tw-pan-y": "pan-y", + "touch-action": cssTouchActionValue + }, + ".touch-pan-up": { + "@defaults touch-action": {}, + "--tw-pan-y": "pan-up", + "touch-action": cssTouchActionValue + }, + ".touch-pan-down": { + "@defaults touch-action": {}, + "--tw-pan-y": "pan-down", + "touch-action": cssTouchActionValue + }, + ".touch-pinch-zoom": { + "@defaults touch-action": {}, + "--tw-pinch-zoom": "pinch-zoom", + "touch-action": cssTouchActionValue + }, + ".touch-manipulation": { + "touch-action": "manipulation" + } + }); + }, + userSelect: ({ addUtilities })=>{ + addUtilities({ + ".select-none": { + "user-select": "none" + }, + ".select-text": { + "user-select": "text" + }, + ".select-all": { + "user-select": "all" + }, + ".select-auto": { + "user-select": "auto" + } + }); + }, + resize: ({ addUtilities })=>{ + addUtilities({ + ".resize-none": { + resize: "none" + }, + ".resize-y": { + resize: "vertical" + }, + ".resize-x": { + resize: "horizontal" + }, + ".resize": { + resize: "both" + } + }); + }, + scrollSnapType: ({ addDefaults , addUtilities })=>{ + addDefaults("scroll-snap-type", { + "--tw-scroll-snap-strictness": "proximity" + }); + addUtilities({ + ".snap-none": { + "scroll-snap-type": "none" + }, + ".snap-x": { + "@defaults scroll-snap-type": {}, + "scroll-snap-type": "x var(--tw-scroll-snap-strictness)" + }, + ".snap-y": { + "@defaults scroll-snap-type": {}, + "scroll-snap-type": "y var(--tw-scroll-snap-strictness)" + }, + ".snap-both": { + "@defaults scroll-snap-type": {}, + "scroll-snap-type": "both var(--tw-scroll-snap-strictness)" + }, + ".snap-mandatory": { + "--tw-scroll-snap-strictness": "mandatory" + }, + ".snap-proximity": { + "--tw-scroll-snap-strictness": "proximity" + } + }); + }, + scrollSnapAlign: ({ addUtilities })=>{ + addUtilities({ + ".snap-start": { + "scroll-snap-align": "start" + }, + ".snap-end": { + "scroll-snap-align": "end" + }, + ".snap-center": { + "scroll-snap-align": "center" + }, + ".snap-align-none": { + "scroll-snap-align": "none" + } + }); + }, + scrollSnapStop: ({ addUtilities })=>{ + addUtilities({ + ".snap-normal": { + "scroll-snap-stop": "normal" + }, + ".snap-always": { + "scroll-snap-stop": "always" + } + }); + }, + scrollMargin: (0, _createUtilityPlugin.default)("scrollMargin", [ + [ + "scroll-m", + [ + "scroll-margin" + ] + ], + [ + [ + "scroll-mx", + [ + "scroll-margin-left", + "scroll-margin-right" + ] + ], + [ + "scroll-my", + [ + "scroll-margin-top", + "scroll-margin-bottom" + ] + ] + ], + [ + [ + "scroll-ms", + [ + "scroll-margin-inline-start" + ] + ], + [ + "scroll-me", + [ + "scroll-margin-inline-end" + ] + ], + [ + "scroll-mt", + [ + "scroll-margin-top" + ] + ], + [ + "scroll-mr", + [ + "scroll-margin-right" + ] + ], + [ + "scroll-mb", + [ + "scroll-margin-bottom" + ] + ], + [ + "scroll-ml", + [ + "scroll-margin-left" + ] + ] + ] + ], { + supportsNegativeValues: true + }), + scrollPadding: (0, _createUtilityPlugin.default)("scrollPadding", [ + [ + "scroll-p", + [ + "scroll-padding" + ] + ], + [ + [ + "scroll-px", + [ + "scroll-padding-left", + "scroll-padding-right" + ] + ], + [ + "scroll-py", + [ + "scroll-padding-top", + "scroll-padding-bottom" + ] + ] + ], + [ + [ + "scroll-ps", + [ + "scroll-padding-inline-start" + ] + ], + [ + "scroll-pe", + [ + "scroll-padding-inline-end" + ] + ], + [ + "scroll-pt", + [ + "scroll-padding-top" + ] + ], + [ + "scroll-pr", + [ + "scroll-padding-right" + ] + ], + [ + "scroll-pb", + [ + "scroll-padding-bottom" + ] + ], + [ + "scroll-pl", + [ + "scroll-padding-left" + ] + ] + ] + ]), + listStylePosition: ({ addUtilities })=>{ + addUtilities({ + ".list-inside": { + "list-style-position": "inside" + }, + ".list-outside": { + "list-style-position": "outside" + } + }); + }, + listStyleType: (0, _createUtilityPlugin.default)("listStyleType", [ + [ + "list", + [ + "listStyleType" + ] + ] + ]), + listStyleImage: (0, _createUtilityPlugin.default)("listStyleImage", [ + [ + "list-image", + [ + "listStyleImage" + ] + ] + ]), + appearance: ({ addUtilities })=>{ + addUtilities({ + ".appearance-none": { + appearance: "none" + } + }); + }, + columns: (0, _createUtilityPlugin.default)("columns", [ + [ + "columns", + [ + "columns" + ] + ] + ]), + breakBefore: ({ addUtilities })=>{ + addUtilities({ + ".break-before-auto": { + "break-before": "auto" + }, + ".break-before-avoid": { + "break-before": "avoid" + }, + ".break-before-all": { + "break-before": "all" + }, + ".break-before-avoid-page": { + "break-before": "avoid-page" + }, + ".break-before-page": { + "break-before": "page" + }, + ".break-before-left": { + "break-before": "left" + }, + ".break-before-right": { + "break-before": "right" + }, + ".break-before-column": { + "break-before": "column" + } + }); + }, + breakInside: ({ addUtilities })=>{ + addUtilities({ + ".break-inside-auto": { + "break-inside": "auto" + }, + ".break-inside-avoid": { + "break-inside": "avoid" + }, + ".break-inside-avoid-page": { + "break-inside": "avoid-page" + }, + ".break-inside-avoid-column": { + "break-inside": "avoid-column" + } + }); + }, + breakAfter: ({ addUtilities })=>{ + addUtilities({ + ".break-after-auto": { + "break-after": "auto" + }, + ".break-after-avoid": { + "break-after": "avoid" + }, + ".break-after-all": { + "break-after": "all" + }, + ".break-after-avoid-page": { + "break-after": "avoid-page" + }, + ".break-after-page": { + "break-after": "page" + }, + ".break-after-left": { + "break-after": "left" + }, + ".break-after-right": { + "break-after": "right" + }, + ".break-after-column": { + "break-after": "column" + } + }); + }, + gridAutoColumns: (0, _createUtilityPlugin.default)("gridAutoColumns", [ + [ + "auto-cols", + [ + "gridAutoColumns" + ] + ] + ]), + gridAutoFlow: ({ addUtilities })=>{ + addUtilities({ + ".grid-flow-row": { + gridAutoFlow: "row" + }, + ".grid-flow-col": { + gridAutoFlow: "column" + }, + ".grid-flow-dense": { + gridAutoFlow: "dense" + }, + ".grid-flow-row-dense": { + gridAutoFlow: "row dense" + }, + ".grid-flow-col-dense": { + gridAutoFlow: "column dense" + } + }); + }, + gridAutoRows: (0, _createUtilityPlugin.default)("gridAutoRows", [ + [ + "auto-rows", + [ + "gridAutoRows" + ] + ] + ]), + gridTemplateColumns: (0, _createUtilityPlugin.default)("gridTemplateColumns", [ + [ + "grid-cols", + [ + "gridTemplateColumns" + ] + ] + ]), + gridTemplateRows: (0, _createUtilityPlugin.default)("gridTemplateRows", [ + [ + "grid-rows", + [ + "gridTemplateRows" + ] + ] + ]), + flexDirection: ({ addUtilities })=>{ + addUtilities({ + ".flex-row": { + "flex-direction": "row" + }, + ".flex-row-reverse": { + "flex-direction": "row-reverse" + }, + ".flex-col": { + "flex-direction": "column" + }, + ".flex-col-reverse": { + "flex-direction": "column-reverse" + } + }); + }, + flexWrap: ({ addUtilities })=>{ + addUtilities({ + ".flex-wrap": { + "flex-wrap": "wrap" + }, + ".flex-wrap-reverse": { + "flex-wrap": "wrap-reverse" + }, + ".flex-nowrap": { + "flex-wrap": "nowrap" + } + }); + }, + placeContent: ({ addUtilities })=>{ + addUtilities({ + ".place-content-center": { + "place-content": "center" + }, + ".place-content-start": { + "place-content": "start" + }, + ".place-content-end": { + "place-content": "end" + }, + ".place-content-between": { + "place-content": "space-between" + }, + ".place-content-around": { + "place-content": "space-around" + }, + ".place-content-evenly": { + "place-content": "space-evenly" + }, + ".place-content-baseline": { + "place-content": "baseline" + }, + ".place-content-stretch": { + "place-content": "stretch" + } + }); + }, + placeItems: ({ addUtilities })=>{ + addUtilities({ + ".place-items-start": { + "place-items": "start" + }, + ".place-items-end": { + "place-items": "end" + }, + ".place-items-center": { + "place-items": "center" + }, + ".place-items-baseline": { + "place-items": "baseline" + }, + ".place-items-stretch": { + "place-items": "stretch" + } + }); + }, + alignContent: ({ addUtilities })=>{ + addUtilities({ + ".content-normal": { + "align-content": "normal" + }, + ".content-center": { + "align-content": "center" + }, + ".content-start": { + "align-content": "flex-start" + }, + ".content-end": { + "align-content": "flex-end" + }, + ".content-between": { + "align-content": "space-between" + }, + ".content-around": { + "align-content": "space-around" + }, + ".content-evenly": { + "align-content": "space-evenly" + }, + ".content-baseline": { + "align-content": "baseline" + }, + ".content-stretch": { + "align-content": "stretch" + } + }); + }, + alignItems: ({ addUtilities })=>{ + addUtilities({ + ".items-start": { + "align-items": "flex-start" + }, + ".items-end": { + "align-items": "flex-end" + }, + ".items-center": { + "align-items": "center" + }, + ".items-baseline": { + "align-items": "baseline" + }, + ".items-stretch": { + "align-items": "stretch" + } + }); + }, + justifyContent: ({ addUtilities })=>{ + addUtilities({ + ".justify-normal": { + "justify-content": "normal" + }, + ".justify-start": { + "justify-content": "flex-start" + }, + ".justify-end": { + "justify-content": "flex-end" + }, + ".justify-center": { + "justify-content": "center" + }, + ".justify-between": { + "justify-content": "space-between" + }, + ".justify-around": { + "justify-content": "space-around" + }, + ".justify-evenly": { + "justify-content": "space-evenly" + }, + ".justify-stretch": { + "justify-content": "stretch" + } + }); + }, + justifyItems: ({ addUtilities })=>{ + addUtilities({ + ".justify-items-start": { + "justify-items": "start" + }, + ".justify-items-end": { + "justify-items": "end" + }, + ".justify-items-center": { + "justify-items": "center" + }, + ".justify-items-stretch": { + "justify-items": "stretch" + } + }); + }, + gap: (0, _createUtilityPlugin.default)("gap", [ + [ + "gap", + [ + "gap" + ] + ], + [ + [ + "gap-x", + [ + "columnGap" + ] + ], + [ + "gap-y", + [ + "rowGap" + ] + ] + ] + ]), + space: ({ matchUtilities , addUtilities , theme })=>{ + matchUtilities({ + "space-x": (value)=>{ + value = value === "0" ? "0px" : value; + if (false) { + return { + "& > :not([hidden]) ~ :not([hidden])": { + "--tw-space-x-reverse": "0", + "margin-inline-end": `calc(${value} * var(--tw-space-x-reverse))`, + "margin-inline-start": `calc(${value} * calc(1 - var(--tw-space-x-reverse)))` + } + }; + } + return { + "& > :not([hidden]) ~ :not([hidden])": { + "--tw-space-x-reverse": "0", + "margin-right": `calc(${value} * var(--tw-space-x-reverse))`, + "margin-left": `calc(${value} * calc(1 - var(--tw-space-x-reverse)))` + } + }; + }, + "space-y": (value)=>{ + value = value === "0" ? "0px" : value; + return { + "& > :not([hidden]) ~ :not([hidden])": { + "--tw-space-y-reverse": "0", + "margin-top": `calc(${value} * calc(1 - var(--tw-space-y-reverse)))`, + "margin-bottom": `calc(${value} * var(--tw-space-y-reverse))` + } + }; + } + }, { + values: theme("space"), + supportsNegativeValues: true + }); + addUtilities({ + ".space-y-reverse > :not([hidden]) ~ :not([hidden])": { + "--tw-space-y-reverse": "1" + }, + ".space-x-reverse > :not([hidden]) ~ :not([hidden])": { + "--tw-space-x-reverse": "1" + } + }); + }, + divideWidth: ({ matchUtilities , addUtilities , theme })=>{ + matchUtilities({ + "divide-x": (value)=>{ + value = value === "0" ? "0px" : value; + if (false) { + return { + "& > :not([hidden]) ~ :not([hidden])": { + "@defaults border-width": {}, + "--tw-divide-x-reverse": "0", + "border-inline-end-width": `calc(${value} * var(--tw-divide-x-reverse))`, + "border-inline-start-width": `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))` + } + }; + } + return { + "& > :not([hidden]) ~ :not([hidden])": { + "@defaults border-width": {}, + "--tw-divide-x-reverse": "0", + "border-right-width": `calc(${value} * var(--tw-divide-x-reverse))`, + "border-left-width": `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))` + } + }; + }, + "divide-y": (value)=>{ + value = value === "0" ? "0px" : value; + return { + "& > :not([hidden]) ~ :not([hidden])": { + "@defaults border-width": {}, + "--tw-divide-y-reverse": "0", + "border-top-width": `calc(${value} * calc(1 - var(--tw-divide-y-reverse)))`, + "border-bottom-width": `calc(${value} * var(--tw-divide-y-reverse))` + } + }; + } + }, { + values: theme("divideWidth"), + type: [ + "line-width", + "length", + "any" + ] + }); + addUtilities({ + ".divide-y-reverse > :not([hidden]) ~ :not([hidden])": { + "@defaults border-width": {}, + "--tw-divide-y-reverse": "1" + }, + ".divide-x-reverse > :not([hidden]) ~ :not([hidden])": { + "@defaults border-width": {}, + "--tw-divide-x-reverse": "1" + } + }); + }, + divideStyle: ({ addUtilities })=>{ + addUtilities({ + ".divide-solid > :not([hidden]) ~ :not([hidden])": { + "border-style": "solid" + }, + ".divide-dashed > :not([hidden]) ~ :not([hidden])": { + "border-style": "dashed" + }, + ".divide-dotted > :not([hidden]) ~ :not([hidden])": { + "border-style": "dotted" + }, + ".divide-double > :not([hidden]) ~ :not([hidden])": { + "border-style": "double" + }, + ".divide-none > :not([hidden]) ~ :not([hidden])": { + "border-style": "none" + } + }); + }, + divideColor: ({ matchUtilities , theme , corePlugins })=>{ + matchUtilities({ + divide: (value)=>{ + if (!corePlugins("divideOpacity")) { + return { + ["& > :not([hidden]) ~ :not([hidden])"]: { + "border-color": (0, _toColorValue.default)(value) + } + }; + } + return { + ["& > :not([hidden]) ~ :not([hidden])"]: (0, _withAlphaVariable.default)({ + color: value, + property: "border-color", + variable: "--tw-divide-opacity" + }) + }; + } + }, { + values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("divideColor"))), + type: [ + "color", + "any" + ] + }); + }, + divideOpacity: ({ matchUtilities , theme })=>{ + matchUtilities({ + "divide-opacity": (value)=>{ + return { + [`& > :not([hidden]) ~ :not([hidden])`]: { + "--tw-divide-opacity": value + } + }; + } + }, { + values: theme("divideOpacity") + }); + }, + placeSelf: ({ addUtilities })=>{ + addUtilities({ + ".place-self-auto": { + "place-self": "auto" + }, + ".place-self-start": { + "place-self": "start" + }, + ".place-self-end": { + "place-self": "end" + }, + ".place-self-center": { + "place-self": "center" + }, + ".place-self-stretch": { + "place-self": "stretch" + } + }); + }, + alignSelf: ({ addUtilities })=>{ + addUtilities({ + ".self-auto": { + "align-self": "auto" + }, + ".self-start": { + "align-self": "flex-start" + }, + ".self-end": { + "align-self": "flex-end" + }, + ".self-center": { + "align-self": "center" + }, + ".self-stretch": { + "align-self": "stretch" + }, + ".self-baseline": { + "align-self": "baseline" + } + }); + }, + justifySelf: ({ addUtilities })=>{ + addUtilities({ + ".justify-self-auto": { + "justify-self": "auto" + }, + ".justify-self-start": { + "justify-self": "start" + }, + ".justify-self-end": { + "justify-self": "end" + }, + ".justify-self-center": { + "justify-self": "center" + }, + ".justify-self-stretch": { + "justify-self": "stretch" + } + }); + }, + overflow: ({ addUtilities })=>{ + addUtilities({ + ".overflow-auto": { + overflow: "auto" + }, + ".overflow-hidden": { + overflow: "hidden" + }, + ".overflow-clip": { + overflow: "clip" + }, + ".overflow-visible": { + overflow: "visible" + }, + ".overflow-scroll": { + overflow: "scroll" + }, + ".overflow-x-auto": { + "overflow-x": "auto" + }, + ".overflow-y-auto": { + "overflow-y": "auto" + }, + ".overflow-x-hidden": { + "overflow-x": "hidden" + }, + ".overflow-y-hidden": { + "overflow-y": "hidden" + }, + ".overflow-x-clip": { + "overflow-x": "clip" + }, + ".overflow-y-clip": { + "overflow-y": "clip" + }, + ".overflow-x-visible": { + "overflow-x": "visible" + }, + ".overflow-y-visible": { + "overflow-y": "visible" + }, + ".overflow-x-scroll": { + "overflow-x": "scroll" + }, + ".overflow-y-scroll": { + "overflow-y": "scroll" + } + }); + }, + overscrollBehavior: ({ addUtilities })=>{ + addUtilities({ + ".overscroll-auto": { + "overscroll-behavior": "auto" + }, + ".overscroll-contain": { + "overscroll-behavior": "contain" + }, + ".overscroll-none": { + "overscroll-behavior": "none" + }, + ".overscroll-y-auto": { + "overscroll-behavior-y": "auto" + }, + ".overscroll-y-contain": { + "overscroll-behavior-y": "contain" + }, + ".overscroll-y-none": { + "overscroll-behavior-y": "none" + }, + ".overscroll-x-auto": { + "overscroll-behavior-x": "auto" + }, + ".overscroll-x-contain": { + "overscroll-behavior-x": "contain" + }, + ".overscroll-x-none": { + "overscroll-behavior-x": "none" + } + }); + }, + scrollBehavior: ({ addUtilities })=>{ + addUtilities({ + ".scroll-auto": { + "scroll-behavior": "auto" + }, + ".scroll-smooth": { + "scroll-behavior": "smooth" + } + }); + }, + textOverflow: ({ addUtilities })=>{ + addUtilities({ + ".truncate": { + overflow: "hidden", + "text-overflow": "ellipsis", + "white-space": "nowrap" + }, + ".overflow-ellipsis": { + "text-overflow": "ellipsis" + }, + ".text-ellipsis": { + "text-overflow": "ellipsis" + }, + ".text-clip": { + "text-overflow": "clip" + } + }); + }, + hyphens: ({ addUtilities })=>{ + addUtilities({ + ".hyphens-none": { + hyphens: "none" + }, + ".hyphens-manual": { + hyphens: "manual" + }, + ".hyphens-auto": { + hyphens: "auto" + } + }); + }, + whitespace: ({ addUtilities })=>{ + addUtilities({ + ".whitespace-normal": { + "white-space": "normal" + }, + ".whitespace-nowrap": { + "white-space": "nowrap" + }, + ".whitespace-pre": { + "white-space": "pre" + }, + ".whitespace-pre-line": { + "white-space": "pre-line" + }, + ".whitespace-pre-wrap": { + "white-space": "pre-wrap" + }, + ".whitespace-break-spaces": { + "white-space": "break-spaces" + } + }); + }, + wordBreak: ({ addUtilities })=>{ + addUtilities({ + ".break-normal": { + "overflow-wrap": "normal", + "word-break": "normal" + }, + ".break-words": { + "overflow-wrap": "break-word" + }, + ".break-all": { + "word-break": "break-all" + }, + ".break-keep": { + "word-break": "keep-all" + } + }); + }, + borderRadius: (0, _createUtilityPlugin.default)("borderRadius", [ + [ + "rounded", + [ + "border-radius" + ] + ], + [ + [ + "rounded-s", + [ + "border-start-start-radius", + "border-end-start-radius" + ] + ], + [ + "rounded-e", + [ + "border-start-end-radius", + "border-end-end-radius" + ] + ], + [ + "rounded-t", + [ + "border-top-left-radius", + "border-top-right-radius" + ] + ], + [ + "rounded-r", + [ + "border-top-right-radius", + "border-bottom-right-radius" + ] + ], + [ + "rounded-b", + [ + "border-bottom-right-radius", + "border-bottom-left-radius" + ] + ], + [ + "rounded-l", + [ + "border-top-left-radius", + "border-bottom-left-radius" + ] + ] + ], + [ + [ + "rounded-ss", + [ + "border-start-start-radius" + ] + ], + [ + "rounded-se", + [ + "border-start-end-radius" + ] + ], + [ + "rounded-ee", + [ + "border-end-end-radius" + ] + ], + [ + "rounded-es", + [ + "border-end-start-radius" + ] + ], + [ + "rounded-tl", + [ + "border-top-left-radius" + ] + ], + [ + "rounded-tr", + [ + "border-top-right-radius" + ] + ], + [ + "rounded-br", + [ + "border-bottom-right-radius" + ] + ], + [ + "rounded-bl", + [ + "border-bottom-left-radius" + ] + ] + ] + ]), + borderWidth: (0, _createUtilityPlugin.default)("borderWidth", [ + [ + "border", + [ + [ + "@defaults border-width", + {} + ], + "border-width" + ] + ], + [ + [ + "border-x", + [ + [ + "@defaults border-width", + {} + ], + "border-left-width", + "border-right-width" + ] + ], + [ + "border-y", + [ + [ + "@defaults border-width", + {} + ], + "border-top-width", + "border-bottom-width" + ] + ] + ], + [ + [ + "border-s", + [ + [ + "@defaults border-width", + {} + ], + "border-inline-start-width" + ] + ], + [ + "border-e", + [ + [ + "@defaults border-width", + {} + ], + "border-inline-end-width" + ] + ], + [ + "border-t", + [ + [ + "@defaults border-width", + {} + ], + "border-top-width" + ] + ], + [ + "border-r", + [ + [ + "@defaults border-width", + {} + ], + "border-right-width" + ] + ], + [ + "border-b", + [ + [ + "@defaults border-width", + {} + ], + "border-bottom-width" + ] + ], + [ + "border-l", + [ + [ + "@defaults border-width", + {} + ], + "border-left-width" + ] + ] + ] + ], { + type: [ + "line-width", + "length" + ] + }), + borderStyle: ({ addUtilities })=>{ + addUtilities({ + ".border-solid": { + "border-style": "solid" + }, + ".border-dashed": { + "border-style": "dashed" + }, + ".border-dotted": { + "border-style": "dotted" + }, + ".border-double": { + "border-style": "double" + }, + ".border-hidden": { + "border-style": "hidden" + }, + ".border-none": { + "border-style": "none" + } + }); + }, + borderColor: ({ matchUtilities , theme , corePlugins })=>{ + matchUtilities({ + border: (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-color", + variable: "--tw-border-opacity" + }); + } + }, { + values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("borderColor"))), + type: [ + "color", + "any" + ] + }); + matchUtilities({ + "border-x": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-left-color": (0, _toColorValue.default)(value), + "border-right-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: [ + "border-left-color", + "border-right-color" + ], + variable: "--tw-border-opacity" + }); + }, + "border-y": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-top-color": (0, _toColorValue.default)(value), + "border-bottom-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: [ + "border-top-color", + "border-bottom-color" + ], + variable: "--tw-border-opacity" + }); + } + }, { + values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("borderColor"))), + type: [ + "color", + "any" + ] + }); + matchUtilities({ + "border-s": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-inline-start-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-inline-start-color", + variable: "--tw-border-opacity" + }); + }, + "border-e": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-inline-end-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-inline-end-color", + variable: "--tw-border-opacity" + }); + }, + "border-t": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-top-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-top-color", + variable: "--tw-border-opacity" + }); + }, + "border-r": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-right-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-right-color", + variable: "--tw-border-opacity" + }); + }, + "border-b": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-bottom-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-bottom-color", + variable: "--tw-border-opacity" + }); + }, + "border-l": (value)=>{ + if (!corePlugins("borderOpacity")) { + return { + "border-left-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "border-left-color", + variable: "--tw-border-opacity" + }); + } + }, { + values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("borderColor"))), + type: [ + "color", + "any" + ] + }); + }, + borderOpacity: (0, _createUtilityPlugin.default)("borderOpacity", [ + [ + "border-opacity", + [ + "--tw-border-opacity" + ] + ] + ]), + backgroundColor: ({ matchUtilities , theme , corePlugins })=>{ + matchUtilities({ + bg: (value)=>{ + if (!corePlugins("backgroundOpacity")) { + return { + "background-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "background-color", + variable: "--tw-bg-opacity" + }); + } + }, { + values: (0, _flattenColorPalette.default)(theme("backgroundColor")), + type: [ + "color", + "any" + ] + }); + }, + backgroundOpacity: (0, _createUtilityPlugin.default)("backgroundOpacity", [ + [ + "bg-opacity", + [ + "--tw-bg-opacity" + ] + ] + ]), + backgroundImage: (0, _createUtilityPlugin.default)("backgroundImage", [ + [ + "bg", + [ + "background-image" + ] + ] + ], { + type: [ + "lookup", + "image", + "url" + ] + }), + gradientColorStops: (()=>{ + function transparentTo(value) { + return (0, _withAlphaVariable.withAlphaValue)(value, 0, "rgb(255 255 255 / 0)"); + } + return function({ matchUtilities , theme , addDefaults }) { + addDefaults("gradient-color-stops", { + "--tw-gradient-from-position": " ", + "--tw-gradient-via-position": " ", + "--tw-gradient-to-position": " " + }); + let options = { + values: (0, _flattenColorPalette.default)(theme("gradientColorStops")), + type: [ + "color", + "any" + ] + }; + let positionOptions = { + values: theme("gradientColorStopPositions"), + type: [ + "length", + "percentage" + ] + }; + matchUtilities({ + from: (value)=>{ + let transparentToValue = transparentTo(value); + return { + "@defaults gradient-color-stops": {}, + "--tw-gradient-from": `${(0, _toColorValue.default)(value)} var(--tw-gradient-from-position)`, + "--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`, + "--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)` + }; + } + }, options); + matchUtilities({ + from: (value)=>{ + return { + "--tw-gradient-from-position": value + }; + } + }, positionOptions); + matchUtilities({ + via: (value)=>{ + let transparentToValue = transparentTo(value); + return { + "@defaults gradient-color-stops": {}, + "--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`, + "--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue.default)(value)} var(--tw-gradient-via-position), var(--tw-gradient-to)` + }; + } + }, options); + matchUtilities({ + via: (value)=>{ + return { + "--tw-gradient-via-position": value + }; + } + }, positionOptions); + matchUtilities({ + to: (value)=>({ + "@defaults gradient-color-stops": {}, + "--tw-gradient-to": `${(0, _toColorValue.default)(value)} var(--tw-gradient-to-position)` + }) + }, options); + matchUtilities({ + to: (value)=>{ + return { + "--tw-gradient-to-position": value + }; + } + }, positionOptions); + }; + })(), + boxDecorationBreak: ({ addUtilities })=>{ + addUtilities({ + ".decoration-slice": { + "box-decoration-break": "slice" + }, + ".decoration-clone": { + "box-decoration-break": "clone" + }, + ".box-decoration-slice": { + "box-decoration-break": "slice" + }, + ".box-decoration-clone": { + "box-decoration-break": "clone" + } + }); + }, + backgroundSize: (0, _createUtilityPlugin.default)("backgroundSize", [ + [ + "bg", + [ + "background-size" + ] + ] + ], { + type: [ + "lookup", + "length", + "percentage", + "size" + ] + }), + backgroundAttachment: ({ addUtilities })=>{ + addUtilities({ + ".bg-fixed": { + "background-attachment": "fixed" + }, + ".bg-local": { + "background-attachment": "local" + }, + ".bg-scroll": { + "background-attachment": "scroll" + } + }); + }, + backgroundClip: ({ addUtilities })=>{ + addUtilities({ + ".bg-clip-border": { + "background-clip": "border-box" + }, + ".bg-clip-padding": { + "background-clip": "padding-box" + }, + ".bg-clip-content": { + "background-clip": "content-box" + }, + ".bg-clip-text": { + "background-clip": "text" + } + }); + }, + backgroundPosition: (0, _createUtilityPlugin.default)("backgroundPosition", [ + [ + "bg", + [ + "background-position" + ] + ] + ], { + type: [ + "lookup", + [ + "position", + { + preferOnConflict: true + } + ] + ] + }), + backgroundRepeat: ({ addUtilities })=>{ + addUtilities({ + ".bg-repeat": { + "background-repeat": "repeat" + }, + ".bg-no-repeat": { + "background-repeat": "no-repeat" + }, + ".bg-repeat-x": { + "background-repeat": "repeat-x" + }, + ".bg-repeat-y": { + "background-repeat": "repeat-y" + }, + ".bg-repeat-round": { + "background-repeat": "round" + }, + ".bg-repeat-space": { + "background-repeat": "space" + } + }); + }, + backgroundOrigin: ({ addUtilities })=>{ + addUtilities({ + ".bg-origin-border": { + "background-origin": "border-box" + }, + ".bg-origin-padding": { + "background-origin": "padding-box" + }, + ".bg-origin-content": { + "background-origin": "content-box" + } + }); + }, + fill: ({ matchUtilities , theme })=>{ + matchUtilities({ + fill: (value)=>{ + return { + fill: (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("fill")), + type: [ + "color", + "any" + ] + }); + }, + stroke: ({ matchUtilities , theme })=>{ + matchUtilities({ + stroke: (value)=>{ + return { + stroke: (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("stroke")), + type: [ + "color", + "url", + "any" + ] + }); + }, + strokeWidth: (0, _createUtilityPlugin.default)("strokeWidth", [ + [ + "stroke", + [ + "stroke-width" + ] + ] + ], { + type: [ + "length", + "number", + "percentage" + ] + }), + objectFit: ({ addUtilities })=>{ + addUtilities({ + ".object-contain": { + "object-fit": "contain" + }, + ".object-cover": { + "object-fit": "cover" + }, + ".object-fill": { + "object-fit": "fill" + }, + ".object-none": { + "object-fit": "none" + }, + ".object-scale-down": { + "object-fit": "scale-down" + } + }); + }, + objectPosition: (0, _createUtilityPlugin.default)("objectPosition", [ + [ + "object", + [ + "object-position" + ] + ] + ]), + padding: (0, _createUtilityPlugin.default)("padding", [ + [ + "p", + [ + "padding" + ] + ], + [ + [ + "px", + [ + "padding-left", + "padding-right" + ] + ], + [ + "py", + [ + "padding-top", + "padding-bottom" + ] + ] + ], + [ + [ + "ps", + [ + "padding-inline-start" + ] + ], + [ + "pe", + [ + "padding-inline-end" + ] + ], + [ + "pt", + [ + "padding-top" + ] + ], + [ + "pr", + [ + "padding-right" + ] + ], + [ + "pb", + [ + "padding-bottom" + ] + ], + [ + "pl", + [ + "padding-left" + ] + ] + ] + ]), + textAlign: ({ addUtilities })=>{ + addUtilities({ + ".text-left": { + "text-align": "left" + }, + ".text-center": { + "text-align": "center" + }, + ".text-right": { + "text-align": "right" + }, + ".text-justify": { + "text-align": "justify" + }, + ".text-start": { + "text-align": "start" + }, + ".text-end": { + "text-align": "end" + } + }); + }, + textIndent: (0, _createUtilityPlugin.default)("textIndent", [ + [ + "indent", + [ + "text-indent" + ] + ] + ], { + supportsNegativeValues: true + }), + verticalAlign: ({ addUtilities , matchUtilities })=>{ + addUtilities({ + ".align-baseline": { + "vertical-align": "baseline" + }, + ".align-top": { + "vertical-align": "top" + }, + ".align-middle": { + "vertical-align": "middle" + }, + ".align-bottom": { + "vertical-align": "bottom" + }, + ".align-text-top": { + "vertical-align": "text-top" + }, + ".align-text-bottom": { + "vertical-align": "text-bottom" + }, + ".align-sub": { + "vertical-align": "sub" + }, + ".align-super": { + "vertical-align": "super" + } + }); + matchUtilities({ + align: (value)=>({ + "vertical-align": value + }) + }); + }, + fontFamily: ({ matchUtilities , theme })=>{ + matchUtilities({ + font: (value)=>{ + let [families, options = {}] = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value : [ + value + ]; + let { fontFeatureSettings , fontVariationSettings } = options; + return { + "font-family": Array.isArray(families) ? families.join(", ") : families, + ...fontFeatureSettings === undefined ? {} : { + "font-feature-settings": fontFeatureSettings + }, + ...fontVariationSettings === undefined ? {} : { + "font-variation-settings": fontVariationSettings + } + }; + } + }, { + values: theme("fontFamily"), + type: [ + "lookup", + "generic-name", + "family-name" + ] + }); + }, + fontSize: ({ matchUtilities , theme })=>{ + matchUtilities({ + text: (value, { modifier })=>{ + let [fontSize, options] = Array.isArray(value) ? value : [ + value + ]; + if (modifier) { + return { + "font-size": fontSize, + "line-height": modifier + }; + } + let { lineHeight , letterSpacing , fontWeight } = (0, _isPlainObject.default)(options) ? options : { + lineHeight: options + }; + return { + "font-size": fontSize, + ...lineHeight === undefined ? {} : { + "line-height": lineHeight + }, + ...letterSpacing === undefined ? {} : { + "letter-spacing": letterSpacing + }, + ...fontWeight === undefined ? {} : { + "font-weight": fontWeight + } + }; + } + }, { + values: theme("fontSize"), + modifiers: theme("lineHeight"), + type: [ + "absolute-size", + "relative-size", + "length", + "percentage" + ] + }); + }, + fontWeight: (0, _createUtilityPlugin.default)("fontWeight", [ + [ + "font", + [ + "fontWeight" + ] + ] + ], { + type: [ + "lookup", + "number", + "any" + ] + }), + textTransform: ({ addUtilities })=>{ + addUtilities({ + ".uppercase": { + "text-transform": "uppercase" + }, + ".lowercase": { + "text-transform": "lowercase" + }, + ".capitalize": { + "text-transform": "capitalize" + }, + ".normal-case": { + "text-transform": "none" + } + }); + }, + fontStyle: ({ addUtilities })=>{ + addUtilities({ + ".italic": { + "font-style": "italic" + }, + ".not-italic": { + "font-style": "normal" + } + }); + }, + fontVariantNumeric: ({ addDefaults , addUtilities })=>{ + let cssFontVariantNumericValue = "var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)"; + addDefaults("font-variant-numeric", { + "--tw-ordinal": " ", + "--tw-slashed-zero": " ", + "--tw-numeric-figure": " ", + "--tw-numeric-spacing": " ", + "--tw-numeric-fraction": " " + }); + addUtilities({ + ".normal-nums": { + "font-variant-numeric": "normal" + }, + ".ordinal": { + "@defaults font-variant-numeric": {}, + "--tw-ordinal": "ordinal", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".slashed-zero": { + "@defaults font-variant-numeric": {}, + "--tw-slashed-zero": "slashed-zero", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".lining-nums": { + "@defaults font-variant-numeric": {}, + "--tw-numeric-figure": "lining-nums", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".oldstyle-nums": { + "@defaults font-variant-numeric": {}, + "--tw-numeric-figure": "oldstyle-nums", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".proportional-nums": { + "@defaults font-variant-numeric": {}, + "--tw-numeric-spacing": "proportional-nums", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".tabular-nums": { + "@defaults font-variant-numeric": {}, + "--tw-numeric-spacing": "tabular-nums", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".diagonal-fractions": { + "@defaults font-variant-numeric": {}, + "--tw-numeric-fraction": "diagonal-fractions", + "font-variant-numeric": cssFontVariantNumericValue + }, + ".stacked-fractions": { + "@defaults font-variant-numeric": {}, + "--tw-numeric-fraction": "stacked-fractions", + "font-variant-numeric": cssFontVariantNumericValue + } + }); + }, + lineHeight: (0, _createUtilityPlugin.default)("lineHeight", [ + [ + "leading", + [ + "lineHeight" + ] + ] + ]), + letterSpacing: (0, _createUtilityPlugin.default)("letterSpacing", [ + [ + "tracking", + [ + "letterSpacing" + ] + ] + ], { + supportsNegativeValues: true + }), + textColor: ({ matchUtilities , theme , corePlugins })=>{ + matchUtilities({ + text: (value)=>{ + if (!corePlugins("textOpacity")) { + return { + color: (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "color", + variable: "--tw-text-opacity" + }); + } + }, { + values: (0, _flattenColorPalette.default)(theme("textColor")), + type: [ + "color", + "any" + ] + }); + }, + textOpacity: (0, _createUtilityPlugin.default)("textOpacity", [ + [ + "text-opacity", + [ + "--tw-text-opacity" + ] + ] + ]), + textDecoration: ({ addUtilities })=>{ + addUtilities({ + ".underline": { + "text-decoration-line": "underline" + }, + ".overline": { + "text-decoration-line": "overline" + }, + ".line-through": { + "text-decoration-line": "line-through" + }, + ".no-underline": { + "text-decoration-line": "none" + } + }); + }, + textDecorationColor: ({ matchUtilities , theme })=>{ + matchUtilities({ + decoration: (value)=>{ + return { + "text-decoration-color": (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("textDecorationColor")), + type: [ + "color", + "any" + ] + }); + }, + textDecorationStyle: ({ addUtilities })=>{ + addUtilities({ + ".decoration-solid": { + "text-decoration-style": "solid" + }, + ".decoration-double": { + "text-decoration-style": "double" + }, + ".decoration-dotted": { + "text-decoration-style": "dotted" + }, + ".decoration-dashed": { + "text-decoration-style": "dashed" + }, + ".decoration-wavy": { + "text-decoration-style": "wavy" + } + }); + }, + textDecorationThickness: (0, _createUtilityPlugin.default)("textDecorationThickness", [ + [ + "decoration", + [ + "text-decoration-thickness" + ] + ] + ], { + type: [ + "length", + "percentage" + ] + }), + textUnderlineOffset: (0, _createUtilityPlugin.default)("textUnderlineOffset", [ + [ + "underline-offset", + [ + "text-underline-offset" + ] + ] + ], { + type: [ + "length", + "percentage", + "any" + ] + }), + fontSmoothing: ({ addUtilities })=>{ + addUtilities({ + ".antialiased": { + "-webkit-font-smoothing": "antialiased", + "-moz-osx-font-smoothing": "grayscale" + }, + ".subpixel-antialiased": { + "-webkit-font-smoothing": "auto", + "-moz-osx-font-smoothing": "auto" + } + }); + }, + placeholderColor: ({ matchUtilities , theme , corePlugins })=>{ + matchUtilities({ + placeholder: (value)=>{ + if (!corePlugins("placeholderOpacity")) { + return { + "&::placeholder": { + color: (0, _toColorValue.default)(value) + } + }; + } + return { + "&::placeholder": (0, _withAlphaVariable.default)({ + color: value, + property: "color", + variable: "--tw-placeholder-opacity" + }) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("placeholderColor")), + type: [ + "color", + "any" + ] + }); + }, + placeholderOpacity: ({ matchUtilities , theme })=>{ + matchUtilities({ + "placeholder-opacity": (value)=>{ + return { + ["&::placeholder"]: { + "--tw-placeholder-opacity": value + } + }; + } + }, { + values: theme("placeholderOpacity") + }); + }, + caretColor: ({ matchUtilities , theme })=>{ + matchUtilities({ + caret: (value)=>{ + return { + "caret-color": (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("caretColor")), + type: [ + "color", + "any" + ] + }); + }, + accentColor: ({ matchUtilities , theme })=>{ + matchUtilities({ + accent: (value)=>{ + return { + "accent-color": (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("accentColor")), + type: [ + "color", + "any" + ] + }); + }, + opacity: (0, _createUtilityPlugin.default)("opacity", [ + [ + "opacity", + [ + "opacity" + ] + ] + ]), + backgroundBlendMode: ({ addUtilities })=>{ + addUtilities({ + ".bg-blend-normal": { + "background-blend-mode": "normal" + }, + ".bg-blend-multiply": { + "background-blend-mode": "multiply" + }, + ".bg-blend-screen": { + "background-blend-mode": "screen" + }, + ".bg-blend-overlay": { + "background-blend-mode": "overlay" + }, + ".bg-blend-darken": { + "background-blend-mode": "darken" + }, + ".bg-blend-lighten": { + "background-blend-mode": "lighten" + }, + ".bg-blend-color-dodge": { + "background-blend-mode": "color-dodge" + }, + ".bg-blend-color-burn": { + "background-blend-mode": "color-burn" + }, + ".bg-blend-hard-light": { + "background-blend-mode": "hard-light" + }, + ".bg-blend-soft-light": { + "background-blend-mode": "soft-light" + }, + ".bg-blend-difference": { + "background-blend-mode": "difference" + }, + ".bg-blend-exclusion": { + "background-blend-mode": "exclusion" + }, + ".bg-blend-hue": { + "background-blend-mode": "hue" + }, + ".bg-blend-saturation": { + "background-blend-mode": "saturation" + }, + ".bg-blend-color": { + "background-blend-mode": "color" + }, + ".bg-blend-luminosity": { + "background-blend-mode": "luminosity" + } + }); + }, + mixBlendMode: ({ addUtilities })=>{ + addUtilities({ + ".mix-blend-normal": { + "mix-blend-mode": "normal" + }, + ".mix-blend-multiply": { + "mix-blend-mode": "multiply" + }, + ".mix-blend-screen": { + "mix-blend-mode": "screen" + }, + ".mix-blend-overlay": { + "mix-blend-mode": "overlay" + }, + ".mix-blend-darken": { + "mix-blend-mode": "darken" + }, + ".mix-blend-lighten": { + "mix-blend-mode": "lighten" + }, + ".mix-blend-color-dodge": { + "mix-blend-mode": "color-dodge" + }, + ".mix-blend-color-burn": { + "mix-blend-mode": "color-burn" + }, + ".mix-blend-hard-light": { + "mix-blend-mode": "hard-light" + }, + ".mix-blend-soft-light": { + "mix-blend-mode": "soft-light" + }, + ".mix-blend-difference": { + "mix-blend-mode": "difference" + }, + ".mix-blend-exclusion": { + "mix-blend-mode": "exclusion" + }, + ".mix-blend-hue": { + "mix-blend-mode": "hue" + }, + ".mix-blend-saturation": { + "mix-blend-mode": "saturation" + }, + ".mix-blend-color": { + "mix-blend-mode": "color" + }, + ".mix-blend-luminosity": { + "mix-blend-mode": "luminosity" + }, + ".mix-blend-plus-lighter": { + "mix-blend-mode": "plus-lighter" + } + }); + }, + boxShadow: (()=>{ + let transformValue = (0, _transformThemeValue.default)("boxShadow"); + let defaultBoxShadow = [ + `var(--tw-ring-offset-shadow, 0 0 #0000)`, + `var(--tw-ring-shadow, 0 0 #0000)`, + `var(--tw-shadow)` + ].join(", "); + return function({ matchUtilities , addDefaults , theme }) { + addDefaults(" box-shadow", { + "--tw-ring-offset-shadow": "0 0 #0000", + "--tw-ring-shadow": "0 0 #0000", + "--tw-shadow": "0 0 #0000", + "--tw-shadow-colored": "0 0 #0000" + }); + matchUtilities({ + shadow: (value)=>{ + value = transformValue(value); + let ast = (0, _parseBoxShadowValue.parseBoxShadowValue)(value); + for (let shadow of ast){ + // Don't override color if the whole shadow is a variable + if (!shadow.valid) { + continue; + } + shadow.color = "var(--tw-shadow-color)"; + } + return { + "@defaults box-shadow": {}, + "--tw-shadow": value === "none" ? "0 0 #0000" : value, + "--tw-shadow-colored": value === "none" ? "0 0 #0000" : (0, _parseBoxShadowValue.formatBoxShadowValue)(ast), + "box-shadow": defaultBoxShadow + }; + } + }, { + values: theme("boxShadow"), + type: [ + "shadow" + ] + }); + }; + })(), + boxShadowColor: ({ matchUtilities , theme })=>{ + matchUtilities({ + shadow: (value)=>{ + return { + "--tw-shadow-color": (0, _toColorValue.default)(value), + "--tw-shadow": "var(--tw-shadow-colored)" + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("boxShadowColor")), + type: [ + "color", + "any" + ] + }); + }, + outlineStyle: ({ addUtilities })=>{ + addUtilities({ + ".outline-none": { + outline: "2px solid transparent", + "outline-offset": "2px" + }, + ".outline": { + "outline-style": "solid" + }, + ".outline-dashed": { + "outline-style": "dashed" + }, + ".outline-dotted": { + "outline-style": "dotted" + }, + ".outline-double": { + "outline-style": "double" + } + }); + }, + outlineWidth: (0, _createUtilityPlugin.default)("outlineWidth", [ + [ + "outline", + [ + "outline-width" + ] + ] + ], { + type: [ + "length", + "number", + "percentage" + ] + }), + outlineOffset: (0, _createUtilityPlugin.default)("outlineOffset", [ + [ + "outline-offset", + [ + "outline-offset" + ] + ] + ], { + type: [ + "length", + "number", + "percentage", + "any" + ], + supportsNegativeValues: true + }), + outlineColor: ({ matchUtilities , theme })=>{ + matchUtilities({ + outline: (value)=>{ + return { + "outline-color": (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("outlineColor")), + type: [ + "color", + "any" + ] + }); + }, + ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme , config })=>{ + let ringColorDefault = (()=>{ + var _theme, _theme1; + if ((0, _featureFlags.flagEnabled)(config(), "respectDefaultRingColorOpacity")) { + return theme("ringColor.DEFAULT"); + } + let ringOpacityDefault = theme("ringOpacity.DEFAULT", "0.5"); + if (!((_theme = theme("ringColor")) === null || _theme === void 0 ? void 0 : _theme.DEFAULT)) { + return `rgb(147 197 253 / ${ringOpacityDefault})`; + } + return (0, _withAlphaVariable.withAlphaValue)((_theme1 = theme("ringColor")) === null || _theme1 === void 0 ? void 0 : _theme1.DEFAULT, ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`); + })(); + addDefaults("ring-width", { + "--tw-ring-inset": " ", + "--tw-ring-offset-width": theme("ringOffsetWidth.DEFAULT", "0px"), + "--tw-ring-offset-color": theme("ringOffsetColor.DEFAULT", "#fff"), + "--tw-ring-color": ringColorDefault, + "--tw-ring-offset-shadow": "0 0 #0000", + "--tw-ring-shadow": "0 0 #0000", + "--tw-shadow": "0 0 #0000", + "--tw-shadow-colored": "0 0 #0000" + }); + matchUtilities({ + ring: (value)=>{ + return { + "@defaults ring-width": {}, + "--tw-ring-offset-shadow": `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + "--tw-ring-shadow": `var(--tw-ring-inset) 0 0 0 calc(${value} + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + "box-shadow": [ + `var(--tw-ring-offset-shadow)`, + `var(--tw-ring-shadow)`, + `var(--tw-shadow, 0 0 #0000)` + ].join(", ") + }; + } + }, { + values: theme("ringWidth"), + type: "length" + }); + addUtilities({ + ".ring-inset": { + "@defaults ring-width": {}, + "--tw-ring-inset": "inset" + } + }); + }, + ringColor: ({ matchUtilities , theme , corePlugins })=>{ + matchUtilities({ + ring: (value)=>{ + if (!corePlugins("ringOpacity")) { + return { + "--tw-ring-color": (0, _toColorValue.default)(value) + }; + } + return (0, _withAlphaVariable.default)({ + color: value, + property: "--tw-ring-color", + variable: "--tw-ring-opacity" + }); + } + }, { + values: Object.fromEntries(Object.entries((0, _flattenColorPalette.default)(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT")), + type: [ + "color", + "any" + ] + }); + }, + ringOpacity: (helpers)=>{ + let { config } = helpers; + return (0, _createUtilityPlugin.default)("ringOpacity", [ + [ + "ring-opacity", + [ + "--tw-ring-opacity" + ] + ] + ], { + filterDefault: !(0, _featureFlags.flagEnabled)(config(), "respectDefaultRingColorOpacity") + })(helpers); + }, + ringOffsetWidth: (0, _createUtilityPlugin.default)("ringOffsetWidth", [ + [ + "ring-offset", + [ + "--tw-ring-offset-width" + ] + ] + ], { + type: "length" + }), + ringOffsetColor: ({ matchUtilities , theme })=>{ + matchUtilities({ + "ring-offset": (value)=>{ + return { + "--tw-ring-offset-color": (0, _toColorValue.default)(value) + }; + } + }, { + values: (0, _flattenColorPalette.default)(theme("ringOffsetColor")), + type: [ + "color", + "any" + ] + }); + }, + blur: ({ matchUtilities , theme })=>{ + matchUtilities({ + blur: (value)=>{ + return { + "--tw-blur": `blur(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("blur") + }); + }, + brightness: ({ matchUtilities , theme })=>{ + matchUtilities({ + brightness: (value)=>{ + return { + "--tw-brightness": `brightness(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("brightness") + }); + }, + contrast: ({ matchUtilities , theme })=>{ + matchUtilities({ + contrast: (value)=>{ + return { + "--tw-contrast": `contrast(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("contrast") + }); + }, + dropShadow: ({ matchUtilities , theme })=>{ + matchUtilities({ + "drop-shadow": (value)=>{ + return { + "--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`).join(" ") : `drop-shadow(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("dropShadow") + }); + }, + grayscale: ({ matchUtilities , theme })=>{ + matchUtilities({ + grayscale: (value)=>{ + return { + "--tw-grayscale": `grayscale(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("grayscale") + }); + }, + hueRotate: ({ matchUtilities , theme })=>{ + matchUtilities({ + "hue-rotate": (value)=>{ + return { + "--tw-hue-rotate": `hue-rotate(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("hueRotate"), + supportsNegativeValues: true + }); + }, + invert: ({ matchUtilities , theme })=>{ + matchUtilities({ + invert: (value)=>{ + return { + "--tw-invert": `invert(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("invert") + }); + }, + saturate: ({ matchUtilities , theme })=>{ + matchUtilities({ + saturate: (value)=>{ + return { + "--tw-saturate": `saturate(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("saturate") + }); + }, + sepia: ({ matchUtilities , theme })=>{ + matchUtilities({ + sepia: (value)=>{ + return { + "--tw-sepia": `sepia(${value})`, + "@defaults filter": {}, + filter: cssFilterValue + }; + } + }, { + values: theme("sepia") + }); + }, + filter: ({ addDefaults , addUtilities })=>{ + addDefaults("filter", { + "--tw-blur": " ", + "--tw-brightness": " ", + "--tw-contrast": " ", + "--tw-grayscale": " ", + "--tw-hue-rotate": " ", + "--tw-invert": " ", + "--tw-saturate": " ", + "--tw-sepia": " ", + "--tw-drop-shadow": " " + }); + addUtilities({ + ".filter": { + "@defaults filter": {}, + filter: cssFilterValue + }, + ".filter-none": { + filter: "none" + } + }); + }, + backdropBlur: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-blur": (value)=>{ + return { + "--tw-backdrop-blur": `blur(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropBlur") + }); + }, + backdropBrightness: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-brightness": (value)=>{ + return { + "--tw-backdrop-brightness": `brightness(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropBrightness") + }); + }, + backdropContrast: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-contrast": (value)=>{ + return { + "--tw-backdrop-contrast": `contrast(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropContrast") + }); + }, + backdropGrayscale: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-grayscale": (value)=>{ + return { + "--tw-backdrop-grayscale": `grayscale(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropGrayscale") + }); + }, + backdropHueRotate: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-hue-rotate": (value)=>{ + return { + "--tw-backdrop-hue-rotate": `hue-rotate(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropHueRotate"), + supportsNegativeValues: true + }); + }, + backdropInvert: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-invert": (value)=>{ + return { + "--tw-backdrop-invert": `invert(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropInvert") + }); + }, + backdropOpacity: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-opacity": (value)=>{ + return { + "--tw-backdrop-opacity": `opacity(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropOpacity") + }); + }, + backdropSaturate: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-saturate": (value)=>{ + return { + "--tw-backdrop-saturate": `saturate(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropSaturate") + }); + }, + backdropSepia: ({ matchUtilities , theme })=>{ + matchUtilities({ + "backdrop-sepia": (value)=>{ + return { + "--tw-backdrop-sepia": `sepia(${value})`, + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }; + } + }, { + values: theme("backdropSepia") + }); + }, + backdropFilter: ({ addDefaults , addUtilities })=>{ + addDefaults("backdrop-filter", { + "--tw-backdrop-blur": " ", + "--tw-backdrop-brightness": " ", + "--tw-backdrop-contrast": " ", + "--tw-backdrop-grayscale": " ", + "--tw-backdrop-hue-rotate": " ", + "--tw-backdrop-invert": " ", + "--tw-backdrop-opacity": " ", + "--tw-backdrop-saturate": " ", + "--tw-backdrop-sepia": " " + }); + addUtilities({ + ".backdrop-filter": { + "@defaults backdrop-filter": {}, + "backdrop-filter": cssBackdropFilterValue + }, + ".backdrop-filter-none": { + "backdrop-filter": "none" + } + }); + }, + transitionProperty: ({ matchUtilities , theme })=>{ + let defaultTimingFunction = theme("transitionTimingFunction.DEFAULT"); + let defaultDuration = theme("transitionDuration.DEFAULT"); + matchUtilities({ + transition: (value)=>{ + return { + "transition-property": value, + ...value === "none" ? {} : { + "transition-timing-function": defaultTimingFunction, + "transition-duration": defaultDuration + } + }; + } + }, { + values: theme("transitionProperty") + }); + }, + transitionDelay: (0, _createUtilityPlugin.default)("transitionDelay", [ + [ + "delay", + [ + "transitionDelay" + ] + ] + ]), + transitionDuration: (0, _createUtilityPlugin.default)("transitionDuration", [ + [ + "duration", + [ + "transitionDuration" + ] + ] + ], { + filterDefault: true + }), + transitionTimingFunction: (0, _createUtilityPlugin.default)("transitionTimingFunction", [ + [ + "ease", + [ + "transitionTimingFunction" + ] + ] + ], { + filterDefault: true + }), + willChange: (0, _createUtilityPlugin.default)("willChange", [ + [ + "will-change", + [ + "will-change" + ] + ] + ]), + content: (0, _createUtilityPlugin.default)("content", [ + [ + "content", + [ + "--tw-content", + [ + "content", + "var(--tw-content)" + ] + ] + ] + ]) +}; diff --git a/node_modules/tailwindcss/lib/css/LICENSE b/node_modules/tailwindcss/lib/css/LICENSE new file mode 100644 index 0000000..a1fb039 --- /dev/null +++ b/node_modules/tailwindcss/lib/css/LICENSE @@ -0,0 +1,25 @@ +MIT License + +Copyright (c) Nicolas Gallagher +Copyright (c) Jonathan Neal +Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Adam Wathan +Copyright (c) Jonathan Reinink + +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/tailwindcss/lib/css/preflight.css b/node_modules/tailwindcss/lib/css/preflight.css new file mode 100644 index 0000000..e5e52cd --- /dev/null +++ b/node_modules/tailwindcss/lib/css/preflight.css @@ -0,0 +1,378 @@ +/* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; /* 1 */ + border-width: 0; /* 2 */ + border-style: solid; /* 2 */ + border-color: theme('borderColor.DEFAULT', currentColor); /* 2 */ +} + +::before, +::after { + --tw-content: ''; +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +5. Use the user's configured `sans` font-feature-settings by default. +6. Use the user's configured `sans` font-variation-settings by default. +*/ + +html { + line-height: 1.5; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -moz-tab-size: 4; /* 3 */ + tab-size: 4; /* 3 */ + font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */ + font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */ + font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ + +body { + margin: 0; /* 1 */ + line-height: inherit; /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; /* 1 */ + color: inherit; /* 2 */ + border-top-width: 1px; /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured `mono` font family by default. +2. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */ + font-size: 1em; /* 2 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; /* 1 */ + border-color: inherit; /* 2 */ + border-collapse: collapse; /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-feature-settings: inherit; /* 1 */ + font-variation-settings: inherit; /* 1 */ + font-size: 100%; /* 1 */ + font-weight: inherit; /* 1 */ + line-height: inherit; /* 1 */ + color: inherit; /* 1 */ + margin: 0; /* 2 */ + padding: 0; /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; /* 1 */ + background-color: transparent; /* 2 */ + background-image: none; /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to `inherit` in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Reset default styling for dialogs. +*/ +dialog { + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::placeholder, +textarea::placeholder { + opacity: 1; /* 1 */ + color: theme('colors.gray.400', #9ca3af); /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role="button"] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ +:disabled { + cursor: default; +} + +/* +1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; /* 1 */ + vertical-align: middle; /* 2 */ +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* Make elements with the HTML hidden attribute stay hidden by default */ +[hidden] { + display: none; +} diff --git a/node_modules/tailwindcss/lib/featureFlags.js b/node_modules/tailwindcss/lib/featureFlags.js new file mode 100644 index 0000000..c2e42d2 --- /dev/null +++ b/node_modules/tailwindcss/lib/featureFlags.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + flagEnabled: function() { + return flagEnabled; + }, + issueFlagNotices: function() { + return issueFlagNotices; + }, + default: function() { + return _default; + } +}); +const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors")); +const _log = /*#__PURE__*/ _interop_require_default(require("./util/log")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +let defaults = { + optimizeUniversalDefaults: false, + generalizedModifiers: true, + get disableColorOpacityUtilitiesByDefault () { + return false; + }, + get relativeContentPathsByDefault () { + return false; + } +}; +let featureFlags = { + future: [ + "hoverOnlyWhenSupported", + "respectDefaultRingColorOpacity", + "disableColorOpacityUtilitiesByDefault", + "relativeContentPathsByDefault" + ], + experimental: [ + "optimizeUniversalDefaults", + "generalizedModifiers" + ] +}; +function flagEnabled(config, flag) { + if (featureFlags.future.includes(flag)) { + var _config_future; + var _config_future_flag, _ref; + return config.future === "all" || ((_ref = (_config_future_flag = config === null || config === void 0 ? void 0 : (_config_future = config.future) === null || _config_future === void 0 ? void 0 : _config_future[flag]) !== null && _config_future_flag !== void 0 ? _config_future_flag : defaults[flag]) !== null && _ref !== void 0 ? _ref : false); + } + if (featureFlags.experimental.includes(flag)) { + var _config_experimental; + var _config_experimental_flag, _ref1; + return config.experimental === "all" || ((_ref1 = (_config_experimental_flag = config === null || config === void 0 ? void 0 : (_config_experimental = config.experimental) === null || _config_experimental === void 0 ? void 0 : _config_experimental[flag]) !== null && _config_experimental_flag !== void 0 ? _config_experimental_flag : defaults[flag]) !== null && _ref1 !== void 0 ? _ref1 : false); + } + return false; +} +function experimentalFlagsEnabled(config) { + if (config.experimental === "all") { + return featureFlags.experimental; + } + var _config_experimental; + return Object.keys((_config_experimental = config === null || config === void 0 ? void 0 : config.experimental) !== null && _config_experimental !== void 0 ? _config_experimental : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]); +} +function issueFlagNotices(config) { + if (process.env.JEST_WORKER_ID !== undefined) { + return; + } + if (experimentalFlagsEnabled(config).length > 0) { + let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", "); + _log.default.warn("experimental-flags-enabled", [ + `You have enabled experimental features: ${changes}`, + "Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time." + ]); + } +} +const _default = featureFlags; diff --git a/node_modules/tailwindcss/lib/index.js b/node_modules/tailwindcss/lib/index.js new file mode 100644 index 0000000..c947d97 --- /dev/null +++ b/node_modules/tailwindcss/lib/index.js @@ -0,0 +1,2 @@ +"use strict"; +module.exports = require("./plugin"); diff --git a/node_modules/tailwindcss/lib/lib/cacheInvalidation.js b/node_modules/tailwindcss/lib/lib/cacheInvalidation.js new file mode 100644 index 0000000..c247179 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/cacheInvalidation.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "hasContentChanged", { + enumerable: true, + get: function() { + return hasContentChanged; + } +}); +const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto")); +const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Calculate the hash of a string. + * + * This doesn't need to be cryptographically secure or + * anything like that since it's used only to detect + * when the CSS changes to invalidate the context. + * + * This is wrapped in a try/catch because it's really dependent + * on how Node itself is build and the environment and OpenSSL + * version / build that is installed on the user's machine. + * + * Based on the environment this can just outright fail. + * + * See https://github.com/nodejs/node/issues/40455 + * + * @param {string} str + */ function getHash(str) { + try { + return _crypto.default.createHash("md5").update(str, "utf-8").digest("binary"); + } catch (err) { + return ""; + } +} +function hasContentChanged(sourcePath, root) { + let css = root.toString(); + // We only care about files with @tailwind directives + // Other files use an existing context + if (!css.includes("@tailwind")) { + return false; + } + let existingHash = _sharedState.sourceHashMap.get(sourcePath); + let rootHash = getHash(css); + let didChange = existingHash !== rootHash; + _sharedState.sourceHashMap.set(sourcePath, rootHash); + return didChange; +} diff --git a/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js b/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js new file mode 100644 index 0000000..e900872 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return collapseAdjacentRules; + } +}); +let comparisonMap = { + atrule: [ + "name", + "params" + ], + rule: [ + "selector" + ] +}; +let types = new Set(Object.keys(comparisonMap)); +function collapseAdjacentRules() { + function collapseRulesIn(root) { + let currentRule = null; + root.each((node)=>{ + if (!types.has(node.type)) { + currentRule = null; + return; + } + if (currentRule === null) { + currentRule = node; + return; + } + let properties = comparisonMap[node.type]; + var _node_property, _currentRule_property; + if (node.type === "atrule" && node.name === "font-face") { + currentRule = node; + } else if (properties.every((property)=>((_node_property = node[property]) !== null && _node_property !== void 0 ? _node_property : "").replace(/\s+/g, " ") === ((_currentRule_property = currentRule[property]) !== null && _currentRule_property !== void 0 ? _currentRule_property : "").replace(/\s+/g, " "))) { + // An AtRule may not have children (for example if we encounter duplicate @import url(…) rules) + if (node.nodes) { + currentRule.append(node.nodes); + } + node.remove(); + } else { + currentRule = node; + } + }); + // After we've collapsed adjacent rules & at-rules, we need to collapse + // adjacent rules & at-rules that are children of at-rules. + // We do not care about nesting rules because Tailwind CSS + // explicitly does not handle rule nesting on its own as + // the user is expected to use a nesting plugin + root.each((node)=>{ + if (node.type === "atrule") { + collapseRulesIn(node); + } + }); + } + return (root)=>{ + collapseRulesIn(root); + }; +} diff --git a/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js b/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js new file mode 100644 index 0000000..70a1ad1 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return collapseDuplicateDeclarations; + } +}); +function collapseDuplicateDeclarations() { + return (root)=>{ + root.walkRules((node)=>{ + let seen = new Map(); + let droppable = new Set([]); + let byProperty = new Map(); + node.walkDecls((decl)=>{ + // This could happen if we have nested selectors. In that case the + // parent will loop over all its declarations but also the declarations + // of nested rules. With this we ensure that we are shallowly checking + // declarations. + if (decl.parent !== node) { + return; + } + if (seen.has(decl.prop)) { + // Exact same value as what we have seen so far + if (seen.get(decl.prop).value === decl.value) { + // Keep the last one, drop the one we've seen so far + droppable.add(seen.get(decl.prop)); + // Override the existing one with the new value. This is necessary + // so that if we happen to have more than one declaration with the + // same value, that we keep removing the previous one. Otherwise we + // will only remove the *first* one. + seen.set(decl.prop, decl); + return; + } + // Not the same value, so we need to check if we can merge it so + // let's collect it first. + if (!byProperty.has(decl.prop)) { + byProperty.set(decl.prop, new Set()); + } + byProperty.get(decl.prop).add(seen.get(decl.prop)); + byProperty.get(decl.prop).add(decl); + } + seen.set(decl.prop, decl); + }); + // Drop all the duplicate declarations with the exact same value we've + // already seen so far. + for (let decl of droppable){ + decl.remove(); + } + // Analyze the declarations based on its unit, drop all the declarations + // with the same unit but the last one in the list. + for (let declarations of byProperty.values()){ + let byUnit = new Map(); + for (let decl of declarations){ + let unit = resolveUnit(decl.value); + if (unit === null) { + continue; + } + if (!byUnit.has(unit)) { + byUnit.set(unit, new Set()); + } + byUnit.get(unit).add(decl); + } + for (let declarations of byUnit.values()){ + // Get all but the last one + let removableDeclarations = Array.from(declarations).slice(0, -1); + for (let decl of removableDeclarations){ + decl.remove(); + } + } + } + }); + }; +} +let UNITLESS_NUMBER = Symbol("unitless-number"); +function resolveUnit(input) { + let result = /^-?\d*.?\d+([\w%]+)?$/g.exec(input); + if (result) { + var _result_; + return (_result_ = result[1]) !== null && _result_ !== void 0 ? _result_ : UNITLESS_NUMBER; + } + return null; +} diff --git a/node_modules/tailwindcss/lib/lib/content.js b/node_modules/tailwindcss/lib/lib/content.js new file mode 100644 index 0000000..b37e360 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/content.js @@ -0,0 +1,181 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + parseCandidateFiles: function() { + return parseCandidateFiles; + }, + resolvedChangedContent: function() { + return resolvedChangedContent; + } +}); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _path = /*#__PURE__*/ _interop_require_default(require("path")); +const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob")); +const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob")); +const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path")); +const _parseGlob = require("../util/parseGlob"); +const _sharedState = require("./sharedState"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function parseCandidateFiles(context, tailwindConfig) { + let files = tailwindConfig.content.files; + // Normalize the file globs + files = files.filter((filePath)=>typeof filePath === "string"); + files = files.map(_normalizepath.default); + // Split into included and excluded globs + let tasks = _fastglob.default.generateTasks(files); + /** @type {ContentPath[]} */ let included = []; + /** @type {ContentPath[]} */ let excluded = []; + for (const task of tasks){ + included.push(...task.positive.map((filePath)=>parseFilePath(filePath, false))); + excluded.push(...task.negative.map((filePath)=>parseFilePath(filePath, true))); + } + let paths = [ + ...included, + ...excluded + ]; + // Resolve paths relative to the config file or cwd + paths = resolveRelativePaths(context, paths); + // Resolve symlinks if possible + paths = paths.flatMap(resolvePathSymlinks); + // Update cached patterns + paths = paths.map(resolveGlobPattern); + return paths; +} +/** + * + * @param {string} filePath + * @param {boolean} ignore + * @returns {ContentPath} + */ function parseFilePath(filePath, ignore) { + let contentPath = { + original: filePath, + base: filePath, + ignore, + pattern: filePath, + glob: null + }; + if ((0, _isglob.default)(filePath)) { + Object.assign(contentPath, (0, _parseGlob.parseGlob)(filePath)); + } + return contentPath; +} +/** + * + * @param {ContentPath} contentPath + * @returns {ContentPath} + */ function resolveGlobPattern(contentPath) { + // This is required for Windows support to properly pick up Glob paths. + // Afaik, this technically shouldn't be needed but there's probably + // some internal, direct path matching with a normalized path in + // a package which can't handle mixed directory separators + let base = (0, _normalizepath.default)(contentPath.base); + // If the user's file path contains any special characters (like parens) for instance fast-glob + // is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this + base = _fastglob.default.escapePath(base); + contentPath.pattern = contentPath.glob ? `${base}/${contentPath.glob}` : base; + contentPath.pattern = contentPath.ignore ? `!${contentPath.pattern}` : contentPath.pattern; + return contentPath; +} +/** + * Resolve each path relative to the config file (when possible) if the experimental flag is enabled + * Otherwise, resolve relative to the current working directory + * + * @param {any} context + * @param {ContentPath[]} contentPaths + * @returns {ContentPath[]} + */ function resolveRelativePaths(context, contentPaths) { + let resolveFrom = []; + // Resolve base paths relative to the config file (when possible) if the experimental flag is enabled + if (context.userConfigPath && context.tailwindConfig.content.relative) { + resolveFrom = [ + _path.default.dirname(context.userConfigPath) + ]; + } + return contentPaths.map((contentPath)=>{ + contentPath.base = _path.default.resolve(...resolveFrom, contentPath.base); + return contentPath; + }); +} +/** + * Resolve the symlink for the base directory / file in each path + * These are added as additional dependencies to watch for changes because + * some tools (like webpack) will only watch the actual file or directory + * but not the symlink itself even in projects that use monorepos. + * + * @param {ContentPath} contentPath + * @returns {ContentPath[]} + */ function resolvePathSymlinks(contentPath) { + let paths = [ + contentPath + ]; + try { + let resolvedPath = _fs.default.realpathSync(contentPath.base); + if (resolvedPath !== contentPath.base) { + paths.push({ + ...contentPath, + base: resolvedPath + }); + } + } catch { + // TODO: log this? + } + return paths; +} +function resolvedChangedContent(context, candidateFiles, fileModifiedMap) { + let changedContent = context.tailwindConfig.content.files.filter((item)=>typeof item.raw === "string").map(({ raw , extension ="html" })=>({ + content: raw, + extension + })); + let [changedFiles, mTimesToCommit] = resolveChangedFiles(candidateFiles, fileModifiedMap); + for (let changedFile of changedFiles){ + let extension = _path.default.extname(changedFile).slice(1); + changedContent.push({ + file: changedFile, + extension + }); + } + return [ + changedContent, + mTimesToCommit + ]; +} +/** + * + * @param {ContentPath[]} candidateFiles + * @param {Map} fileModifiedMap + * @returns {[Set, Map]} + */ function resolveChangedFiles(candidateFiles, fileModifiedMap) { + let paths = candidateFiles.map((contentPath)=>contentPath.pattern); + let mTimesToCommit = new Map(); + let changedFiles = new Set(); + _sharedState.env.DEBUG && console.time("Finding changed files"); + let files = _fastglob.default.sync(paths, { + absolute: true + }); + for (let file of files){ + let prevModified = fileModifiedMap.get(file) || -Infinity; + let modified = _fs.default.statSync(file).mtimeMs; + if (modified > prevModified) { + changedFiles.add(file); + mTimesToCommit.set(file, modified); + } + } + _sharedState.env.DEBUG && console.timeEnd("Finding changed files"); + return [ + changedFiles, + mTimesToCommit + ]; +} diff --git a/node_modules/tailwindcss/lib/lib/defaultExtractor.js b/node_modules/tailwindcss/lib/lib/defaultExtractor.js new file mode 100644 index 0000000..198e5a7 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/defaultExtractor.js @@ -0,0 +1,243 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "defaultExtractor", { + enumerable: true, + get: function() { + return defaultExtractor; + } +}); +const _featureFlags = require("../featureFlags"); +const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex")); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function defaultExtractor(context) { + let patterns = Array.from(buildRegExps(context)); + /** + * @param {string} content + */ return (content)=>{ + /** @type {(string|string)[]} */ let results = []; + for (let pattern of patterns){ + var _content_match; + results = [ + ...results, + ...(_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : [] + ]; + } + return results.filter((v)=>v !== undefined).map(clipAtBalancedParens); + }; +} +function* buildRegExps(context) { + let separator = context.tailwindConfig.separator; + let variantGroupingEnabled = (0, _featureFlags.flagEnabled)(context.tailwindConfig, "variantGrouping"); + let prefix = context.tailwindConfig.prefix !== "" ? _regex.optional(_regex.pattern([ + /-?/, + _regex.escape(context.tailwindConfig.prefix) + ])) : ""; + let utility = _regex.any([ + // Arbitrary properties (without square brackets) + /\[[^\s:'"`]+:[^\s\[\]]+\]/, + // Arbitrary properties with balanced square brackets + // This is a targeted fix to continue to allow theme() + // with square brackets to work in arbitrary properties + // while fixing a problem with the regex matching too much + /\[[^\s:'"`]+:[^\s]+?\[[^\s]+\][^\s]+?\]/, + // Utilities + _regex.pattern([ + // Utility Name / Group Name + /-?(?:\w+)/, + // Normal/Arbitrary values + _regex.optional(_regex.any([ + _regex.pattern([ + // Arbitrary values + /-(?:\w+-)*\[[^\s:]+\]/, + // Not immediately followed by an `{[(` + /(?![{([]])/, + // optionally followed by an opacity modifier + /(?:\/[^\s'"`\\><$]*)?/ + ]), + _regex.pattern([ + // Arbitrary values + /-(?:\w+-)*\[[^\s]+\]/, + // Not immediately followed by an `{[(` + /(?![{([]])/, + // optionally followed by an opacity modifier + /(?:\/[^\s'"`\\$]*)?/ + ]), + // Normal values w/o quotes — may include an opacity modifier + /[-\/][^\s'"`\\$={><]*/ + ])) + ]) + ]); + let variantPatterns = [ + // Without quotes + _regex.any([ + // This is here to provide special support for the `@` variant + _regex.pattern([ + /@\[[^\s"'`]+\](\/[^\s"'`]+)?/, + separator + ]), + _regex.pattern([ + /([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/, + separator + ]), + _regex.pattern([ + /[^\s"'`\[\\]+/, + separator + ]) + ]), + // With quotes allowed + _regex.any([ + _regex.pattern([ + /([^\s"'`\[\\]+-)?\[[^\s`]+\]/, + separator + ]), + _regex.pattern([ + /[^\s`\[\\]+/, + separator + ]) + ]) + ]; + for (const variantPattern of variantPatterns){ + yield _regex.pattern([ + // Variants + "((?=((", + variantPattern, + ")+))\\2)?", + // Important (optional) + /!?/, + prefix, + variantGroupingEnabled ? _regex.any([ + // Or any of those things but grouped separated by commas + _regex.pattern([ + /\(/, + utility, + _regex.zeroOrMore([ + /,/, + utility + ]), + /\)/ + ]), + // Arbitrary properties, constrained utilities, arbitrary values, etc… + utility + ]) : utility + ]); + } + // 5. Inner matches + yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g; +} +// We want to capture any "special" characters +// AND the characters immediately following them (if there is one) +let SPECIALS = /([\[\]'"`])([^\[\]'"`])?/g; +let ALLOWED_CLASS_CHARACTERS = /[^"'`\s<>\]]+/; +/** + * Clips a string ensuring that parentheses, quotes, etc… are balanced + * Used for arbitrary values only + * + * We will go past the end of the balanced parens until we find a non-class character + * + * Depth matching behavior: + * w-[calc(100%-theme('spacing[some_key][1.5]'))]'] + * ┬ ┬ ┬┬ ┬ ┬┬ ┬┬┬┬┬┬┬ + * 1 2 3 4 34 3 210 END + * ╰────┴──────────┴────────┴────────┴┴───┴─┴┴┴ + * + * @param {string} input + */ function clipAtBalancedParens(input) { + // We are care about this for arbitrary values + if (!input.includes("-[")) { + return input; + } + let depth = 0; + let openStringTypes = []; + // Find all parens, brackets, quotes, etc + // Stop when we end at a balanced pair + // This is naive and will treat mismatched parens as balanced + // This shouldn't be a problem in practice though + let matches = input.matchAll(SPECIALS); + // We can't use lookbehind assertions because we have to support Safari + // So, instead, we've emulated it using capture groups and we'll re-work the matches to accommodate + matches = Array.from(matches).flatMap((match)=>{ + const [, ...groups] = match; + return groups.map((group, idx)=>Object.assign([], match, { + index: match.index + idx, + 0: group + })); + }); + for (let match of matches){ + let char = match[0]; + let inStringType = openStringTypes[openStringTypes.length - 1]; + if (char === inStringType) { + openStringTypes.pop(); + } else if (char === "'" || char === '"' || char === "`") { + openStringTypes.push(char); + } + if (inStringType) { + continue; + } else if (char === "[") { + depth++; + continue; + } else if (char === "]") { + depth--; + continue; + } + // We've gone one character past the point where we should stop + // This means that there was an extra closing `]` + // We'll clip to just before it + if (depth < 0) { + return input.substring(0, match.index - 1); + } + // We've finished balancing the brackets but there still may be characters that can be included + // For example in the class `text-[#336699]/[.35]` + // The depth goes to `0` at the closing `]` but goes up again at the `[` + // If we're at zero and encounter a non-class character then we clip the class there + if (depth === 0 && !ALLOWED_CLASS_CHARACTERS.test(char)) { + return input.substring(0, match.index); + } + } + return input; +} // Regular utilities + // {{modifier}:}*{namespace}{-{suffix}}*{/{opacityModifier}}? + // Arbitrary values + // {{modifier}:}*{namespace}-[{arbitraryValue}]{/{opacityModifier}}? + // arbitraryValue: no whitespace, balanced quotes unless within quotes, balanced brackets unless within quotes + // Arbitrary properties + // {{modifier}:}*[{validCssPropertyName}:{arbitraryValue}] diff --git a/node_modules/tailwindcss/lib/lib/detectNesting.js b/node_modules/tailwindcss/lib/lib/detectNesting.js new file mode 100644 index 0000000..c6d0626 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/detectNesting.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +function isRoot(node) { + return node.type === "root"; +} +function isAtLayer(node) { + return node.type === "atrule" && node.name === "layer"; +} +function _default(_context) { + return (root, result)=>{ + let found = false; + root.walkAtRules("tailwind", (node)=>{ + if (found) return false; + if (node.parent && !(isRoot(node.parent) || isAtLayer(node.parent))) { + found = true; + node.warn(result, [ + "Nested @tailwind rules were detected, but are not supported.", + "Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix", + "Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy" + ].join("\n")); + return false; + } + }); + root.walkRules((rule)=>{ + if (found) return false; + rule.walkRules((nestedRule)=>{ + found = true; + nestedRule.warn(result, [ + "Nested CSS was detected, but CSS nesting has not been configured correctly.", + "Please enable a CSS nesting plugin *before* Tailwind in your configuration.", + "See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting" + ].join("\n")); + return false; + }); + }); + }; +} diff --git a/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js b/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js new file mode 100644 index 0000000..e2e3c26 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js @@ -0,0 +1,238 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv")); +const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean")); +const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue")); +const _index = /*#__PURE__*/ _interop_require_default(require("../value-parser/index")); +const _normalizeScreens = require("../util/normalizeScreens"); +const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery")); +const _toPath = require("../util/toPath"); +const _withAlphaVariable = require("../util/withAlphaVariable"); +const _pluginUtils = require("../util/pluginUtils"); +const _log = /*#__PURE__*/ _interop_require_default(require("../util/log")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function isObject(input) { + return typeof input === "object" && input !== null; +} +function findClosestExistingPath(theme, path) { + let parts = (0, _toPath.toPath)(path); + do { + parts.pop(); + if ((0, _dlv.default)(theme, parts) !== undefined) break; + }while (parts.length); + return parts.length ? parts : undefined; +} +function pathToString(path) { + if (typeof path === "string") return path; + return path.reduce((acc, cur, i)=>{ + if (cur.includes(".")) return `${acc}[${cur}]`; + return i === 0 ? cur : `${acc}.${cur}`; + }, ""); +} +function list(items) { + return items.map((key)=>`'${key}'`).join(", "); +} +function listKeys(obj) { + return list(Object.keys(obj)); +} +function validatePath(config, path, defaultValue, themeOpts = {}) { + const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, ""); + const pathSegments = Array.isArray(path) ? path : (0, _toPath.toPath)(pathString); + const value = (0, _dlv.default)(config.theme, pathSegments, defaultValue); + if (value === undefined) { + let error = `'${pathString}' does not exist in your theme config.`; + const parentSegments = pathSegments.slice(0, -1); + const parentValue = (0, _dlv.default)(config.theme, parentSegments); + if (isObject(parentValue)) { + const validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [ + ...parentSegments, + key + ]).isValid); + const suggestion = (0, _didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys); + if (suggestion) { + error += ` Did you mean '${pathToString([ + ...parentSegments, + suggestion + ])}'?`; + } else if (validKeys.length > 0) { + error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list(validKeys)}`; + } + } else { + const closestPath = findClosestExistingPath(config.theme, pathString); + if (closestPath) { + const closestValue = (0, _dlv.default)(config.theme, closestPath); + if (isObject(closestValue)) { + error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}`; + } else { + error += ` '${pathToString(closestPath)}' is not an object.`; + } + } else { + error += ` Your theme has the following top-level keys: ${listKeys(config.theme)}`; + } + } + return { + isValid: false, + error + }; + } + if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) { + let error = `'${pathString}' was found but does not resolve to a string.`; + if (isObject(value)) { + let validKeys = Object.keys(value).filter((key)=>validatePath(config, [ + ...pathSegments, + key + ]).isValid); + if (validKeys.length) { + error += ` Did you mean something like '${pathToString([ + ...pathSegments, + validKeys[0] + ])}'?`; + } + } + return { + isValid: false, + error + }; + } + const [themeSection] = pathSegments; + return { + isValid: true, + value: (0, _transformThemeValue.default)(themeSection)(value, themeOpts) + }; +} +function extractArgs(node, vNodes, functions) { + vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions)); + let args = [ + "" + ]; + for (let vNode of vNodes){ + if (vNode.type === "div" && vNode.value === ",") { + args.push(""); + } else { + args[args.length - 1] += _index.default.stringify(vNode); + } + } + return args; +} +function resolveVNode(node, vNode, functions) { + if (vNode.type === "function" && functions[vNode.value] !== undefined) { + let args = extractArgs(node, vNode.nodes, functions); + vNode.type = "word"; + vNode.value = functions[vNode.value](node, ...args); + } + return vNode; +} +function resolveFunctions(node, input, functions) { + let hasAnyFn = Object.keys(functions).some((fn)=>input.includes(`${fn}(`)); + if (!hasAnyFn) return input; + return (0, _index.default)(input).walk((vNode)=>{ + resolveVNode(node, vNode, functions); + }).toString(); +} +let nodeTypePropertyMap = { + atrule: "params", + decl: "value" +}; +/** + * @param {string} path + * @returns {Iterable<[path: string, alpha: string|undefined]>} + */ function* toPaths(path) { + // Strip quotes from beginning and end of string + // This allows the alpha value to be present inside of quotes + path = path.replace(/^['"]+|['"]+$/g, ""); + let matches = path.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/); + let alpha = undefined; + yield [ + path, + undefined + ]; + if (matches) { + path = matches[1]; + alpha = matches[2]; + yield [ + path, + alpha + ]; + } +} +/** + * + * @param {any} config + * @param {string} path + * @param {any} defaultValue + */ function resolvePath(config, path, defaultValue) { + const results = Array.from(toPaths(path)).map(([path, alpha])=>{ + return Object.assign(validatePath(config, path, defaultValue, { + opacityValue: alpha + }), { + resolvedPath: path, + alpha + }); + }); + var _results_find; + return (_results_find = results.find((result)=>result.isValid)) !== null && _results_find !== void 0 ? _results_find : results[0]; +} +function _default(context) { + let config = context.tailwindConfig; + let functions = { + theme: (node, path, ...defaultValue)=>{ + let { isValid , value , error , alpha } = resolvePath(config, path, defaultValue.length ? defaultValue : undefined); + if (!isValid) { + var _parentNode_raws_tailwind; + let parentNode = node.parent; + let candidate = (_parentNode_raws_tailwind = parentNode === null || parentNode === void 0 ? void 0 : parentNode.raws.tailwind) === null || _parentNode_raws_tailwind === void 0 ? void 0 : _parentNode_raws_tailwind.candidate; + if (parentNode && candidate !== undefined) { + // Remove this utility from any caches + context.markInvalidUtilityNode(parentNode); + // Remove the CSS node from the markup + parentNode.remove(); + // Show a warning + _log.default.warn("invalid-theme-key-in-class", [ + `The utility \`${candidate}\` contains an invalid theme value and was not generated.` + ]); + return; + } + throw node.error(error); + } + let maybeColor = (0, _pluginUtils.parseColorFormat)(value); + let isColorFunction = maybeColor !== undefined && typeof maybeColor === "function"; + if (alpha !== undefined || isColorFunction) { + if (alpha === undefined) { + alpha = 1.0; + } + value = (0, _withAlphaVariable.withAlphaValue)(maybeColor, alpha, maybeColor); + } + return value; + }, + screen: (node, screen)=>{ + screen = screen.replace(/^['"]+/g, "").replace(/['"]+$/g, ""); + let screens = (0, _normalizeScreens.normalizeScreens)(config.theme.screens); + let screenDefinition = screens.find(({ name })=>name === screen); + if (!screenDefinition) { + throw node.error(`The '${screen}' screen does not exist in your theme.`); + } + return (0, _buildMediaQuery.default)(screenDefinition); + } + }; + return (root)=>{ + root.walk((node)=>{ + let property = nodeTypePropertyMap[node.type]; + if (property === undefined) { + return; + } + node[property] = resolveFunctions(node, node[property], functions); + }); + }; +} diff --git a/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js b/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js new file mode 100644 index 0000000..19a2c5a --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js @@ -0,0 +1,534 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return expandApplyAtRules; + } +}); +const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss")); +const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser")); +const _generateRules = require("./generateRules"); +const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName")); +const _applyImportantSelector = require("../util/applyImportantSelector"); +const _pseudoElements = require("../util/pseudoElements"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +/** @typedef {Map} ApplyCache */ function extractClasses(node) { + /** @type {Map>} */ let groups = new Map(); + let container = _postcss.default.root({ + nodes: [ + node.clone() + ] + }); + container.walkRules((rule)=>{ + (0, _postcssselectorparser.default)((selectors)=>{ + selectors.walkClasses((classSelector)=>{ + let parentSelector = classSelector.parent.toString(); + let classes = groups.get(parentSelector); + if (!classes) { + groups.set(parentSelector, classes = new Set()); + } + classes.add(classSelector.value); + }); + }).processSync(rule.selector); + }); + let normalizedGroups = Array.from(groups.values(), (classes)=>Array.from(classes)); + let classes = normalizedGroups.flat(); + return Object.assign(classes, { + groups: normalizedGroups + }); +} +let selectorExtractor = (0, _postcssselectorparser.default)(); +/** + * @param {string} ruleSelectors + */ function extractSelectors(ruleSelectors) { + return selectorExtractor.astSync(ruleSelectors); +} +function extractBaseCandidates(candidates, separator) { + let baseClasses = new Set(); + for (let candidate of candidates){ + baseClasses.add(candidate.split(separator).pop()); + } + return Array.from(baseClasses); +} +function prefix(context, selector) { + let prefix = context.tailwindConfig.prefix; + return typeof prefix === "function" ? prefix(selector) : prefix + selector; +} +function* pathToRoot(node) { + yield node; + while(node.parent){ + yield node.parent; + node = node.parent; + } +} +/** + * Only clone the node itself and not its children + * + * @param {*} node + * @param {*} overrides + * @returns + */ function shallowClone(node, overrides = {}) { + let children = node.nodes; + node.nodes = []; + let tmp = node.clone(overrides); + node.nodes = children; + return tmp; +} +/** + * Clone just the nodes all the way to the top that are required to represent + * this singular rule in the tree. + * + * For example, if we have CSS like this: + * ```css + * @media (min-width: 768px) { + * @supports (display: grid) { + * .foo { + * display: grid; + * grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + * } + * } + * + * @supports (backdrop-filter: blur(1px)) { + * .bar { + * backdrop-filter: blur(1px); + * } + * } + * + * .baz { + * color: orange; + * } + * } + * ``` + * + * And we're cloning `.bar` it'll return a cloned version of what's required for just that single node: + * + * ```css + * @media (min-width: 768px) { + * @supports (backdrop-filter: blur(1px)) { + * .bar { + * backdrop-filter: blur(1px); + * } + * } + * } + * ``` + * + * @param {import('postcss').Node} node + */ function nestedClone(node) { + for (let parent of pathToRoot(node)){ + if (node === parent) { + continue; + } + if (parent.type === "root") { + break; + } + node = shallowClone(parent, { + nodes: [ + node + ] + }); + } + return node; +} +/** + * @param {import('postcss').Root} root + */ function buildLocalApplyCache(root, context) { + /** @type {ApplyCache} */ let cache = new Map(); + root.walkRules((rule)=>{ + // Ignore rules generated by Tailwind + for (let node of pathToRoot(rule)){ + var _node_raws_tailwind; + if (((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.layer) !== undefined) { + return; + } + } + // Clone what's required to represent this singular rule in the tree + let container = nestedClone(rule); + let sort = context.offsets.create("user"); + for (let className of extractClasses(rule)){ + let list = cache.get(className) || []; + cache.set(className, list); + list.push([ + { + layer: "user", + sort, + important: false + }, + container + ]); + } + }); + return cache; +} +/** + * @returns {ApplyCache} + */ function buildApplyCache(applyCandidates, context) { + for (let candidate of applyCandidates){ + if (context.notClassCache.has(candidate) || context.applyClassCache.has(candidate)) { + continue; + } + if (context.classCache.has(candidate)) { + context.applyClassCache.set(candidate, context.classCache.get(candidate).map(([meta, rule])=>[ + meta, + rule.clone() + ])); + continue; + } + let matches = Array.from((0, _generateRules.resolveMatches)(candidate, context)); + if (matches.length === 0) { + context.notClassCache.add(candidate); + continue; + } + context.applyClassCache.set(candidate, matches); + } + return context.applyClassCache; +} +/** + * Build a cache only when it's first used + * + * @param {() => ApplyCache} buildCacheFn + * @returns {ApplyCache} + */ function lazyCache(buildCacheFn) { + let cache = null; + return { + get: (name)=>{ + cache = cache || buildCacheFn(); + return cache.get(name); + }, + has: (name)=>{ + cache = cache || buildCacheFn(); + return cache.has(name); + } + }; +} +/** + * Take a series of multiple caches and merge + * them so they act like one large cache + * + * @param {ApplyCache[]} caches + * @returns {ApplyCache} + */ function combineCaches(caches) { + return { + get: (name)=>caches.flatMap((cache)=>cache.get(name) || []), + has: (name)=>caches.some((cache)=>cache.has(name)) + }; +} +function extractApplyCandidates(params) { + let candidates = params.split(/[\s\t\n]+/g); + if (candidates[candidates.length - 1] === "!important") { + return [ + candidates.slice(0, -1), + true + ]; + } + return [ + candidates, + false + ]; +} +function processApply(root, context, localCache) { + let applyCandidates = new Set(); + // Collect all @apply rules and candidates + let applies = []; + root.walkAtRules("apply", (rule)=>{ + let [candidates] = extractApplyCandidates(rule.params); + for (let util of candidates){ + applyCandidates.add(util); + } + applies.push(rule); + }); + // Start the @apply process if we have rules with @apply in them + if (applies.length === 0) { + return; + } + // Fill up some caches! + let applyClassCache = combineCaches([ + localCache, + buildApplyCache(applyCandidates, context) + ]); + /** + * When we have an apply like this: + * + * .abc { + * @apply hover:font-bold; + * } + * + * What we essentially will do is resolve to this: + * + * .abc { + * @apply .hover\:font-bold:hover { + * font-weight: 500; + * } + * } + * + * Notice that the to-be-applied class is `.hover\:font-bold:hover` and that the utility candidate was `hover:font-bold`. + * What happens in this function is that we prepend a `.` and escape the candidate. + * This will result in `.hover\:font-bold` + * Which means that we can replace `.hover\:font-bold` with `.abc` in `.hover\:font-bold:hover` resulting in `.abc:hover` + * + * @param {string} selector + * @param {string} utilitySelectors + * @param {string} candidate + */ function replaceSelector(selector, utilitySelectors, candidate) { + let selectorList = extractSelectors(selector); + let utilitySelectorsList = extractSelectors(utilitySelectors); + let candidateList = extractSelectors(`.${(0, _escapeClassName.default)(candidate)}`); + let candidateClass = candidateList.nodes[0].nodes[0]; + selectorList.each((sel)=>{ + /** @type {Set} */ let replaced = new Set(); + utilitySelectorsList.each((utilitySelector)=>{ + let hasReplaced = false; + utilitySelector = utilitySelector.clone(); + utilitySelector.walkClasses((node)=>{ + if (node.value !== candidateClass.value) { + return; + } + // Don't replace multiple instances of the same class + // This is theoretically correct but only partially + // We'd need to generate every possible permutation of the replacement + // For example with `.foo + .foo { … }` and `section { @apply foo; }` + // We'd need to generate all of these: + // - `.foo + .foo` + // - `.foo + section` + // - `section + .foo` + // - `section + section` + if (hasReplaced) { + return; + } + // Since you can only `@apply` class names this is sufficient + // We want to replace the matched class name with the selector the user is using + // Ex: Replace `.text-blue-500` with `.foo.bar:is(.something-cool)` + node.replaceWith(...sel.nodes.map((node)=>node.clone())); + // Record that we did something and we want to use this new selector + replaced.add(utilitySelector); + hasReplaced = true; + }); + }); + // Sort tag names before class names (but only sort each group (separated by a combinator) + // separately and not in total) + // This happens when replacing `.bar` in `.foo.bar` with a tag like `section` + for (let sel of replaced){ + let groups = [ + [] + ]; + for (let node of sel.nodes){ + if (node.type === "combinator") { + groups.push(node); + groups.push([]); + } else { + let last = groups[groups.length - 1]; + last.push(node); + } + } + sel.nodes = []; + for (let group of groups){ + if (Array.isArray(group)) { + group.sort((a, b)=>{ + if (a.type === "tag" && b.type === "class") { + return -1; + } else if (a.type === "class" && b.type === "tag") { + return 1; + } else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) { + return -1; + } else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") { + return 1; + } + return 0; + }); + } + sel.nodes = sel.nodes.concat(group); + } + } + sel.replaceWith(...replaced); + }); + return selectorList.toString(); + } + let perParentApplies = new Map(); + // Collect all apply candidates and their rules + for (let apply of applies){ + let [candidates] = perParentApplies.get(apply.parent) || [ + [], + apply.source + ]; + perParentApplies.set(apply.parent, [ + candidates, + apply.source + ]); + let [applyCandidates, important] = extractApplyCandidates(apply.params); + if (apply.parent.type === "atrule") { + if (apply.parent.name === "screen") { + let screenType = apply.parent.params; + throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates.map((c)=>`${screenType}:${c}`).join(" ")} instead.`); + } + throw apply.error(`@apply is not supported within nested at-rules like @${apply.parent.name}. You can fix this by un-nesting @${apply.parent.name}.`); + } + for (let applyCandidate of applyCandidates){ + if ([ + prefix(context, "group"), + prefix(context, "peer") + ].includes(applyCandidate)) { + // TODO: Link to specific documentation page with error code. + throw apply.error(`@apply should not be used with the '${applyCandidate}' utility`); + } + if (!applyClassCache.has(applyCandidate)) { + throw apply.error(`The \`${applyCandidate}\` class does not exist. If \`${applyCandidate}\` is a custom class, make sure it is defined within a \`@layer\` directive.`); + } + let rules = applyClassCache.get(applyCandidate); + candidates.push([ + applyCandidate, + important, + rules + ]); + } + } + for (let [parent, [candidates, atApplySource]] of perParentApplies){ + let siblings = []; + for (let [applyCandidate, important, rules] of candidates){ + let potentialApplyCandidates = [ + applyCandidate, + ...extractBaseCandidates([ + applyCandidate + ], context.tailwindConfig.separator) + ]; + for (let [meta, node] of rules){ + let parentClasses = extractClasses(parent); + let nodeClasses = extractClasses(node); + // When we encounter a rule like `.dark .a, .b { … }` we only want to be left with `[.dark, .a]` if the base applyCandidate is `.a` or with `[.b]` if the base applyCandidate is `.b` + // So we've split them into groups + nodeClasses = nodeClasses.groups.filter((classList)=>classList.some((className)=>potentialApplyCandidates.includes(className))).flat(); + // Add base utility classes from the @apply node to the list of + // classes to check whether it intersects and therefore results in a + // circular dependency or not. + // + // E.g.: + // .foo { + // @apply hover:a; // This applies "a" but with a modifier + // } + // + // We only have to do that with base classes of the `node`, not of the `parent` + // E.g.: + // .hover\:foo { + // @apply bar; + // } + // .bar { + // @apply foo; + // } + // + // This should not result in a circular dependency because we are + // just applying `.foo` and the rule above is `.hover\:foo` which is + // unrelated. However, if we were to apply `hover:foo` then we _did_ + // have to include this one. + nodeClasses = nodeClasses.concat(extractBaseCandidates(nodeClasses, context.tailwindConfig.separator)); + let intersects = parentClasses.some((selector)=>nodeClasses.includes(selector)); + if (intersects) { + throw node.error(`You cannot \`@apply\` the \`${applyCandidate}\` utility here because it creates a circular dependency.`); + } + let root = _postcss.default.root({ + nodes: [ + node.clone() + ] + }); + // Make sure every node in the entire tree points back at the @apply rule that generated it + root.walk((node)=>{ + node.source = atApplySource; + }); + let canRewriteSelector = node.type !== "atrule" || node.type === "atrule" && node.name !== "keyframes"; + if (canRewriteSelector) { + root.walkRules((rule)=>{ + // Let's imagine you have the following structure: + // + // .foo { + // @apply bar; + // } + // + // @supports (a: b) { + // .bar { + // color: blue + // } + // + // .something-unrelated {} + // } + // + // In this case we want to apply `.bar` but it happens to be in + // an atrule node. We clone that node instead of the nested one + // because we still want that @supports rule to be there once we + // applied everything. + // + // However it happens to be that the `.something-unrelated` is + // also in that same shared @supports atrule. This is not good, + // and this should not be there. The good part is that this is + // a clone already and it can be safely removed. The question is + // how do we know we can remove it. Basically what we can do is + // match it against the applyCandidate that you want to apply. If + // it doesn't match the we can safely delete it. + // + // If we didn't do this, then the `replaceSelector` function + // would have replaced this with something that didn't exist and + // therefore it removed the selector altogether. In this specific + // case it would result in `{}` instead of `.something-unrelated {}` + if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate)) { + rule.remove(); + return; + } + // Strip the important selector from the parent selector if at the beginning + let importantSelector = typeof context.tailwindConfig.important === "string" ? context.tailwindConfig.important : null; + // We only want to move the "important" selector if this is a Tailwind-generated utility + // We do *not* want to do this for user CSS that happens to be structured the same + let isGenerated = parent.raws.tailwind !== undefined; + let parentSelector = isGenerated && importantSelector && parent.selector.indexOf(importantSelector) === 0 ? parent.selector.slice(importantSelector.length) : parent.selector; + rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate); + // And then re-add it if it was removed + if (importantSelector && parentSelector !== parent.selector) { + rule.selector = (0, _applyImportantSelector.applyImportantSelector)(rule.selector, importantSelector); + } + rule.walkDecls((d)=>{ + d.important = meta.important || important; + }); + // Move pseudo elements to the end of the selector (if necessary) + let selector = (0, _postcssselectorparser.default)().astSync(rule.selector); + selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel)); + rule.selector = selector.toString(); + }); + } + // It could be that the node we were inserted was removed because the class didn't match + // If that was the *only* rule in the parent, then we have nothing add so we skip it + if (!root.nodes[0]) { + continue; + } + // Insert it + siblings.push([ + meta.sort, + root.nodes[0] + ]); + } + } + // Inject the rules, sorted, correctly + let nodes = context.offsets.sort(siblings).map((s)=>s[1]); + // `parent` refers to the node at `.abc` in: .abc { @apply mt-2 } + parent.after(nodes); + } + for (let apply of applies){ + // If there are left-over declarations, just remove the @apply + if (apply.parent.nodes.length > 1) { + apply.remove(); + } else { + // The node is empty, drop the full node + apply.parent.remove(); + } + } + // Do it again, in case we have other `@apply` rules + processApply(root, context, localCache); +} +function expandApplyAtRules(context) { + return (root)=>{ + // Build a cache of the user's CSS so we can use it to resolve classes used by @apply + let localCache = lazyCache(()=>buildLocalApplyCache(root, context)); + processApply(root, context, localCache); + }; +} diff --git a/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js b/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js new file mode 100644 index 0000000..43c3240 --- /dev/null +++ b/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js @@ -0,0 +1,274 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return expandTailwindAtRules; + } +}); +const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); +const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru")); +const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState")); +const _generateRules = require("./generateRules"); +const _log = /*#__PURE__*/ _interop_require_default(require("../util/log")); +const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes")); +const _defaultExtractor = require("./defaultExtractor"); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +let env = _sharedState.env; +const builtInExtractors = { + DEFAULT: _defaultExtractor.defaultExtractor +}; +const builtInTransformers = { + DEFAULT: (content)=>content, + svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ") +}; +function getExtractor(context, fileExtension) { + let extractors = context.tailwindConfig.content.extract; + return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context); +} +function getTransformer(tailwindConfig, fileExtension) { + let transformers = tailwindConfig.content.transform; + return transformers[fileExtension] || transformers.DEFAULT || builtInTransformers[fileExtension] || builtInTransformers.DEFAULT; +} +let extractorCache = new WeakMap(); +// Scans template contents for possible classes. This is a hot path on initial build but +// not too important for subsequent builds. The faster the better though — if we can speed +// up these regexes by 50% that could cut initial build time by like 20%. +function getClassCandidates(content, extractor, candidates, seen) { + if (!extractorCache.has(extractor)) { + extractorCache.set(extractor, new _quicklru.default({ + maxSize: 25000 + })); + } + for (let line of content.split("\n")){ + line = line.trim(); + if (seen.has(line)) { + continue; + } + seen.add(line); + if (extractorCache.get(extractor).has(line)) { + for (let match of extractorCache.get(extractor).get(line)){ + candidates.add(match); + } + } else { + let extractorMatches = extractor(line).filter((s)=>s !== "!*"); + let lineMatchesSet = new Set(extractorMatches); + for (let match of lineMatchesSet){ + candidates.add(match); + } + extractorCache.get(extractor).set(line, lineMatchesSet); + } + } +} +/** + * + * @param {[import('./offsets.js').RuleOffset, import('postcss').Node][]} rules + * @param {*} context + */ function buildStylesheet(rules, context) { + let sortedRules = context.offsets.sort(rules); + let returnValue = { + base: new Set(), + defaults: new Set(), + components: new Set(), + utilities: new Set(), + variants: new Set() + }; + for (let [sort, rule] of sortedRules){ + returnValue[sort.layer].add(rule); + } + return returnValue; +} +function expandTailwindAtRules(context) { + return async (root)=>{ + let layerNodes = { + base: null, + components: null, + utilities: null, + variants: null + }; + root.walkAtRules((rule)=>{ + // Make sure this file contains Tailwind directives. If not, we can save + // a lot of work and bail early. Also we don't have to register our touch + // file as a dependency since the output of this CSS does not depend on + // the source of any templates. Think Vue