import * as React from 'react'; import React__default, { forwardRef, createElement, useLayoutEffect, createContext, useState, useRef, useCallback, useEffect, useContext, useMemo, useImperativeHandle } from 'react'; import * as ReactDOM from 'react-dom'; import ReactDOM__default, { createPortal } from 'react-dom'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } var jsxRuntime = {exports: {}}; var reactJsxRuntime_production_min = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var hasRequiredReactJsxRuntime_production_min; function requireReactJsxRuntime_production_min () { if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min; hasRequiredReactJsxRuntime_production_min = 1; var f=React__default,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true}; function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q; return reactJsxRuntime_production_min; } var hasRequiredJsxRuntime; function requireJsxRuntime () { if (hasRequiredJsxRuntime) return jsxRuntime.exports; hasRequiredJsxRuntime = 1; { jsxRuntime.exports = requireReactJsxRuntime_production_min(); } return jsxRuntime.exports; } var jsxRuntimeExports = requireJsxRuntime(); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); const toCamelCase$1 = (string) => string.replace( /^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase() ); const toPascalCase = (string) => { const camelCase = toCamelCase$1(string); return camelCase.charAt(0).toUpperCase() + camelCase.slice(1); }; const mergeClasses = (...classes) => classes.filter((className, index, array) => { return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index; }).join(" ").trim(); const hasA11yProp = (props) => { for (const prop in props) { if (prop.startsWith("aria-") || prop === "role" || prop === "title") { return true; } } }; /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ var defaultAttributes = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }; /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Icon = forwardRef( ({ color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => createElement( "svg", { ref, ...defaultAttributes, width: size, height: size, stroke: color, strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth, className: mergeClasses("lucide", className), ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" }, ...rest }, [ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)), ...Array.isArray(children) ? children : [children] ] ) ); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const createLucideIcon = (iconName, iconNode) => { const Component = forwardRef( ({ className, ...props }, ref) => createElement(Icon, { ref, iconNode, className: mergeClasses( `lucide-${toKebabCase(toPascalCase(iconName))}`, `lucide-${iconName}`, className ), ...props }) ); Component.displayName = toPascalCase(iconName); return Component; }; /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$M = [ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }], ["path", { d: "M19 12H5", key: "x3x0zl" }] ]; const ArrowLeft = createLucideIcon("arrow-left", __iconNode$M); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$L = [ ["path", { d: "M5 12h14", key: "1ays0h" }], ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }] ]; const ArrowRight = createLucideIcon("arrow-right", __iconNode$L); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$K = [ ["path", { d: "M12 7v14", key: "1akyts" }], ["path", { d: "M16 12h2", key: "7q9ll5" }], ["path", { d: "M16 8h2", key: "msurwy" }], [ "path", { d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z", key: "ruj8y" } ], ["path", { d: "M6 12h2", key: "32wvfc" }], ["path", { d: "M6 8h2", key: "30oboj" }] ]; const BookOpenText = createLucideIcon("book-open-text", __iconNode$K); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$J = [ ["path", { d: "M12 7v14", key: "1akyts" }], [ "path", { d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z", key: "ruj8y" } ] ]; const BookOpen = createLucideIcon("book-open", __iconNode$J); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$I = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]; const Check = createLucideIcon("check", __iconNode$I); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$H = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]; const ChevronDown = createLucideIcon("chevron-down", __iconNode$H); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$G = [ ["path", { d: "M12 12v4", key: "tww15h" }], ["path", { d: "M12 20h.01", key: "zekei9" }], ["path", { d: "M17 18h.5a1 1 0 0 0 0-9h-1.79A7 7 0 1 0 7 17.708", key: "xsb5ju" }] ]; const CloudAlert = createLucideIcon("cloud-alert", __iconNode$G); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$F = [ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }], ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }] ]; const Copy = createLucideIcon("copy", __iconNode$F); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$E = [ ["path", { d: "M12 15V3", key: "m9g1x1" }], ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }], ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }] ]; const Download = createLucideIcon("download", __iconNode$E); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$D = [ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }], ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }], ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }] ]; const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$D); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$C = [ ["path", { d: "M10 12v-1", key: "v7bkov" }], ["path", { d: "M10 18v-2", key: "1cjy8d" }], ["path", { d: "M10 7V6", key: "dljcrl" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], [ "path", { d: "M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01", key: "gkbcor" } ], ["circle", { cx: "10", cy: "20", r: "2", key: "1xzdoj" }] ]; const FileArchive = createLucideIcon("file-archive", __iconNode$C); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$B = [ ["path", { d: "M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3", key: "rslqgf" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], [ "path", { d: "M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0", key: "9f7x3i" } ] ]; const FileAudio = createLucideIcon("file-audio", __iconNode$B); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$A = [ ["path", { d: "M12 22h6a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3.072", key: "n6s66f" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], [ "path", { d: "m6.69 16.479 1.29 4.88a.5.5 0 0 1-.698.591l-1.843-.849a1 1 0 0 0-.88.001l-1.846.85a.5.5 0 0 1-.693-.593l1.29-4.88", key: "1e6yvx" } ], ["circle", { cx: "5", cy: "14", r: "3", key: "ufru5t" }] ]; const FileBadge = createLucideIcon("file-badge", __iconNode$A); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$z = [ ["path", { d: "M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "16lz6z" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], [ "path", { d: "M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z", key: "99pj1s" } ], ["path", { d: "M7 17v5", key: "1yj1jh" }], ["path", { d: "M11.7 14.2 7 17l-4.7-2.8", key: "1yk8tc" }] ]; const FileBox = createLucideIcon("file-box", __iconNode$z); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$y = [ ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }], ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }] ]; const FileCode = createLucideIcon("file-code", __iconNode$y); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$x = [ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], ["path", { d: "m2.305 15.53.923-.382", key: "yfp9st" }], ["path", { d: "m3.228 12.852-.924-.383", key: "bckynb" }], [ "path", { d: "M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5", key: "1yo3oz" } ], ["path", { d: "m4.852 11.228-.383-.923", key: "1j88i9" }], ["path", { d: "m4.852 16.772-.383.924", key: "sag1dv" }], ["path", { d: "m7.148 11.228.383-.923", key: "rj39hk" }], ["path", { d: "m7.53 17.696-.382-.924", key: "1uu5cs" }], ["path", { d: "m8.772 12.852.923-.383", key: "13811l" }], ["path", { d: "m8.772 15.148.923.383", key: "z1a5l0" }], ["circle", { cx: "6", cy: "14", r: "3", key: "a1xfv6" }] ]; const FileCog = createLucideIcon("file-cog", __iconNode$x); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$w = [ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], ["circle", { cx: "10", cy: "12", r: "2", key: "737tya" }], ["path", { d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22", key: "wt3hpn" }] ]; const FileImage = createLucideIcon("file-image", __iconNode$w); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$v = [ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], ["rect", { width: "8", height: "6", x: "8", y: "12", rx: "1", key: "3yr8at" }], ["path", { d: "M10 12v-2a2 2 0 1 1 4 0v2", key: "j4i8d" }] ]; const FileLock = createLucideIcon("file-lock", __iconNode$v); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$u = [ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }], [ "path", { d: "M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z", key: "1tzo1f" } ] ]; const FilePlay = createLucideIcon("file-play", __iconNode$u); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$t = [ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], ["path", { d: "M10 9H8", key: "b1mrlr" }], ["path", { d: "M16 13H8", key: "t4e002" }], ["path", { d: "M16 17H8", key: "z1uh3a" }] ]; const FileText = createLucideIcon("file-text", __iconNode$t); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$s = [ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }] ]; const File$1 = createLucideIcon("file", __iconNode$s); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$r = [ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }], ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }], ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }] ]; const Image$2 = createLucideIcon("image", __iconNode$r); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$q = [ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }], ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }] ]; const Link = createLucideIcon("link", __iconNode$q); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$p = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]]; const LoaderCircle = createLucideIcon("loader-circle", __iconNode$p); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$o = [ ["path", { d: "M12 2v4", key: "3427ic" }], ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }], ["path", { d: "M18 12h4", key: "wj9ykh" }], ["path", { d: "m16.2 16.2 2.9 2.9", key: "1bxg5t" }], ["path", { d: "M12 18v4", key: "jadmvz" }], ["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }], ["path", { d: "M2 12h4", key: "j09sii" }], ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }] ]; const Loader = createLucideIcon("loader", __iconNode$o); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$n = [ ["path", { d: "m10 17 5-5-5-5", key: "1bsop3" }], ["path", { d: "M15 12H3", key: "6jk70r" }], ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }] ]; const LogIn = createLucideIcon("log-in", __iconNode$n); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$m = [ ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }], ["path", { d: "M21 12H9", key: "dn1m92" }], ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }] ]; const LogOut = createLucideIcon("log-out", __iconNode$m); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$l = [ ["path", { d: "M15 3h6v6", key: "1q9fwt" }], ["path", { d: "m21 3-7 7", key: "1l2asr" }], ["path", { d: "m3 21 7-7", key: "tjx5ai" }], ["path", { d: "M9 21H3v-6", key: "wtvkvv" }] ]; const Maximize2 = createLucideIcon("maximize-2", __iconNode$l); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$k = [ ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }], ["path", { d: "M8 10h.01", key: "19clt8" }], ["path", { d: "M12 10h.01", key: "1nrarc" }], ["path", { d: "M16 10h.01", key: "1m94wz" }] ]; const MessageSquareMore = createLucideIcon("message-square-more", __iconNode$k); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$j = [ ["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }], ["path", { d: "M18.89 13.23A7.12 7.12 0 0 0 19 12v-2", key: "80xlxr" }], ["path", { d: "M5 10v2a7 7 0 0 0 12 5", key: "p2k8kg" }], ["path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33", key: "1gzdoj" }], ["path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12", key: "r2i35w" }], ["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }] ]; const MicOff = createLucideIcon("mic-off", __iconNode$j); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$i = [ ["path", { d: "M12 19v3", key: "npa21l" }], ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }], ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }] ]; const Mic = createLucideIcon("mic", __iconNode$i); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$h = [ ["path", { d: "m14 10 7-7", key: "oa77jy" }], ["path", { d: "M20 10h-6V4", key: "mjg0md" }], ["path", { d: "m3 21 7-7", key: "tjx5ai" }], ["path", { d: "M4 14h6v6", key: "rmj7iw" }] ]; const Minimize2 = createLucideIcon("minimize-2", __iconNode$h); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$g = [ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }], ["path", { d: "M9 3v18", key: "fh3hqa" }] ]; const PanelLeft = createLucideIcon("panel-left", __iconNode$g); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$f = [ [ "path", { d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551", key: "1miecu" } ] ]; const Paperclip = createLucideIcon("paperclip", __iconNode$f); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$e = [ [ "path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z", key: "1a8usu" } ], ["path", { d: "m15 5 4 4", key: "1mk7zo" }] ]; const Pencil = createLucideIcon("pencil", __iconNode$e); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$d = [ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }], ["path", { d: "M3 3v5h5", key: "1xhq8a" }] ]; const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$d); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$c = [ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }], ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }] ]; const Search = createLucideIcon("search", __iconNode$c); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$b = [ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }], ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }], ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }] ]; const Smile = createLucideIcon("smile", __iconNode$b); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$a = [ [ "path", { d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z", key: "1s2grr" } ], ["path", { d: "M20 2v4", key: "1rf3ol" }], ["path", { d: "M22 4h-4", key: "gwowj6" }], ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }] ]; const Sparkles = createLucideIcon("sparkles", __iconNode$a); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$9 = [ ["path", { d: "M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6", key: "y09zxi" }], ["path", { d: "m21 3-9 9", key: "mpx6sq" }], ["path", { d: "M15 3h6v6", key: "1q9fwt" }] ]; const SquareArrowOutUpRight = createLucideIcon("square-arrow-out-up-right", __iconNode$9); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$8 = [ [ "path", { d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z", key: "r04s7s" } ] ]; const Star = createLucideIcon("star", __iconNode$8); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$7 = [ ["path", { d: "M17 14V2", key: "8ymqnk" }], [ "path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z", key: "m61m77" } ] ]; const ThumbsDown = createLucideIcon("thumbs-down", __iconNode$7); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$6 = [ ["path", { d: "M7 10v12", key: "1qc93n" }], [ "path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z", key: "emmmcr" } ] ]; const ThumbsUp = createLucideIcon("thumbs-up", __iconNode$6); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$5 = [ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }], ["path", { d: "M3 6h18", key: "d0wm0j" }], ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }] ]; const Trash = createLucideIcon("trash", __iconNode$5); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$4 = [ [ "path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3", key: "wmoenq" } ], ["path", { d: "M12 9v4", key: "juzpu7" }], ["path", { d: "M12 17h.01", key: "p32p05" }] ]; const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$4); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$3 = [ ["path", { d: "M12 3v12", key: "1x0j5s" }], ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }], ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }] ]; const Upload = createLucideIcon("upload", __iconNode$3); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$2 = [ ["path", { d: "M2 21a8 8 0 0 1 13.292-6", key: "bjp14o" }], ["circle", { cx: "10", cy: "8", r: "5", key: "o932ke" }], ["path", { d: "M19 16v6", key: "tddt3s" }], ["path", { d: "M22 19h-6", key: "vcuq98" }] ]; const UserRoundPlus = createLucideIcon("user-round-plus", __iconNode$2); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode$1 = [ ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }], ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }] ]; const User = createLucideIcon("user", __iconNode$1); /** * @license lucide-react v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const __iconNode = [ ["path", { d: "M18 6 6 18", key: "1bl5f8" }], ["path", { d: "m6 6 12 12", key: "d8bk6v" }] ]; const X = createLucideIcon("x", __iconNode); var withSelector = {exports: {}}; var useSyncExternalStoreWithSelector_production = {}; /** * @license React * use-sync-external-store-with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var hasRequiredUseSyncExternalStoreWithSelector_production; function requireUseSyncExternalStoreWithSelector_production () { if (hasRequiredUseSyncExternalStoreWithSelector_production) return useSyncExternalStoreWithSelector_production; hasRequiredUseSyncExternalStoreWithSelector_production = 1; var React = React__default; function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue; useSyncExternalStoreWithSelector_production.useSyncExternalStoreWithSelector = function ( subscribe, getSnapshot, getServerSnapshot, selector, isEqual ) { var instRef = useRef(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo( function () { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = true; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(nextSnapshot); if (void 0 !== isEqual && inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, nextSnapshot)) return (memoizedSelection = currentSelection); } return (memoizedSelection = nextSnapshot); } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector(nextSnapshot); if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return (memoizedSnapshot = nextSnapshot), currentSelection; memoizedSnapshot = nextSnapshot; return (memoizedSelection = nextSelection); } var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [ function () { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function () { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot, getServerSnapshot, selector, isEqual] ); var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); useEffect( function () { inst.hasValue = true; inst.value = value; }, [value] ); useDebugValue(value); return value; }; return useSyncExternalStoreWithSelector_production; } var hasRequiredWithSelector; function requireWithSelector () { if (hasRequiredWithSelector) return withSelector.exports; hasRequiredWithSelector = 1; { withSelector.exports = requireUseSyncExternalStoreWithSelector_production(); } return withSelector.exports; } var withSelectorExports = requireWithSelector(); function defaultNoopBatch(callback) { callback(); } function createListenerCollection() { let first = null; let last = null; return { clear() { first = null; last = null; }, notify() { defaultNoopBatch(() => { let listener = first; while (listener) { listener.callback(); listener = listener.next; } }); }, get() { const listeners = []; let listener = first; while (listener) { listeners.push(listener); listener = listener.next; } return listeners; }, subscribe(callback) { let isSubscribed = true; const listener = last = { callback, next: null, prev: last }; if (listener.prev) { listener.prev.next = listener; } else { first = listener; } return function unsubscribe() { if (!isSubscribed || first === null) return; isSubscribed = false; if (listener.next) { listener.next.prev = listener.prev; } else { last = listener.prev; } if (listener.prev) { listener.prev.next = listener.next; } else { first = listener.next; } }; } }; } var nullListeners = { notify() { }, get: () => [] }; function createSubscription(store, parentSub) { let unsubscribe; let listeners = nullListeners; let subscriptionsAmount = 0; let selfSubscribed = false; function addNestedSub(listener) { trySubscribe(); const cleanupListener = listeners.subscribe(listener); let removed = false; return () => { if (!removed) { removed = true; cleanupListener(); tryUnsubscribe(); } }; } function notifyNestedSubs() { listeners.notify(); } function handleChangeWrapper() { if (subscription.onStateChange) { subscription.onStateChange(); } } function isSubscribed() { return selfSubscribed; } function trySubscribe() { subscriptionsAmount++; if (!unsubscribe) { unsubscribe = store.subscribe(handleChangeWrapper); listeners = createListenerCollection(); } } function tryUnsubscribe() { subscriptionsAmount--; if (unsubscribe && subscriptionsAmount === 0) { unsubscribe(); unsubscribe = void 0; listeners.clear(); listeners = nullListeners; } } function trySubscribeSelf() { if (!selfSubscribed) { selfSubscribed = true; trySubscribe(); } } function tryUnsubscribeSelf() { if (selfSubscribed) { selfSubscribed = false; tryUnsubscribe(); } } const subscription = { addNestedSub, notifyNestedSubs, handleChangeWrapper, isSubscribed, trySubscribe: trySubscribeSelf, tryUnsubscribe: tryUnsubscribeSelf, getListeners: () => listeners }; return subscription; } var canUseDOM$1 = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); var isDOM = /* @__PURE__ */ canUseDOM$1(); var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative"; var isReactNative$1 = /* @__PURE__ */ isRunningInReactNative(); var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative$1 ? React.useLayoutEffect : React.useEffect; var useIsomorphicLayoutEffect$2 = /* @__PURE__ */ getUseIsomorphicLayoutEffect(); var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`); var gT = typeof globalThis !== "undefined" ? globalThis : ( /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ {} ); function getContext() { if (!React.createContext) return {}; const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map(); let realContext = contextMap.get(React.createContext); if (!realContext) { realContext = React.createContext( null ); contextMap.set(React.createContext, realContext); } return realContext; } var ReactReduxContext = /* @__PURE__ */ getContext(); function Provider$1(providerProps) { const { children, context, serverState, store } = providerProps; const contextValue = React.useMemo(() => { const subscription = createSubscription(store); const baseContextValue = { store, subscription, getServerState: serverState ? () => serverState : void 0 }; { return baseContextValue; } }, [store, serverState]); const previousState = React.useMemo(() => store.getState(), [store]); useIsomorphicLayoutEffect$2(() => { const { subscription } = contextValue; subscription.onStateChange = subscription.notifyNestedSubs; subscription.trySubscribe(); if (previousState !== store.getState()) { subscription.notifyNestedSubs(); } return () => { subscription.tryUnsubscribe(); subscription.onStateChange = void 0; }; }, [contextValue, previousState]); const Context = context || ReactReduxContext; return /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children); } var Provider_default = Provider$1; function createReduxContextHook(context = ReactReduxContext) { return function useReduxContext2() { const contextValue = React.useContext(context); return contextValue; }; } var useReduxContext = /* @__PURE__ */ createReduxContextHook(); function createStoreHook(context = ReactReduxContext) { const useReduxContext2 = context === ReactReduxContext ? useReduxContext : ( // @ts-ignore createReduxContextHook(context) ); const useStore2 = () => { const { store } = useReduxContext2(); return store; }; Object.assign(useStore2, { withTypes: () => useStore2 }); return useStore2; } var useStore$1 = /* @__PURE__ */ createStoreHook(); function createDispatchHook(context = ReactReduxContext) { const useStore2 = context === ReactReduxContext ? useStore$1 : createStoreHook(context); const useDispatch2 = () => { const store = useStore2(); return store.dispatch; }; Object.assign(useDispatch2, { withTypes: () => useDispatch2 }); return useDispatch2; } var useDispatch = /* @__PURE__ */ createDispatchHook(); var refEquality = (a, b) => a === b; function createSelectorHook(context = ReactReduxContext) { const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); const useSelector2 = (selector, equalityFnOrOptions = {}) => { const { equalityFn = refEquality } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions; const reduxContext = useReduxContext2(); const { store, subscription, getServerState } = reduxContext; React.useRef(true); const wrappedSelector = React.useCallback( { [selector.name](state) { const selected = selector(state); return selected; } }[selector.name], [selector] ); const selectedState = withSelectorExports.useSyncExternalStoreWithSelector( subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn ); React.useDebugValue(selectedState); return selectedState; }; Object.assign(useSelector2, { withTypes: () => useSelector2 }); return useSelector2; } var useSelector = /* @__PURE__ */ createSelectorHook(); const SvgMessageSquareMore = (props) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", fill: "var(--primary-foreground)" }), /* @__PURE__ */ React.createElement("circle", { cx: 8, cy: 10, r: 1, fill: "var(--primary)" }), /* @__PURE__ */ React.createElement("circle", { cx: 12, cy: 10, r: 1, fill: "var(--primary)" }), /* @__PURE__ */ React.createElement("circle", { cx: 16, cy: 10, r: 1, fill: "var(--primary)" })); // packages/react/compose-refs/src/compose-refs.tsx function setRef(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef(refs[i], null); } } }; } }; } function useComposedRefs(...refs) { return React.useCallback(composeRefs(...refs), refs); } // src/slot.tsx // @__NO_SIDE_EFFECTS__ function createSlot(ownerName) { const SlotClone = /* @__PURE__ */ createSlotClone(ownerName); const Slot2 = React.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; const childrenArray = React.Children.toArray(children); const slottable = childrenArray.find(isSlottable); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React.Children.count(newElement) > 1) return React.Children.only(null); return React.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null }); } return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot2.displayName = `${ownerName}.Slot`; return Slot2; } var Slot$2 = /* @__PURE__ */ createSlot("Slot"); // @__NO_SIDE_EFFECTS__ function createSlotClone(ownerName) { const SlotClone = React.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; if (React.isValidElement(children)) { const childrenRef = getElementRef$1(children); const props2 = mergeProps(slotProps, children.props); if (children.type !== React.Fragment) { props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; } return React.cloneElement(children, props2); } return React.Children.count(children) > 1 ? React.Children.only(null) : null; }); SlotClone.displayName = `${ownerName}.SlotClone`; return SlotClone; } var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable"); // @__NO_SIDE_EFFECTS__ function createSlottable(ownerName) { const Slottable2 = ({ children }) => { return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); }; Slottable2.displayName = `${ownerName}.Slottable`; Slottable2.__radixId = SLOTTABLE_IDENTIFIER; return Slottable2; } function isSlottable(child) { return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER; } function mergeProps(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { const result = childPropValue(...args); slotPropValue(...args); return result; }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef$1(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof value === "boolean" ? `${value}` : value === 0 ? "0" : value; const cx = clsx; const cva = (base, config)=>(props)=>{ var _config_compoundVariants; if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className); const { variants, defaultVariants } = config; const getVariantClassNames = Object.keys(variants).map((variant)=>{ const variantProp = props === null || props === void 0 ? void 0 : props[variant]; const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant]; if (variantProp === null) return null; const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp); return variants[variant][variantKey]; }); const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{ let [key, value] = param; if (value === undefined) { return acc; } acc[key] = value; return acc; }, {}); const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param; return Object.entries(compoundVariantOptions).every((param)=>{ let [key, value] = param; return Array.isArray(value) ? value.includes({ ...defaultVariants, ...propsWithoutUndefined }[key]) : ({ ...defaultVariants, ...propsWithoutUndefined })[key] === value; }) ? [ ...acc, cvClass, cvClassName ] : acc; }, []); return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className); }; const CLASS_PART_SEPARATOR = '-'; const createClassGroupUtils = config => { const classMap = createClassMap(config); const { conflictingClassGroups, conflictingClassGroupModifiers } = config; const getClassGroupId = className => { const classParts = className.split(CLASS_PART_SEPARATOR); // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts. if (classParts[0] === '' && classParts.length !== 1) { classParts.shift(); } return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className); }; const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => { const conflicts = conflictingClassGroups[classGroupId] || []; if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) { return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]]; } return conflicts; }; return { getClassGroupId, getConflictingClassGroupIds }; }; const getGroupRecursive = (classParts, classPartObject) => { if (classParts.length === 0) { return classPartObject.classGroupId; } const currentClassPart = classParts[0]; const nextClassPartObject = classPartObject.nextPart.get(currentClassPart); const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined; if (classGroupFromNextClassPart) { return classGroupFromNextClassPart; } if (classPartObject.validators.length === 0) { return undefined; } const classRest = classParts.join(CLASS_PART_SEPARATOR); return classPartObject.validators.find(({ validator }) => validator(classRest))?.classGroupId; }; const arbitraryPropertyRegex = /^\[(.+)\]$/; const getGroupIdForArbitraryProperty = className => { if (arbitraryPropertyRegex.test(className)) { const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1]; const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':')); if (property) { // I use two dots here because one dot is used as prefix for class groups in plugins return 'arbitrary..' + property; } } }; /** * Exported for testing only */ const createClassMap = config => { const { theme, classGroups } = config; const classMap = { nextPart: new Map(), validators: [] }; for (const classGroupId in classGroups) { processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme); } return classMap; }; const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => { classGroup.forEach(classDefinition => { if (typeof classDefinition === 'string') { const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition); classPartObjectToEdit.classGroupId = classGroupId; return; } if (typeof classDefinition === 'function') { if (isThemeGetter(classDefinition)) { processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme); return; } classPartObject.validators.push({ validator: classDefinition, classGroupId }); return; } Object.entries(classDefinition).forEach(([key, classGroup]) => { processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme); }); }); }; const getPart = (classPartObject, path) => { let currentClassPartObject = classPartObject; path.split(CLASS_PART_SEPARATOR).forEach(pathPart => { if (!currentClassPartObject.nextPart.has(pathPart)) { currentClassPartObject.nextPart.set(pathPart, { nextPart: new Map(), validators: [] }); } currentClassPartObject = currentClassPartObject.nextPart.get(pathPart); }); return currentClassPartObject; }; const isThemeGetter = func => func.isThemeGetter; // LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance const createLruCache = maxCacheSize => { if (maxCacheSize < 1) { return { get: () => undefined, set: () => {} }; } let cacheSize = 0; let cache = new Map(); let previousCache = new Map(); const update = (key, value) => { cache.set(key, value); cacheSize++; if (cacheSize > maxCacheSize) { cacheSize = 0; previousCache = cache; cache = new Map(); } }; return { get(key) { let value = cache.get(key); if (value !== undefined) { return value; } if ((value = previousCache.get(key)) !== undefined) { update(key, value); return value; } }, set(key, value) { if (cache.has(key)) { cache.set(key, value); } else { update(key, value); } } }; }; const IMPORTANT_MODIFIER = '!'; const MODIFIER_SEPARATOR = ':'; const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length; const createParseClassName = config => { const { prefix, experimentalParseClassName } = config; /** * Parse class name into parts. * * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js */ let parseClassName = className => { const modifiers = []; let bracketDepth = 0; let parenDepth = 0; let modifierStart = 0; let postfixModifierPosition; for (let index = 0; index < className.length; index++) { let currentCharacter = className[index]; if (bracketDepth === 0 && parenDepth === 0) { if (currentCharacter === MODIFIER_SEPARATOR) { modifiers.push(className.slice(modifierStart, index)); modifierStart = index + MODIFIER_SEPARATOR_LENGTH; continue; } if (currentCharacter === '/') { postfixModifierPosition = index; continue; } } if (currentCharacter === '[') { bracketDepth++; } else if (currentCharacter === ']') { bracketDepth--; } else if (currentCharacter === '(') { parenDepth++; } else if (currentCharacter === ')') { parenDepth--; } } const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart); const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier); const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier; const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined; return { modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition }; }; if (prefix) { const fullPrefix = prefix + MODIFIER_SEPARATOR; const parseClassNameOriginal = parseClassName; parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : { isExternal: true, modifiers: [], hasImportantModifier: false, baseClassName: className, maybePostfixModifierPosition: undefined }; } if (experimentalParseClassName) { const parseClassNameOriginal = parseClassName; parseClassName = className => experimentalParseClassName({ className, parseClassName: parseClassNameOriginal }); } return parseClassName; }; const stripImportantModifier = baseClassName => { if (baseClassName.endsWith(IMPORTANT_MODIFIER)) { return baseClassName.substring(0, baseClassName.length - 1); } /** * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons. * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864 */ if (baseClassName.startsWith(IMPORTANT_MODIFIER)) { return baseClassName.substring(1); } return baseClassName; }; /** * Sorts modifiers according to following schema: * - Predefined modifiers are sorted alphabetically * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it */ const createSortModifiers = config => { const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true])); const sortModifiers = modifiers => { if (modifiers.length <= 1) { return modifiers; } const sortedModifiers = []; let unsortedModifiers = []; modifiers.forEach(modifier => { const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier]; if (isPositionSensitive) { sortedModifiers.push(...unsortedModifiers.sort(), modifier); unsortedModifiers = []; } else { unsortedModifiers.push(modifier); } }); sortedModifiers.push(...unsortedModifiers.sort()); return sortedModifiers; }; return sortModifiers; }; const createConfigUtils = config => ({ cache: createLruCache(config.cacheSize), parseClassName: createParseClassName(config), sortModifiers: createSortModifiers(config), ...createClassGroupUtils(config) }); const SPLIT_CLASSES_REGEX = /\s+/; const mergeClassList = (classList, configUtils) => { const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils; /** * Set of classGroupIds in following format: * `{importantModifier}{variantModifiers}{classGroupId}` * @example 'float' * @example 'hover:focus:bg-color' * @example 'md:!pr' */ const classGroupsInConflict = []; const classNames = classList.trim().split(SPLIT_CLASSES_REGEX); let result = ''; for (let index = classNames.length - 1; index >= 0; index -= 1) { const originalClassName = classNames[index]; const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName); if (isExternal) { result = originalClassName + (result.length > 0 ? ' ' + result : result); continue; } let hasPostfixModifier = !!maybePostfixModifierPosition; let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName); if (!classGroupId) { if (!hasPostfixModifier) { // Not a Tailwind class result = originalClassName + (result.length > 0 ? ' ' + result : result); continue; } classGroupId = getClassGroupId(baseClassName); if (!classGroupId) { // Not a Tailwind class result = originalClassName + (result.length > 0 ? ' ' + result : result); continue; } hasPostfixModifier = false; } const variantModifier = sortModifiers(modifiers).join(':'); const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier; const classId = modifierId + classGroupId; if (classGroupsInConflict.includes(classId)) { // Tailwind class omitted due to conflict continue; } classGroupsInConflict.push(classId); const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier); for (let i = 0; i < conflictGroups.length; ++i) { const group = conflictGroups[i]; classGroupsInConflict.push(modifierId + group); } // Tailwind class not in conflict result = originalClassName + (result.length > 0 ? ' ' + result : result); } return result; }; /** * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better. * * Specifically: * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts * * Original code has MIT license: Copyright (c) Luke Edwards (lukeed.com) */ function twJoin() { let index = 0; let argument; let resolvedValue; let string = ''; while (index < arguments.length) { if (argument = arguments[index++]) { if (resolvedValue = toValue(argument)) { string && (string += ' '); string += resolvedValue; } } } return string; } const toValue = mix => { if (typeof mix === 'string') { return mix; } let resolvedValue; let string = ''; for (let k = 0; k < mix.length; k++) { if (mix[k]) { if (resolvedValue = toValue(mix[k])) { string && (string += ' '); string += resolvedValue; } } } return string; }; function createTailwindMerge(createConfigFirst, ...createConfigRest) { let configUtils; let cacheGet; let cacheSet; let functionToCall = initTailwindMerge; function initTailwindMerge(classList) { const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()); configUtils = createConfigUtils(config); cacheGet = configUtils.cache.get; cacheSet = configUtils.cache.set; functionToCall = tailwindMerge; return tailwindMerge(classList); } function tailwindMerge(classList) { const cachedResult = cacheGet(classList); if (cachedResult) { return cachedResult; } const result = mergeClassList(classList, configUtils); cacheSet(classList, result); return result; } return function callTailwindMerge() { return functionToCall(twJoin.apply(null, arguments)); }; } const fromTheme = key => { const themeGetter = theme => theme[key] || []; themeGetter.isThemeGetter = true; return themeGetter; }; const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i; const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i; const fractionRegex = /^\d+\/\d+$/; const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/; const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/; const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/; // Shadow always begins with x and y offset separated by underscore optionally prepended by inset const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/; const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; const isFraction = value => fractionRegex.test(value); const isNumber$2 = value => !!value && !Number.isNaN(Number(value)); const isInteger = value => !!value && Number.isInteger(Number(value)); const isPercent = value => value.endsWith('%') && isNumber$2(value.slice(0, -1)); const isTshirtSize = value => tshirtUnitRegex.test(value); const isAny = () => true; const isLengthOnly = value => // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths. // For example, `hsl(0 0% 0%)` would be classified as a length without this check. // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough. lengthUnitRegex.test(value) && !colorFunctionRegex.test(value); const isNever = () => false; const isShadow = value => shadowRegex.test(value); const isImage = value => imageRegex.test(value); const isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value); const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever); const isArbitraryValue = value => arbitraryValueRegex.test(value); const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly); const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber$2); const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever); const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage); const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow); const isArbitraryVariable = value => arbitraryVariableRegex.test(value); const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength); const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName); const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition); const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize); const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage); const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true); // Helpers const getIsArbitraryValue = (value, testLabel, testValue) => { const result = arbitraryValueRegex.exec(value); if (result) { if (result[1]) { return testLabel(result[1]); } return testValue(result[2]); } return false; }; const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => { const result = arbitraryVariableRegex.exec(value); if (result) { if (result[1]) { return testLabel(result[1]); } return shouldMatchNoLabel; } return false; }; // Labels const isLabelPosition = label => label === 'position' || label === 'percentage'; const isLabelImage = label => label === 'image' || label === 'url'; const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size'; const isLabelLength = label => label === 'length'; const isLabelNumber = label => label === 'number'; const isLabelFamilyName = label => label === 'family-name'; const isLabelShadow = label => label === 'shadow'; const getDefaultConfig = () => { /** * Theme getters for theme variable namespaces * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces */ /***/ const themeColor = fromTheme('color'); const themeFont = fromTheme('font'); const themeText = fromTheme('text'); const themeFontWeight = fromTheme('font-weight'); const themeTracking = fromTheme('tracking'); const themeLeading = fromTheme('leading'); const themeBreakpoint = fromTheme('breakpoint'); const themeContainer = fromTheme('container'); const themeSpacing = fromTheme('spacing'); const themeRadius = fromTheme('radius'); const themeShadow = fromTheme('shadow'); const themeInsetShadow = fromTheme('inset-shadow'); const themeTextShadow = fromTheme('text-shadow'); const themeDropShadow = fromTheme('drop-shadow'); const themeBlur = fromTheme('blur'); const themePerspective = fromTheme('perspective'); const themeAspect = fromTheme('aspect'); const themeEase = fromTheme('ease'); const themeAnimate = fromTheme('animate'); /** * Helpers to avoid repeating the same scales * * We use functions that create a new array every time they're called instead of static arrays. * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config. */ /***/ const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column']; const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left', // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 'left-top', 'top-right', // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 'right-top', 'bottom-right', // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 'right-bottom', 'bottom-left', // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 'left-bottom']; const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue]; const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll']; const scaleOverscroll = () => ['auto', 'contain', 'none']; const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing]; const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()]; const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue]; const scaleGridColRowStartAndEnd = () => ['auto', { span: ['full', isInteger, isArbitraryVariable, isArbitraryValue] }, isInteger, isArbitraryVariable, isArbitraryValue]; const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]; const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue]; const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe']; const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe']; const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()]; const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()]; const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue]; const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, { position: [isArbitraryVariable, isArbitraryValue] }]; const scaleBgRepeat = () => ['no-repeat', { repeat: ['', 'x', 'y', 'space', 'round'] }]; const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, { size: [isArbitraryVariable, isArbitraryValue] }]; const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength]; const scaleRadius = () => [ // Deprecated since Tailwind CSS v4.0.0 '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue]; const scaleBorderWidth = () => ['', isNumber$2, isArbitraryVariableLength, isArbitraryLength]; const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double']; const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']; const scaleMaskImagePosition = () => [isNumber$2, isPercent, isArbitraryVariablePosition, isArbitraryPosition]; const scaleBlur = () => [ // Deprecated since Tailwind CSS v4.0.0 '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue]; const scaleRotate = () => ['none', isNumber$2, isArbitraryVariable, isArbitraryValue]; const scaleScale = () => ['none', isNumber$2, isArbitraryVariable, isArbitraryValue]; const scaleSkew = () => [isNumber$2, isArbitraryVariable, isArbitraryValue]; const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()]; return { cacheSize: 500, theme: { animate: ['spin', 'ping', 'pulse', 'bounce'], aspect: ['video'], blur: [isTshirtSize], breakpoint: [isTshirtSize], color: [isAny], container: [isTshirtSize], 'drop-shadow': [isTshirtSize], ease: ['in', 'out', 'in-out'], font: [isAnyNonArbitrary], 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'], 'inset-shadow': [isTshirtSize], leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'], perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'], radius: [isTshirtSize], shadow: [isTshirtSize], spacing: ['px', isNumber$2], text: [isTshirtSize], 'text-shadow': [isTshirtSize], tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest'] }, classGroups: { // -------------- // --- Layout --- // -------------- /** * Aspect Ratio * @see https://tailwindcss.com/docs/aspect-ratio */ aspect: [{ aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect] }], /** * Container * @see https://tailwindcss.com/docs/container * @deprecated since Tailwind CSS v4.0.0 */ container: ['container'], /** * Columns * @see https://tailwindcss.com/docs/columns */ columns: [{ columns: [isNumber$2, isArbitraryValue, isArbitraryVariable, themeContainer] }], /** * Break After * @see https://tailwindcss.com/docs/break-after */ 'break-after': [{ 'break-after': scaleBreak() }], /** * Break Before * @see https://tailwindcss.com/docs/break-before */ 'break-before': [{ 'break-before': scaleBreak() }], /** * Break Inside * @see https://tailwindcss.com/docs/break-inside */ 'break-inside': [{ 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column'] }], /** * Box Decoration Break * @see https://tailwindcss.com/docs/box-decoration-break */ 'box-decoration': [{ 'box-decoration': ['slice', 'clone'] }], /** * Box Sizing * @see https://tailwindcss.com/docs/box-sizing */ box: [{ box: ['border', 'content'] }], /** * Display * @see https://tailwindcss.com/docs/display */ display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'], /** * Screen Reader Only * @see https://tailwindcss.com/docs/display#screen-reader-only */ sr: ['sr-only', 'not-sr-only'], /** * Floats * @see https://tailwindcss.com/docs/float */ float: [{ float: ['right', 'left', 'none', 'start', 'end'] }], /** * Clear * @see https://tailwindcss.com/docs/clear */ clear: [{ clear: ['left', 'right', 'both', 'none', 'start', 'end'] }], /** * Isolation * @see https://tailwindcss.com/docs/isolation */ isolation: ['isolate', 'isolation-auto'], /** * Object Fit * @see https://tailwindcss.com/docs/object-fit */ 'object-fit': [{ object: ['contain', 'cover', 'fill', 'none', 'scale-down'] }], /** * Object Position * @see https://tailwindcss.com/docs/object-position */ 'object-position': [{ object: scalePositionWithArbitrary() }], /** * Overflow * @see https://tailwindcss.com/docs/overflow */ overflow: [{ overflow: scaleOverflow() }], /** * Overflow X * @see https://tailwindcss.com/docs/overflow */ 'overflow-x': [{ 'overflow-x': scaleOverflow() }], /** * Overflow Y * @see https://tailwindcss.com/docs/overflow */ 'overflow-y': [{ 'overflow-y': scaleOverflow() }], /** * Overscroll Behavior * @see https://tailwindcss.com/docs/overscroll-behavior */ overscroll: [{ overscroll: scaleOverscroll() }], /** * Overscroll Behavior X * @see https://tailwindcss.com/docs/overscroll-behavior */ 'overscroll-x': [{ 'overscroll-x': scaleOverscroll() }], /** * Overscroll Behavior Y * @see https://tailwindcss.com/docs/overscroll-behavior */ 'overscroll-y': [{ 'overscroll-y': scaleOverscroll() }], /** * Position * @see https://tailwindcss.com/docs/position */ position: ['static', 'fixed', 'absolute', 'relative', 'sticky'], /** * Top / Right / Bottom / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ inset: [{ inset: scaleInset() }], /** * Right / Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ 'inset-x': [{ 'inset-x': scaleInset() }], /** * Top / Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ 'inset-y': [{ 'inset-y': scaleInset() }], /** * Start * @see https://tailwindcss.com/docs/top-right-bottom-left */ start: [{ start: scaleInset() }], /** * End * @see https://tailwindcss.com/docs/top-right-bottom-left */ end: [{ end: scaleInset() }], /** * Top * @see https://tailwindcss.com/docs/top-right-bottom-left */ top: [{ top: scaleInset() }], /** * Right * @see https://tailwindcss.com/docs/top-right-bottom-left */ right: [{ right: scaleInset() }], /** * Bottom * @see https://tailwindcss.com/docs/top-right-bottom-left */ bottom: [{ bottom: scaleInset() }], /** * Left * @see https://tailwindcss.com/docs/top-right-bottom-left */ left: [{ left: scaleInset() }], /** * Visibility * @see https://tailwindcss.com/docs/visibility */ visibility: ['visible', 'invisible', 'collapse'], /** * Z-Index * @see https://tailwindcss.com/docs/z-index */ z: [{ z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue] }], // ------------------------ // --- Flexbox and Grid --- // ------------------------ /** * Flex Basis * @see https://tailwindcss.com/docs/flex-basis */ basis: [{ basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()] }], /** * Flex Direction * @see https://tailwindcss.com/docs/flex-direction */ 'flex-direction': [{ flex: ['row', 'row-reverse', 'col', 'col-reverse'] }], /** * Flex Wrap * @see https://tailwindcss.com/docs/flex-wrap */ 'flex-wrap': [{ flex: ['nowrap', 'wrap', 'wrap-reverse'] }], /** * Flex * @see https://tailwindcss.com/docs/flex */ flex: [{ flex: [isNumber$2, isFraction, 'auto', 'initial', 'none', isArbitraryValue] }], /** * Flex Grow * @see https://tailwindcss.com/docs/flex-grow */ grow: [{ grow: ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Flex Shrink * @see https://tailwindcss.com/docs/flex-shrink */ shrink: [{ shrink: ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Order * @see https://tailwindcss.com/docs/order */ order: [{ order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue] }], /** * Grid Template Columns * @see https://tailwindcss.com/docs/grid-template-columns */ 'grid-cols': [{ 'grid-cols': scaleGridTemplateColsRows() }], /** * Grid Column Start / End * @see https://tailwindcss.com/docs/grid-column */ 'col-start-end': [{ col: scaleGridColRowStartAndEnd() }], /** * Grid Column Start * @see https://tailwindcss.com/docs/grid-column */ 'col-start': [{ 'col-start': scaleGridColRowStartOrEnd() }], /** * Grid Column End * @see https://tailwindcss.com/docs/grid-column */ 'col-end': [{ 'col-end': scaleGridColRowStartOrEnd() }], /** * Grid Template Rows * @see https://tailwindcss.com/docs/grid-template-rows */ 'grid-rows': [{ 'grid-rows': scaleGridTemplateColsRows() }], /** * Grid Row Start / End * @see https://tailwindcss.com/docs/grid-row */ 'row-start-end': [{ row: scaleGridColRowStartAndEnd() }], /** * Grid Row Start * @see https://tailwindcss.com/docs/grid-row */ 'row-start': [{ 'row-start': scaleGridColRowStartOrEnd() }], /** * Grid Row End * @see https://tailwindcss.com/docs/grid-row */ 'row-end': [{ 'row-end': scaleGridColRowStartOrEnd() }], /** * Grid Auto Flow * @see https://tailwindcss.com/docs/grid-auto-flow */ 'grid-flow': [{ 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense'] }], /** * Grid Auto Columns * @see https://tailwindcss.com/docs/grid-auto-columns */ 'auto-cols': [{ 'auto-cols': scaleGridAutoColsRows() }], /** * Grid Auto Rows * @see https://tailwindcss.com/docs/grid-auto-rows */ 'auto-rows': [{ 'auto-rows': scaleGridAutoColsRows() }], /** * Gap * @see https://tailwindcss.com/docs/gap */ gap: [{ gap: scaleUnambiguousSpacing() }], /** * Gap X * @see https://tailwindcss.com/docs/gap */ 'gap-x': [{ 'gap-x': scaleUnambiguousSpacing() }], /** * Gap Y * @see https://tailwindcss.com/docs/gap */ 'gap-y': [{ 'gap-y': scaleUnambiguousSpacing() }], /** * Justify Content * @see https://tailwindcss.com/docs/justify-content */ 'justify-content': [{ justify: [...scaleAlignPrimaryAxis(), 'normal'] }], /** * Justify Items * @see https://tailwindcss.com/docs/justify-items */ 'justify-items': [{ 'justify-items': [...scaleAlignSecondaryAxis(), 'normal'] }], /** * Justify Self * @see https://tailwindcss.com/docs/justify-self */ 'justify-self': [{ 'justify-self': ['auto', ...scaleAlignSecondaryAxis()] }], /** * Align Content * @see https://tailwindcss.com/docs/align-content */ 'align-content': [{ content: ['normal', ...scaleAlignPrimaryAxis()] }], /** * Align Items * @see https://tailwindcss.com/docs/align-items */ 'align-items': [{ items: [...scaleAlignSecondaryAxis(), { baseline: ['', 'last'] }] }], /** * Align Self * @see https://tailwindcss.com/docs/align-self */ 'align-self': [{ self: ['auto', ...scaleAlignSecondaryAxis(), { baseline: ['', 'last'] }] }], /** * Place Content * @see https://tailwindcss.com/docs/place-content */ 'place-content': [{ 'place-content': scaleAlignPrimaryAxis() }], /** * Place Items * @see https://tailwindcss.com/docs/place-items */ 'place-items': [{ 'place-items': [...scaleAlignSecondaryAxis(), 'baseline'] }], /** * Place Self * @see https://tailwindcss.com/docs/place-self */ 'place-self': [{ 'place-self': ['auto', ...scaleAlignSecondaryAxis()] }], // Spacing /** * Padding * @see https://tailwindcss.com/docs/padding */ p: [{ p: scaleUnambiguousSpacing() }], /** * Padding X * @see https://tailwindcss.com/docs/padding */ px: [{ px: scaleUnambiguousSpacing() }], /** * Padding Y * @see https://tailwindcss.com/docs/padding */ py: [{ py: scaleUnambiguousSpacing() }], /** * Padding Start * @see https://tailwindcss.com/docs/padding */ ps: [{ ps: scaleUnambiguousSpacing() }], /** * Padding End * @see https://tailwindcss.com/docs/padding */ pe: [{ pe: scaleUnambiguousSpacing() }], /** * Padding Top * @see https://tailwindcss.com/docs/padding */ pt: [{ pt: scaleUnambiguousSpacing() }], /** * Padding Right * @see https://tailwindcss.com/docs/padding */ pr: [{ pr: scaleUnambiguousSpacing() }], /** * Padding Bottom * @see https://tailwindcss.com/docs/padding */ pb: [{ pb: scaleUnambiguousSpacing() }], /** * Padding Left * @see https://tailwindcss.com/docs/padding */ pl: [{ pl: scaleUnambiguousSpacing() }], /** * Margin * @see https://tailwindcss.com/docs/margin */ m: [{ m: scaleMargin() }], /** * Margin X * @see https://tailwindcss.com/docs/margin */ mx: [{ mx: scaleMargin() }], /** * Margin Y * @see https://tailwindcss.com/docs/margin */ my: [{ my: scaleMargin() }], /** * Margin Start * @see https://tailwindcss.com/docs/margin */ ms: [{ ms: scaleMargin() }], /** * Margin End * @see https://tailwindcss.com/docs/margin */ me: [{ me: scaleMargin() }], /** * Margin Top * @see https://tailwindcss.com/docs/margin */ mt: [{ mt: scaleMargin() }], /** * Margin Right * @see https://tailwindcss.com/docs/margin */ mr: [{ mr: scaleMargin() }], /** * Margin Bottom * @see https://tailwindcss.com/docs/margin */ mb: [{ mb: scaleMargin() }], /** * Margin Left * @see https://tailwindcss.com/docs/margin */ ml: [{ ml: scaleMargin() }], /** * Space Between X * @see https://tailwindcss.com/docs/margin#adding-space-between-children */ 'space-x': [{ 'space-x': scaleUnambiguousSpacing() }], /** * Space Between X Reverse * @see https://tailwindcss.com/docs/margin#adding-space-between-children */ 'space-x-reverse': ['space-x-reverse'], /** * Space Between Y * @see https://tailwindcss.com/docs/margin#adding-space-between-children */ 'space-y': [{ 'space-y': scaleUnambiguousSpacing() }], /** * Space Between Y Reverse * @see https://tailwindcss.com/docs/margin#adding-space-between-children */ 'space-y-reverse': ['space-y-reverse'], // -------------- // --- Sizing --- // -------------- /** * Size * @see https://tailwindcss.com/docs/width#setting-both-width-and-height */ size: [{ size: scaleSizing() }], /** * Width * @see https://tailwindcss.com/docs/width */ w: [{ w: [themeContainer, 'screen', ...scaleSizing()] }], /** * Min-Width * @see https://tailwindcss.com/docs/min-width */ 'min-w': [{ 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 'none', ...scaleSizing()] }], /** * Max-Width * @see https://tailwindcss.com/docs/max-width */ 'max-w': [{ 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ { screen: [themeBreakpoint] }, ...scaleSizing()] }], /** * Height * @see https://tailwindcss.com/docs/height */ h: [{ h: ['screen', 'lh', ...scaleSizing()] }], /** * Min-Height * @see https://tailwindcss.com/docs/min-height */ 'min-h': [{ 'min-h': ['screen', 'lh', 'none', ...scaleSizing()] }], /** * Max-Height * @see https://tailwindcss.com/docs/max-height */ 'max-h': [{ 'max-h': ['screen', 'lh', ...scaleSizing()] }], // ------------------ // --- Typography --- // ------------------ /** * Font Size * @see https://tailwindcss.com/docs/font-size */ 'font-size': [{ text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength] }], /** * Font Smoothing * @see https://tailwindcss.com/docs/font-smoothing */ 'font-smoothing': ['antialiased', 'subpixel-antialiased'], /** * Font Style * @see https://tailwindcss.com/docs/font-style */ 'font-style': ['italic', 'not-italic'], /** * Font Weight * @see https://tailwindcss.com/docs/font-weight */ 'font-weight': [{ font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber] }], /** * Font Stretch * @see https://tailwindcss.com/docs/font-stretch */ 'font-stretch': [{ 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue] }], /** * Font Family * @see https://tailwindcss.com/docs/font-family */ 'font-family': [{ font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont] }], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ 'fvn-normal': ['normal-nums'], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ 'fvn-ordinal': ['ordinal'], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ 'fvn-slashed-zero': ['slashed-zero'], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ 'fvn-figure': ['lining-nums', 'oldstyle-nums'], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ 'fvn-spacing': ['proportional-nums', 'tabular-nums'], /** * Font Variant Numeric * @see https://tailwindcss.com/docs/font-variant-numeric */ 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'], /** * Letter Spacing * @see https://tailwindcss.com/docs/letter-spacing */ tracking: [{ tracking: [themeTracking, isArbitraryVariable, isArbitraryValue] }], /** * Line Clamp * @see https://tailwindcss.com/docs/line-clamp */ 'line-clamp': [{ 'line-clamp': [isNumber$2, 'none', isArbitraryVariable, isArbitraryNumber] }], /** * Line Height * @see https://tailwindcss.com/docs/line-height */ leading: [{ leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ themeLeading, ...scaleUnambiguousSpacing()] }], /** * List Style Image * @see https://tailwindcss.com/docs/list-style-image */ 'list-image': [{ 'list-image': ['none', isArbitraryVariable, isArbitraryValue] }], /** * List Style Position * @see https://tailwindcss.com/docs/list-style-position */ 'list-style-position': [{ list: ['inside', 'outside'] }], /** * List Style Type * @see https://tailwindcss.com/docs/list-style-type */ 'list-style-type': [{ list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue] }], /** * Text Alignment * @see https://tailwindcss.com/docs/text-align */ 'text-alignment': [{ text: ['left', 'center', 'right', 'justify', 'start', 'end'] }], /** * Placeholder Color * @deprecated since Tailwind CSS v3.0.0 * @see https://v3.tailwindcss.com/docs/placeholder-color */ 'placeholder-color': [{ placeholder: scaleColor() }], /** * Text Color * @see https://tailwindcss.com/docs/text-color */ 'text-color': [{ text: scaleColor() }], /** * Text Decoration * @see https://tailwindcss.com/docs/text-decoration */ 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'], /** * Text Decoration Style * @see https://tailwindcss.com/docs/text-decoration-style */ 'text-decoration-style': [{ decoration: [...scaleLineStyle(), 'wavy'] }], /** * Text Decoration Thickness * @see https://tailwindcss.com/docs/text-decoration-thickness */ 'text-decoration-thickness': [{ decoration: [isNumber$2, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength] }], /** * Text Decoration Color * @see https://tailwindcss.com/docs/text-decoration-color */ 'text-decoration-color': [{ decoration: scaleColor() }], /** * Text Underline Offset * @see https://tailwindcss.com/docs/text-underline-offset */ 'underline-offset': [{ 'underline-offset': [isNumber$2, 'auto', isArbitraryVariable, isArbitraryValue] }], /** * Text Transform * @see https://tailwindcss.com/docs/text-transform */ 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'], /** * Text Overflow * @see https://tailwindcss.com/docs/text-overflow */ 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'], /** * Text Wrap * @see https://tailwindcss.com/docs/text-wrap */ 'text-wrap': [{ text: ['wrap', 'nowrap', 'balance', 'pretty'] }], /** * Text Indent * @see https://tailwindcss.com/docs/text-indent */ indent: [{ indent: scaleUnambiguousSpacing() }], /** * Vertical Alignment * @see https://tailwindcss.com/docs/vertical-align */ 'vertical-align': [{ align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue] }], /** * Whitespace * @see https://tailwindcss.com/docs/whitespace */ whitespace: [{ whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] }], /** * Word Break * @see https://tailwindcss.com/docs/word-break */ break: [{ break: ['normal', 'words', 'all', 'keep'] }], /** * Overflow Wrap * @see https://tailwindcss.com/docs/overflow-wrap */ wrap: [{ wrap: ['break-word', 'anywhere', 'normal'] }], /** * Hyphens * @see https://tailwindcss.com/docs/hyphens */ hyphens: [{ hyphens: ['none', 'manual', 'auto'] }], /** * Content * @see https://tailwindcss.com/docs/content */ content: [{ content: ['none', isArbitraryVariable, isArbitraryValue] }], // ------------------- // --- Backgrounds --- // ------------------- /** * Background Attachment * @see https://tailwindcss.com/docs/background-attachment */ 'bg-attachment': [{ bg: ['fixed', 'local', 'scroll'] }], /** * Background Clip * @see https://tailwindcss.com/docs/background-clip */ 'bg-clip': [{ 'bg-clip': ['border', 'padding', 'content', 'text'] }], /** * Background Origin * @see https://tailwindcss.com/docs/background-origin */ 'bg-origin': [{ 'bg-origin': ['border', 'padding', 'content'] }], /** * Background Position * @see https://tailwindcss.com/docs/background-position */ 'bg-position': [{ bg: scaleBgPosition() }], /** * Background Repeat * @see https://tailwindcss.com/docs/background-repeat */ 'bg-repeat': [{ bg: scaleBgRepeat() }], /** * Background Size * @see https://tailwindcss.com/docs/background-size */ 'bg-size': [{ bg: scaleBgSize() }], /** * Background Image * @see https://tailwindcss.com/docs/background-image */ 'bg-image': [{ bg: ['none', { linear: [{ to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl'] }, isInteger, isArbitraryVariable, isArbitraryValue], radial: ['', isArbitraryVariable, isArbitraryValue], conic: [isInteger, isArbitraryVariable, isArbitraryValue] }, isArbitraryVariableImage, isArbitraryImage] }], /** * Background Color * @see https://tailwindcss.com/docs/background-color */ 'bg-color': [{ bg: scaleColor() }], /** * Gradient Color Stops From Position * @see https://tailwindcss.com/docs/gradient-color-stops */ 'gradient-from-pos': [{ from: scaleGradientStopPosition() }], /** * Gradient Color Stops Via Position * @see https://tailwindcss.com/docs/gradient-color-stops */ 'gradient-via-pos': [{ via: scaleGradientStopPosition() }], /** * Gradient Color Stops To Position * @see https://tailwindcss.com/docs/gradient-color-stops */ 'gradient-to-pos': [{ to: scaleGradientStopPosition() }], /** * Gradient Color Stops From * @see https://tailwindcss.com/docs/gradient-color-stops */ 'gradient-from': [{ from: scaleColor() }], /** * Gradient Color Stops Via * @see https://tailwindcss.com/docs/gradient-color-stops */ 'gradient-via': [{ via: scaleColor() }], /** * Gradient Color Stops To * @see https://tailwindcss.com/docs/gradient-color-stops */ 'gradient-to': [{ to: scaleColor() }], // --------------- // --- Borders --- // --------------- /** * Border Radius * @see https://tailwindcss.com/docs/border-radius */ rounded: [{ rounded: scaleRadius() }], /** * Border Radius Start * @see https://tailwindcss.com/docs/border-radius */ 'rounded-s': [{ 'rounded-s': scaleRadius() }], /** * Border Radius End * @see https://tailwindcss.com/docs/border-radius */ 'rounded-e': [{ 'rounded-e': scaleRadius() }], /** * Border Radius Top * @see https://tailwindcss.com/docs/border-radius */ 'rounded-t': [{ 'rounded-t': scaleRadius() }], /** * Border Radius Right * @see https://tailwindcss.com/docs/border-radius */ 'rounded-r': [{ 'rounded-r': scaleRadius() }], /** * Border Radius Bottom * @see https://tailwindcss.com/docs/border-radius */ 'rounded-b': [{ 'rounded-b': scaleRadius() }], /** * Border Radius Left * @see https://tailwindcss.com/docs/border-radius */ 'rounded-l': [{ 'rounded-l': scaleRadius() }], /** * Border Radius Start Start * @see https://tailwindcss.com/docs/border-radius */ 'rounded-ss': [{ 'rounded-ss': scaleRadius() }], /** * Border Radius Start End * @see https://tailwindcss.com/docs/border-radius */ 'rounded-se': [{ 'rounded-se': scaleRadius() }], /** * Border Radius End End * @see https://tailwindcss.com/docs/border-radius */ 'rounded-ee': [{ 'rounded-ee': scaleRadius() }], /** * Border Radius End Start * @see https://tailwindcss.com/docs/border-radius */ 'rounded-es': [{ 'rounded-es': scaleRadius() }], /** * Border Radius Top Left * @see https://tailwindcss.com/docs/border-radius */ 'rounded-tl': [{ 'rounded-tl': scaleRadius() }], /** * Border Radius Top Right * @see https://tailwindcss.com/docs/border-radius */ 'rounded-tr': [{ 'rounded-tr': scaleRadius() }], /** * Border Radius Bottom Right * @see https://tailwindcss.com/docs/border-radius */ 'rounded-br': [{ 'rounded-br': scaleRadius() }], /** * Border Radius Bottom Left * @see https://tailwindcss.com/docs/border-radius */ 'rounded-bl': [{ 'rounded-bl': scaleRadius() }], /** * Border Width * @see https://tailwindcss.com/docs/border-width */ 'border-w': [{ border: scaleBorderWidth() }], /** * Border Width X * @see https://tailwindcss.com/docs/border-width */ 'border-w-x': [{ 'border-x': scaleBorderWidth() }], /** * Border Width Y * @see https://tailwindcss.com/docs/border-width */ 'border-w-y': [{ 'border-y': scaleBorderWidth() }], /** * Border Width Start * @see https://tailwindcss.com/docs/border-width */ 'border-w-s': [{ 'border-s': scaleBorderWidth() }], /** * Border Width End * @see https://tailwindcss.com/docs/border-width */ 'border-w-e': [{ 'border-e': scaleBorderWidth() }], /** * Border Width Top * @see https://tailwindcss.com/docs/border-width */ 'border-w-t': [{ 'border-t': scaleBorderWidth() }], /** * Border Width Right * @see https://tailwindcss.com/docs/border-width */ 'border-w-r': [{ 'border-r': scaleBorderWidth() }], /** * Border Width Bottom * @see https://tailwindcss.com/docs/border-width */ 'border-w-b': [{ 'border-b': scaleBorderWidth() }], /** * Border Width Left * @see https://tailwindcss.com/docs/border-width */ 'border-w-l': [{ 'border-l': scaleBorderWidth() }], /** * Divide Width X * @see https://tailwindcss.com/docs/border-width#between-children */ 'divide-x': [{ 'divide-x': scaleBorderWidth() }], /** * Divide Width X Reverse * @see https://tailwindcss.com/docs/border-width#between-children */ 'divide-x-reverse': ['divide-x-reverse'], /** * Divide Width Y * @see https://tailwindcss.com/docs/border-width#between-children */ 'divide-y': [{ 'divide-y': scaleBorderWidth() }], /** * Divide Width Y Reverse * @see https://tailwindcss.com/docs/border-width#between-children */ 'divide-y-reverse': ['divide-y-reverse'], /** * Border Style * @see https://tailwindcss.com/docs/border-style */ 'border-style': [{ border: [...scaleLineStyle(), 'hidden', 'none'] }], /** * Divide Style * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style */ 'divide-style': [{ divide: [...scaleLineStyle(), 'hidden', 'none'] }], /** * Border Color * @see https://tailwindcss.com/docs/border-color */ 'border-color': [{ border: scaleColor() }], /** * Border Color X * @see https://tailwindcss.com/docs/border-color */ 'border-color-x': [{ 'border-x': scaleColor() }], /** * Border Color Y * @see https://tailwindcss.com/docs/border-color */ 'border-color-y': [{ 'border-y': scaleColor() }], /** * Border Color S * @see https://tailwindcss.com/docs/border-color */ 'border-color-s': [{ 'border-s': scaleColor() }], /** * Border Color E * @see https://tailwindcss.com/docs/border-color */ 'border-color-e': [{ 'border-e': scaleColor() }], /** * Border Color Top * @see https://tailwindcss.com/docs/border-color */ 'border-color-t': [{ 'border-t': scaleColor() }], /** * Border Color Right * @see https://tailwindcss.com/docs/border-color */ 'border-color-r': [{ 'border-r': scaleColor() }], /** * Border Color Bottom * @see https://tailwindcss.com/docs/border-color */ 'border-color-b': [{ 'border-b': scaleColor() }], /** * Border Color Left * @see https://tailwindcss.com/docs/border-color */ 'border-color-l': [{ 'border-l': scaleColor() }], /** * Divide Color * @see https://tailwindcss.com/docs/divide-color */ 'divide-color': [{ divide: scaleColor() }], /** * Outline Style * @see https://tailwindcss.com/docs/outline-style */ 'outline-style': [{ outline: [...scaleLineStyle(), 'none', 'hidden'] }], /** * Outline Offset * @see https://tailwindcss.com/docs/outline-offset */ 'outline-offset': [{ 'outline-offset': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Outline Width * @see https://tailwindcss.com/docs/outline-width */ 'outline-w': [{ outline: ['', isNumber$2, isArbitraryVariableLength, isArbitraryLength] }], /** * Outline Color * @see https://tailwindcss.com/docs/outline-color */ 'outline-color': [{ outline: scaleColor() }], // --------------- // --- Effects --- // --------------- /** * Box Shadow * @see https://tailwindcss.com/docs/box-shadow */ shadow: [{ shadow: [ // Deprecated since Tailwind CSS v4.0.0 '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow] }], /** * Box Shadow Color * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color */ 'shadow-color': [{ shadow: scaleColor() }], /** * Inset Box Shadow * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow */ 'inset-shadow': [{ 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow] }], /** * Inset Box Shadow Color * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color */ 'inset-shadow-color': [{ 'inset-shadow': scaleColor() }], /** * Ring Width * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring */ 'ring-w': [{ ring: scaleBorderWidth() }], /** * Ring Width Inset * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings * @deprecated since Tailwind CSS v4.0.0 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 */ 'ring-w-inset': ['ring-inset'], /** * Ring Color * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color */ 'ring-color': [{ ring: scaleColor() }], /** * Ring Offset Width * @see https://v3.tailwindcss.com/docs/ring-offset-width * @deprecated since Tailwind CSS v4.0.0 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 */ 'ring-offset-w': [{ 'ring-offset': [isNumber$2, isArbitraryLength] }], /** * Ring Offset Color * @see https://v3.tailwindcss.com/docs/ring-offset-color * @deprecated since Tailwind CSS v4.0.0 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 */ 'ring-offset-color': [{ 'ring-offset': scaleColor() }], /** * Inset Ring Width * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring */ 'inset-ring-w': [{ 'inset-ring': scaleBorderWidth() }], /** * Inset Ring Color * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color */ 'inset-ring-color': [{ 'inset-ring': scaleColor() }], /** * Text Shadow * @see https://tailwindcss.com/docs/text-shadow */ 'text-shadow': [{ 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow] }], /** * Text Shadow Color * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color */ 'text-shadow-color': [{ 'text-shadow': scaleColor() }], /** * Opacity * @see https://tailwindcss.com/docs/opacity */ opacity: [{ opacity: [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Mix Blend Mode * @see https://tailwindcss.com/docs/mix-blend-mode */ 'mix-blend': [{ 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter'] }], /** * Background Blend Mode * @see https://tailwindcss.com/docs/background-blend-mode */ 'bg-blend': [{ 'bg-blend': scaleBlendMode() }], /** * Mask Clip * @see https://tailwindcss.com/docs/mask-clip */ 'mask-clip': [{ 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view'] }, 'mask-no-clip'], /** * Mask Composite * @see https://tailwindcss.com/docs/mask-composite */ 'mask-composite': [{ mask: ['add', 'subtract', 'intersect', 'exclude'] }], /** * Mask Image * @see https://tailwindcss.com/docs/mask-image */ 'mask-image-linear-pos': [{ 'mask-linear': [isNumber$2] }], 'mask-image-linear-from-pos': [{ 'mask-linear-from': scaleMaskImagePosition() }], 'mask-image-linear-to-pos': [{ 'mask-linear-to': scaleMaskImagePosition() }], 'mask-image-linear-from-color': [{ 'mask-linear-from': scaleColor() }], 'mask-image-linear-to-color': [{ 'mask-linear-to': scaleColor() }], 'mask-image-t-from-pos': [{ 'mask-t-from': scaleMaskImagePosition() }], 'mask-image-t-to-pos': [{ 'mask-t-to': scaleMaskImagePosition() }], 'mask-image-t-from-color': [{ 'mask-t-from': scaleColor() }], 'mask-image-t-to-color': [{ 'mask-t-to': scaleColor() }], 'mask-image-r-from-pos': [{ 'mask-r-from': scaleMaskImagePosition() }], 'mask-image-r-to-pos': [{ 'mask-r-to': scaleMaskImagePosition() }], 'mask-image-r-from-color': [{ 'mask-r-from': scaleColor() }], 'mask-image-r-to-color': [{ 'mask-r-to': scaleColor() }], 'mask-image-b-from-pos': [{ 'mask-b-from': scaleMaskImagePosition() }], 'mask-image-b-to-pos': [{ 'mask-b-to': scaleMaskImagePosition() }], 'mask-image-b-from-color': [{ 'mask-b-from': scaleColor() }], 'mask-image-b-to-color': [{ 'mask-b-to': scaleColor() }], 'mask-image-l-from-pos': [{ 'mask-l-from': scaleMaskImagePosition() }], 'mask-image-l-to-pos': [{ 'mask-l-to': scaleMaskImagePosition() }], 'mask-image-l-from-color': [{ 'mask-l-from': scaleColor() }], 'mask-image-l-to-color': [{ 'mask-l-to': scaleColor() }], 'mask-image-x-from-pos': [{ 'mask-x-from': scaleMaskImagePosition() }], 'mask-image-x-to-pos': [{ 'mask-x-to': scaleMaskImagePosition() }], 'mask-image-x-from-color': [{ 'mask-x-from': scaleColor() }], 'mask-image-x-to-color': [{ 'mask-x-to': scaleColor() }], 'mask-image-y-from-pos': [{ 'mask-y-from': scaleMaskImagePosition() }], 'mask-image-y-to-pos': [{ 'mask-y-to': scaleMaskImagePosition() }], 'mask-image-y-from-color': [{ 'mask-y-from': scaleColor() }], 'mask-image-y-to-color': [{ 'mask-y-to': scaleColor() }], 'mask-image-radial': [{ 'mask-radial': [isArbitraryVariable, isArbitraryValue] }], 'mask-image-radial-from-pos': [{ 'mask-radial-from': scaleMaskImagePosition() }], 'mask-image-radial-to-pos': [{ 'mask-radial-to': scaleMaskImagePosition() }], 'mask-image-radial-from-color': [{ 'mask-radial-from': scaleColor() }], 'mask-image-radial-to-color': [{ 'mask-radial-to': scaleColor() }], 'mask-image-radial-shape': [{ 'mask-radial': ['circle', 'ellipse'] }], 'mask-image-radial-size': [{ 'mask-radial': [{ closest: ['side', 'corner'], farthest: ['side', 'corner'] }] }], 'mask-image-radial-pos': [{ 'mask-radial-at': scalePosition() }], 'mask-image-conic-pos': [{ 'mask-conic': [isNumber$2] }], 'mask-image-conic-from-pos': [{ 'mask-conic-from': scaleMaskImagePosition() }], 'mask-image-conic-to-pos': [{ 'mask-conic-to': scaleMaskImagePosition() }], 'mask-image-conic-from-color': [{ 'mask-conic-from': scaleColor() }], 'mask-image-conic-to-color': [{ 'mask-conic-to': scaleColor() }], /** * Mask Mode * @see https://tailwindcss.com/docs/mask-mode */ 'mask-mode': [{ mask: ['alpha', 'luminance', 'match'] }], /** * Mask Origin * @see https://tailwindcss.com/docs/mask-origin */ 'mask-origin': [{ 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view'] }], /** * Mask Position * @see https://tailwindcss.com/docs/mask-position */ 'mask-position': [{ mask: scaleBgPosition() }], /** * Mask Repeat * @see https://tailwindcss.com/docs/mask-repeat */ 'mask-repeat': [{ mask: scaleBgRepeat() }], /** * Mask Size * @see https://tailwindcss.com/docs/mask-size */ 'mask-size': [{ mask: scaleBgSize() }], /** * Mask Type * @see https://tailwindcss.com/docs/mask-type */ 'mask-type': [{ 'mask-type': ['alpha', 'luminance'] }], /** * Mask Image * @see https://tailwindcss.com/docs/mask-image */ 'mask-image': [{ mask: ['none', isArbitraryVariable, isArbitraryValue] }], // --------------- // --- Filters --- // --------------- /** * Filter * @see https://tailwindcss.com/docs/filter */ filter: [{ filter: [ // Deprecated since Tailwind CSS v3.0.0 '', 'none', isArbitraryVariable, isArbitraryValue] }], /** * Blur * @see https://tailwindcss.com/docs/blur */ blur: [{ blur: scaleBlur() }], /** * Brightness * @see https://tailwindcss.com/docs/brightness */ brightness: [{ brightness: [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Contrast * @see https://tailwindcss.com/docs/contrast */ contrast: [{ contrast: [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Drop Shadow * @see https://tailwindcss.com/docs/drop-shadow */ 'drop-shadow': [{ 'drop-shadow': [ // Deprecated since Tailwind CSS v4.0.0 '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow] }], /** * Drop Shadow Color * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color */ 'drop-shadow-color': [{ 'drop-shadow': scaleColor() }], /** * Grayscale * @see https://tailwindcss.com/docs/grayscale */ grayscale: [{ grayscale: ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Hue Rotate * @see https://tailwindcss.com/docs/hue-rotate */ 'hue-rotate': [{ 'hue-rotate': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Invert * @see https://tailwindcss.com/docs/invert */ invert: [{ invert: ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Saturate * @see https://tailwindcss.com/docs/saturate */ saturate: [{ saturate: [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Sepia * @see https://tailwindcss.com/docs/sepia */ sepia: [{ sepia: ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Filter * @see https://tailwindcss.com/docs/backdrop-filter */ 'backdrop-filter': [{ 'backdrop-filter': [ // Deprecated since Tailwind CSS v3.0.0 '', 'none', isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Blur * @see https://tailwindcss.com/docs/backdrop-blur */ 'backdrop-blur': [{ 'backdrop-blur': scaleBlur() }], /** * Backdrop Brightness * @see https://tailwindcss.com/docs/backdrop-brightness */ 'backdrop-brightness': [{ 'backdrop-brightness': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Contrast * @see https://tailwindcss.com/docs/backdrop-contrast */ 'backdrop-contrast': [{ 'backdrop-contrast': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Grayscale * @see https://tailwindcss.com/docs/backdrop-grayscale */ 'backdrop-grayscale': [{ 'backdrop-grayscale': ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Hue Rotate * @see https://tailwindcss.com/docs/backdrop-hue-rotate */ 'backdrop-hue-rotate': [{ 'backdrop-hue-rotate': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Invert * @see https://tailwindcss.com/docs/backdrop-invert */ 'backdrop-invert': [{ 'backdrop-invert': ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Opacity * @see https://tailwindcss.com/docs/backdrop-opacity */ 'backdrop-opacity': [{ 'backdrop-opacity': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Saturate * @see https://tailwindcss.com/docs/backdrop-saturate */ 'backdrop-saturate': [{ 'backdrop-saturate': [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Backdrop Sepia * @see https://tailwindcss.com/docs/backdrop-sepia */ 'backdrop-sepia': [{ 'backdrop-sepia': ['', isNumber$2, isArbitraryVariable, isArbitraryValue] }], // -------------- // --- Tables --- // -------------- /** * Border Collapse * @see https://tailwindcss.com/docs/border-collapse */ 'border-collapse': [{ border: ['collapse', 'separate'] }], /** * Border Spacing * @see https://tailwindcss.com/docs/border-spacing */ 'border-spacing': [{ 'border-spacing': scaleUnambiguousSpacing() }], /** * Border Spacing X * @see https://tailwindcss.com/docs/border-spacing */ 'border-spacing-x': [{ 'border-spacing-x': scaleUnambiguousSpacing() }], /** * Border Spacing Y * @see https://tailwindcss.com/docs/border-spacing */ 'border-spacing-y': [{ 'border-spacing-y': scaleUnambiguousSpacing() }], /** * Table Layout * @see https://tailwindcss.com/docs/table-layout */ 'table-layout': [{ table: ['auto', 'fixed'] }], /** * Caption Side * @see https://tailwindcss.com/docs/caption-side */ caption: [{ caption: ['top', 'bottom'] }], // --------------------------------- // --- Transitions and Animation --- // --------------------------------- /** * Transition Property * @see https://tailwindcss.com/docs/transition-property */ transition: [{ transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue] }], /** * Transition Behavior * @see https://tailwindcss.com/docs/transition-behavior */ 'transition-behavior': [{ transition: ['normal', 'discrete'] }], /** * Transition Duration * @see https://tailwindcss.com/docs/transition-duration */ duration: [{ duration: [isNumber$2, 'initial', isArbitraryVariable, isArbitraryValue] }], /** * Transition Timing Function * @see https://tailwindcss.com/docs/transition-timing-function */ ease: [{ ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue] }], /** * Transition Delay * @see https://tailwindcss.com/docs/transition-delay */ delay: [{ delay: [isNumber$2, isArbitraryVariable, isArbitraryValue] }], /** * Animation * @see https://tailwindcss.com/docs/animation */ animate: [{ animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue] }], // ------------------ // --- Transforms --- // ------------------ /** * Backface Visibility * @see https://tailwindcss.com/docs/backface-visibility */ backface: [{ backface: ['hidden', 'visible'] }], /** * Perspective * @see https://tailwindcss.com/docs/perspective */ perspective: [{ perspective: [themePerspective, isArbitraryVariable, isArbitraryValue] }], /** * Perspective Origin * @see https://tailwindcss.com/docs/perspective-origin */ 'perspective-origin': [{ 'perspective-origin': scalePositionWithArbitrary() }], /** * Rotate * @see https://tailwindcss.com/docs/rotate */ rotate: [{ rotate: scaleRotate() }], /** * Rotate X * @see https://tailwindcss.com/docs/rotate */ 'rotate-x': [{ 'rotate-x': scaleRotate() }], /** * Rotate Y * @see https://tailwindcss.com/docs/rotate */ 'rotate-y': [{ 'rotate-y': scaleRotate() }], /** * Rotate Z * @see https://tailwindcss.com/docs/rotate */ 'rotate-z': [{ 'rotate-z': scaleRotate() }], /** * Scale * @see https://tailwindcss.com/docs/scale */ scale: [{ scale: scaleScale() }], /** * Scale X * @see https://tailwindcss.com/docs/scale */ 'scale-x': [{ 'scale-x': scaleScale() }], /** * Scale Y * @see https://tailwindcss.com/docs/scale */ 'scale-y': [{ 'scale-y': scaleScale() }], /** * Scale Z * @see https://tailwindcss.com/docs/scale */ 'scale-z': [{ 'scale-z': scaleScale() }], /** * Scale 3D * @see https://tailwindcss.com/docs/scale */ 'scale-3d': ['scale-3d'], /** * Skew * @see https://tailwindcss.com/docs/skew */ skew: [{ skew: scaleSkew() }], /** * Skew X * @see https://tailwindcss.com/docs/skew */ 'skew-x': [{ 'skew-x': scaleSkew() }], /** * Skew Y * @see https://tailwindcss.com/docs/skew */ 'skew-y': [{ 'skew-y': scaleSkew() }], /** * Transform * @see https://tailwindcss.com/docs/transform */ transform: [{ transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu'] }], /** * Transform Origin * @see https://tailwindcss.com/docs/transform-origin */ 'transform-origin': [{ origin: scalePositionWithArbitrary() }], /** * Transform Style * @see https://tailwindcss.com/docs/transform-style */ 'transform-style': [{ transform: ['3d', 'flat'] }], /** * Translate * @see https://tailwindcss.com/docs/translate */ translate: [{ translate: scaleTranslate() }], /** * Translate X * @see https://tailwindcss.com/docs/translate */ 'translate-x': [{ 'translate-x': scaleTranslate() }], /** * Translate Y * @see https://tailwindcss.com/docs/translate */ 'translate-y': [{ 'translate-y': scaleTranslate() }], /** * Translate Z * @see https://tailwindcss.com/docs/translate */ 'translate-z': [{ 'translate-z': scaleTranslate() }], /** * Translate None * @see https://tailwindcss.com/docs/translate */ 'translate-none': ['translate-none'], // --------------------- // --- Interactivity --- // --------------------- /** * Accent Color * @see https://tailwindcss.com/docs/accent-color */ accent: [{ accent: scaleColor() }], /** * Appearance * @see https://tailwindcss.com/docs/appearance */ appearance: [{ appearance: ['none', 'auto'] }], /** * Caret Color * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities */ 'caret-color': [{ caret: scaleColor() }], /** * Color Scheme * @see https://tailwindcss.com/docs/color-scheme */ 'color-scheme': [{ scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light'] }], /** * Cursor * @see https://tailwindcss.com/docs/cursor */ cursor: [{ cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue] }], /** * Field Sizing * @see https://tailwindcss.com/docs/field-sizing */ 'field-sizing': [{ 'field-sizing': ['fixed', 'content'] }], /** * Pointer Events * @see https://tailwindcss.com/docs/pointer-events */ 'pointer-events': [{ 'pointer-events': ['auto', 'none'] }], /** * Resize * @see https://tailwindcss.com/docs/resize */ resize: [{ resize: ['none', '', 'y', 'x'] }], /** * Scroll Behavior * @see https://tailwindcss.com/docs/scroll-behavior */ 'scroll-behavior': [{ scroll: ['auto', 'smooth'] }], /** * Scroll Margin * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-m': [{ 'scroll-m': scaleUnambiguousSpacing() }], /** * Scroll Margin X * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-mx': [{ 'scroll-mx': scaleUnambiguousSpacing() }], /** * Scroll Margin Y * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-my': [{ 'scroll-my': scaleUnambiguousSpacing() }], /** * Scroll Margin Start * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-ms': [{ 'scroll-ms': scaleUnambiguousSpacing() }], /** * Scroll Margin End * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-me': [{ 'scroll-me': scaleUnambiguousSpacing() }], /** * Scroll Margin Top * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-mt': [{ 'scroll-mt': scaleUnambiguousSpacing() }], /** * Scroll Margin Right * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-mr': [{ 'scroll-mr': scaleUnambiguousSpacing() }], /** * Scroll Margin Bottom * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-mb': [{ 'scroll-mb': scaleUnambiguousSpacing() }], /** * Scroll Margin Left * @see https://tailwindcss.com/docs/scroll-margin */ 'scroll-ml': [{ 'scroll-ml': scaleUnambiguousSpacing() }], /** * Scroll Padding * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-p': [{ 'scroll-p': scaleUnambiguousSpacing() }], /** * Scroll Padding X * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-px': [{ 'scroll-px': scaleUnambiguousSpacing() }], /** * Scroll Padding Y * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-py': [{ 'scroll-py': scaleUnambiguousSpacing() }], /** * Scroll Padding Start * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-ps': [{ 'scroll-ps': scaleUnambiguousSpacing() }], /** * Scroll Padding End * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-pe': [{ 'scroll-pe': scaleUnambiguousSpacing() }], /** * Scroll Padding Top * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-pt': [{ 'scroll-pt': scaleUnambiguousSpacing() }], /** * Scroll Padding Right * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-pr': [{ 'scroll-pr': scaleUnambiguousSpacing() }], /** * Scroll Padding Bottom * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-pb': [{ 'scroll-pb': scaleUnambiguousSpacing() }], /** * Scroll Padding Left * @see https://tailwindcss.com/docs/scroll-padding */ 'scroll-pl': [{ 'scroll-pl': scaleUnambiguousSpacing() }], /** * Scroll Snap Align * @see https://tailwindcss.com/docs/scroll-snap-align */ 'snap-align': [{ snap: ['start', 'end', 'center', 'align-none'] }], /** * Scroll Snap Stop * @see https://tailwindcss.com/docs/scroll-snap-stop */ 'snap-stop': [{ snap: ['normal', 'always'] }], /** * Scroll Snap Type * @see https://tailwindcss.com/docs/scroll-snap-type */ 'snap-type': [{ snap: ['none', 'x', 'y', 'both'] }], /** * Scroll Snap Type Strictness * @see https://tailwindcss.com/docs/scroll-snap-type */ 'snap-strictness': [{ snap: ['mandatory', 'proximity'] }], /** * Touch Action * @see https://tailwindcss.com/docs/touch-action */ touch: [{ touch: ['auto', 'none', 'manipulation'] }], /** * Touch Action X * @see https://tailwindcss.com/docs/touch-action */ 'touch-x': [{ 'touch-pan': ['x', 'left', 'right'] }], /** * Touch Action Y * @see https://tailwindcss.com/docs/touch-action */ 'touch-y': [{ 'touch-pan': ['y', 'up', 'down'] }], /** * Touch Action Pinch Zoom * @see https://tailwindcss.com/docs/touch-action */ 'touch-pz': ['touch-pinch-zoom'], /** * User Select * @see https://tailwindcss.com/docs/user-select */ select: [{ select: ['none', 'text', 'all', 'auto'] }], /** * Will Change * @see https://tailwindcss.com/docs/will-change */ 'will-change': [{ 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue] }], // ----------- // --- SVG --- // ----------- /** * Fill * @see https://tailwindcss.com/docs/fill */ fill: [{ fill: ['none', ...scaleColor()] }], /** * Stroke Width * @see https://tailwindcss.com/docs/stroke-width */ 'stroke-w': [{ stroke: [isNumber$2, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber] }], /** * Stroke * @see https://tailwindcss.com/docs/stroke */ stroke: [{ stroke: ['none', ...scaleColor()] }], // --------------------- // --- Accessibility --- // --------------------- /** * Forced Color Adjust * @see https://tailwindcss.com/docs/forced-color-adjust */ 'forced-color-adjust': [{ 'forced-color-adjust': ['auto', 'none'] }] }, conflictingClassGroups: { overflow: ['overflow-x', 'overflow-y'], overscroll: ['overscroll-x', 'overscroll-y'], inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'], 'inset-x': ['right', 'left'], 'inset-y': ['top', 'bottom'], flex: ['basis', 'grow', 'shrink'], gap: ['gap-x', 'gap-y'], p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'], px: ['pr', 'pl'], py: ['pt', 'pb'], m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'], mx: ['mr', 'ml'], my: ['mt', 'mb'], size: ['w', 'h'], 'font-size': ['leading'], 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'], 'fvn-ordinal': ['fvn-normal'], 'fvn-slashed-zero': ['fvn-normal'], 'fvn-figure': ['fvn-normal'], 'fvn-spacing': ['fvn-normal'], 'fvn-fraction': ['fvn-normal'], 'line-clamp': ['display', 'overflow'], rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'], 'rounded-s': ['rounded-ss', 'rounded-es'], 'rounded-e': ['rounded-se', 'rounded-ee'], 'rounded-t': ['rounded-tl', 'rounded-tr'], 'rounded-r': ['rounded-tr', 'rounded-br'], 'rounded-b': ['rounded-br', 'rounded-bl'], 'rounded-l': ['rounded-tl', 'rounded-bl'], 'border-spacing': ['border-spacing-x', 'border-spacing-y'], 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'], 'border-w-x': ['border-w-r', 'border-w-l'], 'border-w-y': ['border-w-t', 'border-w-b'], 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'], 'border-color-x': ['border-color-r', 'border-color-l'], 'border-color-y': ['border-color-t', 'border-color-b'], translate: ['translate-x', 'translate-y', 'translate-none'], 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'], 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'], 'scroll-mx': ['scroll-mr', 'scroll-ml'], 'scroll-my': ['scroll-mt', 'scroll-mb'], 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'], 'scroll-px': ['scroll-pr', 'scroll-pl'], 'scroll-py': ['scroll-pt', 'scroll-pb'], touch: ['touch-x', 'touch-y', 'touch-pz'], 'touch-x': ['touch'], 'touch-y': ['touch'], 'touch-pz': ['touch'] }, conflictingClassGroupModifiers: { 'font-size': ['leading'] }, orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection'] }; }; const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig); const WIDGET_HOST_ID = "wisebot-widget-host"; const WIDGET_ROOT_ID = "wisebot-widget-root"; const WIDGET_APP_ID = "wisebot-widget-app"; const WIDGET_HIGHLIGHT_ID = "wisebot-widget-highlight"; const CHAT_SESSION_KEY = "wisebot-chat-session"; const CHAT_VERSION_KEY = "wisebot-chat-version"; const WIDGET_DEFAULT_COLOR = "#165DFB"; const STOP_WORDS = /* @__PURE__ */ new Set([ "алло", "без", "близко", "более", "больше", "будем", "будет", "будете", "будешь", "будто", "буду", "будут", "будь", "бы", "бывает", "бывь", "был", "была", "были", "было", "быть", "в", "важная", "важное", "важные", "важный", "вам", "вами", "вас", "ваш", "ваша", "ваше", "ваши", "вверх", "вдали", "вдруг", "ведь", "везде", "весь", "вниз", "внизу", "во", "вокруг", "вон", "восемнадцатый", "восемнадцать", "восемь", "восьмой", "вот", "впрочем", "времени", "время", "все", "всегда", "всего", "всем", "всеми", "всему", "всех", "всею", "всю", "всюду", "вся", "всё", "второй", "вы", "г", "где", "говорил", "говорит", "год", "года", "году", "да", "давно", "даже", "далеко", "дальше", "даром", "два", "двадцатый", "двадцать", "две", "двенадцатый", "двенадцать", "двух", "девятнадцатый", "девятнадцать", "девятый", "девять", "действительно", "дел", "день", "десятый", "десять", "для", "до", "довольно", "долго", "должно", "другая", "другие", "других", "друго", "другое", "другой", "е", "его", "ее", "ей", "ему", "если", "есть", "еще", "ещё", "ею", "её", "ж", "же", "жизнь", "за", "занят", "занята", "занято", "заняты", "затем", "зато", "зачем", "здесь", "значит", "и", "из", "или", "им", "именно", "иметь", "ими", "имя", "иногда", "их", "к", "каждая", "каждое", "каждые", "каждый", "кажется", "как", "какая", "какой", "кем", "когда", "кого", "ком", "кому", "конечно", "которая", "которого", "которой", "которые", "который", "которых", "кроме", "кругом", "кто", "куда", "лет", "ли", "лишь", "лучше", "люди", "м", "мало", "между", "меля", "менее", "меньше", "меня", "миллионов", "мимо", "мира", "мне", "много", "многочисленная", "многочисленное", "многочисленные", "многочисленный", "мной", "мною", "мог", "могут", "мож", "может", "можно", "можхо", "мои", "мой", "мор", "мочь", "моя", "моё", "мы", "на", "наверху", "над", "надо", "назад", "наиболее", "наконец", "нам", "нами", "нас", "начала", "наш", "наша", "наше", "наши", "не", "него", "недавно", "недалеко", "нее", "ней", "нельзя", "нем", "немного", "нему", "непрерывно", "нередко", "несколько", "нет", "нею", "неё", "ни", "нибудь", "ниже", "низко", "никогда", "никуда", "ними", "них", "ничего", "но", "ну", "нужно", "нх", "о", "об", "оба", "обычно", "один", "одиннадцатый", "одиннадцать", "однажды", "однако", "одного", "одной", "около", "он", "она", "они", "оно", "опять", "особенно", "от", "отовсюду", "отсюда", "очень", "первый", "перед", "по", "под", "пожалуйста", "позже", "пока", "пор", "пора", "после", "посреди", "потом", "потому", "почему", "почти", "прекрасно", "при", "про", "просто", "против", "процентов", "пятнадцатый", "пятнадцать", "пятый", "пять", "раз", "разве", "рано", "раньше", "рядом", "с", "сам", "сама", "сами", "самим", "самими", "самих", "само", "самого", "самой", "самом", "самому", "саму", "свое", "своего", "своей", "свои", "своих", "свою", "сеаой", "себе", "себя", "сегодня", "седьмой", "сейчас", "семнадцатый", "семнадцать", "семь", "сих", "сказал", "сказала", "сказать", "сколько", "слишком", "сначала", "снова", "со", "собой", "собою", "совсем", "спасибо", "стал", "суть", "т", "та", "так", "такая", "также", "такие", "такое", "такой", "там", "твой", "твоя", "твоё", "те", "тебе", "тебя", "тем", "теми", "теперь", "тех", "то", "тобой", "тобою", "тогда", "того", "тоже", "только", "том", "тому", "тот", "тою", "третий", "три", "тринадцатый", "тринадцать", "ту", "туда", "тут", "ты", "тысяч", "у", "уж", "уже", "уметь", "хорошо", "хотеть", "хоть", "хотя", "хочешь", "часто", "чаще", "чего", "человек", "чем", "чему", "через", "четвертый", "четыре", "четырнадцатый", "четырнадцать", "что", "чтоб", "чтобы", "чуть", "шестнадцатый", "шестнадцать", "шестой", "шесть", "эта", "эти", "этим", "этими", "этих", "это", "этого", "этой", "этом", "этому", "этот", "эту", "я", "а" ]); function cn(...inputs) { return twMerge(clsx(inputs)); } function getRoot(isInShadowRoot) { let root = document.body; if (isInShadowRoot) { const host = document.querySelector(`#${WIDGET_HOST_ID}`); if (host?.shadowRoot) root = host.shadowRoot; } return root; } function formatBytes(bytes) { if (bytes === 0) return "0 B"; const sizes = ["B", "KB", "MB", "GB", "TB"]; const i = Math.floor(Math.log(bytes) / Math.log(1024)); return `${(bytes / 1024 ** i).toFixed(i ? 1 : 0)} ${sizes[i]}`; } function formatTooltipPayload(payload) { return payload.startsWith("/") ? payload : `/${payload}`; } function isTouchDevice() { if (typeof window === "undefined" || typeof navigator === "undefined") return false; const nav = navigator; return "ontouchstart" in window || nav.maxTouchPoints && nav.maxTouchPoints > 0 || nav.msMaxTouchPoints && nav.msMaxTouchPoints > 0; } const buttonVariants = cva( "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", { variants: { variant: { default: "bg-primary lucide hover:bg-primary/90 shadow-xs", destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs", outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs", ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", link: "lucide-foreground underline-offset-4 hover:underline" }, size: { default: "h-9 px-4 py-2 has-[>svg]:px-3", sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5", lg: "h-10 rounded-md px-6 has-[>svg]:px-4", icon: "size-9" } }, defaultVariants: { variant: "default", size: "default" } } ); const Button = React.forwardRef(({ asChild = false, className, size, variant, ...props }, ref) => { const Comp = asChild ? Slot$2 : "button"; return /* @__PURE__ */ jsxRuntimeExports.jsx( Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ref, ...props } ); }); Button.displayName = "Button"; function Card({ className, variant, ...props }) { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { "data-slot": "card", "data-variant": variant, className: cn( "bg-card text-card-foreground isolate flex flex-col overflow-hidden rounded-none md:rounded-xl", "[&[data-variant=embedded]]:h-full [&[data-variant=embedded]]:w-full [&[data-variant=embedded]]:rounded-none [&[data-variant=embedded]]:shadow-none", "[&[data-variant=fullscreen]]:h-full [&[data-variant=fullscreen]]:w-full [&[data-variant=fullscreen]]:rounded-none [&[data-variant=fullscreen]]:shadow-none", "[&[data-variant=carousel]]:bg-muted/60 [&[data-variant=carousel]]:border-muted [&[data-variant=carousel]]:rounded-lg [&[data-variant=carousel]]:border [&[data-variant=carousel]]:shadow-sm [&[data-variant=carousel]]:transition-all [&[data-variant=carousel]]:duration-300", className ), ...props } ); } function CardHeader({ className, ...props }) { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { "data-slot": "card-header", className: cn( "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5", "has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className ), ...props } ); } function CardTitle({ className, ...props }) { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { "data-slot": "card-title", className: cn("leading-none font-semibold", className), ...props } ); } function CardDescription({ className, ...props }) { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { "data-slot": "card-description", className: cn("lucide-muted-foreground text-sm", className), ...props } ); } const CardContent = React.forwardRef(({ className, ...props }, ref) => { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { ref, "data-slot": "card-content", className: cn("px-3 sm:px-4", className), ...props } ); }); CardContent.displayName = "CardContent"; function CardFooter({ className, ...props }) { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { "data-slot": "card-footer", className: cn("flex items-center px-4 [.border-t]:pt-6", className), ...props } ); } // src/primitive.tsx function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { return function handleEvent(event) { originalEventHandler?.(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) { return ourEventHandler?.(event); } }; } // packages/react/context/src/create-context.tsx function createContext2(rootComponentName, defaultContext) { const Context = React.createContext(defaultContext); const Provider = (props) => { const { children, ...context } = props; const value = React.useMemo(() => context, Object.values(context)); return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children }); }; Provider.displayName = rootComponentName + "Provider"; function useContext2(consumerName) { const context = React.useContext(Context); if (context) return context; if (defaultContext !== void 0) return defaultContext; throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } return [Provider, useContext2]; } function createContextScope(scopeName, createContextScopeDeps = []) { let defaultContexts = []; function createContext3(rootComponentName, defaultContext) { const BaseContext = React.createContext(defaultContext); const index = defaultContexts.length; defaultContexts = [...defaultContexts, defaultContext]; const Provider = (props) => { const { scope, children, ...context } = props; const Context = scope?.[scopeName]?.[index] || BaseContext; const value = React.useMemo(() => context, Object.values(context)); return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children }); }; Provider.displayName = rootComponentName + "Provider"; function useContext2(consumerName, scope) { const Context = scope?.[scopeName]?.[index] || BaseContext; const context = React.useContext(Context); if (context) return context; if (defaultContext !== void 0) return defaultContext; throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } return [Provider, useContext2]; } const createScope = () => { const scopeContexts = defaultContexts.map((defaultContext) => { return React.createContext(defaultContext); }); return function useScope(scope) { const contexts = scope?.[scopeName] || scopeContexts; return React.useMemo( () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts] ); }; }; createScope.scopeName = scopeName; return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; } function composeContextScopes(...scopes) { const baseScope = scopes[0]; if (scopes.length === 1) return baseScope; const createScope = () => { const scopeHooks = scopes.map((createScope2) => ({ useScope: createScope2(), scopeName: createScope2.scopeName })); return function useComposedScopes(overrideScopes) { const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { const scopeProps = useScope(overrideScopes); const currentScope = scopeProps[`__scope${scopeName}`]; return { ...nextScopes2, ...currentScope }; }, {}); return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); }; }; createScope.scopeName = baseScope.scopeName; return createScope; } // src/primitive.tsx var NODES = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ]; var Primitive = NODES.reduce((primitive, node) => { const Slot = createSlot(`Primitive.${node}`); const Node = React.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot : node; if (typeof window !== "undefined") { window[Symbol.for("radix-ui")] = true; } return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node }; }, {}); function dispatchDiscreteCustomEvent(target, event) { if (target) ReactDOM.flushSync(() => target.dispatchEvent(event)); } // packages/react/use-callback-ref/src/use-callback-ref.tsx function useCallbackRef$1(callback) { const callbackRef = React.useRef(callback); React.useEffect(() => { callbackRef.current = callback; }); return React.useMemo(() => (...args) => callbackRef.current?.(...args), []); } // packages/react/use-escape-keydown/src/use-escape-keydown.tsx function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) { const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp); React.useEffect(() => { const handleKeyDown = (event) => { if (event.key === "Escape") { onEscapeKeyDown(event); } }; ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true }); return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true }); }, [onEscapeKeyDown, ownerDocument]); } var DISMISSABLE_LAYER_NAME = "DismissableLayer"; var CONTEXT_UPDATE = "dismissableLayer.update"; var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; var originalBodyPointerEvents; var DismissableLayerContext = React.createContext({ layers: /* @__PURE__ */ new Set(), layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), branches: /* @__PURE__ */ new Set() }); var DismissableLayer = React.forwardRef( (props, forwardedRef) => { const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props; const context = React.useContext(DismissableLayerContext); const [node, setNode] = React.useState(null); const ownerDocument = node?.ownerDocument ?? globalThis?.document; const [, force] = React.useState({}); const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2)); const layers = Array.from(context.layers); const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); const index = node ? layers.indexOf(node) : -1; const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; const pointerDownOutside = usePointerDownOutside((event) => { const target = event.target; const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target)); if (!isPointerEventsEnabled || isPointerDownOnBranch) return; onPointerDownOutside?.(event); onInteractOutside?.(event); if (!event.defaultPrevented) onDismiss?.(); }, ownerDocument); const focusOutside = useFocusOutside((event) => { const target = event.target; const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); if (isFocusInBranch) return; onFocusOutside?.(event); onInteractOutside?.(event); if (!event.defaultPrevented) onDismiss?.(); }, ownerDocument); useEscapeKeydown((event) => { const isHighestLayer = index === context.layers.size - 1; if (!isHighestLayer) return; onEscapeKeyDown?.(event); if (!event.defaultPrevented && onDismiss) { event.preventDefault(); onDismiss(); } }, ownerDocument); React.useEffect(() => { if (!node) return; if (disableOutsidePointerEvents) { if (context.layersWithOutsidePointerEventsDisabled.size === 0) { originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; ownerDocument.body.style.pointerEvents = "none"; } context.layersWithOutsidePointerEventsDisabled.add(node); } context.layers.add(node); dispatchUpdate(); return () => { if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) { ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; } }; }, [node, ownerDocument, disableOutsidePointerEvents, context]); React.useEffect(() => { return () => { if (!node) return; context.layers.delete(node); context.layersWithOutsidePointerEventsDisabled.delete(node); dispatchUpdate(); }; }, [node, context]); React.useEffect(() => { const handleUpdate = () => force({}); document.addEventListener(CONTEXT_UPDATE, handleUpdate); return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); }, []); return /* @__PURE__ */ jsxRuntimeExports.jsx( Primitive.div, { ...layerProps, ref: composedRefs, style: { pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, ...props.style }, onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), onPointerDownCapture: composeEventHandlers( props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture ) } ); } ); DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; var BRANCH_NAME = "DismissableLayerBranch"; var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => { const context = React.useContext(DismissableLayerContext); const ref = React.useRef(null); const composedRefs = useComposedRefs(forwardedRef, ref); React.useEffect(() => { const node = ref.current; if (node) { context.branches.add(node); return () => { context.branches.delete(node); }; } }, [context.branches]); return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs }); }); DismissableLayerBranch.displayName = BRANCH_NAME; function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) { const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside); const isPointerInsideReactTreeRef = React.useRef(false); const handleClickRef = React.useRef(() => { }); React.useEffect(() => { const handlePointerDown = (event) => { if (event.target && !isPointerInsideReactTreeRef.current) { let handleAndDispatchPointerDownOutsideEvent2 = function() { handleAndDispatchCustomEvent( POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true } ); }; const eventDetail = { originalEvent: event }; if (event.pointerType === "touch") { ownerDocument.removeEventListener("click", handleClickRef.current); handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); } else { handleAndDispatchPointerDownOutsideEvent2(); } } else { ownerDocument.removeEventListener("click", handleClickRef.current); } isPointerInsideReactTreeRef.current = false; }; const timerId = window.setTimeout(() => { ownerDocument.addEventListener("pointerdown", handlePointerDown); }, 0); return () => { window.clearTimeout(timerId); ownerDocument.removeEventListener("pointerdown", handlePointerDown); ownerDocument.removeEventListener("click", handleClickRef.current); }; }, [ownerDocument, handlePointerDownOutside]); return { // ensures we check React component tree (not just DOM tree) onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true }; } function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { const handleFocusOutside = useCallbackRef$1(onFocusOutside); const isFocusInsideReactTreeRef = React.useRef(false); React.useEffect(() => { const handleFocus = (event) => { if (event.target && !isFocusInsideReactTreeRef.current) { const eventDetail = { originalEvent: event }; handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { discrete: false }); } }; ownerDocument.addEventListener("focusin", handleFocus); return () => ownerDocument.removeEventListener("focusin", handleFocus); }, [ownerDocument, handleFocusOutside]); return { onFocusCapture: () => isFocusInsideReactTreeRef.current = true, onBlurCapture: () => isFocusInsideReactTreeRef.current = false }; } function dispatchUpdate() { const event = new CustomEvent(CONTEXT_UPDATE); document.dispatchEvent(event); } function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { const target = detail.originalEvent.target; const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); if (handler) target.addEventListener(name, handler, { once: true }); if (discrete) { dispatchDiscreteCustomEvent(target, event); } else { target.dispatchEvent(event); } } // packages/react/use-layout-effect/src/use-layout-effect.tsx var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => { }; // packages/react/id/src/id.tsx var useReactId = React[" useId ".trim().toString()] || (() => void 0); var count$1 = 0; function useId(deterministicId) { const [id, setId] = React.useState(useReactId()); useLayoutEffect2(() => { setId((reactId) => reactId ?? String(count$1++)); }, [deterministicId]); return (id ? `radix-${id}` : ""); } /** * Custom positioning reference element. * @see https://floating-ui.com/docs/virtual-elements */ const sides = ['top', 'right', 'bottom', 'left']; const min = Math.min; const max = Math.max; const round = Math.round; const floor = Math.floor; const createCoords = v => ({ x: v, y: v }); const oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const oppositeAlignmentMap = { start: 'end', end: 'start' }; function clamp(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function getSide(placement) { return placement.split('-')[0]; } function getAlignment(placement) { return placement.split('-')[1]; } function getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']); function getSideAxis(placement) { return yAxisSides.has(getSide(placement)) ? 'y' : 'x'; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); } const lrPlacement = ['left', 'right']; const rlPlacement = ['right', 'left']; const tbPlacement = ['top', 'bottom']; const btPlacement = ['bottom', 'top']; function getSideList(side, isStart, rtl) { switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rlPlacement : lrPlacement; return isStart ? lrPlacement : rlPlacement; case 'left': case 'right': return isStart ? tbPlacement : btPlacement; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== 'number' ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { const { x, y, width, height } = rect; return { width, height, top: y, left: x, right: x + width, bottom: y + height, x, y }; } function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = getSide(placement); const isVertical = sideAxis === 'y'; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case 'top': coords = { x: commonX, y: reference.y - floating.height }; break; case 'bottom': coords = { x: commonX, y: reference.y + reference.height }; break; case 'right': coords = { x: reference.x + reference.width, y: commonY }; break; case 'left': coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (getAlignment(placement)) { case 'start': coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case 'end': coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } /** * Computes the `x` and `y` coordinates that will place the floating element * next to a given reference element. * * This export does not have any `platform` interface logic. You will need to * write one for the platform you are using Floating UI with. */ const computePosition$1 = async (reference, floating, config) => { const { placement = 'bottom', strategy = 'absolute', middleware = [], platform } = config; const validMiddleware = middleware.filter(Boolean); const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); let rects = await platform.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let middlewareData = {}; let resetCount = 0; for (let i = 0; i < validMiddleware.length; i++) { const { name, fn } = validMiddleware[i]; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData = { ...middlewareData, [name]: { ...middlewareData[name], ...data } }; if (reset && resetCount <= 50) { resetCount++; if (typeof reset === 'object') { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; /** * Resolves with an object of overflow side offsets that determine how much the * element is overflowing a given clipping boundary on each side. * - positive = overflowing the boundary by that number of pixels * - negative = how many pixels left before it will overflow * - 0 = lies flush with the boundary * @see https://floating-ui.com/docs/detectOverflow */ async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform, rects, elements, strategy } = state; const { boundary = 'clippingAncestors', rootBoundary = 'viewport', elementContext = 'floating', altBoundary = false, padding = 0 } = evaluate(options, state); const paddingObject = getPaddingObject(padding); const altContext = elementContext === 'floating' ? 'reference' : 'floating'; const element = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = rectToClientRect(await platform.getClippingRect({ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), boundary, rootBoundary, strategy })); const rect = elementContext === 'floating' ? { x, y, width: rects.floating.width, height: rects.floating.height } : rects.reference; const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ elements, rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } /** * Provides data to position an inner element of the floating element so that it * appears centered to the reference element. * @see https://floating-ui.com/docs/arrow */ const arrow$3 = options => ({ name: 'arrow', options, async fn(state) { const { x, y, placement, rects, platform, elements, middlewareData } = state; // Since `element` is required, we don't Partial<> the type. const { element, padding = 0 } = evaluate(options, state) || {}; if (element == null) { return {}; } const paddingObject = getPaddingObject(padding); const coords = { x, y }; const axis = getAlignmentAxis(placement); const length = getAxisLength(axis); const arrowDimensions = await platform.getDimensions(element); const isYAxis = axis === 'y'; const minProp = isYAxis ? 'top' : 'left'; const maxProp = isYAxis ? 'bottom' : 'right'; const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; const startDiff = coords[axis] - rects.reference[axis]; const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; // DOM platform can return `window` as the `offsetParent`. if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { clientSize = elements.floating[clientProp] || rects.floating[length]; } const centerToReference = endDiff / 2 - startDiff / 2; // If the padding is large enough that it causes the arrow to no longer be // centered, modify the padding so that it is centered. const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; const minPadding = min(paddingObject[minProp], largestPossiblePadding); const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); // Make sure the arrow doesn't overflow the floating element if the center // point is outside the floating element's bounds. const min$1 = minPadding; const max = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset = clamp(min$1, center, max); // If the reference is small enough that the arrow's padding causes it to // to point to nothing for an aligned placement, adjust the offset of the // floating element itself. To ensure `shift()` continues to take action, // a single reset is performed when this is true. const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; return { [axis]: coords[axis] + alignmentOffset, data: { [axis]: offset, centerOffset: center - offset - alignmentOffset, ...(shouldAddOffset && { alignmentOffset }) }, reset: shouldAddOffset }; } }); /** * Optimizes the visibility of the floating element by flipping the `placement` * in order to keep it in view when the preferred placement(s) will overflow the * clipping boundary. Alternative to `autoPlacement`. * @see https://floating-ui.com/docs/flip */ const flip$2 = function (options) { if (options === void 0) { options = {}; } return { name: 'flip', options, async fn(state) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform, elements } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = 'bestFit', fallbackAxisSideDirection = 'none', flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state); // If a reset by the arrow was caused due to an alignment offset being // added, we should skip any logic now since `flip()` has already done its // work. // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = getSide(placement); const initialSideAxis = getSideAxis(initialPlacement); const isBasePlacement = getSide(initialPlacement) === initialPlacement; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements = [initialPlacement, ...fallbackPlacements]; const overflow = await detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides = getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides[0]], overflow[sides[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; // One or more sides is overflowing. if (!overflows.every(side => side <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements[nextIndex]; if (nextPlacement) { const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis // overflows the main axis. overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { // Try next placement and re-run the lifecycle. return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } } // First, find the candidates that fit on the mainAxis side of overflow, // then find the placement that fits the best on the main crossAxis side. let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; // Otherwise fallback. if (!resetPlacement) { switch (fallbackStrategy) { case 'bestFit': { var _overflowsData$filter2; const placement = (_overflowsData$filter2 = overflowsData.filter(d => { if (hasFallbackAxisSideDirection) { const currentSideAxis = getSideAxis(d.placement); return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal // reading directions favoring greater width. currentSideAxis === 'y'; } return true; }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; if (placement) { resetPlacement = placement; } break; } case 'initialPlacement': resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some(side => overflow[side] >= 0); } /** * Provides data to hide the floating element in applicable situations, such as * when it is not in the same clipping context as the reference element. * @see https://floating-ui.com/docs/hide */ const hide$2 = function (options) { if (options === void 0) { options = {}; } return { name: 'hide', options, async fn(state) { const { rects } = state; const { strategy = 'referenceHidden', ...detectOverflowOptions } = evaluate(options, state); switch (strategy) { case 'referenceHidden': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, elementContext: 'reference' }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case 'escaped': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { return {}; } } } }; }; const originSides = /*#__PURE__*/new Set(['left', 'top']); // For type backwards-compatibility, the `OffsetOptions` type was also // Derivable. async function convertValueToCoords(state, options) { const { placement, platform, elements } = state; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const side = getSide(placement); const alignment = getAlignment(placement); const isVertical = getSideAxis(placement) === 'y'; const mainAxisMulti = originSides.has(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = evaluate(options, state); // eslint-disable-next-line prefer-const let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === 'number' ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: rawValue.mainAxis || 0, crossAxis: rawValue.crossAxis || 0, alignmentAxis: rawValue.alignmentAxis }; if (alignment && typeof alignmentAxis === 'number') { crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } /** * Modifies the placement by translating the floating element along the * specified axes. * A number (shorthand for `mainAxis` or distance), or an axes configuration * object may be passed. * @see https://floating-ui.com/docs/offset */ const offset$2 = function (options) { if (options === void 0) { options = 0; } return { name: 'offset', options, async fn(state) { var _middlewareData$offse, _middlewareData$arrow; const { x, y, placement, middlewareData } = state; const diffCoords = await convertValueToCoords(state, options); // If the placement is the same and the arrow caused an alignment offset // then we don't need to change the positioning coordinates. if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } return { x: x + diffCoords.x, y: y + diffCoords.y, data: { ...diffCoords, placement } }; } }; }; /** * Optimizes the visibility of the floating element by shifting it in order to * keep it in view when it will overflow the clipping boundary. * @see https://floating-ui.com/docs/shift */ const shift$2 = function (options) { if (options === void 0) { options = {}; } return { name: 'shift', options, async fn(state) { const { x, y, placement } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: _ref => { let { x, y } = _ref; return { x, y }; } }, ...detectOverflowOptions } = evaluate(options, state); const coords = { x, y }; const overflow = await detectOverflow(state, detectOverflowOptions); const crossAxis = getSideAxis(getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === 'y' ? 'top' : 'left'; const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; const min = mainAxisCoord + overflow[minSide]; const max = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp(min, mainAxisCoord, max); } if (checkCrossAxis) { const minSide = crossAxis === 'y' ? 'top' : 'left'; const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; const min = crossAxisCoord + overflow[minSide]; const max = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp(min, crossAxisCoord, max); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y, enabled: { [mainAxis]: checkMainAxis, [crossAxis]: checkCrossAxis } } }; } }; }; /** * Built-in `limiter` that will stop `shift()` at a certain point. */ const limitShift$2 = function (options) { if (options === void 0) { options = {}; } return { options, fn(state) { const { x, y, placement, rects, middlewareData } = state; const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state); const coords = { x, y }; const crossAxis = getSideAxis(placement); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const rawOffset = evaluate(offset, state); const computedOffset = typeof rawOffset === 'number' ? { mainAxis: rawOffset, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...rawOffset }; if (checkMainAxis) { const len = mainAxis === 'y' ? 'height' : 'width'; const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; if (mainAxisCoord < limitMin) { mainAxisCoord = limitMin; } else if (mainAxisCoord > limitMax) { mainAxisCoord = limitMax; } } if (checkCrossAxis) { var _middlewareData$offse, _middlewareData$offse2; const len = mainAxis === 'y' ? 'width' : 'height'; const isOriginSide = originSides.has(getSide(placement)); const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); if (crossAxisCoord < limitMin) { crossAxisCoord = limitMin; } else if (crossAxisCoord > limitMax) { crossAxisCoord = limitMax; } } return { [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }; } }; }; /** * Provides data that allows you to change the size of the floating element — * for instance, prevent it from overflowing the clipping boundary or match the * width of the reference element. * @see https://floating-ui.com/docs/size */ const size$2 = function (options) { if (options === void 0) { options = {}; } return { name: 'size', options, async fn(state) { var _state$middlewareData, _state$middlewareData2; const { placement, rects, platform, elements } = state; const { apply = () => {}, ...detectOverflowOptions } = evaluate(options, state); const overflow = await detectOverflow(state, detectOverflowOptions); const side = getSide(placement); const alignment = getAlignment(placement); const isYAxis = getSideAxis(placement) === 'y'; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === 'top' || side === 'bottom') { heightSide = side; widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; } else { widthSide = side; heightSide = alignment === 'end' ? 'top' : 'bottom'; } const maximumClippingHeight = height - overflow.top - overflow.bottom; const maximumClippingWidth = width - overflow.left - overflow.right; const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); const noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { availableWidth = maximumClippingWidth; } if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { availableHeight = maximumClippingHeight; } if (noShift && !alignment) { const xMin = max(overflow.left, 0); const xMax = max(overflow.right, 0); const yMin = max(overflow.top, 0); const yMax = max(overflow.bottom, 0); if (isYAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); const nextDimensions = await platform.getDimensions(elements.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; function hasWindow() { return typeof window !== 'undefined'; } function getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); } // Mocked nodes in testing environments may not be instances of Node. By // returning `#document` an infinite loop won't occur. // https://github.com/floating-ui/floating-ui/issues/2317 return '#document'; } function getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { if (!hasWindow()) { return false; } return value instanceof Node || value instanceof getWindow(value).Node; } function isElement(value) { if (!hasWindow()) { return false; } return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement(value) { if (!hasWindow()) { return false; } return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { if (!hasWindow() || typeof ShadowRoot === 'undefined') { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']); function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display); } const tableElements$1 = /*#__PURE__*/new Set(['table', 'td', 'th']); function isTableElement(element) { return tableElements$1.has(getNodeName(element)); } const topLayerSelectors = [':popover-open', ':modal']; function isTopLayer(element) { return topLayerSelectors.some(selector => { try { return element.matches(selector); } catch (_e) { return false; } }); } const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective']; const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter']; const containValues = ['paint', 'layout', 'strict', 'content']; function isContainingBlock(elementOrCss) { const webkit = isWebKit(); const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block // https://drafts.csswg.org/css-transforms-2/#individual-transforms return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value)); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else if (isTopLayer(currentNode)) { return null; } currentNode = getParentNode(currentNode); } return null; } function isWebKit() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']); function isLastTraversableNode(node) { return lastTraversableNodeNames.has(getNodeName(node)); } function getComputedStyle$1(element) { return getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.scrollX, scrollTop: element.scrollY }; } function getParentNode(node) { if (getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { const frameElement = getFrameElement(win); return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } function getFrameElement(win) { return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; } function getCssDimensions(element) { const css = getComputedStyle$1(element); // In testing environments, the `width` and `height` properties are empty // strings for SVG elements, returning NaN. Fallback to `0` in this case. let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element) { return !isElement(element) ? element.contextElement : element; } function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? round(rect.width) : rect.width) / width; let y = ($ ? round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = /*#__PURE__*/createCoords(0); function getVisualOffsets(element) { const win = getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { return false; } return isFixed; } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = getFrameElement(currentWin); while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = getComputedStyle$1(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = getWindow(currentIFrame); currentIFrame = getFrameElement(currentWin); } } return rectToClientRect({ width, height, x, y }); } // If has a CSS width greater than the viewport, then this will be // incorrect for RTL. function getWindowScrollBarX(element, rect) { const leftScroll = getNodeScroll(element).scrollLeft; if (!rect) { return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; } return rect.left + leftScroll; } function getHTMLOffset(documentElement, scroll) { const htmlRect = documentElement.getBoundingClientRect(); const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); const y = htmlRect.top + scroll.scrollTop; return { x, y }; } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements, rect, offsetParent, strategy } = _ref; const isFixed = strategy === 'fixed'; const documentElement = getDocumentElement(offsetParent); const topLayer = elements ? isTopLayer(elements.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); const isOffsetParentAnElement = isHTMLElement(offsetParent); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y }; } function getClientRects(element) { return Array.from(element.getClientRects()); } // Gets the entire size of the scrollable document area, even extending outside // of the `` and `` rect bounds if horizontally scrollable. function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (getComputedStyle$1(body).direction === 'rtl') { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } // Safety check: ensure the scrollbar space is reasonable in case this // calculation is affected by unusual styles. // Most scrollbars leave 15-18px of space. const SCROLLBAR_MAX = 25; function getViewportRect(element, strategy) { const win = getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } const windowScrollbarX = getWindowScrollBarX(html); // `overflow: hidden` + `scrollbar-gutter: stable` reduces the // visual width of the but this is not considered in the size // of `html.clientWidth`. if (windowScrollbarX <= 0) { const doc = html.ownerDocument; const body = doc.body; const bodyStyles = getComputedStyle(body); const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { width -= clippingStableScrollbarWidth; } } else if (windowScrollbarX <= SCROLLBAR_MAX) { // If the scrollbar is on the left, the width needs to be extended // by the scrollbar amount so there isn't extra space on the right. width += windowScrollbarX; } return { width, height, x, y }; } const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']); // Returns the inner client rect, subtracting scrollbars if present. function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === 'viewport') { rect = getViewportRect(element, strategy); } else if (clippingAncestor === 'document') { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y, width: clippingAncestor.width, height: clippingAncestor.height }; } return rectToClientRect(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); } // A "clipping ancestor" is an `overflow` element with the characteristic of // clipping (or hiding) child elements. This returns all clipping ancestors // of the given element up the tree. function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); let currentContainingBlockComputedStyle = null; const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; let currentNode = elementIsFixed ? getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = getComputedStyle$1(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === 'fixed') { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { // Drop non-containing blocks. result = result.filter(ancestor => ancestor !== currentNode); } else { // Record last containing block for next iteration. currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } // Gets the maximum area that the element is visible in due to any number of // clipping ancestors. function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); accRect.top = max(rect.top, accRect.top); accRect.right = min(rect.right, accRect.right); accRect.bottom = min(rect.bottom, accRect.bottom); accRect.left = max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element) { const { width, height } = getCssDimensions(element); return { width, height }; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === 'fixed'; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); // If the scrollbar appears on the left (e.g. RTL systems). Use // Firefox with layout.scrollbar.side = 3 in about:config to test this. function setLeftRTLScrollbarOffset() { offsets.x = getWindowScrollBarX(documentElement); } if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { setLeftRTLScrollbarOffset(); } } if (isFixed && !isOffsetParentAnElement && documentElement) { setLeftRTLScrollbarOffset(); } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; return { x, y, width: rect.width, height: rect.height }; } function isStaticPositioned(element) { return getComputedStyle$1(element).position === 'static'; } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') { return null; } if (polyfill) { return polyfill(element); } let rawOffsetParent = element.offsetParent; // Firefox returns the element as the offsetParent if it's non-static, // while Chrome and Safari return the element. The element must // be used to perform the correct calculations even if the element is // non-static. if (getDocumentElement(element) === rawOffsetParent) { rawOffsetParent = rawOffsetParent.ownerDocument.body; } return rawOffsetParent; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function getOffsetParent(element, polyfill) { const win = getWindow(element); if (isTopLayer(element)) { return win; } if (!isHTMLElement(element)) { let svgOffsetParent = getParentNode(element); while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { return svgOffsetParent; } svgOffsetParent = getParentNode(svgOffsetParent); } return win; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { return win; } return offsetParent || getContainingBlock(element) || win; } const getElementRects = async function (data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; const floatingDimensions = await getDimensionsFn(data.floating); return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, width: floatingDimensions.width, height: floatingDimensions.height } }; }; function isRTL(element) { return getComputedStyle$1(element).direction === 'rtl'; } const platform$2 = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement, isRTL }; function rectsAreEqual(a, b) { return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; } // https://samthor.au/2021/observing-dom/ function observeMove(element, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const elementRectForRootMargin = element.getBoundingClientRect(); const { left, top, width, height } = elementRectForRootMargin; if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { // If the reference is clipped, the ratio is 0. Throttle the refresh // to prevent an infinite loop of updates. timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 1000); } else { refresh(false, ratio); } } if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { // It's possible that even though the ratio is reported as 1, the // element is not actually fully within the IntersectionObserver's root // area anymore. This can happen under performance constraints. This may // be a bug in the browser's IntersectionObserver implementation. To // work around this, we compare the element's bounding rect now with // what it was at the time we created the IntersectionObserver. If they // are not equal then the element moved, so we refresh. refresh(); } isFirstUpdate = false; } // Older browsers don't support a `document` as the root and will throw an // error. try { io = new IntersectionObserver(handleObserve, { ...options, // Handle